Kaydet (Commit) 6c6bc189 authored tarafından Marcel Metz's avatar Marcel Metz Kaydeden (comit) Eike Rathke

Replace XclExpChTrActionStack with std::stack< XclExpChTrAction* >

üst ecfcc545
......@@ -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"
......@@ -600,30 +600,15 @@ public:
virtual void SaveXml( XclExpXmlStream& rStrm );
};
//___________________________________________________________________
// 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
......
......@@ -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,11 @@ XclExpChangeTrack::XclExpChangeTrack( const XclExpRoot& rRoot ) :
DateTime aLastDateTime( DateTime::EMPTY );
sal_uInt32 nIndex = 1;
sal_Int32 nLogNumber = 1;
while( XclExpChTrAction* pAction = aActionStack.Pop() )
while( !aActionStack.empty() )
{
XclExpChTrAction* pAction = aActionStack.top();
aActionStack.pop();
if( (nIndex == 1) || pAction->ForceInfoRecord() ||
(pAction->GetUsername() != sLastUsername) ||
(pAction->GetDateTime() != aLastDateTime) )
......@@ -1526,6 +1514,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 +1586,7 @@ void XclExpChangeTrack::PushActionRecord( const ScChangeAction& rAction )
default:;
}
if( pXclAction )
aActionStack.Push( pXclAction );
aActionStack.push( pXclAction );
}
sal_Bool XclExpChangeTrack::WriteUserNamesStream()
......
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