Kaydet (Commit) 08e14eb2 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:unuseddefaultparam in starmath

Change-Id: I740d931c0236c1a4d40013b458f249692695d6e5
üst 1685ff14
......@@ -164,11 +164,11 @@ public:
* 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.
*
* @param bMoveCaret If true that caret will be moved into the limit.
* 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, bool bMoveCaret = true);
bool InsertLimit(SmSubSup eSubSup);
/** Insert a new row or newline
*
......@@ -217,7 +217,7 @@ public:
void Draw(OutputDevice& pDev, Point Offset, bool isCaretVisible);
bool IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBraceNode = nullptr) const;
void MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor = true);
void MoveAfterBracket(SmBraceNode* pBraceNode);
private:
friend class SmDocShell;
......@@ -414,11 +414,11 @@ public:
SmNodeListParser(){
pList = nullptr;
}
/** Parse a list of nodes to an expression
/** Parse a list of nodes to an expression.
*
* If bDeleteErrorNodes is true, old error nodes will be deleted.
* Old error nodes will be deleted.
*/
SmNode* Parse(SmNodeList* list, bool bDeleteErrorNodes = true);
SmNode* Parse(SmNodeList* list);
/** True, if the token is an operator */
static bool IsOperator(const SmToken &token);
/** True, if the token is a relation operator */
......
......@@ -371,7 +371,7 @@ class SmSymbolDialog : public ModalDialog
DECL_LINK_TYPED(GetClickHdl, Button*, void);
void SymbolDblClickHdl();
void FillSymbolSets(bool bDeleteText = true);
void FillSymbolSets();
const SmSym *GetSymbol() const;
virtual void DataChanged( const DataChangedEvent& rDCEvt ) override;
......@@ -444,8 +444,8 @@ class SmSymDefineDialog : public ModalDialog
void FillSymbols(ComboBox &rComboBox, bool bDeleteText = true);
void FillSymbolSets(ComboBox &rComboBox, bool bDeleteText = true);
void FillFonts(bool bDeleteText = true);
void FillStyles(bool bDeleteText = true);
void FillFonts();
void FillStyles();
void SetSymbolSetManager(const SmSymbolManager &rMgr);
void SetFont(const OUString &rFontName, const OUString &rStyleName);
......
......@@ -587,7 +587,7 @@ void SmCursor::InsertSubSup(SmSubSup eSubSup) {
FinishEdit(pLineList, pLineParent, nParentIndex, PosAfterScript, pScriptLine);
}
bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
bool SmCursor::InsertLimit(SmSubSup eSubSup) {
//Find a subject to set limits on
SmOperNode *pSubject = nullptr;
//Check if pSelectedNode might be a subject
......@@ -629,7 +629,7 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
pSubSup->SetSubSup(eSubSup, pLine);
PosAfterLimit = SmCaretPos(pLine, 1);
//If it's already there... let's move the caret
} else if(bMoveCaret){
} else {
pLine = pSubSup->GetSubSup(eSubSup);
SmNodeList* pLineList = NodeToList(pLine);
if(pLineList->size() > 0)
......@@ -644,9 +644,8 @@ bool SmCursor::InsertLimit(SmSubSup eSubSup, bool bMoveCaret) {
AnnotateSelection();
//Set caret position
if(bMoveCaret)
if(!SetCaretPosition(PosAfterLimit, true))
SetCaretPosition(SmCaretPos(pLine, 0), true);
if(!SetCaretPosition(PosAfterLimit, true))
SetCaretPosition(SmCaretPos(pLine, 0), true);
EndEdit();
......@@ -1539,33 +1538,29 @@ bool SmCursor::IsAtTailOfBracket(SmBracketType eBracketType, SmBraceNode** ppBra
return true;
}
void SmCursor::MoveAfterBracket(SmBraceNode* pBraceNode, bool bMoveAnchor)
void SmCursor::MoveAfterBracket(SmBraceNode* pBraceNode)
{
mpPosition->CaretPos.pSelectedNode = pBraceNode;
mpPosition->CaretPos.Index = 1;
if (bMoveAnchor) {
mpAnchor->CaretPos.pSelectedNode = pBraceNode;
mpAnchor->CaretPos.Index = 1;
}
mpAnchor->CaretPos.pSelectedNode = pBraceNode;
mpAnchor->CaretPos.Index = 1;
RequestRepaint();
}
/////////////////////////////////////// SmNodeListParser
SmNode* SmNodeListParser::Parse(SmNodeList* list, bool bDeleteErrorNodes){
SmNode* SmNodeListParser::Parse(SmNodeList* list){
pList = list;
if(bDeleteErrorNodes){
//Delete error nodes
SmNodeList::iterator it = pList->begin();
while(it != pList->end()) {
if((*it)->GetType() == NERROR){
//Delete and erase
delete *it;
it = pList->erase(it);
}else
++it;
}
//Delete error nodes
SmNodeList::iterator it = pList->begin();
while(it != pList->end()) {
if((*it)->GetType() == NERROR){
//Delete and erase
delete *it;
it = pList->erase(it);
}else
++it;
}
SmNode* retval = Expression();
pList = nullptr;
......
......@@ -1437,13 +1437,12 @@ void SmShowSymbol::SetSymbol(const SmSym *pSymbol)
}
void SmSymbolDialog::FillSymbolSets(bool bDeleteText)
void SmSymbolDialog::FillSymbolSets()
// populate the entries of possible SymbolsSets in the dialog with
// current values of the SymbolSet manager but selects none of those
{
m_pSymbolSets->Clear();
if (bDeleteText)
m_pSymbolSets->SetNoSelection();
m_pSymbolSets->SetNoSelection();
std::set< OUString > aSybolSetNames( rSymbolMgr.GetSymbolSetNames() );
std::set< OUString >::const_iterator aIt( aSybolSetNames.begin() );
......@@ -1743,11 +1742,10 @@ void SmSymDefineDialog::FillSymbolSets(ComboBox &rComboBox, bool bDeleteText)
}
void SmSymDefineDialog::FillFonts(bool bDelete)
void SmSymDefineDialog::FillFonts()
{
pFonts->Clear();
if (bDelete)
pFonts->SetNoSelection();
pFonts->SetNoSelection();
// Include all fonts of FontList into the font list.
// If there are duplicates, only include one entry of each font since the style will be
......@@ -1761,11 +1759,10 @@ void SmSymDefineDialog::FillFonts(bool bDelete)
}
void SmSymDefineDialog::FillStyles(bool bDeleteText)
void SmSymDefineDialog::FillStyles()
{
pStyles->Clear();
if (bDeleteText)
pStyles->SetText(OUString());
pStyles->SetText(OUString());
OUString aText (pFonts->GetSelectEntry());
if (!aText.isEmpty())
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment