diff options
author | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:15 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:15 +0100 |
commit | ea92df6f21f5e2314d23c37a1a70b9fce4765c2a (patch) | |
tree | 5e89e862655a47466400620b36bdf789076bb8a2 /sw | |
parent | b16214b41156933767d6066f6097246346491e35 (diff) |
undoapi: UndoCore.hxx: split out UndoDraw.hxx
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docdraw.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/UndoCore.hxx | 111 | ||||
-rw-r--r-- | sw/source/core/inc/UndoDraw.hxx | 150 | ||||
-rw-r--r-- | sw/source/core/undo/undobj1.cxx | 1 | ||||
-rw-r--r-- | sw/source/core/undo/undraw.cxx | 5 |
5 files changed, 156 insertions, 113 deletions
diff --git a/sw/source/core/doc/docdraw.cxx b/sw/source/core/doc/docdraw.cxx index 6021766e8cbf..000f12892cf9 100644 --- a/sw/source/core/doc/docdraw.cxx +++ b/sw/source/core/doc/docdraw.cxx @@ -56,7 +56,7 @@ #include <poolfmt.hxx> #include <viewsh.hxx> // fuer MakeDrawView #include <drawdoc.hxx> -#include <UndoCore.hxx> +#include <UndoDraw.hxx> #include <swundo.hxx> // fuer die UndoIds #include <dcontact.hxx> #include <dview.hxx> diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index ebf9ffb8b740..fd67b3a915e4 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -46,8 +46,6 @@ #endif #include <svl/itemset.hxx> -#include <svx/svdundo.hxx> // #111827# - #include <swtypes.hxx> #include <IDocumentContentOperations.hxx> #include <calbck.hxx> @@ -69,13 +67,7 @@ class SwGrfNode; class SwFtnInfo; class SwEndNoteInfo; class SwFmtAnchor; -struct SwUndoGroupObjImpl; -class SdrMark; class SdrMarkList; -class SdrObject; -class SdrObjGroup; -class SdrUndoAction; -class SwDrawFrmFmt; class SwUndoDelete; class SwRedlineSaveData; class SwRedline; @@ -946,109 +938,6 @@ public: }; //-------------------------------------------------------------------- -// ---------- Undo fuer DrawObjecte ---------------------------------- - -class SwSdrUndo : public SwUndo -{ - SdrUndoAction* pSdrUndo; - SdrMarkList* pMarkList; // MarkList for all selected SdrObjects -public: - SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList ); - - virtual ~SwSdrUndo(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - - String GetComment() const; -}; - -class SwUndoDrawGroup : public SwUndo -{ - SwUndoGroupObjImpl* pObjArr; - USHORT nSize; - BOOL bDelFmt; - -public: - SwUndoDrawGroup( USHORT nCnt ); - - virtual ~SwUndoDrawGroup(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - - void AddObj( USHORT nPos, SwDrawFrmFmt*, SdrObject* ); - void SetGroupFmt( SwDrawFrmFmt* ); -}; - -// --> OD 2006-11-01 #130889# -// Action "ungroup drawing object" is now splitted into three parts - see -// method <SwDoc::UnGroupSelection(..)>: -// - creation for <SwDrawFrmFmt> instances for the group members of the -// selected group objects -// - intrinsic ungroup of the selected group objects -// - creation of <SwDrawContact> instances for the former group members and -// connection to the Writer layout. -// Thus, two undo actions (instances of <SwUndo>) are needed: -// - Existing class <SwUndoDrawUnGroup> takes over the part for the formats. -// - New class <SwUndoDrawUnGroupConnectToLayout> takes over the part for -// contact object. -class SwUndoDrawUnGroup : public SwUndo -{ - SwUndoGroupObjImpl* pObjArr; - USHORT nSize; - BOOL bDelFmt; - -public: - SwUndoDrawUnGroup( SdrObjGroup* ); - - virtual ~SwUndoDrawUnGroup(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - - void AddObj( USHORT nPos, SwDrawFrmFmt* ); -}; - -// --> OD 2006-11-01 #130889# -class SwUndoDrawUnGroupConnectToLayout : public SwUndo -{ - private: - std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > > aDrawFmtsAndObjs; - - public: - SwUndoDrawUnGroupConnectToLayout(); - - virtual ~SwUndoDrawUnGroupConnectToLayout(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - - void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt, - SdrObject* pDrawObject ); -}; -// <-- - - -class SwUndoDrawDelete : public SwUndo -{ - SwUndoGroupObjImpl* pObjArr; - SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects - USHORT nSize; - BOOL bDelFmt; - -public: - SwUndoDrawDelete( USHORT nCnt ); - - virtual ~SwUndoDrawDelete(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - - void AddObj( USHORT nPos, SwDrawFrmFmt*, const SdrMark& ); -}; - -//-------------------------------------------------------------------- class SwUndoReRead : public SwUndo { diff --git a/sw/source/core/inc/UndoDraw.hxx b/sw/source/core/inc/UndoDraw.hxx new file mode 100644 index 000000000000..1407266279fa --- /dev/null +++ b/sw/source/core/inc/UndoDraw.hxx @@ -0,0 +1,150 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef SW_UNDO_DRAW_HXX +#define SW_UNDO_DRAW_HXX + +#include <undobj.hxx> + +#include <svx/svdundo.hxx> + + +struct SwUndoGroupObjImpl; +class SdrMark; +class SdrMarkList; +class SdrObject; +class SdrObjGroup; +class SdrUndoAction; +class SwDrawFrmFmt; + + + +//-------------------------------------------------------------------- +// ----------- Undo for Draw Objects --------------------------------- + +class SwSdrUndo : public SwUndo +{ + SdrUndoAction* pSdrUndo; + SdrMarkList* pMarkList; // MarkList for all selected SdrObjects +public: + SwSdrUndo( SdrUndoAction* , const SdrMarkList* pMarkList ); + + virtual ~SwSdrUndo(); + + virtual void UndoImpl( ::sw::UndoRedoContext & ); + virtual void RedoImpl( ::sw::UndoRedoContext & ); + + String GetComment() const; +}; + +class SwUndoDrawGroup : public SwUndo +{ + SwUndoGroupObjImpl* pObjArr; + USHORT nSize; + BOOL bDelFmt; + +public: + SwUndoDrawGroup( USHORT nCnt ); + + virtual ~SwUndoDrawGroup(); + + virtual void UndoImpl( ::sw::UndoRedoContext & ); + virtual void RedoImpl( ::sw::UndoRedoContext & ); + + void AddObj( USHORT nPos, SwDrawFrmFmt*, SdrObject* ); + void SetGroupFmt( SwDrawFrmFmt* ); +}; + +// --> OD 2006-11-01 #130889# +// Action "ungroup drawing object" is now splitted into three parts - see +// method <SwDoc::UnGroupSelection(..)>: +// - creation for <SwDrawFrmFmt> instances for the group members of the +// selected group objects +// - intrinsic ungroup of the selected group objects +// - creation of <SwDrawContact> instances for the former group members and +// connection to the Writer layout. +// Thus, two undo actions (instances of <SwUndo>) are needed: +// - Existing class <SwUndoDrawUnGroup> takes over the part for the formats. +// - New class <SwUndoDrawUnGroupConnectToLayout> takes over the part for +// contact object. +class SwUndoDrawUnGroup : public SwUndo +{ + SwUndoGroupObjImpl* pObjArr; + USHORT nSize; + BOOL bDelFmt; + +public: + SwUndoDrawUnGroup( SdrObjGroup* ); + + virtual ~SwUndoDrawUnGroup(); + + virtual void UndoImpl( ::sw::UndoRedoContext & ); + virtual void RedoImpl( ::sw::UndoRedoContext & ); + + void AddObj( USHORT nPos, SwDrawFrmFmt* ); +}; + +// --> OD 2006-11-01 #130889# +class SwUndoDrawUnGroupConnectToLayout : public SwUndo +{ + private: + std::vector< std::pair< SwDrawFrmFmt*, SdrObject* > > aDrawFmtsAndObjs; + + public: + SwUndoDrawUnGroupConnectToLayout(); + + virtual ~SwUndoDrawUnGroupConnectToLayout(); + + virtual void UndoImpl( ::sw::UndoRedoContext & ); + virtual void RedoImpl( ::sw::UndoRedoContext & ); + + void AddFmtAndObj( SwDrawFrmFmt* pDrawFrmFmt, + SdrObject* pDrawObject ); +}; +// <-- + + +class SwUndoDrawDelete : public SwUndo +{ + SwUndoGroupObjImpl* pObjArr; + SdrMarkList* pMarkLst; // MarkList for all selected SdrObjects + USHORT nSize; + BOOL bDelFmt; + +public: + SwUndoDrawDelete( USHORT nCnt ); + + virtual ~SwUndoDrawDelete(); + + virtual void UndoImpl( ::sw::UndoRedoContext & ); + virtual void RedoImpl( ::sw::UndoRedoContext & ); + + void AddObj( USHORT nPos, SwDrawFrmFmt*, const SdrMark& ); +}; + +#endif // SW_UNDO_DRAW_HXX + diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 8309da724475..af0600179814 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -38,6 +38,7 @@ #include <frmfmt.hxx> #include <flyfrm.hxx> #include <UndoCore.hxx> +#include <UndoDraw.hxx> #include <rolbck.hxx> // fuer die Attribut History #include <doc.hxx> #include <docary.hxx> diff --git a/sw/source/core/undo/undraw.cxx b/sw/source/core/undo/undraw.cxx index a9f958e0e1bc..a4faad6e83ab 100644 --- a/sw/source/core/undo/undraw.cxx +++ b/sw/source/core/undo/undraw.cxx @@ -28,14 +28,17 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <UndoDraw.hxx> + #include <rtl/string.h> #include <rtl/memory.h> -#include <hintids.hxx> #include <svx/svdogrp.hxx> #include <svx/svdundo.hxx> #include <svx/svdpage.hxx> #include <svx/svdmark.hxx> + +#include <hintids.hxx> #include <fmtanchr.hxx> #include <fmtflcnt.hxx> #include <txtflcnt.hxx> |