From fdc03900eac6519c10bbd0df332167dda06c7372 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Tue, 17 May 2016 22:59:41 +0400 Subject: [PATCH] Redundant return will be removed from upper part of sliced text --- limereport/items/lrtextitem.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index ea96609..0c50d2d 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -415,6 +415,7 @@ BaseDesignIntf *TextItem::cloneUpperPart(int height, QObject *owner, QGraphicsIt } } loop_exit: + tmpText = tmpText.trimmed(); upperPart->setHeight(linesHeight+fakeMarginSize()*2+borderLineSize()*2); QScopedPointer context(new HtmlContext(m_strText)); upperPart->setContent(context->extendTextByTags(tmpText,0)); @@ -442,10 +443,12 @@ BaseDesignIntf *TextItem::cloneBottomPart(int height, QObject *owner, QGraphicsI for (;curLinelineCount();curLine++){ if (tmpText=="") textPos= 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 context(new HtmlContext(m_strText)); bottomPart->setContent(context->extendTextByTags(tmpText,textPos)); bottomPart->setHeight(bottomPart->m_textSize.height()+borderLineSize()*2);