--- sc/source/filter/inc/XclExpChangeTrack.hxx | 23 +++----------------- sc/source/filter/xcl97/XclExpChangeTrack.cxx | 29 ++++++++++--------------- 2 files changed, 16 insertions(+), 36 deletions(-)
diff --git a/sc/source/filter/inc/XclExpChangeTrack.hxx b/sc/source/filter/inc/XclExpChangeTrack.hxx index b3e8009..4997f0e 100644 --- a/sc/source/filter/inc/XclExpChangeTrack.hxx +++ b/sc/source/filter/inc/XclExpChangeTrack.hxx @@ -29,8 +29,8 @@ #ifndef SC_XCLEXPCHANGETRACK_HXX #define SC_XCLEXPCHANGETRACK_HXX +#include <stack> #include <tools/datetime.hxx> -#include <tools/stack.hxx> #include <rtl/uuid.h> #include "bigrange.hxx" #include "chgtrack.hxx" @@ -601,29 +601,14 @@ public: }; //___________________________________________________________________ -// XclExpChTrActionStack - temporary action stack - -class XclExpChTrActionStack : private Stack -{ -public: - virtual ~XclExpChTrActionStack(); - - void Push( XclExpChTrAction* pNewRec ); - inline XclExpChTrAction* Pop() { return (XclExpChTrAction*) Stack::Pop(); } - -private: - using Stack::Push; -}; - -//___________________________________________________________________ // XclExpChangeTrack - exports the "Revision Log" stream class XclExpChangeTrack : protected XclExpRoot { private: - std::vector<ExcRecord*> aRecList; // list of "Revision Log" stream records - XclExpChTrActionStack aActionStack; - XclExpChTrTabIdBuffer* pTabIdBuffer; + std::vector<ExcRecord*> aRecList; // list of "Revision Log" stream records + std::stack<XclExpChTrAction*> aActionStack; + XclExpChTrTabIdBuffer* pTabIdBuffer; std::vector<XclExpChTrTabIdBuffer*> maBuffers; ScDocument* pTempDoc; // empty document diff --git a/sc/source/filter/xcl97/XclExpChangeTrack.cxx b/sc/source/filter/xcl97/XclExpChangeTrack.cxx index 5f5687b..171c707 100644 --- a/sc/source/filter/xcl97/XclExpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclExpChangeTrack.cxx @@ -1325,21 +1325,6 @@ void XclExpChTr0x014A::SaveXml( XclExpXmlStream& rStrm ) //___________________________________________________________________ -XclExpChTrActionStack::~XclExpChTrActionStack() -{ - while( XclExpChTrAction* pRec = Pop() ) - delete pRec; -} - -void XclExpChTrActionStack::Push( XclExpChTrAction* pNewRec ) -{ - OSL_ENSURE( pNewRec, "XclExpChTrActionStack::Push - NULL pointer" ); - if( pNewRec ) - Stack::Push( pNewRec ); -} - -//___________________________________________________________________ - class ExcXmlRecord : public ExcRecord { public: @@ -1479,8 +1464,12 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) : DateTime aLastDateTime; sal_uInt32 nIndex = 1; sal_Int32 nLogNumber = 1; - while( XclExpChTrAction* pAction = aActionStack.Pop() ) + XclExpChTrAction* pAction; + while( !aActionStack.empty() ) { + pAction = aActionStack.top(); + aActionStack.pop(); + if( (nIndex == 1) || pAction->ForceInfoRecord() || (pAction->GetUsername() != sLastUsername) || (pAction->GetDateTime() != aLastDateTime) ) @@ -1526,6 +1515,12 @@ XclExpChangeTrack::~XclExpChangeTrack() for ( pIter = maBuffers.begin(); pIter != maBuffers.end(); ++pIter ) delete *pIter; + while( !aActionStack.empty() ) + { + delete aActionStack.top(); + aActionStack.pop(); + } + if( pTempDoc ) delete pTempDoc; } @@ -1592,7 +1587,7 @@ void XclExpChangeTrack::PushActionRecord( const ScChangeAction& rAction ) default:; } if( pXclAction ) - aActionStack.Push( pXclAction ); + aActionStack.push( pXclAction ); } sal_Bool XclExpChangeTrack::WriteUserNamesStream()
_______________________________________________ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice