summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextengine.cpp
diff options
context:
space:
mode:
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2016-03-29 18:33:35 +0200
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>2016-04-08 12:30:42 +0000
commit53180c430fb27fb1f5e901000856350bcf6d2723 (patch)
treec1c6d0816e85ae1d7f889d9b5b98a8c35e4af242 /src/gui/text/qtextengine.cpp
parentbfe86cb642d12c7a2f7a646b3bd35d2cbac737a0 (diff)
Add flag for showing document terminator in text
In 208496091d994c2ffe44ea41368fb659978c1581, the behavior of QTextOption::ShowLineAndParagraphSeparators was changed to also include a section symbol at the end of the document. This was an unnecessary behavioral change. Instead we add a separate flag for this marker. [ChangeLog][QtGui][Text] Added QTextOption::ShowDocumentTerminator flag. Task-number: QTBUG-52048 Change-Id: I2f6f7e5c9c894f46525682f2c6520a7003fa09bc Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Diffstat (limited to 'src/gui/text/qtextengine.cpp')
-rw-r--r--src/gui/text/qtextengine.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index fa73507c16..7864975091 100644
--- a/src/gui/text/qtextengine.cpp
+++ b/src/gui/text/qtextengine.cpp
@@ -1569,8 +1569,12 @@ void QTextEngine::validate() const
layoutData = new LayoutData();
if (block.docHandle()) {
layoutData->string = block.text();
- if (option.flags() & QTextOption::ShowLineAndParagraphSeparators)
- layoutData->string += QLatin1Char(block.next().isValid() ? 0xb6 : 0xA7);
+ if (block.next().isValid()) {
+ if (option.flags() & QTextOption::ShowLineAndParagraphSeparators)
+ layoutData->string += QChar(0xb6);
+ } else if (option.flags() & QTextOption::ShowDocumentTerminator) {
+ layoutData->string += QChar(0xA7);
+ }
} else {
layoutData->string = text;
}