summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextdocumentlayout.cpp14
-rw-r--r--src/gui/text/qtextengine.cpp8
-rw-r--r--src/gui/text/qtextoption.cpp2
-rw-r--r--src/gui/text/qtextoption.h1
4 files changed, 15 insertions, 10 deletions
diff --git a/src/gui/text/qtextdocumentlayout.cpp b/src/gui/text/qtextdocumentlayout.cpp
index a8b57d6dfd..1b2113d281 100644
--- a/src/gui/text/qtextdocumentlayout.cpp
+++ b/src/gui/text/qtextdocumentlayout.cpp
@@ -2901,14 +2901,12 @@ static void markFrames(QTextFrame *current, int from, int oldLength, int length)
return;
QTextFrameData *fd = data(current);
- for (int i = 0; i < fd->floats.size(); ++i) {
- QTextFrame *f = fd->floats[i];
- if (!f) {
- // float got removed in editing operation
- fd->floats.removeAt(i);
- --i;
- }
- }
+ // float got removed in editing operation
+ QTextFrame *null = nullptr; // work-around for (at least) MSVC 2012 emitting
+ // warning C4100 for its own header <algorithm>
+ // when passing nullptr directly to std::remove
+ fd->floats.erase(std::remove(fd->floats.begin(), fd->floats.end(), null),
+ fd->floats.end());
fd->layoutDirty = true;
fd->sizeDirty = true;
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp
index 8e03797080..e65ec15caa 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;
}
diff --git a/src/gui/text/qtextoption.cpp b/src/gui/text/qtextoption.cpp
index 2eb025f412..87e31eeb2c 100644
--- a/src/gui/text/qtextoption.cpp
+++ b/src/gui/text/qtextoption.cpp
@@ -309,6 +309,8 @@ QList<QTextOption::Tab> QTextOption::tabs() const
this width is excluded.
\value ShowTabsAndSpaces Visualize spaces with little dots, and tabs with little arrows.
\value ShowLineAndParagraphSeparators Visualize line and paragraph separators with appropriate symbol characters.
+ \value ShowDocumentTerminator Visualize the end of the document with a section sign. This enum value was added
+ in Qt 5.7.
\value AddSpaceForLineAndParagraphSeparators While determining the line-break positions take into account the
space added for drawing a separator character.
\value SuppressColors Suppress all color changes in the character formats (except the main selection).
diff --git a/src/gui/text/qtextoption.h b/src/gui/text/qtextoption.h
index 2ae0ec3d4c..f9c24ffeaf 100644
--- a/src/gui/text/qtextoption.h
+++ b/src/gui/text/qtextoption.h
@@ -109,6 +109,7 @@ public:
ShowLineAndParagraphSeparators = 0x2,
AddSpaceForLineAndParagraphSeparators = 0x4,
SuppressColors = 0x8,
+ ShowDocumentTerminator = 0x10,
IncludeTrailingSpaces = 0x80000000
};
Q_DECLARE_FLAGS(Flags, Flag)