diff options
author | Khaled Hosny <khaled@libreoffice.org> | 2023-09-11 20:32:22 +0300 |
---|---|---|
committer | خالد حسني <khaled@libreoffice.org> | 2023-09-11 21:24:57 +0200 |
commit | d52feb11c7eab0adf82c1fb410adfd3127bf9497 (patch) | |
tree | 4e4d3a09e44d2d20dc66178dd40c48d9581f92e2 /starmath/source/visitors.cxx | |
parent | bf11a197519f6637b5a4f1f42436c2c9f262ef97 (diff) |
starmath: Fix selection of surrogate pairs in inline editing
Don’t split nodes in the middle of surrogate pairs.
Change-Id: I3ce8cf19d4c331e2ead73ed375745e8866b3d7a8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156827
Tested-by: Jenkins
Reviewed-by: خالد حسني <khaled@libreoffice.org>
Diffstat (limited to 'starmath/source/visitors.cxx')
-rw-r--r-- | starmath/source/visitors.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/starmath/source/visitors.cxx b/starmath/source/visitors.cxx index 936097ccef3f..c2c4717df299 100644 --- a/starmath/source/visitors.cxx +++ b/starmath/source/visitors.cxx @@ -1040,8 +1040,11 @@ void SmCaretPosGraphBuildingVisitor::Visit( SmTextNode* pNode ) { SAL_WARN_IF( pNode->GetText().isEmpty(), "starmath", "Empty SmTextNode is bad" ); - int size = pNode->GetText().getLength(); - for( int i = 1; i <= size; i++ ){ + OUString& aText = pNode->GetText(); + sal_Int32 i = 0; + while (i < aText.getLength()) + { + aText.iterateCodePoints(&i); SmCaretPosGraphEntry* pRight = mpRightMost; mpRightMost = mpGraph->Add( SmCaretPos( pNode, i ), pRight ); pRight->SetRight( mpRightMost ); |