summaryrefslogtreecommitdiff
path: root/starmath
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-10-27 10:50:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-27 11:38:22 +0000
commit618171552e1bcddb07660167d9df4512435269b0 (patch)
tree24663a06258318d8ab0d57d1e6f676e4afdebcdc /starmath
parenta6628078a929a39a95ae8b2f51348996dc41afbc (diff)
loplugin:expandablemethods in sot..starmath
Change-Id: I5b718bbda9ceca5bbfd1e6482ebd215e15884956 Reviewed-on: https://gerrit.libreoffice.org/30318 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath')
-rw-r--r--starmath/inc/ElementsDockingWindow.hxx2
-rw-r--r--starmath/inc/dialog.hxx1
-rw-r--r--starmath/inc/rect.hxx2
-rw-r--r--starmath/inc/utility.hxx1
-rw-r--r--starmath/source/ElementsDockingWindow.cxx7
-rw-r--r--starmath/source/cfgitem.cxx10
-rw-r--r--starmath/source/cfgitem.hxx1
-rw-r--r--starmath/source/dialog.cxx2
-rw-r--r--starmath/source/mathmlimport.cxx2
-rw-r--r--starmath/source/mathmlimport.hxx4
-rw-r--r--starmath/source/rect.cxx10
-rw-r--r--starmath/source/utility.cxx19
12 files changed, 14 insertions, 47 deletions
diff --git a/starmath/inc/ElementsDockingWindow.hxx b/starmath/inc/ElementsDockingWindow.hxx
index 15ca546b9e37..50b164840a24 100644
--- a/starmath/inc/ElementsDockingWindow.hxx
+++ b/starmath/inc/ElementsDockingWindow.hxx
@@ -106,8 +106,6 @@ class SmElementsControl : public Control
void addElements(const sal_uInt16 aElementsArray[][2], sal_uInt16 size);
- void addSeparator();
-
void build();
//if pContext is not NULL, then draw, otherwise
diff --git a/starmath/inc/dialog.hxx b/starmath/inc/dialog.hxx
index 047f1157515f..79bc363db7f3 100644
--- a/starmath/inc/dialog.hxx
+++ b/starmath/inc/dialog.hxx
@@ -379,7 +379,6 @@ public:
bool SelectSymbolSet(const OUString &rSymbolSetName);
void SelectSymbol(sal_uInt16 nSymbolPos);
- sal_uInt16 GetSelectedSymbol() const { return m_pSymbolSetDisplay->GetSelectSymbol(); }
};
diff --git a/starmath/inc/rect.hxx b/starmath/inc/rect.hxx
index c28e1d257539..5f20fdac1b6f 100644
--- a/starmath/inc/rect.hxx
+++ b/starmath/inc/rect.hxx
@@ -111,8 +111,6 @@ class SmRect
protected:
void BuildRect (const OutputDevice &rDev, const SmFormat *pFormat,
const OUString &rText, sal_uInt16 nBorderWidth);
- void Init(const OutputDevice &rDev, const SmFormat *pFormat,
- const OUString &rText, sal_uInt16 nBorderWidth);
inline void CopyMBL(const SmRect& rRect);
void CopyAlignInfo(const SmRect& rRect);
diff --git a/starmath/inc/utility.hxx b/starmath/inc/utility.hxx
index be4c84db6062..7920fc84d38a 100644
--- a/starmath/inc/utility.hxx
+++ b/starmath/inc/utility.hxx
@@ -122,7 +122,6 @@ public:
virtual ~SmFontPickList() { Clear(); }
virtual void Insert(const vcl::Font &rFont);
- void Remove(const vcl::Font &rFont);
void Clear();
vcl::Font Get(sal_uInt16 nPos = 0) const;
diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx
index fe517fbc5e11..4721e516d7a1 100644
--- a/starmath/source/ElementsDockingWindow.cxx
+++ b/starmath/source/ElementsDockingWindow.cxx
@@ -502,11 +502,6 @@ void SmElementsControl::DoScroll(long nDelta)
Invalidate();
}
-void SmElementsControl::addSeparator()
-{
- maElementList.push_back(o3tl::make_unique<SmElementSeparator>());
-}
-
void SmElementsControl::addElement(const OUString& aElementVisual, const OUString& aElementSource, const OUString& aHelpText)
{
std::unique_ptr<SmNode> pNode(SmParser().ParseExpression(aElementVisual));
@@ -541,7 +536,7 @@ void SmElementsControl::addElements(const sal_uInt16 aElementsArray[][2], sal_uI
sal_uInt16 aElementId = aElementsArray[i][0];
sal_uInt16 aElementIdHelp = aElementsArray[i][1];
if (aElementId == 0xFFFF) {
- addSeparator();
+ maElementList.push_back(o3tl::make_unique<SmElementSeparator>());
} else {
if (aElementId == RID_NEWLINE)
addElement(OUString( "\xe2\x86\xb5", 3, RTL_TEXTENCODING_UTF8 ), SM_RESSTR(aElementId), SM_RESSTR(aElementIdHelp));
diff --git a/starmath/source/cfgitem.cxx b/starmath/source/cfgitem.cxx
index 1daf41e62359..4b1bd12c2b3a 100644
--- a/starmath/source/cfgitem.cxx
+++ b/starmath/source/cfgitem.cxx
@@ -361,13 +361,6 @@ void SmMathConfig::SetFormatModified( bool bVal )
}
-void SmMathConfig::SetFontFormatListModified( bool bVal )
-{
- if (pFontFormatList)
- pFontFormatList->SetModified( bVal );
-}
-
-
void SmMathConfig::ReadSymbol( SmSym &rSymbol,
const OUString &rSymbolName,
const OUString &rBaseNode ) const
@@ -974,7 +967,8 @@ void SmMathConfig::SetStandardFormat( const SmFormat &rFormat, bool bSaveFontFor
if (bSaveFontFormatList)
{
// needed for SmFontTypeDialog's DefaultButtonClickHdl
- SetFontFormatListModified( true );
+ if (pFontFormatList)
+ pFontFormatList->SetModified( true );
SaveFontFormatList();
}
}
diff --git a/starmath/source/cfgitem.hxx b/starmath/source/cfgitem.hxx
index c4c110527677..1bb91e340f2a 100644
--- a/starmath/source/cfgitem.hxx
+++ b/starmath/source/cfgitem.hxx
@@ -130,7 +130,6 @@ protected:
inline bool IsOtherModified() const { return bIsOtherModified; }
void SetFormatModified( bool bVal );
inline bool IsFormatModified() const { return bIsFormatModified; }
- void SetFontFormatListModified( bool bVal );
SmFontFormatList & GetFontFormatList();
const SmFontFormatList & GetFontFormatList() const
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index 7421c1e3e5c5..d4f31924a185 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1466,7 +1466,7 @@ IMPL_LINK_NOARG(SmSymbolDialog, EditClickHdl, Button*, void)
// remember old SymbolSet
OUString aOldSymbolSet (m_pSymbolSets->GetSelectEntry());
- sal_uInt16 nSymPos = GetSelectedSymbol();
+ sal_uInt16 nSymPos = m_pSymbolSetDisplay->GetSelectSymbol();
// adapt dialog to data of the SymbolSet manager, which might have changed
if (pDialog->Execute() == RET_OK && rSymbolMgr.IsModified())
diff --git a/starmath/source/mathmlimport.cxx b/starmath/source/mathmlimport.cxx
index 60f88916bd02..b318406234c0 100644
--- a/starmath/source/mathmlimport.cxx
+++ b/starmath/source/mathmlimport.cxx
@@ -484,7 +484,7 @@ void SmXMLImport::endDocument()
throw(xml::sax::SAXException, uno::RuntimeException, std::exception)
{
//Set the resulted tree into the SmDocShell where it belongs
- SmNode *pTree = GetTree();
+ SmNode *pTree = popOrZero(aNodeStack);
if (pTree && pTree->GetType() == NTABLE)
{
uno::Reference <frame::XModel> xModel = GetModel();
diff --git a/starmath/source/mathmlimport.hxx b/starmath/source/mathmlimport.hxx
index 8031ed447274..04d49c82950d 100644
--- a/starmath/source/mathmlimport.hxx
+++ b/starmath/source/mathmlimport.hxx
@@ -238,10 +238,6 @@ public:
const SvXMLTokenMap &GetActionAttrTokenMap();
SmNodeStack & GetNodeStack() { return aNodeStack; }
- SmNode *GetTree()
- {
- return popOrZero(aNodeStack);
- }
bool GetSuccess() { return bSuccess; }
SAL_WARN_UNUSED_RESULT const OUString& GetText() { return aText; }
diff --git a/starmath/source/rect.cxx b/starmath/source/rect.cxx
index 63798c6b917f..6252e5551f5c 100644
--- a/starmath/source/rect.cxx
+++ b/starmath/source/rect.cxx
@@ -215,13 +215,6 @@ void SmRect::BuildRect(const OutputDevice &rDev, const SmFormat *pFormat,
}
-void SmRect::Init(const OutputDevice &rDev, const SmFormat *pFormat,
- const OUString &rText, sal_uInt16 nEBorderWidth)
- // get rectangle fitting for drawing 'rText' on OutputDevice 'rDev'
-{
- BuildRect(rDev, pFormat, rText, nEBorderWidth);
-}
-
SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
const OUString &rText, long nEBorderWidth)
@@ -229,7 +222,8 @@ SmRect::SmRect(const OutputDevice &rDev, const SmFormat *pFormat,
OSL_ENSURE( nEBorderWidth >= 0, "BorderWidth is negative" );
if (nEBorderWidth < 0)
nEBorderWidth = 0;
- Init(rDev, pFormat, rText, sal::static_int_cast<sal_uInt16>(nEBorderWidth));
+ // get rectangle fitting for drawing 'rText' on OutputDevice 'rDev'
+ BuildRect(rDev, pFormat, rText, sal::static_int_cast<sal_uInt16>(nEBorderWidth));
}
diff --git a/starmath/source/utility.cxx b/starmath/source/utility.cxx
index 34a4de5b0015..cadb88e1c6fc 100644
--- a/starmath/source/utility.cxx
+++ b/starmath/source/utility.cxx
@@ -88,25 +88,20 @@ OUString SmFontPickList::GetStringItem(const vcl::Font &rFont)
void SmFontPickList::Insert(const vcl::Font &rFont)
{
- Remove(rFont);
- aFontVec.push_front( rFont );
-
- if (aFontVec.size() > nMaxItems)
- {
- aFontVec.pop_back();
- }
-}
-
-void SmFontPickList::Remove(const vcl::Font &rFont)
-{
for (size_t nPos = 0; nPos < aFontVec.size(); nPos++)
if (CompareItem( aFontVec[nPos], rFont))
{
aFontVec.erase( aFontVec.begin() + nPos );
break;
}
-}
+ aFontVec.push_front( rFont );
+
+ if (aFontVec.size() > nMaxItems)
+ {
+ aFontVec.pop_back();
+ }
+}
void SmFontPickList::ReadFrom(const SmFontDialog& rDialog)
{