loplugin:expandablemethods in lotuswordpro..package

Change-Id: Ic9827c998f4f78775fdf5c1eaf9d4749d4986102
Reviewed-on: https://gerrit.libreoffice.org/30682
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2016-11-08 09:33:15 +02:00
parent 6aa8e86f3a
commit dca61b588a
22 changed files with 36 additions and 127 deletions

View File

@@ -320,7 +320,6 @@ public:
static void appendToken( OUStringBuffer& rStr, const OUString& rToken, sal_Unicode cSep = OOX_DUMP_LISTSEP );
static void appendIndex( OUStringBuffer& rStr, const OUString& rIdx );
static void appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx );
static OUString getToken( const OUString& rData, sal_Int32& rnPos, sal_Unicode cSep = OOX_DUMP_LISTSEP );
@@ -879,7 +878,6 @@ protected:
virtual bool implIsValid() const override;
const OUString* implGetOption( const OUString& rKey ) const;
NameListRef implGetNameList( const OUString& rListName ) const;
private:
typedef std::shared_ptr< SharedConfigData > SharedConfigDataRef;
@@ -1638,7 +1636,6 @@ protected:
sal_Int64 getRecId() const { return mnRecId; }
sal_Int64 getRecSize() const { return mnRecSize; }
NameListRef getRecNames() const { return maRecNames.getNameList( cfg() ); }
virtual bool implIsValid() const override;
virtual void implDump() override;

View File

@@ -142,12 +142,6 @@ public:
/** Attaches VBA macros to objects registered via registerMacroAttacher(). */
void attachMacros();
/** Returns true, if the document contains at least one code module. */
bool hasModules() const;
/** Returns true, if the document contains at least one dialog. */
bool hasDialogs() const;
void setOleOverridesSink( css::uno::Reference< css::container::XNameContainer >& rxOleOverridesSink ){ mxOleOverridesSink = rxOleOverridesSink; }
protected:

View File

