loplugin:unusedmethods unused return value in starmath

Change-Id: Ic70c3d727ecadd082f7e5d293fc2b279b1287b8f
This commit is contained in:
Noel Grandin
2016-01-14 10:03:16 +02:00
parent 50f024844b
commit 5669ea31dd
10 changed files with 11 additions and 25 deletions

View File

@@ -36,9 +36,6 @@ struct SmCaretPos{
int Index; int Index;
/** True, if this is a valid caret position */ /** True, if this is a valid caret position */
bool IsValid() const { return pSelectedNode != nullptr; } bool IsValid() const { return pSelectedNode != nullptr; }
bool operator!=(const SmCaretPos &pos) const {
return pos.pSelectedNode != pSelectedNode || Index != pos.Index;
}
bool operator==(const SmCaretPos &pos) const { bool operator==(const SmCaretPos &pos) const {
return pos.pSelectedNode == pSelectedNode && Index == pos.Index; return pos.pSelectedNode == pSelectedNode && Index == pos.Index;
} }

View File

@@ -481,14 +481,14 @@ public:
// Dialog // Dialog
virtual short Execute() override; virtual short Execute() override;
bool SelectOldSymbolSet(const OUString &rSymbolSetName) void SelectOldSymbolSet(const OUString &rSymbolSetName)
{ {
return SelectSymbolSet(*pOldSymbolSets, rSymbolSetName, false); SelectSymbolSet(*pOldSymbolSets, rSymbolSetName, false);
} }
bool SelectOldSymbol(const OUString &rSymbolName) void SelectOldSymbol(const OUString &rSymbolName)
{ {
return SelectSymbol(*pOldSymbols, rSymbolName, false); SelectSymbol(*pOldSymbols, rSymbolName, false);
} }
bool SelectSymbolSet(const OUString &rSymbolSetName) bool SelectSymbolSet(const OUString &rSymbolSetName)

View File

@@ -178,7 +178,7 @@ public:
const OUString GetComment() const; const OUString GetComment() const;
// to replace chars that can not be saved with the document... // to replace chars that can not be saved with the document...
bool ReplaceBadChars(); void ReplaceBadChars();
void UpdateText(); void UpdateText();
void SetText(const OUString& rBuffer); void SetText(const OUString& rBuffer);

View File

@@ -116,7 +116,7 @@ public:
bool IsExportSymbolNames() const { return m_bExportSymNames; } bool IsExportSymbolNames() const { return m_bExportSymNames; }
void SetExportSymbolNames(bool bVal) { m_bExportSymNames = bVal; } void SetExportSymbolNames(bool bVal) { m_bExportSymNames = bVal; }
size_t AddError(SmParseError Type, SmNode *pNode); void AddError(SmParseError Type, SmNode *pNode);
const SmErrorDesc* NextError(); const SmErrorDesc* NextError();
const SmErrorDesc* PrevError(); const SmErrorDesc* PrevError();
const SmErrorDesc* GetError(size_t i); const SmErrorDesc* GetError(size_t i);

View File

@@ -135,7 +135,6 @@ public:
vcl::Font Get(sal_uInt16 nPos = 0) const; vcl::Font Get(sal_uInt16 nPos = 0) const;
SmFontPickList& operator = (const SmFontPickList& rList); SmFontPickList& operator = (const SmFontPickList& rList);
vcl::Font operator [] (sal_uInt16 nPos) const;
void ReadFrom(const SmFontDialog& rDialog); void ReadFrom(const SmFontDialog& rDialog);
void WriteTo(SmFontDialog& rDialog) const; void WriteTo(SmFontDialog& rDialog) const;

View File

@@ -807,7 +807,7 @@ bool SmDocShell::Save()
/* /*
* replace bad characters that can not be saved. (#i74144) * replace bad characters that can not be saved. (#i74144)
* */ * */
bool SmDocShell::ReplaceBadChars() void SmDocShell::ReplaceBadChars()
{ {
bool bReplace = false; bool bReplace = false;
@@ -827,8 +827,6 @@ bool SmDocShell::ReplaceBadChars()
if (bReplace) if (bReplace)
aText = aBuf.makeStringAndClear(); aText = aBuf.makeStringAndClear();
} }
return bReplace;
} }

View File

@@ -2414,7 +2414,7 @@ SmNode *SmParser::ParseExpression(const OUString &rBuffer)
} }
size_t SmParser::AddError(SmParseError Type, SmNode *pNode) void SmParser::AddError(SmParseError Type, SmNode *pNode)
{ {
std::unique_ptr<SmErrorDesc> pErrDesc(new SmErrorDesc); std::unique_ptr<SmErrorDesc> pErrDesc(new SmErrorDesc);
@@ -2445,8 +2445,6 @@ size_t SmParser::AddError(SmParseError Type, SmNode *pNode)
pErrDesc->m_aText += SM_RESSTR(nRID); pErrDesc->m_aText += SM_RESSTR(nRID);
m_aErrDescList.push_back(std::move(pErrDesc)); m_aErrDescList.push_back(std::move(pErrDesc));
return m_aErrDescList.size()-1;
} }

View File

@@ -20,16 +20,15 @@ SmRtfExport::SmRtfExport(const SmNode* pIn)
{ {
} }
bool SmRtfExport::ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding) void SmRtfExport::ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding)
{ {
if (!m_pTree) if (!m_pTree)
return false; return;
m_pBuffer = &rBuffer; m_pBuffer = &rBuffer;
m_nEncoding = nEncoding; m_nEncoding = nEncoding;
m_pBuffer->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE LO_STRING_SVTOOLS_RTF_MOMATH " "); m_pBuffer->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE LO_STRING_SVTOOLS_RTF_MOMATH " ");
HandleNode(m_pTree, 0); HandleNode(m_pTree, 0);
m_pBuffer->append("}"); // moMath m_pBuffer->append("}"); // moMath
return true;
} }
// NOTE: This is still work in progress and unfinished, but it already covers a good // NOTE: This is still work in progress and unfinished, but it already covers a good

View File

@@ -21,7 +21,7 @@ class SmRtfExport : public SmWordExportBase
{ {
public: public:
explicit SmRtfExport(const SmNode* pIn); explicit SmRtfExport(const SmNode* pIn);
bool ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding); void ConvertFromStarMath(OStringBuffer& rBuffer, rtl_TextEncoding nEncoding);
private: private:
virtual void HandleVerticalStack(const SmNode* pNode, int nLevel) override; virtual void HandleVerticalStack(const SmNode* pNode, int nLevel) override;
virtual void HandleText(const SmNode* pNode, int nLevel) override; virtual void HandleText(const SmNode* pNode, int nLevel) override;

View File

@@ -66,11 +66,6 @@ SmFontPickList& SmFontPickList::operator = (const SmFontPickList& rList)
return *this; return *this;
} }
vcl::Font SmFontPickList::operator [] (sal_uInt16 nPos) const
{
return aFontVec[nPos];
}
vcl::Font SmFontPickList::Get(sal_uInt16 nPos) const vcl::Font SmFontPickList::Get(sal_uInt16 nPos) const
{ {
return nPos < aFontVec.size() ? aFontVec[nPos] : vcl::Font(); return nPos < aFontVec.size() ? aFontVec[nPos] : vcl::Font();