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

loplugin:expandablemethods in sot..starmath

Change-Id: I5b718bbda9ceca5bbfd1e6482ebd215e15884956
Reviewed-on: https://gerrit.libreoffice.org/30318Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
Tested-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst a6628078
......@@ -274,7 +274,7 @@ void StgCache::SetStrm( UCBStorageStream* pStgStream )
void StgCache::SetDirty( const rtl::Reference< StgPage > &rPage )
{
assert( IsWritable() );
assert( m_pStrm && m_pStrm->IsWritable() );
maDirtyPages[ rPage->GetPage() ] = rPage;
}
......
......@@ -70,7 +70,6 @@ public:
SvStream* GetStrm() { return m_pStrm; }
void SetStrm( SvStream*, bool );
void SetStrm( UCBStorageStream* );
bool IsWritable() const { return ( m_pStrm && m_pStrm->IsWritable() ); }
bool Good() const { return m_nError == SVSTREAM_OK; }
ErrCode GetError() { return m_nError; }
void MoveError( StorageBase& );
......
......@@ -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
......
......@@ -379,7 +379,6 @@ public:
bool SelectSymbolSet(const OUString &rSymbolSetName);
void SelectSymbol(sal_uInt16 nSymbolPos);
sal_uInt16 GetSelectedSymbol() const { return m_pSymbolSetDisplay->GetSelectSymbol(); }
};
......
......@@ -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);
......
......@@ -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;
......
......@@ -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));
......
......@@ -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();
}
}
......
......@@ -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
......
......@@ -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())
......
......@@ -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();
......
......@@ -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; }
......
......@@ -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));
}
......
......@@ -87,17 +87,6 @@ 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))
......@@ -105,8 +94,14 @@ void SmFontPickList::Remove(const vcl::Font &rFont)
aFontVec.erase( aFontVec.begin() + nPos );
break;
}
}
aFontVec.push_front( rFont );
if (aFontVec.size() > nMaxItems)
{
aFontVec.pop_back();
}
}
void SmFontPickList::ReadFrom(const SmFontDialog& rDialog)
{
......
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