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.hxx141
1 files changed, 36 insertions, 105 deletions
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 22967d040b62..cf92a707e40f 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
@@ -401,7 +392,6 @@ public:
*/
virtual SwRewriter GetRewriter() const;
- OUT_UNDOBJ( Insert )
DECL_FIXEDMEMPOOL_NEWDEL(SwUndoInsert)
};
@@ -471,8 +461,6 @@ public:
xub_StrLen ContentStart() const { return nSttCntnt; }
BOOL IsDelFullPara() const { return bDelFullPara; }
- OUT_UNDOBJ( Delete )
-
DECL_FIXEDMEMPOOL_NEWDEL(SwUndoDelete)
};
@@ -508,7 +496,6 @@ public:
virtual SwRewriter GetRewriter() const;
BOOL CanGrouping( SwDoc*, SwPosition&, sal_Unicode cIns );
- OUT_UNDOBJ( Overwrite )
};
@@ -527,7 +514,6 @@ public:
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
void SetTblFlag() { bTblFlag = TRUE; }
- OUT_UNDOBJ( SplitNode )
};
@@ -565,7 +551,6 @@ public:
void SetMoveRedlines( bool b ) { bMoveRedlines = b; }
- OUT_UNDOBJ( Move )
};
@@ -591,7 +576,6 @@ public:
SwHistory& GetHistory() { return *m_pHistory; }
- OUT_UNDOBJ( InsAttr )
};
class SwUndoResetAttr : public SwUndo, private SwUndRng
@@ -611,7 +595,6 @@ public:
SwHistory& GetHistory() { return *m_pHistory; }
- OUT_UNDOBJ( ResetAttr )
};
class SwUndoFmtAttr : public SwUndo
@@ -657,8 +640,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!
};
@@ -755,7 +736,7 @@ public:
virtual SwRewriter GetRewriter() const;
SwHistory* GetHistory() { return pHistory; }
- OUT_UNDOBJ( SetFmtColl )
+
};
@@ -773,7 +754,6 @@ public:
SwHistory& GetHistory() { return *m_pHistory; }
- OUT_UNDOBJ( MoveLeftMargin )
};
// Basis-Klasse fuer Insert von Dokument, Glossaries und Kopieren
@@ -799,21 +779,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
@@ -840,7 +817,6 @@ public:
virtual SwRewriter GetRewriter() const;
- OUT_UNDOBJ( InsTable )
};
class SwUndoTxtToTbl : public SwUndo, public SwUndRng
@@ -865,7 +841,6 @@ public:
SwHistory& GetHistory(); // wird ggfs. angelegt
void AddFillBox( const SwTableBox& rBox );
- OUT_UNDOBJ( TextToTable )
};
class SwUndoTblToTxt : public SwUndo
@@ -891,7 +866,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
@@ -904,7 +878,6 @@ public:
virtual ~SwUndoAttrTbl();
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( SetTableAttr )
};
class SwUndoTblAutoFmt : public SwUndo
@@ -922,7 +895,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
void SaveBoxCntnt( const SwTableBox& rBox );
- OUT_UNDOBJ( TableAutoFmt )
};
class SwUndoTblNdsChg : public SwUndo
@@ -972,7 +944,6 @@ public:
nRelDiff = (USHORT)nRelDif;
}
- OUT_UNDOBJ( TblNodesChg )
};
class SwUndoTblMerge : public SwUndo, private SwUndRng
@@ -998,7 +969,6 @@ public:
void SaveCollection( const SwTableBox& rBox );
- OUT_UNDOBJ( TblMerge )
};
@@ -1026,7 +996,6 @@ public:
void SetNumFmt( ULONG nNewNumFmtIdx, const double& rNewNumber )
{ nFmtIdx = nNewNumFmtIdx; fNum = rNewNumber; }
void SetBox( const SwTableBox& rBox );
- OUT_UNDOBJ( TblNumFmt )
};
class _UndoTblCpyTbl_Entries;
@@ -1051,7 +1020,6 @@ public:
BOOL IsEmpty() const;
BOOL InsertRow( SwTable& rTbl, const SwSelBoxes& rBoxes, USHORT nCnt );
- OUT_UNDOBJ( TblCpyTbl )
};
class SwUndoCpyTbl : public SwUndo
@@ -1065,7 +1033,6 @@ public:
virtual void Redo( SwUndoIter& );
void SetTableSttIdx( ULONG nIdx ) { nTblNode = nIdx; }
- OUT_UNDOBJ( CpyTbl )
};
class SwUndoSplitTbl : public SwUndo
@@ -1144,7 +1111,6 @@ public:
SwUndoInsBookmark( const ::sw::mark::IMark& );
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( InsBookmark )
};
@@ -1203,7 +1169,6 @@ public:
void Insert( const String& rOrgPos, const String& rNewPos );
void Insert( ULONG nOrgPos, ULONG nNewPos );
- OUT_UNDOBJ( Sort )
};
@@ -1233,7 +1198,6 @@ public:
virtual void Undo( SwUndoIter& ) = 0;
virtual void Redo( SwUndoIter& ) = 0;
- OUT_UNDOBJ( FlyBase )
};
class SwUndoInsLayFmt : public SwUndoFlyBase
@@ -1250,7 +1214,6 @@ public:
String GetComment() const;
- OUT_UNDOBJ( InsLayFmt )
};
class SwUndoDelLayFmt : public SwUndoFlyBase
@@ -1267,7 +1230,6 @@ public:
virtual SwRewriter GetRewriter() const;
- OUT_UNDOBJ( DelLayFmt )
};
@@ -1344,7 +1306,6 @@ public:
BOOL IsFull() const
{ return ((USHRT_MAX / sizeof( void* )) - 50 ) < aArr.Count(); }
- OUT_UNDOBJ( Replace )
};
@@ -1361,7 +1322,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( SwUndoTblHeadline )
};
@@ -1369,57 +1329,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 ----------------
@@ -1431,7 +1370,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( SwUndoOutlineLeftRight )
};
//--------------------------------------------------------------------
@@ -1447,7 +1385,6 @@ public:
virtual ~SwUndoDefaultAttr();
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
- OUT_UNDOBJ( DefaultAttr )
};
//--------------------------------------------------------------------
@@ -1479,7 +1416,6 @@ public:
void SetLRSpaceEndPos();
- OUT_UNDOBJ( InsNum )
};
class SwUndoDelNum : public SwUndo, private SwUndRng
@@ -1498,7 +1434,6 @@ public:
void AddNode( const SwTxtNode& rNd, BOOL bResetLRSpace );
SwHistory* GetHistory() { return pHistory; }
- OUT_UNDOBJ( DelNum )
};
class SwUndoMoveNum : public SwUndo, private SwUndRng
@@ -1511,7 +1446,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
@@ -1522,7 +1456,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( NumUpDown )
};
class SwUndoNumOrNoNum : public SwUndo
@@ -1536,7 +1469,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( NumOrNoNum )
};
class SwUndoNumRuleStart : public SwUndo
@@ -1551,7 +1483,6 @@ public:
virtual void Undo( SwUndoIter& );
virtual void Redo( SwUndoIter& );
virtual void Repeat( SwUndoIter& );
- OUT_UNDOBJ( NumRuleStart )
};
//--------------------------------------------------------------------