0
0
mirror of https://github.com/fralx/LimeReport.git synced 2024-12-24 16:44:39 +03:00

Redundant return will be removed from upper part of sliced text

This commit is contained in:
Arin Alexander 2016-05-17 22:59:41 +04:00
parent fc9e7c792b
commit fdc03900ea

View File

@ -415,6 +415,7 @@ BaseDesignIntf *TextItem::cloneUpperPart(int height, QObject *owner, QGraphicsIt
} }
} }
loop_exit: loop_exit:
tmpText = tmpText.trimmed();
upperPart->setHeight(linesHeight+fakeMarginSize()*2+borderLineSize()*2); upperPart->setHeight(linesHeight+fakeMarginSize()*2+borderLineSize()*2);
QScopedPointer<HtmlContext> context(new HtmlContext(m_strText)); QScopedPointer<HtmlContext> context(new HtmlContext(m_strText));
upperPart->setContent(context->extendTextByTags(tmpText,0)); upperPart->setContent(context->extendTextByTags(tmpText,0));
@ -442,10 +443,12 @@ BaseDesignIntf *TextItem::cloneBottomPart(int height, QObject *owner, QGraphicsI
for (;curLine<curBlock.layout()->lineCount();curLine++){ for (;curLine<curBlock.layout()->lineCount();curLine++){
if (tmpText=="") textPos= curBlock.layout()->lineAt(curLine).textStart(); if (tmpText=="") textPos= curBlock.layout()->lineAt(curLine).textStart();
tmpText+=curBlock.text().mid(curBlock.layout()->lineAt(curLine).textStart(), tmpText+=curBlock.text().mid(curBlock.layout()->lineAt(curLine).textStart(),
curBlock.layout()->lineAt(curLine).textLength())+"\n"; curBlock.layout()->lineAt(curLine).textLength()) +"\n";
} }
} }
if (!m_strText.endsWith("\n")) tmpText = tmpText.trimmed();
QScopedPointer<HtmlContext> context(new HtmlContext(m_strText)); QScopedPointer<HtmlContext> context(new HtmlContext(m_strText));
bottomPart->setContent(context->extendTextByTags(tmpText,textPos)); bottomPart->setContent(context->extendTextByTags(tmpText,textPos));
bottomPart->setHeight(bottomPart->m_textSize.height()+borderLineSize()*2); bottomPart->setHeight(bottomPart->m_textSize.height()+borderLineSize()*2);