From 4c05834a363535804d2cf5892704e19a5bb4f966 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 May 2017 14:05:56 +0200 Subject: loplugin:unusedmethods Change-Id: I1c50d176e793397a1f9625f797a3750cf191a61c Reviewed-on: https://gerrit.libreoffice.org/37679 Tested-by: Jenkins Reviewed-by: Noel Grandin --- starmath/source/cursor.cxx | 65 ---------------------------------------------- 1 file changed, 65 deletions(-) (limited to 'starmath/source/cursor.cxx') 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(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(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(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(); -- cgit