From b3529ffd0c7537e04a05b83288349ab2c898cf85 Mon Sep 17 00:00:00 2001 From: Arin Alexander Date: Thu, 20 Apr 2017 21:09:52 +0300 Subject: [PATCH] TextItem render has been fixed --- limereport/items/lrtextitem.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/limereport/items/lrtextitem.cpp b/limereport/items/lrtextitem.cpp index 1224bc9..608f0ed 100644 --- a/limereport/items/lrtextitem.cpp +++ b/limereport/items/lrtextitem.cpp @@ -491,18 +491,20 @@ TextItem::TextPtr TextItem::textDocument() const setTextFont(text,_font); } - text->documentLayout(); + //text->documentLayout(); + if (m_lineSpacing != 1 || m_textIndent !=0 ){ - for ( QTextBlock block = text->begin(); block.isValid(); block = block.next()) - { - QTextCursor tc = QTextCursor(block); - QTextBlockFormat fmt = block.blockFormat(); - fmt.setTextIndent(m_textIndent); - - if(fmt.lineHeight() != m_lineSpacing) { - fmt.setLineHeight(m_lineSpacing,QTextBlockFormat::LineDistanceHeight); + for ( QTextBlock block = text->begin(); block.isValid(); block = block.next()) + { + QTextCursor tc = QTextCursor(block); + QTextBlockFormat fmt = block.blockFormat(); + fmt.setTextIndent(m_textIndent); + if (fmt.lineHeight() != m_lineSpacing) { + fmt.setLineHeight(m_lineSpacing,QTextBlockFormat::LineDistanceHeight); + } tc.setBlockFormat( fmt ); } + } return text;