summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtextboundaryfinder.cpp
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-05-10 10:31:16 +0300
committerQt by Nokia <qt-info@nokia.com>2012-05-10 11:34:25 +0200
commitcbfdec66033d14020d3e8a49bacc0d12d2b6798e (patch)
tree02e94eaad62c85f1556623b17412607102f067cb /src/corelib/tools/qtextboundaryfinder.cpp
parent8c0048a377568b646b3b87be0b02322fce68b780 (diff)
move the default text breaking algorithm impl from HarfBuzz to Qt
there are several reasons to do this: * text breaking is not a shaper's job; * since the text breaking rules are bound to a specific Unicode version, updating Qt's internal unicode data would require updating the data in HB as well; * makes porting to HurfBuzz-NG some easier Change-Id: I0bbf8e8a343bc074696f4ddf2ae4e7fa32a61629 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src/corelib/tools/qtextboundaryfinder.cpp')
-rw-r--r--src/corelib/tools/qtextboundaryfinder.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/corelib/tools/qtextboundaryfinder.cpp b/src/corelib/tools/qtextboundaryfinder.cpp
index 20ee954efd..c6c88ea8aa 100644
--- a/src/corelib/tools/qtextboundaryfinder.cpp
+++ b/src/corelib/tools/qtextboundaryfinder.cpp
@@ -40,9 +40,9 @@
****************************************************************************/
#include <QtCore/qtextboundaryfinder.h>
#include <QtCore/qvarlengtharray.h>
+
#include <private/qunicodetables_p.h>
-#include <qdebug.h>
-#include "private/qharfbuzz_p.h"
+#include <private/qunicodetools_p.h>
QT_BEGIN_NAMESPACE
@@ -93,11 +93,12 @@ static void init(QTextBoundaryFinder::BoundaryType type, const QChar *chars, int
scriptItems.append(item);
}
- qGetCharAttributes(string, length, scriptItems.data(), scriptItems.count(), attributes);
+ QCharAttributeOptions options = 0;
if (type == QTextBoundaryFinder::Word)
- HB_GetWordBoundaries(string, length, scriptItems.data(), scriptItems.count(), attributes);
+ options |= GetWordBreaks;
else if (type == QTextBoundaryFinder::Sentence)
- HB_GetSentenceBoundaries(string, length, scriptItems.data(), scriptItems.count(), attributes);
+ options |= GetSentenceBreaks;
+ qGetCharAttributes(string, length, scriptItems.data(), scriptItems.count(), attributes, options);
}
/*!