diff options
author | Takeshi Abe <tabe@fixedpoint.jp> | 2016-08-17 17:36:16 +0900 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2016-08-18 07:34:02 +0000 |
commit | ddeb13b497e3c118c3bcb0fe55e1a61498b9daa2 (patch) | |
tree | a0ad111de264b08eee9dae3d61dd72f413f01cf0 /starmath | |
parent | Resolves: tdf#101347 conditional formatting super slow on exit (diff) | |
download | core-ddeb13b497e3c118c3bcb0fe55e1a61498b9daa2.tar.gz core-ddeb13b497e3c118c3bcb0fe55e1a61498b9daa2.zip |
starmath: Use SmCaretPos::GetPosAfter()
Change-Id: Ie05354f9e359b9dbc10f9d8ee8a9579c67ec5e5f
Reviewed-on: https://gerrit.libreoffice.org/28185
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/source/cursor.cxx | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 047e2883f197..35a06b700cda 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -411,24 +411,18 @@ SmCaretPos SmCursor::PatchLineList(SmNodeList* pLineList, SmNodeList::iterator a --aIter; //Thus find node before aIter if(aIter == pLineList->begin()) return SmCaretPos(); - if((*aIter)->GetType() == NTEXT) - return SmCaretPos(*aIter, static_cast<SmTextNode*>(*aIter)->GetText().getLength()); - return SmCaretPos(*aIter, 1); + return SmCaretPos::GetPosAfter(*aIter); } if(prev && next && next->GetType() == NPLACE && !SmNodeListParser::IsOperator(prev->GetToken())){ aIter = pLineList->erase(aIter); delete next; - if(prev->GetType() == NTEXT) - return SmCaretPos(prev, static_cast<SmTextNode*>(prev)->GetText().getLength()); - return SmCaretPos(prev, 1); + return SmCaretPos::GetPosAfter(prev); } //If we didn't do anything return if(!prev) //return an invalid to indicate we're in front of line return SmCaretPos(); - if(prev->GetType() == NTEXT) - return SmCaretPos(prev, static_cast<SmTextNode*>(prev)->GetText().getLength()); - return SmCaretPos(prev, 1); + return SmCaretPos::GetPosAfter(prev); } SmNodeList::iterator SmCursor::TakeSelectedNodesFromList(SmNodeList *pLineList, |