summaryrefslogtreecommitdiff
path: root/sw/inc/undobj.hxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/inc/undobj.hxx')
-rw-r--r--sw/inc/undobj.hxx142
1 files changed, 36 insertions, 106 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index b5298895317d..1c78914efbe7 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -24,8 +24,18 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _UNDOBJ_HXX
-#define _UNDOBJ_HXX
+#ifndef SW_UNDOBJ_HXX
+#define SW_UNDOBJ_HXX
+
+// --> OD 2006-11-01 #130889#
+#include <vector>
+// <--
+#include <memory>
+
+#include <boost/shared_ptr.hpp>
+
+#include <com/sun/star/uno/Sequence.h>
+
#include <tools/mempool.hxx>
#ifndef _SVSTDARR_HXX
#define _SVSTDARR_USHORTS
@@ -36,23 +46,16 @@
#include <svl/svstdarr.hxx>
#endif
#include <svl/itemset.hxx>
-#include <com/sun/star/uno/Sequence.h>
+
+#include <svx/svdundo.hxx> // #111827#
+
#include <numrule.hxx>
#include <itabenum.hxx>
#include <format.hxx>
#include <SwRewriter.hxx>
-#include <svx/svdundo.hxx> // #111827#
-
#include <swundo.hxx>
-
#include <IMark.hxx>
#include <IDocumentContentOperations.hxx>
-// --> OD 2006-11-01 #130889#
-#include <vector>
-// <--
-
-#include <boost/shared_ptr.hpp>
-#include <memory>
class SwUndoIter;
@@ -71,8 +74,9 @@ class SwTableBox;
struct SwSortOptions;
class SwFrmFmt;
class SwHistoryBookmark;
-class SwSection;
+class SwSectionData;
class SwSectionFmt;
+class SwTOXBase;
class SvxTabStopItem;
class SwDDEFieldType;
class Graphic;
@@ -112,15 +116,6 @@ namespace utl {
class TransliterationWrapper;
}
-#ifdef DBG_UTIL
-class Writer;
-class SwUndo;
-#define OUT_UNDOBJ( name ) \
- friend Writer& OutUndo_ ## name( Writer&, const SwUndo& );
-#else
-#define OUT_UNDOBJ( name )
-#endif
-
const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
@@ -244,7 +239,6 @@ protected:
public:
SwUndoSaveCntnt();
~SwUndoSaveCntnt();
- OUT_UNDOBJ( SaveCntnt )
};
@@ -271,7 +265,6 @@ public:
const SwHistory* GetHistory() const { return pHistory; }
SwHistory* GetHistory() { return pHistory; }
- OUT_UNDOBJ( SaveSection )
};
@@ -320,7 +313,6 @@ public:
// Setzen vom End-Undo-Offset geschieht im Doc::EndUndo
USHORT GetEndOffset() const { return nEndOffset; }
void SetEndOffset( USHORT n ) { nEndOffset = n; }
- OUT_UNDOBJ( Start )
};
class SwUndoEnd: public SwUndo
@@ -352,7 +344,6 @@ public:
// Setzen vom Start-Undo-Offset geschieht im Doc::EndUndo
void SetSttOffset(USHORT _nSttOffSet) { nSttOffset = _nSttOffSet; }
USHORT GetSttOffset() const { return nSttOffset; }
- OUT_UNDOBJ( End )
};
class SwUndoInsert: public SwUndo, private SwUndoSaveCntnt
@@ -402,7 +393,6 @@ public:
virtual SwRewriter GetRewriter() const;
BOOL CanGrouping( const SwPosition&, sal_Unicode cIns );
- OUT_UNDOBJ( Insert )
DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert)
};
@@ -472,8 +462,6 @@ public:
xub_StrLen ContentStart() const { return nSttCntnt; }
BOOL IsDelFullPara() const { return bDelFullPara; }
- OUT_UNDOBJ( Delete )
-
DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete)
};
@@ -509,7 +497,6 @@ public:
virtual SwRewriter GetRewriter() const;
BOOL CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns );
- OUT_UNDOBJ( Overwrite )
};
@@ -528,7 +515,6 @@ public:
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
void SetTblFlag() { bTblFlag = TRUE; }
- OUT_UNDOBJ( SplitNode )
};
@@ -567,7 +553,6 @@ public:
void SetMoveRedlines( bool b ) { bMoveRedlines = b; }
- OUT_UNDOBJ( Move )
};
@@ -593,7 +578,6 @@ public:
SwHistory& GetHistory() { return *m_pHistory; }
- OUT_UNDOBJ( InsAttr )
};
class SwUndoResetAttr : public SwUndo, private SwUndRng
@@ -613,7 +597,6 @@ public:
SwHistory& GetHistory() { return *m_pHistory; }
- OUT_UNDOBJ( ResetAttr )
};
class SwUndoFmtAttr : public SwUndo
@@ -659,8 +642,6 @@ public:
virtual void Repeat( SwUndoIter& );
virtual SwRewriter GetRewriter() const;
- OUT_UNDOBJ( InsFmtAttr )
-
void PutAttr( const SfxPoolItem& rItem );
SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc!
};
@@ -757,7 +738,7 @@ public:
virtual SwRewriter GetRewriter() const;
SwHistory* GetHistory() { return pHistory; }
- OUT_UNDOBJ( SetFmtColl )
+
};
@@ -775,7 +756,6 @@ public:
SwHistory& GetHistory() { return *m_pHistory; }
- OUT_UNDOBJ( MoveLeftMargin )
};
// Basis-Klasse fuer Insert von Dokument, Glossaries und Kopieren
@@ -801,21 +781,18 @@ public:
// setze den Destination-Bereich nach dem Einlesen.
void SetInsertRange( const SwPaM&, BOOL bScanFlys = TRUE,
BOOL bSttWasTxtNd = TRUE );
- OUT_UNDOBJ( Inserts )
};
class SwUndoInsDoc : public SwUndoInserts
{
public:
SwUndoInsDoc( const SwPaM& );
- OUT_UNDOBJ( InsDoc )
};
class SwUndoCpyDoc : public SwUndoInserts
{
public:
SwUndoCpyDoc( const SwPaM& );
- OUT_UNDOBJ( Copy )
};
class SwUndoInsTbl : public SwUndo
@@ -842,7 +819,6 @@ public:
virtual SwRewriter GetRewriter() const;
- OUT_UNDOBJ( InsTable )
};
class SwUndoTxtToTbl : public SwUndo, public SwUndRng
@@ -867,7 +843,6 @@ public:
SwHistory& GetHistory(); // wird ggfs. angelegt
void AddFillBox( const SwTableBox& rBox );
- OUT_UNDOBJ( TextToTable )
};
class SwUndoTblToTxt : public SwUndo
@@ -893,7 +868,6 @@ public:
void SetRange( const SwNodeRange& );
void AddBoxPos( SwDoc& rDoc, ULONG nNdIdx, ULONG nEndIdx,
xub_StrLen nCntntIdx = STRING_MAXLEN);
- OUT_UNDOBJ( TableToText )
};
class SwUndoAttrTbl : public SwUndo
@@ -906,7 +880,6 @@ public:
virtual ~SwUndoAttrTbl();
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( SetTableAttr )
};
class SwUndoTblAutoFmt : public SwUndo
@@ -924,7 +897,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
void SaveBoxCntnt( const SwTableBox& rBox );
- OUT_UNDOBJ( TableAutoFmt )
};
class SwUndoTblNdsChg : public SwUndo
@@ -974,7 +946,6 @@ public:
nRelDiff = (USHORT)nRelDif;
}
- OUT_UNDOBJ( TblNodesChg )
};
class SwUndoTblMerge : public SwUndo, private SwUndRng
@@ -1000,7 +971,6 @@ public:
void SaveCollection( const SwTableBox& rBox );
- OUT_UNDOBJ( TblMerge )
};
@@ -1028,7 +998,6 @@ public:
void SetNumFmt( ULONG nNewNumFmtIdx, const double& rNewNumber )
{ nFmtIdx = nNewNumFmtIdx; fNum = rNewNumber; }
void SetBox( const SwTableBox& rBox );
- OUT_UNDOBJ( TblNumFmt )
};
class _UndoTblCpyTbl_Entries;
@@ -1053,7 +1022,6 @@ public:
BOOL IsEmpty() const;
BOOL InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, USHORT nCnt );
- OUT_UNDOBJ( TblCpyTbl )
};
class SwUndoCpyTbl : public SwUndo
@@ -1067,7 +1035,6 @@ public:
virtual void Redo( SwUndoIter& );
void SetTableSttIdx( ULONG nIdx ) { nTblNode = nIdx; }
- OUT_UNDOBJ( CpyTbl )
};
class SwUndoSplitTbl : public SwUndo
@@ -1146,7 +1113,6 @@ public:
SwUndoDelBookmark( const ::sw::mark::IMark& );
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( DelBookmark )
};
class SwUndoInsBookmark : public SwUndoBookmark
@@ -1155,7 +1121,6 @@ public:
SwUndoInsBookmark( const ::sw::mark::IMark& );
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( InsBookmark )
};
@@ -1214,7 +1179,6 @@ public:
void Insert( const String& rOrgPos, const String& rNewPos );
void Insert( ULONG nOrgPos, ULONG nNewPos );
- OUT_UNDOBJ( Sort )
};
@@ -1244,7 +1208,6 @@ public:
virtual void Undo( SwUndoIter& ) = 0;
virtual void Redo( SwUndoIter& ) = 0;
- OUT_UNDOBJ( FlyBase )
};
class SwUndoInsLayFmt : public SwUndoFlyBase
@@ -1261,7 +1224,6 @@ public:
String GetComment() const;
- OUT_UNDOBJ( InsLayFmt )
};
class SwUndoDelLayFmt : public SwUndoFlyBase
@@ -1278,7 +1240,6 @@ public:
virtual SwRewriter GetRewriter() const;
- OUT_UNDOBJ( DelLayFmt )
};
@@ -1355,7 +1316,6 @@ public:
BOOL IsFull() const
{ return ((USHRT_MAX / sizeof( void* )) - 50 ) < aArr.Count(); }
- OUT_UNDOBJ( Replace )
};
@@ -1372,7 +1332,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( SwUndoTblHeadline )
};
@@ -1380,57 +1339,36 @@ public:
class SwUndoInsSection : public SwUndo, private SwUndRng
{
- SwHistory* pHistory;
- SwSection* pSection;
- SwRedlineData* pRedlData;
- SfxItemSet* pAttr;
- ULONG nSectNodePos;
- BOOL bSplitAtStt : 1;
- BOOL bSplitAtEnd : 1;
- BOOL bUpdateFtn : 1;
+private:
+ const ::std::auto_ptr<SwSectionData> m_pSectionData;
+ const ::std::auto_ptr<SwTOXBase> m_pTOXBase; /// set iff section is TOX
+ const ::std::auto_ptr<SfxItemSet> m_pAttrSet;
+ ::std::auto_ptr<SwHistory> m_pHistory;
+ ::std::auto_ptr<SwRedlineData> m_pRedlData;
+ ULONG m_nSectionNodePos;
+ bool m_bSplitAtStart : 1;
+ bool m_bSplitAtEnd : 1;
+ bool m_bUpdateFtn : 1;
void Join( SwDoc& rDoc, ULONG nNode );
public:
- SwUndoInsSection( const SwPaM&, const SwSection&,
- const SfxItemSet* pSet );
+ SwUndoInsSection(SwPaM const&, SwSectionData const&,
+ SfxItemSet const*const pSet, SwTOXBase const*const pTOXBase);
virtual ~SwUndoInsSection();
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( SwUndoInsSection )
- void SetSectNdPos( ULONG nPos ) { nSectNodePos = nPos; }
- void SaveSplitNode( SwTxtNode* pTxtNd, BOOL bAtStt );
- void SetUpdtFtnFlag( BOOL bFlag ) { bUpdateFtn = bFlag; }
+ void SetSectNdPos(ULONG const nPos) { m_nSectionNodePos = nPos; }
+ void SaveSplitNode(SwTxtNode *const pTxtNd, bool const bAtStart);
+ void SetUpdtFtnFlag(bool const bFlag) { m_bUpdateFtn = bFlag; }
};
-class SwUndoDelSection : public SwUndo
-{
- ULONG nSttNd, nEndNd;
- SwSection* pSection;
- SfxItemSet* pAttr;
-public:
- SwUndoDelSection( const SwSectionFmt& );
- virtual ~SwUndoDelSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( SwUndoDelSection )
-};
+SW_DLLPRIVATE SwUndo * MakeUndoDelSection(SwSectionFmt const&);
+
+SW_DLLPRIVATE SwUndo * MakeUndoUpdateSection(SwSectionFmt const&, bool const);
-class SwUndoChgSection : public SwUndo
-{
- ULONG nSttNd;
- SwSection* pSection;
- SfxItemSet* pAttr;
- BOOL bOnlyAttrChgd;
-public:
- SwUndoChgSection( const SwSectionFmt&, BOOL bOnlyAttrChgd );
- virtual ~SwUndoChgSection();
- virtual void Undo( SwUndoIter& );
- virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( SwUndoChgSection )
-};
//------------ Undo von verschieben/stufen von Gliederung ----------------
@@ -1442,7 +1380,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( SwUndoOutlineLeftRight )
};
//--------------------------------------------------------------------
@@ -1458,7 +1395,6 @@ public:
virtual ~SwUndoDefaultAttr();
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( DefaultAttr )
};
//--------------------------------------------------------------------
@@ -1490,7 +1426,6 @@ public:
void SetLRSpaceEndPos();
- OUT_UNDOBJ( InsNum )
};
class SwUndoDelNum : public SwUndo, private SwUndRng
@@ -1509,7 +1444,6 @@ public:
void AddNode( const SwTxtNode& rNd, BOOL bResetLRSpace );
SwHistory* GetHistory() { return pHistory; }
- OUT_UNDOBJ( DelNum )
};
class SwUndoMoveNum : public SwUndo, private SwUndRng
@@ -1522,7 +1456,6 @@ public:
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
void SetStartNode( ULONG nValue ) { nNewStt = nValue; }
- OUT_UNDOBJ( MoveNum )
};
class SwUndoNumUpDown : public SwUndo, private SwUndRng
@@ -1533,7 +1466,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( NumUpDown )
};
class SwUndoNumOrNoNum : public SwUndo
@@ -1547,7 +1479,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( NumOrNoNum )
};
class SwUndoNumRuleStart : public SwUndo
@@ -1562,7 +1493,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( NumRuleStart )
};
//--------------------------------------------------------------------