diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-16 14:05:56 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-05-18 09:17:43 +0200 |
commit | 4c05834a363535804d2cf5892704e19a5bb4f966 (patch) | |
tree | 43226f521a491e833bdd3f18b1655e945018ba64 /starmath | |
parent | 60861faa8653afebb504cfbcaeed633d2373a27d (diff) |
loplugin:unusedmethods
Change-Id: I1c50d176e793397a1f9625f797a3750cf191a61c
Reviewed-on: https://gerrit.libreoffice.org/37679
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r-- | starmath/inc/cursor.hxx | 11 | ||||
-rw-r--r-- | starmath/source/cursor.cxx | 65 |
2 files changed, 0 insertions, 76 deletions
diff --git a/starmath/inc/cursor.hxx b/starmath/inc/cursor.hxx index f35011a31c42..72de1a1cbadb 100644 --- a/starmath/inc/cursor.hxx +++ b/starmath/inc/cursor.hxx @@ -138,17 +138,6 @@ public: */ void InsertSubSup(SmSubSup eSubSup); - /** Create a limit on an SmOperNode - * - * This method only work if the caret is inside an SmOperNode, or to the right of one. - * Notice also that this method ignores any selection made. - * - * The caret will be moved into the limit. - * - * @returns True, if the caret was in a context where this operation was possible. - */ - bool InsertLimit(SmSubSup eSubSup); - /** Insert a new row or newline * * Inserts a new row if position is in an matrix or stack command. diff --git a/starmath/source/cursor.cxx b/starmath/source/cursor.cxx index 78bfb040e39d..564df363a72d 100644 --- a/starmath/source/cursor.cxx +++ b/starmath/source/cursor.cxx @@ -586,71 +586,6 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) { FinishEdit(pLineList, pLineParent, nParentIndex, PosAfterScript, pScriptLine); } -bool SmCursor::InsertLimit(SmSubSup eSubSup) { - //Find a subject to set limits on - SmOperNode *pSubject = nullptr; - //Check if pSelectedNode might be a subject - if(mpPosition->CaretPos.pSelectedNode->GetType() == SmNodeType::Oper) - pSubject = static_cast<SmOperNode*>(mpPosition->CaretPos.pSelectedNode); - else { - //If not, check if parent of the current line is a SmOperNode - SmNode *pLineNode = FindTopMostNodeInLine(mpPosition->CaretPos.pSelectedNode); - if(pLineNode->GetParent() && pLineNode->GetParent()->GetType() == SmNodeType::Oper) - pSubject = static_cast<SmOperNode*>(pLineNode->GetParent()); - } - - //Abort operation if we're not in the appropriate context - if(!pSubject) - return false; - - BeginEdit(); - - //Find the sub sup node - SmSubSupNode *pSubSup = nullptr; - //Check if there's already one there... - if(pSubject->GetSubNode(0)->GetType() == SmNodeType::SubSup) - pSubSup = static_cast<SmSubSupNode*>(pSubject->GetSubNode(0)); - else { //if not create a new SmSubSupNode - SmToken token; - token.nGroup = TG::Limit; - pSubSup = new SmSubSupNode(token); - //Set it's body - pSubSup->SetBody(pSubject->GetSubNode(0)); - //Replace the operation of the SmOperNode - pSubject->SetSubNode(0, pSubSup); - } - - //Create the limit, if needed - SmCaretPos PosAfterLimit; - SmNode *pLine = nullptr; - if(!pSubSup->GetSubSup(eSubSup)){ - pLine = new SmPlaceNode(); - pSubSup->SetSubSup(eSubSup, pLine); - PosAfterLimit = SmCaretPos(pLine, 1); - //If it's already there... let's move the caret - } else { - pLine = pSubSup->GetSubSup(eSubSup); - SmNodeList* pLineList = NodeToList(pLine); - if (!pLineList->empty()) - PosAfterLimit = SmCaretPos::GetPosAfter(pLineList->back()); - pLine = SmNodeListParser().Parse(pLineList); - delete pLineList; - pSubSup->SetSubSup(eSubSup, pLine); - } - - //Rebuild graph of caret positions - BuildGraph(); - AnnotateSelection(); - - //Set caret position - if(!SetCaretPosition(PosAfterLimit)) - SetCaretPosition(SmCaretPos(pLine, 0)); - - EndEdit(); - - return true; -} - void SmCursor::InsertBrackets(SmBracketType eBracketType) { BeginEdit(); |