diff options
22 files changed, 36 insertions, 127 deletions
diff --git a/include/oox/dump/dumperbase.hxx b/include/oox/dump/dumperbase.hxx index 917835fd04f4..772197a538ee 100644 --- a/include/oox/dump/dumperbase.hxx +++ b/include/oox/dump/dumperbase.hxx @@ -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; diff --git a/include/oox/ole/vbaproject.hxx b/include/oox/ole/vbaproject.hxx index 6949834eadf8..c29a8eaa2ce0 100644 --- a/include/oox/ole/vbaproject.hxx +++ b/include/oox/ole/vbaproject.hxx @@ -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: diff --git a/lotuswordpro/source/filter/lwpcolor.cxx b/lotuswordpro/source/filter/lwpcolor.cxx index b475ed365a9a..47eb247da16a 100644 --- a/lotuswordpro/source/filter/lwpcolor.cxx +++ b/lotuswordpro/source/filter/lwpcolor.cxx @@ -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: */ diff --git a/lotuswordpro/source/filter/lwpcolor.hxx b/lotuswordpro/source/filter/lwpcolor.hxx index 61d7beb1e06e..9c3469382ba4 100644 --- a/lotuswordpro/source/filter/lwpcolor.hxx +++ b/lotuswordpro/source/filter/lwpcolor.hxx @@ -99,7 +99,6 @@ private: AGLRGB_INVALID = 99, AGLRGB_TRANSPARENT = 100 }; - void ResolveRGB(); }; inline sal_uInt16 LwpColor::GetRed() { diff --git a/lotuswordpro/source/filter/lwpdivinfo.cxx b/lotuswordpro/source/filter/lwpdivinfo.cxx index efa32f69561a..d3d50ce3b882 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.cxx +++ b/lotuswordpro/source/filter/lwpdivinfo.cxx @@ -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()); diff --git a/lotuswordpro/source/filter/lwpdivinfo.hxx b/lotuswordpro/source/filter/lwpdivinfo.hxx index fb1adca2ae4a..2fdd96dc67e7 100644 --- a/lotuswordpro/source/filter/lwpdivinfo.hxx +++ b/lotuswordpro/source/filter/lwpdivinfo.hxx @@ -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: */ diff --git a/lotuswordpro/source/filter/lwpframelayout.cxx b/lotuswordpro/source/filter/lwpframelayout.cxx index 7f593e4a2cd7..ef95f678ad2a 100644 --- a/lotuswordpro/source/filter/lwpframelayout.cxx +++ b/lotuswordpro/source/filter/lwpframelayout.cxx @@ -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); diff --git a/lotuswordpro/source/filter/lwpframelayout.hxx b/lotuswordpro/source/filter/lwpframelayout.hxx index 603f0d33d15c..99b3a215ccc3 100644 --- a/lotuswordpro/source/filter/lwpframelayout.hxx +++ b/lotuswordpro/source/filter/lwpframelayout.hxx @@ -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: diff --git a/lotuswordpro/source/filter/lwpfribmark.cxx b/lotuswordpro/source/filter/lwpfribmark.cxx index 7b77d277eb76..a71a3921d462 100644 --- a/lotuswordpro/source/filter/lwpfribmark.cxx +++ b/lotuswordpro/source/filter/lwpfribmark.cxx @@ -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) { diff --git a/lotuswordpro/source/filter/lwpfribmark.hxx b/lotuswordpro/source/filter/lwpfribmark.hxx index da2ee48552d8..9ea3730fbeda 100644 --- a/lotuswordpro/source/filter/lwpfribmark.hxx +++ b/lotuswordpro/source/filter/lwpfribmark.hxx @@ -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; diff --git a/lotuswordpro/source/filter/lwpobjstrm.cxx b/lotuswordpro/source/filter/lwpobjstrm.cxx index bb7e255059b3..8a28c9fd214a 100644 --- a/lotuswordpro/source/filter/lwpobjstrm.cxx +++ b/lotuswordpro/source/filter/lwpobjstrm.cxx @@ -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; diff --git a/lotuswordpro/source/filter/lwpobjstrm.hxx b/lotuswordpro/source/filter/lwpobjstrm.hxx index 826bd8e757b4..918659da82b4 100644 --- a/lotuswordpro/source/filter/lwpobjstrm.hxx +++ b/lotuswordpro/source/filter/lwpobjstrm.hxx @@ -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); diff --git a/lotuswordpro/source/filter/lwptablelayout.hxx b/lotuswordpro/source/filter/lwptablelayout.hxx index 16d3b09d3497..48e00c871b07 100644 --- a/lotuswordpro/source/filter/lwptablelayout.hxx +++ b/lotuswordpro/source/filter/lwptablelayout.hxx @@ -182,9 +182,8 @@ protected: bool IsSizeRightToContent(); bool IsJustifiable(); LwpFrame* m_pFrame; - -private: }; + /** * @brief * VO_COLUMNLAYOUT object diff --git a/lotuswordpro/source/filter/lwptaboverride.hxx b/lotuswordpro/source/filter/lwptaboverride.hxx index 4ebac3cd72fc..c5eeaa893d20 100644 --- a/lotuswordpro/source/filter/lwptaboverride.hxx +++ b/lotuswordpro/source/filter/lwptaboverride.hxx @@ -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: */ diff --git a/oox/inc/drawingml/chart/typegroupconverter.hxx b/oox/inc/drawingml/chart/typegroupconverter.hxx index 22a134ce8951..9ab86c8aa241 100644 --- a/oox/inc/drawingml/chart/typegroupconverter.hxx +++ b/oox/inc/drawingml/chart/typegroupconverter.hxx @@ -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 > diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index f6c88e763376..c92ee47f03bd 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -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 diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx index a63fe323300c..373e665cd14a 100644 --- a/oox/source/dump/dumperbase.cxx +++ b/oox/source/dump/dumperbase.cxx @@ -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 ) ) diff --git a/oox/source/ole/vbaproject.cxx b/oox/source/ole/vbaproject.cxx index e71669600647..b520d652f8d6 100644 --- a/oox/source/ole/vbaproject.cxx +++ b/oox/source/ole/vbaproject.cxx @@ -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 ) diff --git a/package/inc/ZipOutputStream.hxx b/package/inc/ZipOutputStream.hxx index e532c3add02a..79fb84d47926 100644 --- a/package/inc/ZipOutputStream.hxx +++ b/package/inc/ZipOutputStream.hxx @@ -74,7 +74,6 @@ private: // ScheduledThread handling helpers void consumeScheduledThreadEntry(ZipOutputEntry* pCandidate); void consumeFinishedScheduledThreadEntries(); - void consumeAllScheduledThreadEntries(); public: void reduceScheduledThreadsToGivenNumberOrLess( diff --git a/package/inc/ZipPackageStream.hxx b/package/inc/ZipPackageStream.hxx index d6e1763e86af..605432ed169d 100644 --- a/package/inc/ZipPackageStream.hxx +++ b/package/inc/ZipPackageStream.hxx @@ -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, diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx index 38039636b56d..603a61423eb4 100644 --- a/package/source/zipapi/ZipOutputStream.cxx +++ b/package/source/zipapi/ZipOutputStream.cxx @@ -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) diff --git a/package/source/zippackage/ZipPackageStream.cxx b/package/source/zippackage/ZipPackageStream.cxx index 90fb399379b3..17a6fac66f6b 100644 --- a/package/source/zippackage/ZipPackageStream.cxx +++ b/package/source/zippackage/ZipPackageStream.cxx @@ -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 ); } |