summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qplatformfontdatabase.cpp21
-rw-r--r--src/gui/text/qplatformfontdatabase.h7
-rw-r--r--src/gui/text/qsyntaxhighlighter.cpp2
-rw-r--r--src/gui/text/qtextdocumentfragment.cpp10
4 files changed, 36 insertions, 4 deletions
diff --git a/src/gui/text/qplatformfontdatabase.cpp b/src/gui/text/qplatformfontdatabase.cpp
index 599b18ac05..4ad826e87b 100644
--- a/src/gui/text/qplatformfontdatabase.cpp
+++ b/src/gui/text/qplatformfontdatabase.cpp
@@ -45,6 +45,7 @@
#include <qpa/qplatformscreen.h>
#include <QtCore/QLibraryInfo>
#include <QtCore/QDir>
+#include <QtCore/QMetaEnum>
#include <algorithm>
#include <iterator>
@@ -201,6 +202,26 @@ QSupportedWritingSystems &QSupportedWritingSystems::operator=(const QSupportedWr
return *this;
}
+#ifndef QT_NO_DEBUG_STREAM
+QDebug operator<<(QDebug debug, const QSupportedWritingSystems &sws)
+{
+ QMetaObject mo = QFontDatabase::staticMetaObject;
+ QMetaEnum me = mo.enumerator(mo.indexOfEnumerator("WritingSystem"));
+
+ QDebugStateSaver saver(debug);
+ debug.nospace() << "QSupportedWritingSystems(";
+ int i = sws.d->vector.indexOf(true);
+ while (i > 0) {
+ debug << me.valueToKey(i);
+ i = sws.d->vector.indexOf(true, i + 1);
+ if (i > 0)
+ debug << ", ";
+ }
+ debug << ")";
+ return debug;
+}
+#endif
+
/*!
Destroys the supported writing systems object.
*/
diff --git a/src/gui/text/qplatformfontdatabase.h b/src/gui/text/qplatformfontdatabase.h
index 2d99183ca3..2ca783f0fd 100644
--- a/src/gui/text/qplatformfontdatabase.h
+++ b/src/gui/text/qplatformfontdatabase.h
@@ -84,11 +84,18 @@ private:
friend Q_GUI_EXPORT bool operator==(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
friend Q_GUI_EXPORT bool operator!=(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
+#ifndef QT_NO_DEBUG_STREAM
+ friend Q_GUI_EXPORT QDebug operator<<(QDebug, const QSupportedWritingSystems &);
+#endif
};
Q_GUI_EXPORT bool operator==(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
Q_GUI_EXPORT bool operator!=(const QSupportedWritingSystems &, const QSupportedWritingSystems &);
+#ifndef QT_NO_DEBUG_STREAM
+Q_GUI_EXPORT QDebug operator<<(QDebug, const QSupportedWritingSystems &);
+#endif
+
class QFontRequestPrivate;
class QFontEngineMulti;
diff --git a/src/gui/text/qsyntaxhighlighter.cpp b/src/gui/text/qsyntaxhighlighter.cpp
index 8834afc80e..fcda17605f 100644
--- a/src/gui/text/qsyntaxhighlighter.cpp
+++ b/src/gui/text/qsyntaxhighlighter.cpp
@@ -292,7 +292,7 @@ void QSyntaxHighlighterPrivate::reformatBlock(const QTextBlock &block)
/*!
Constructs a QSyntaxHighlighter with the given \a parent.
- If the parent is a QTextEdit, it installs the syntaxhighlighter on the
+ If the parent is a QTextEdit, it installs the syntax highlighter on the
parents document. The specified QTextEdit also becomes the owner of
the QSyntaxHighlighter.
*/
diff --git a/src/gui/text/qtextdocumentfragment.cpp b/src/gui/text/qtextdocumentfragment.cpp
index 3a78296c57..ea37695f4e 100644
--- a/src/gui/text/qtextdocumentfragment.cpp
+++ b/src/gui/text/qtextdocumentfragment.cpp
@@ -825,9 +825,13 @@ bool QTextHtmlImporter::closeTag()
break;
case Html_div:
- if (closedNode->children.isEmpty())
- break;
- Q_FALLTHROUGH();
+ if (cursor.position() > 0) {
+ const QChar curChar = cursor.document()->characterAt(cursor.position() - 1);
+ if (!closedNode->children.isEmpty() && curChar != QChar::LineSeparator) {
+ blockTagClosed = true;
+ }
+ }
+ break;
default:
if (closedNode->isBlock())
blockTagClosed = true;