diff options
author | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:16 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:16 +0100 |
commit | 4bda913932d28f94cc6c8214a69cb23e5d1e3afa (patch) | |
tree | a746266e697f5e26463d4c02244b2eb7713fac14 /sw/source/core/inc/UndoCore.hxx | |
parent | 45a0fe36f18e88732e3fe6e8a73f58dc02de3909 (diff) |
undoapi: UndoCore.hxx: split out UndoAttribute.hxx
Diffstat (limited to 'sw/source/core/inc/UndoCore.hxx')
-rw-r--r-- | sw/source/core/inc/UndoCore.hxx | 247 |
1 files changed, 2 insertions, 245 deletions
diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index 02d7c4b30a88..0ac921f6c597 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -36,22 +36,12 @@ #include <tools/mempool.hxx> -#ifndef _SVSTDARR_HXX -#define _SVSTDARR_USHORTS -#define _SVSTDARR_ULONGS -#define _SVSTDARR_BOOLS -#define _SVSTDARR_BYTES -#define _SVSTDARR_USHORTSSORT -#include <svl/svstdarr.hxx> -#endif -#include <svl/itemset.hxx> - #include <swtypes.hxx> #include <IDocumentContentOperations.hxx> #include <calbck.hxx> -class SwFmt; +class SfxItemSet; class SwFmtColl; class SwTxtNode; class SwTableNode; @@ -60,16 +50,14 @@ class SwHistoryBookmark; class SwSectionData; class SwSectionFmt; class SwTOXBase; -class SvxTabStopItem; class Graphic; class SwGrfNode; -class SwFtnInfo; -class SwEndNoteInfo; class SwFmtAnchor; class SdrMarkList; class SwUndoDelete; class SwRedlineSaveData; class SwUndoAttrTbl; +class SwUndoFmtAttr; namespace sfx2 { class MetadatableUndo; @@ -371,153 +359,6 @@ public: }; -class SwUndoAttr : public SwUndo, private SwUndRng -{ - SfxItemSet m_AttrSet; // attributes for Redo - const ::std::auto_ptr<SwHistory> m_pHistory; // History for Undo - ::std::auto_ptr<SwRedlineData> m_pRedlineData; // Redlining - ::std::auto_ptr<SwRedlineSaveDatas> m_pRedlineSaveData; - ULONG m_nNodeIndex; // Offset: for Redlining - const SetAttrMode m_nInsertFlags; // insert flags - - void RemoveIdx( SwDoc& rDoc ); - -public: - SwUndoAttr( const SwPaM&, const SfxItemSet &, const SetAttrMode nFlags ); - SwUndoAttr( const SwPaM&, const SfxPoolItem&, const SetAttrMode nFlags ); - - virtual ~SwUndoAttr(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); - - void SaveRedlineData( const SwPaM& rPam, BOOL bInsCntnt ); - - SwHistory& GetHistory() { return *m_pHistory; } - -}; - -class SwUndoResetAttr : public SwUndo, private SwUndRng -{ - const ::std::auto_ptr<SwHistory> m_pHistory; - SvUShortsSort m_Ids; - const USHORT m_nFormatId; // Format-Id for Redo - -public: - SwUndoResetAttr( const SwPaM&, USHORT nFmtId ); - SwUndoResetAttr( const SwPosition&, USHORT nFmtId ); - - virtual ~SwUndoResetAttr(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); - - void SetAttrs( const SvUShortsSort& rArr ); - - SwHistory& GetHistory() { return *m_pHistory; } - -}; - -class SwUndoFmtAttr : public SwUndo -{ - friend class SwUndoDefaultAttr; - SwFmt * m_pFmt; - ::std::auto_ptr<SfxItemSet> m_pOldSet; // old attributes - ULONG m_nNodeIndex; - const USHORT m_nFmtWhich; - const bool m_bSaveDrawPt; - - bool IsFmtInDoc( SwDoc* ); //is the attribute format still in the Doc? - void SaveFlyAnchor( bool bSaveDrawPt = false ); - // --> OD 2004-10-26 #i35443# - Add return value, type <bool>. - // Return value indicates, if anchor attribute is restored. - // Notes: - If anchor attribute is restored, all other existing attributes - // are also restored. - // - Anchor attribute isn't restored successfully, if it contains - // an invalid anchor position and all other existing attributes - // aren't restored. - // This situation occurs for undo of styles. - bool RestoreFlyAnchor(::sw::UndoRedoContext & rContext); - // <-- - // --> OD 2008-02-27 #refactorlists# - removed <rAffectedItemSet> - void Init(); - // <-- - -public: - // register at the Format and save old attributes - // --> OD 2008-02-27 #refactorlists# - removed <rNewSet> - SwUndoFmtAttr( const SfxItemSet& rOldSet, - SwFmt& rFmt, - bool bSaveDrawPt = true ); - // <-- - SwUndoFmtAttr( const SfxPoolItem& rItem, - SwFmt& rFmt, - bool bSaveDrawPt = true ); - - virtual ~SwUndoFmtAttr(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); - - virtual SwRewriter GetRewriter() const; - - void PutAttr( const SfxPoolItem& rItem ); - SwFmt* GetFmt( SwDoc& rDoc ); // checks if it is still in the Doc! -}; - -// --> OD 2008-02-12 #newlistlevelattrs# -class SwUndoFmtResetAttr : public SwUndo -{ - public: - SwUndoFmtResetAttr( SwFmt& rChangedFormat, - const USHORT nWhichId ); - ~SwUndoFmtResetAttr(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - - private: - // format at which a certain attribute is reset. - SwFmt * const m_pChangedFormat; - // which ID of the reset attribute - const USHORT m_nWhichId; - // old attribute which has been reset - needed for undo. - ::std::auto_ptr<SfxPoolItem> m_pOldItem; -}; -// <-- - -class SwUndoDontExpandFmt : public SwUndo -{ - const ULONG m_nNodeIndex; - const xub_StrLen m_nContentIndex; - -public: - SwUndoDontExpandFmt( const SwPosition& rPos ); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); -}; - -// helper class to receive changed attribute sets -class SwUndoFmtAttrHelper : public SwClient -{ - ::std::auto_ptr<SwUndoFmtAttr> m_pUndo; - const bool m_bSaveDrawPt; - -public: - SwUndoFmtAttrHelper( SwFmt& rFmt, bool bSaveDrawPt = true ); - - virtual void Modify( SfxPoolItem*, SfxPoolItem* ); - - SwUndoFmtAttr* GetUndo() const { return m_pUndo.get(); } - // release the undo object (so it is not deleted here), and return it - SwUndoFmtAttr* ReleaseUndo() { return m_pUndo.release(); } -}; - class SwUndoFmtColl : public SwUndo, private SwUndRng { @@ -569,26 +410,6 @@ public: }; -class SwUndoMoveLeftMargin : public SwUndo, private SwUndRng -{ - const ::std::auto_ptr<SwHistory> m_pHistory; - const bool m_bModulus; - -public: - SwUndoMoveLeftMargin( const SwPaM&, BOOL bRight, BOOL bModulus ); - - virtual ~SwUndoMoveLeftMargin(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); - - SwHistory& GetHistory() { return *m_pHistory; } - -}; - - - class SwUndoBookmark : public SwUndo { const ::std::auto_ptr<SwHistoryBookmark> m_pHistoryBookmark; @@ -812,23 +633,6 @@ public: //-------------------------------------------------------------------- -class SwUndoDefaultAttr : public SwUndo -{ - ::std::auto_ptr<SfxItemSet> m_pOldSet; // the old attributes - ::std::auto_ptr<SvxTabStopItem> m_pTabStop; - -public: - // registers at the format and saves old attributes - SwUndoDefaultAttr( const SfxItemSet& rOldSet ); - - virtual ~SwUndoDefaultAttr(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); -}; - -//-------------------------------------------------------------------- - class SwUndoReRead : public SwUndo { Graphic *pGrf; @@ -917,53 +721,6 @@ public: void SetDrawObj( BYTE nLayerId ); }; -//-------------------------------------------------------------------- - -class SwUndoChangeFootNote : public SwUndo, private SwUndRng -{ - const ::std::auto_ptr<SwHistory> m_pHistory; - const String m_Text; - const USHORT m_nNumber; - const bool m_bEndNote; - -public: - SwUndoChangeFootNote( const SwPaM& rRange, const String& rTxt, - USHORT nNum, bool bIsEndNote ); - virtual ~SwUndoChangeFootNote(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); - - SwHistory& GetHistory() { return *m_pHistory; } -}; - -class SwUndoFootNoteInfo : public SwUndo -{ - ::std::auto_ptr<SwFtnInfo> m_pFootNoteInfo; - -public: - SwUndoFootNoteInfo( const SwFtnInfo &rInfo ); - - virtual ~SwUndoFootNoteInfo(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); -}; - -class SwUndoEndNoteInfo : public SwUndo -{ - ::std::auto_ptr<SwEndNoteInfo> m_pEndNoteInfo; - -public: - SwUndoEndNoteInfo( const SwEndNoteInfo &rInfo ); - - virtual ~SwUndoEndNoteInfo(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); -}; - //-------------------------------------------------------------------- |