summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qtextboundaryfinder.h
diff options
context:
space:
mode:
authorKonstantin Ritt <ritt.ks@gmail.com>2012-10-12 06:49:27 +0300
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-10-12 07:44:51 +0200
commitda7111be51cab7c7484afd15ec9de7fb852ae305 (patch)
tree03ffbe7a5cb8e49ada9b521bf5f613d501cbbb3a /src/corelib/tools/qtextboundaryfinder.h
parent8b41f22f5c4bb401182e2b458f61177b92bd48ce (diff)
QTextBoundaryFinder: Fix handling of break opportunities
Add BoundaryReason::BreakOpportunity flag that will be returned by the boundaryReasons() when the boundary finder is at the break opportunity position that might be not an item boundary. This is the same as (StartWord || EndWord) in Grapheme and Sentence modes; in Word and Line modes, BreakOpportunity flag might occur between the words or in between of Line boundaries (e.g. in conjunction with SoftHyphen flag). In other words, the text boundaries are always break opportunities, but not vice versa. StartWord and EndWord flags has been deprecated by new StartOfItem and EndOfItem flags which are not about the word boundaries only. In line breaking, StartOfItem and EndOfItem are set for the mandatory breaks only. Change-Id: I79bf297e2b988f5976f30cff0c8ca616385f6552 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/corelib/tools/qtextboundaryfinder.h')
-rw-r--r--src/corelib/tools/qtextboundaryfinder.h16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/corelib/tools/qtextboundaryfinder.h b/src/corelib/tools/qtextboundaryfinder.h
index c752623844..6e33167bcb 100644
--- a/src/corelib/tools/qtextboundaryfinder.h
+++ b/src/corelib/tools/qtextboundaryfinder.h
@@ -63,16 +63,20 @@ public:
enum BoundaryType {
Grapheme,
Word,
- Line,
- Sentence
+ Sentence,
+ Line
};
enum BoundaryReason {
NotAtBoundary = 0,
- StartWord = 0x10,
- EndWord = 0x20,
- MandatoryBreak = 0x40,
- SoftHyphen = 0x80
+ BreakOpportunity = 0x1f,
+ StartOfItem = 0x20,
+ EndOfItem = 0x40,
+ MandatoryBreak = 0x80,
+ SoftHyphen = 0x100,
+ // ### Qt6: remove
+ StartWord = 0x1000,
+ EndWord = 0x2000
};
Q_DECLARE_FLAGS( BoundaryReasons, BoundaryReason )