summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-02-09 14:29:21 +0100
committerUlf Hermann <ulf.hermann@qt.io>2018-03-20 08:19:25 +0000
commit5a4787dca01c302dd462a76222dfbf28c8951a8d (patch)
tree897b7caea659526d740e98c06b11c15970d35a7b /src/gui/text/qtextdocument.cpp
parentdd74f5d347d0a5a21527142f85114374e2d90646 (diff)
Modernize the "regularexpression" feature
Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index e27b388762..44d1b2f201 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -47,7 +47,9 @@
#include "qtextlist.h"
#include <qdebug.h>
#include <qregexp.h>
+#if QT_CONFIG(regularexpression)
#include <qregularexpression.h>
+#endif
#include <qvarlengtharray.h>
#include <qtextcodec.h>
#include <qthread.h>
@@ -1488,7 +1490,7 @@ QTextCursor QTextDocument::find(const QRegExp &expr, const QTextCursor &cursor,
}
#endif // QT_REGEXP
-#ifndef QT_NO_REGULAREXPRESSION
+#if QT_CONFIG(regularexpression)
static bool findInBlock(const QTextBlock &block, const QRegularExpression &expression, int offset,
QTextDocument::FindFlags options, QTextCursor *cursor)
{
@@ -1613,7 +1615,7 @@ QTextCursor QTextDocument::find(const QRegularExpression &expr, const QTextCurso
}
return find(expr, pos, options);
}
-#endif // QT_NO_REGULAREXPRESSION
+#endif // QT_CONFIG(regularexpression)
/*!
\fn QTextObject *QTextDocument::createObject(const QTextFormat &format)