summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-11-25 14:31:07 +0100
committerMichael Stahl <mst@openoffice.org>2010-11-25 14:31:07 +0100
commit89071dd67bb173a489a5286da21b7623dad8c6e5 (patch)
tree575fb78405e90e191844b556d3607bb346ec9e35 /sw/inc
parentf1dc19695c083ec5f1356a2c082f2c4feb53aa33 (diff)
unodapi: #i115383#: new sw::UndoManager:
new header UndoManager.hxx, new class sw::UndoManager. UndoManager implements the IDocumentUndoRedo interface. SwDoc has UndoManager member, and forwards IDocumentUndoRedo calls.
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/doc.hxx28
-rw-r--r--sw/inc/undobj.hxx7
2 files changed, 13 insertions, 22 deletions
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 736fbb70a3b5..33233d11d6a5 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -24,8 +24,8 @@
* for a copy of the LGPLv3 License.
*
************************************************************************/
-#ifndef _DOC_HXX
-#define _DOC_HXX
+#ifndef SW_DOC_HXX
+#define SW_DOC_HXX
/** SwDoc interfaces */
@@ -191,7 +191,6 @@ class SwURLStateChanged;
class SwUndo;
class SwUndoIds;
class SwUndoIter;
-class SwUndos;
class SwUnoCrsr;
class SwUnoCrsrTbl;
class ViewShell;
@@ -227,6 +226,7 @@ namespace sw { namespace mark {
}}
namespace sw {
class MetaFieldManager;
+ class UndoManager;
}
namespace com { namespace sun { namespace star {
@@ -311,6 +311,7 @@ class SW_DLLPUBLIC SwDoc :
const ::boost::scoped_ptr< ::sw::mark::MarkManager> pMarkManager;
const ::boost::scoped_ptr< ::sw::MetaFieldManager > m_pMetaFieldManager;
+ const ::boost::scoped_ptr< ::sw::UndoManager > m_pUndoManager;
// -------------------------------------------------------------------
// die Pointer
@@ -336,8 +337,6 @@ class SW_DLLPUBLIC SwDoc :
SwRootFrm *pLayout; // Rootframe des spezifischen Layouts.
SdrModel *pDrawModel; // StarView Drawing
- SwUndos *pUndos; // Undo/Redo History
-
SwDocUpdtFld *pUpdtFlds; // Struktur zum Field-Update
SwFldTypes *pFldTypes; // Feldtypen
SwNewDBMgr *pNewDBMgr; // Pointer auf den neuen DBMgr fuer
@@ -428,11 +427,6 @@ private:
// -------------------------------------------------------------------
// sonstige
- sal_uInt16 nUndoPos; // akt. Undo-InsertPosition (fuers Redo!)
- sal_uInt16 nUndoSavePos; // Position im Undo-Array, ab der das Doc
- // nicht als modifiziert gilt
- sal_uInt16 nUndoCnt; // Anzahl von Undo Aktionen
- sal_uInt16 nUndoSttEnd; // != 0 -> innerhalb einer Klammerung
sal_uInt16 nAutoFmtRedlnCommentNo; // SeqNo fuers UI-seitige zusammenfassen
// von AutoFmt-Redlines. Wird vom SwAutoFmt
@@ -464,15 +458,12 @@ private:
// leider auch temporaer von
// SwSwgReader::InLayout(), wenn fehlerhafte
// Frames geloescht werden muessen
- bool mbUndo : 1; // TRUE: Undo eingeschaltet
- bool mbGroupUndo : 1; // TRUE: Undos werden gruppiert
bool mbPageNums : 1; // TRUE: es gibt virtuelle Seitennummern
bool mbLoaded : 1; // TRUE: ein geladenes Doc
bool mbUpdateExpFld : 1; // TRUE: Expression-Felder updaten
bool mbNewDoc : 1; // TRUE: neues Doc
bool mbNewFldLst : 1; // TRUE: Felder-Liste neu aufbauen
bool mbCopyIsMove : 1; // TRUE: Copy ist ein verstecktes Move
- bool mbNoDrawUndoObj : 1; // TRUE: keine DrawUndoObjecte speichern
bool mbVisibleLinks : 1; // TRUE: Links werden sichtbar eingefuegt
bool mbBrowseMode : 1; // TRUE: Dokument im BrowseModus anzeigen
bool mbInReading : 1; // TRUE: Dokument wird gerade gelesen
@@ -616,13 +607,10 @@ private:
sal_Bool mbStartIdleTimer ; // idle timer mode start/stop
static SwAutoCompleteWord *pACmpltWords; // Liste aller Worte fuers AutoComplete
- static sal_uInt16 nUndoActions; // anzahl von Undo ::com::sun::star::chaos::Action
//---------------- private Methoden ------------------------------
void checkRedlining(RedlineMode_t& _rReadlineMode);
- sal_Bool DelUndoObj( sal_uInt16 nEnde ); // loescht alle UndoObjecte vom Anfang
- // bis zum angegebenen Ende
DECL_LINK( AddDrawUndo, SdrUndoAction * );
// DrawModel
void DrawNotifyUndoHdl(); // wegen CLOOKs
@@ -839,7 +827,6 @@ public:
virtual void setUndoNoModifiedPosition( SwUndoNoModifiedPosition );
virtual SwUndoNoModifiedPosition getUndoNoModifiedPosition() const;
-
/** abfragen/setzen der Anzahl von wiederherstellbaren Undo-Actions */
static sal_uInt16 GetUndoActionCount();
static void SetUndoActionCount(sal_uInt16 nNew);
@@ -1858,9 +1845,8 @@ public:
bool IsCopyIsMove() const { return mbCopyIsMove; }
void SetCopyIsMove( bool bFlag ) { mbCopyIsMove = bFlag; }
- // fuers Draw-Undo: Aktionen auf Flys wollen wir selbst behandeln
- bool IsNoDrawUndoObj() const { return mbNoDrawUndoObj; }
- void SetNoDrawUndoObj( bool bFlag ) { mbNoDrawUndoObj = bFlag; }
+ bool IsNoDrawUndoObj() const;
+ void SetNoDrawUndoObj( bool const bFlag );
SwDrawContact* GroupSelection( SdrView& );
void UnGroupSelection( SdrView& );
sal_Bool DeleteSelection( SwDrawView& );
@@ -2140,6 +2126,8 @@ public:
#endif
::sfx2::IXmlIdRegistry& GetXmlIdRegistry();
::sw::MetaFieldManager & GetMetaFieldManager();
+ ::sw::UndoManager & GetUndoManager();
+ ::sw::UndoManager const& GetUndoManager() const;
SfxObjectShell* CreateCopy(bool bCallInitNew) const;
};
diff --git a/sw/inc/undobj.hxx b/sw/inc/undobj.hxx
index 7f16e4e4d44c..962c0fc07762 100644
--- a/sw/inc/undobj.hxx
+++ b/sw/inc/undobj.hxx
@@ -114,6 +114,9 @@ namespace utl {
class TransliterationWrapper;
}
+namespace sw {
+ class UndoManager;
+}
const String UNDO_ARG1("$1", RTL_TEXTENCODING_ASCII_US);
const String UNDO_ARG2("$2", RTL_TEXTENCODING_ASCII_US);
@@ -1263,7 +1266,7 @@ SV_DECL_PTRARR_DEL( _UnReplaceDatas, _UnReplaceData*, 10, 25 )
class SwUndoReplace : public SwUndo
{
- friend class SwDoc;
+ friend class ::sw::UndoManager;
BOOL bOldIterFlag; // Status vom Undo-Iter vorm 1. Aufruf
USHORT nAktPos; // fuer GetUndoRange und Undo/Redo
@@ -1831,7 +1834,7 @@ public:
class SwUndoIter
{
- friend class SwDoc; // um im SwDoc::Undo bWeiter zu stezen
+ friend class ::sw::UndoManager; // to set bWeiter in SwDoc::Undo
friend void SwUndoEnd::Undo( SwUndoIter& );
friend void SwUndoStart::Undo( SwUndoIter& );
friend void SwUndoEnd::Redo( SwUndoIter& );