@@ -59,17 +59,6 @@
************************************************************************/
#include "lwpcolor.hxx"
/**
* @descr read color and then resolve the RGB values
*/
void LwpColor::Read(LwpObjectStream *pStrm)
{
m_nRed = pStrm->QuickReaduInt16();
m_nGreen = pStrm->QuickReaduInt16();
m_nBlue = pStrm->QuickReaduInt16();
m_nExtra = pStrm->QuickReaduInt16();
ResolveRGB();
}
/**
* @descr return the BGR format
@@ -80,11 +69,18 @@ sal_uInt32 LwpColor::To24Color()
(m_nGreen & 0xFF00) |
(static_cast<sal_uInt32>((m_nBlue & 0xFF00) << 8)));
}
/**
* @descr resolver RGB values per the extra bytes
* @descr read color and then resolve the RGB values
*/
void LwpColor::ResolveRGB()
void LwpColor::Read(LwpObjectStream *pStrm)
{
m_nRed = pStrm->QuickReaduInt16();
m_nGreen = pStrm->QuickReaduInt16();
m_nBlue = pStrm->QuickReaduInt16();
m_nExtra = pStrm->QuickReaduInt16();
// resolve RGB values per the extra bytes
switch(m_nExtra)
{
case AGLRGB_RGB:
@@ -135,7 +131,7 @@ void LwpColor::ResolveRGB()
m_nRed = 0;
m_nGreen = 0;
m_nBlue = 0;
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -99,7 +99,6 @@ private:
AGLRGB_INVALID = 99,
AGLRGB_TRANSPARENT = 100
};
void ResolveRGB();
};
inline sal_uInt16 LwpColor::GetRed()
{

View File

@@ -155,7 +155,7 @@ void LwpDivInfo::GetNumberOfPages(sal_uInt16 & nPageno)
sal_uInt16 LwpDivInfo::GetMaxNumberOfPages()
{
LwpDocument* pDiv = GetDivision();
LwpDocument* pDiv = dynamic_cast<LwpDocument*>(m_ParentID.obj().get());
if(!pDiv)
return 0;
LwpDLVListHeadTailHolder* pHeadTail = dynamic_cast<LwpDLVListHeadTailHolder*>(pDiv->GetPageHintsID().obj().get());

View File

@@ -83,7 +83,6 @@ public:
inline bool IsOleDivision();
inline bool IsScrollable();
inline bool IsGotoable();
inline LwpDocument* GetDivision();
void GetNumberOfPages(sal_uInt16& nPageno);
sal_uInt16 GetMaxNumberOfPages();
protected:
@@ -153,10 +152,6 @@ inline bool LwpDivInfo::IsGotoable()
return HasContents() && (IsScrollable() || IsOleDivision());
}
inline LwpDocument* LwpDivInfo::GetDivision()
{
return dynamic_cast<LwpDocument*>(m_ParentID.obj().get());
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -1171,14 +1171,9 @@ void LwpDropcapLayout::XFConvert(XFContentContainer* pCont)
}
}
LwpStory* LwpDropcapLayout::GetContentStory()
{
return static_cast<LwpStory*>(m_Content.obj(VO_STORY).get());
}
void LwpDropcapLayout::RegisterStyle(LwpFoundry* pFoundry)
{
LwpStory* pStory = GetContentStory();
LwpStory* pStory = static_cast<LwpStory*>(m_Content.obj(VO_STORY).get());
if (pStory)
{
pStory->SetDropcapFlag(true);

View File

@@ -191,7 +191,6 @@ public:
sal_uInt16 GetLines(){return m_nLines;}
void SetChars(sal_uInt32 nChars){ m_nChars += nChars;}
sal_uInt32 GetChars() const {return m_nChars;}
LwpStory* GetContentStory();
void RegisterStyle(LwpFoundry* pFoundry);
void RegisterStyle() override;
protected:

View File

@@ -86,17 +86,12 @@ void LwpFribCHBlock::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/)
m_nType = pObjStrm->QuickReaduInt8();
}
LwpCHBlkMarker* LwpFribCHBlock::GetMarker()
{
return dynamic_cast<LwpCHBlkMarker*>(m_objMarker.obj().get());
}
void LwpFribCHBlock::XFConvert(XFContentContainer* pXFPara,LwpStory* pStory)
{
sal_uInt8 type = GetType();
if (!pStory)
return;
LwpCHBlkMarker* pMarker = GetMarker();
LwpCHBlkMarker* pMarker = dynamic_cast<LwpCHBlkMarker*>(m_objMarker.obj().get());
if (!pMarker)
return;
@@ -1401,11 +1396,6 @@ LwpFribRubyMarker::LwpFribRubyMarker( LwpPara* pPara )
{
}
LwpRubyMarker* LwpFribRubyMarker::GetMarker()
{
return dynamic_cast<LwpRubyMarker*>(m_objMarker.obj(VO_RUBYMARKER).get());
}
void LwpFribRubyMarker::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/)
{
m_objMarker.ReadIndexed(pObjStrm);
@@ -1415,7 +1405,7 @@ void LwpFribRubyMarker::Read(LwpObjectStream* pObjStrm, sal_uInt16 /*len*/)
void LwpFribRubyMarker::XFConvert(XFContentContainer* pXFPara)
{
sal_uInt8 type = GetType();
LwpRubyMarker* pMarker = GetMarker();
LwpRubyMarker* pMarker = dynamic_cast<LwpRubyMarker*>(m_objMarker.obj(VO_RUBYMARKER).get());
if (type == MARKER_START)
{

View File

@@ -76,7 +76,6 @@ public:
{}
virtual ~LwpFribCHBlock() override {}
void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) override;
LwpCHBlkMarker* GetMarker();
enum{MARKER_START=1,MARKER_END,MARKER_NONE};
void XFConvert(XFContentContainer* pXFPara,LwpStory* pStory);
private:
@@ -149,7 +148,6 @@ public:
explicit LwpFribRubyMarker( LwpPara* pPara );
virtual ~LwpFribRubyMarker() override {}
void Read(LwpObjectStream* pObjStrm, sal_uInt16 len) override;
LwpRubyMarker* GetMarker();
enum{MARKER_START=1,MARKER_END,MARKER_NONE};
void XFConvert(XFContentContainer* pXFPara);
void RegisterStyle(LwpFoundry* pFoundry) override;

View File

@@ -69,13 +69,7 @@ LwpObjectStream::LwpObjectStream(LwpSvStream *pStrm, bool isCompressed, sal_uInt
m_pStrm(pStrm), m_bCompressed(isCompressed)
{
assert(size<IO_BUFFERSIZE);
ReadStream();
}
/**
* @descr read object data from stream
*/
void LwpObjectStream::ReadStream()
{
// read object data from stream
if(m_nBufSize == 0)
{
m_pContentBuf = nullptr;

View File

@@ -105,7 +105,6 @@ public:
void ReadComplete();
LwpSvStream *GetStream();
private:
void ReadStream();
void Read2Buffer();
sal_uInt8* AllocBuffer(sal_uInt16 size);
static sal_uInt16 DecompressBuffer(sal_uInt8* pDst, sal_uInt8* pSrc, sal_uInt16 Size);

View File

@@ -182,9 +182,8 @@ protected:
bool IsSizeRightToContent();
bool IsJustifiable();
LwpFrame* m_pFrame;
private:
};
/**
* @brief
* VO_COLUMNLAYOUT object

View File

@@ -88,7 +88,6 @@ public:
}
inline LwpObjectID& GetTabRackID();
inline bool IsTabRackOverridden();
inline void Override(LwpTabOverride* pOther);
protected:
@@ -114,17 +113,11 @@ inline void LwpTabOverride::Override(LwpTabOverride* pOther)
{
if (m_nApply & TO_TABRACK)
{
if (IsTabRackOverridden())
//m_aTabRackID = *(pOther->GetTabRackID());
if ((m_nOverride & TO_TABRACK) != 0)
pOther->m_aTabRackID = GetTabRackID();
}
}
inline bool LwpTabOverride::IsTabRackOverridden()
{
return (m_nOverride & TO_TABRACK) != 0;
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -133,10 +133,8 @@ public:
/** Returns the object type for a series depending on the chart type. */
ObjectType getSeriesObjectType() const;
/** Returns true, if this chart type has to reverse its series order. */
bool isReverseSeries() const;
/** Returns series title, if the chart type group contains only one single series. */
OUString getSingleSeriesTitle() const;
OUString getSingleSeriesTitle() const;
/** Creates a coordinate system according to the contained chart type. */
css::uno::Reference< css::chart2::XCoordinateSystem >

View File

@@ -222,11 +222,6 @@ ObjectType TypeGroupConverter::getSeriesObjectType() const
(maTypeInfo.mbSeriesIsFrame2d ? OBJECTTYPE_FILLEDSERIES2D : OBJECTTYPE_LINEARSERIES2D);
}
bool TypeGroupConverter::isReverseSeries() const
{
return maTypeInfo.mbReverseSeries && !mb3dChart && !isStacked() && !isPercent();
}
OUString TypeGroupConverter::getSingleSeriesTitle() const
{
OUString aSeriesTitle;
@@ -349,7 +344,7 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra
aSeries.push_back( std::make_shared<SeriesConverter>( *this, **aIt ) );
// reverse series order for some unstacked 2D chart types
if( isReverseSeries() )
if( maTypeInfo.mbReverseSeries && !mb3dChart && !isStacked() && !isPercent() )
::std::reverse( aSeries.begin(), aSeries.end() );
// decide whether to use varying colors for each data point

View File

@@ -519,16 +519,11 @@ void StringHelper::appendToken( OUStringBuffer& rStr, const OUString& rToken, sa
rStr.append( rToken );
}
void StringHelper::appendIndex( OUStringBuffer& rStr, const OUString& rIdx )
{
rStr.append( '[' ).append( rIdx ).append( ']' );
}
void StringHelper::appendIndex( OUStringBuffer& rStr, sal_Int64 nIdx )
{
OUStringBuffer aToken;
appendDec( aToken, nIdx );
appendIndex( rStr, aToken.makeStringAndClear() );
rStr.append( '[' ).append( aToken.makeStringAndClear() ).append( ']' );
}
OUString StringHelper::getToken( const OUString& rData, sal_Int32& rnPos, sal_Unicode cSep )
@@ -1449,7 +1444,7 @@ void Config::eraseNameList( const String& rListName )
NameListRef Config::getNameList( const String& rListName ) const
{
return implGetNameList( rListName );
return mxCfgData->getNameList( rListName );
}
bool Config::implIsValid() const
@@ -1462,11 +1457,6 @@ const OUString* Config::implGetOption( const OUString& rKey ) const
return mxCfgData->getOption( rKey );
}
NameListRef Config::implGetNameList( const OUString& rListName ) const
{
return mxCfgData->getNameList( rListName );
}
Output::Output( const Reference< XComponentContext >& rxContext, const OUString& rFileName ) :
mxStrm( InputOutputHelper::openTextOutputStream( rxContext, rFileName, RTL_TEXTENCODING_UTF8 ) ),
mnCol( 0 ),
@@ -2458,7 +2448,7 @@ bool RecordObjectBase::implIsValid() const
void RecordObjectBase::implDump()
{
NameListRef xRecNames = getRecNames();
NameListRef xRecNames = maRecNames.getNameList( cfg() );
ItemFormatMap aSimpleRecs( maSimpleRecs.getNameList( cfg() ) );
while( implStartRecord( *mxBaseStrm, mnRecPos, mnRecId, mnRecSize ) )

View File

@@ -165,7 +165,8 @@ bool VbaProject::importVbaProject( StorageBase& rVbaPrjStrg )
GraphicHelper grfHlp( mxContext, xFrame, noStorage );
importVbaProject( rVbaPrjStrg, grfHlp );
// return true if something has been imported
return hasModules() || hasDialogs();
return (mxBasicLib.is() && mxBasicLib->hasElements()) ||
(mxDialogLib.is() && mxDialogLib->hasElements());
}
void VbaProject::importVbaProject( StorageBase& rVbaPrjStrg, const GraphicHelper& rGraphicHelper )
@@ -187,16 +188,6 @@ void VbaProject::registerMacroAttacher( const VbaMacroAttacherRef& rxAttacher )
maMacroAttachers.push_back( rxAttacher );
}
bool VbaProject::hasModules() const
{
return mxBasicLib.is() && mxBasicLib->hasElements();
}
bool VbaProject::hasDialogs() const
{
return mxDialogLib.is() && mxDialogLib->hasElements();
}
// protected ------------------------------------------------------------------
void VbaProject::addDummyModule( const OUString& rName, sal_Int32 nType )

View File

@@ -74,7 +74,6 @@ private:
// ScheduledThread handling helpers
void consumeScheduledThreadEntry(ZipOutputEntry* pCandidate);
void consumeFinishedScheduledThreadEntries();
void consumeAllScheduledThreadEntries();
public:
void reduceScheduledThreadsToGivenNumberOrLess(

View File

@@ -117,8 +117,6 @@ public:
{ m_xBaseEncryptionData->m_nIterationCount = nNewCount;}
void setSize (const sal_Int64 nNewSize);
void CloseOwnStreamIfAny();
ZipPackageStream( ZipPackage & rNewPackage,
const css::uno::Reference < css::uno::XComponentContext >& xContext,
sal_Int32 nFormat,

View File

@@ -148,16 +148,6 @@ void ZipOutputStream::consumeFinishedScheduledThreadEntries()
m_aEntries = aNonFinishedEntries;
}
void ZipOutputStream::consumeAllScheduledThreadEntries()
{
while(!m_aEntries.empty())
{
ZipOutputEntry* pCandidate = m_aEntries.back();
m_aEntries.pop_back();
consumeScheduledThreadEntry(pCandidate);
}
}
void ZipOutputStream::reduceScheduledThreadsToGivenNumberOrLess(sal_Int32 nThreads)
{
while(static_cast< sal_Int32 >(m_aEntries.size()) > nThreads)
@@ -181,7 +171,12 @@ void ZipOutputStream::finish()
comphelper::ThreadPool::getSharedOptimalPool().waitUntilDone(mpThreadTaskTag);
// consume all processed entries
consumeAllScheduledThreadEntries();
while(!m_aEntries.empty())
{
ZipOutputEntry* pCandidate = m_aEntries.back();
m_aEntries.pop_back();
consumeScheduledThreadEntry(pCandidate);
}
sal_Int32 nOffset= static_cast < sal_Int32 > (m_aChucker.GetPosition());
for (ZipEntry* p : m_aZipList)

View File

@@ -139,16 +139,6 @@ void ZipPackageStream::setZipEntryOnLoading( const ZipEntry &rInEntry )
m_bToBeCompressed = false;
}
void ZipPackageStream::CloseOwnStreamIfAny()
{
if ( m_xStream.is() )
{
m_xStream->closeInput();
m_xStream.clear();
m_bHasSeekable = false;
}
}
uno::Reference< io::XInputStream > const & ZipPackageStream::GetOwnSeekStream()
{
if ( !m_bHasSeekable && m_xStream.is() )
@@ -905,7 +895,12 @@ void ZipPackageStream::successfullyWritten( ZipEntry *pEntry )
{
if ( !IsPackageMember() )
{
CloseOwnStreamIfAny();
if ( m_xStream.is() )
{
m_xStream->closeInput();
m_xStream.clear();
m_bHasSeekable = false;
}
SetPackageMember ( true );
}