- 
    
Bug
 - 
    Resolution: Done
 - 
    
P2: Important
 - 
    4.6.2
 - 
    None
 - 
    Ubuntu 10.04
 
Unless I am misunderstanding how to use it, the QTextBoundaryFinder is not returning the correct values for the boundaryReasons() in certain cases. Here is a sample app:
int main() { QTextStream out(stdout); QTextBoundaryFinder finder(QTextBoundaryFinder::Word, QLatin1String("This is a test")); finder.toStart(); int previousBoundary = finder.position(); int currentBoundary = finder.toNextBoundary(); while (currentBoundary != -1) { out << "Boundary: " << qSetFieldWidth(10) << previousBoundary << currentBoundary << finder.boundaryReasons().testFlag(QTextBoundaryFinder::NotAtBoundary) << finder.boundaryReasons().testFlag(QTextBoundaryFinder::StartWord) << finder.boundaryReasons().testFlag(QTextBoundaryFinder::EndWord) << endl; previousBoundary = currentBoundary; currentBoundary = finder.toNextBoundary(); } return 0; }
This finds all the boundaries correctly, but the boundaryReasons() flag is not correct between the "is" and the "a". This is showing that at the boundary at position 8 (just before "a" is not only at the start of a word (which is correct) but also at the end of a word (which is incorrect.)
Boundary: 0 4 0 0 1 Boundary: 4 5 0 1 0 Boundary: 5 7 0 0 1 Boundary: 7 8 0 1 1 Boundary: 8 9 0 0 1 Boundary: 9 10 0 1 0 Boundary: 10 14 0 0 1
- is required for
 - 
                    
QTBUG-17860 word by word selection selects spaces on wrong end of word and becomes broken
-         
 - Closed
 
 -