diff options
author | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:17 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-12-15 09:14:17 +0100 |
commit | b00d6a52eb72d0af5ace5845c01cda8f1bd9ed76 (patch) | |
tree | ddc2ee4fe07bec051e046bb899266c28b5b83a82 /sw | |
parent | 131e7a3e6bdcec0ce96cf233919ecee74eb93d00 (diff) |
undoapi: UndoCore.hxx: split out UndoSort.hxx
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docsort.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/inc/UndoCore.hxx | 62 | ||||
-rw-r--r-- | sw/source/core/inc/UndoSort.hxx | 97 | ||||
-rw-r--r-- | sw/source/core/undo/unsort.cxx | 2 |
4 files changed, 100 insertions, 63 deletions
diff --git a/sw/source/core/doc/docsort.cxx b/sw/source/core/doc/docsort.cxx index 03ef4c1042ad..33b3b8966f7f 100644 --- a/sw/source/core/doc/docsort.cxx +++ b/sw/source/core/doc/docsort.cxx @@ -48,7 +48,7 @@ #include <swundo.hxx> #include <sortopt.hxx> #include <docsort.hxx> -#include <UndoCore.hxx> +#include <UndoSort.hxx> #include <UndoRedline.hxx> #include <hints.hxx> #include <tblsel.hxx> diff --git a/sw/source/core/inc/UndoCore.hxx b/sw/source/core/inc/UndoCore.hxx index 0e835197242b..b333d6de86f2 100644 --- a/sw/source/core/inc/UndoCore.hxx +++ b/sw/source/core/inc/UndoCore.hxx @@ -44,8 +44,6 @@ class SfxItemSet; class SwFmtColl; class SwTxtNode; -class SwTableNode; -struct SwSortOptions; class SwSectionData; class SwSectionFmt; class SwTOXBase; @@ -55,7 +53,6 @@ class SwFmtAnchor; class SdrMarkList; class SwUndoDelete; class SwRedlineSaveData; -class SwUndoAttrTbl; class SwUndoFmtAttr; namespace sfx2 { @@ -355,7 +352,6 @@ public: }; - class SwUndoFmtColl : public SwUndo, private SwUndRng { String aFmtName; @@ -406,64 +402,6 @@ public: }; -/*-------------------------------------------------------------------- - Beschreibung: Undo auf Sorting - --------------------------------------------------------------------*/ - -struct SwSortUndoElement -{ - union { - struct { - ULONG nKenn; - ULONG nSource, nTarget; - } TXT; - struct { - String *pSource, *pTarget; - } TBL; - } SORT_TXT_TBL; - - SwSortUndoElement( const String& aS, const String& aT ) - { - SORT_TXT_TBL.TBL.pSource = new String( aS ); - SORT_TXT_TBL.TBL.pTarget = new String( aT ); - } - SwSortUndoElement( ULONG nS, ULONG nT ) - { - SORT_TXT_TBL.TXT.nSource = nS; - SORT_TXT_TBL.TXT.nTarget = nT; - SORT_TXT_TBL.TXT.nKenn = 0xffffffff; - } - ~SwSortUndoElement(); -}; - -SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10,30) -SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10,30) - -class SwUndoSort : public SwUndo, private SwUndRng -{ - SwSortOptions* pSortOpt; // die Optionen mit den Sortier-Kriterien - SwSortList aSortList; - SwUndoAttrTbl* pUndoTblAttr; - SwRedlineData* pRedlData; - ULONG nTblNd; - -public: - SwUndoSort( const SwPaM&, const SwSortOptions& ); - SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode&, - const SwSortOptions&, BOOL bSaveTable ); - - virtual ~SwUndoSort(); - - virtual void UndoImpl( ::sw::UndoRedoContext & ); - virtual void RedoImpl( ::sw::UndoRedoContext & ); - virtual void RepeatImpl( ::sw::RepeatContext & ); - - void Insert( const String& rOrgPos, const String& rNewPos ); - void Insert( ULONG nOrgPos, ULONG nNewPos ); - -}; - - class SwUndoSetFlyFmt : public SwUndo, public SwClient { SwFrmFmt* pFrmFmt; // das gespeicherte FlyFormat diff --git a/sw/source/core/inc/UndoSort.hxx b/sw/source/core/inc/UndoSort.hxx new file mode 100644 index 000000000000..b89ae502f7db --- /dev/null +++ b/sw/source/core/inc/UndoSort.hxx @@ -0,0 +1,97 @@ +/************************************************************************* + * + * 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_SORT_HXX +#define SW_UNDO_SORT_HXX + +#include <undobj.hxx> + + +struct SwSortOptions; +class SwTableNode; +class SwUndoAttrTbl; + + +/*-------------------------------------------------------------------- + Undo for Sorting + --------------------------------------------------------------------*/ + +struct SwSortUndoElement +{ + union { + struct { + ULONG nKenn; + ULONG nSource, nTarget; + } TXT; + struct { + String *pSource, *pTarget; + } TBL; + } SORT_TXT_TBL; + + SwSortUndoElement( const String& aS, const String& aT ) + { + SORT_TXT_TBL.TBL.pSource = new String( aS ); + SORT_TXT_TBL.TBL.pTarget = new String( aT ); + } + SwSortUndoElement( ULONG nS, ULONG nT ) + { + SORT_TXT_TBL.TXT.nSource = nS; + SORT_TXT_TBL.TXT.nTarget = nT; + SORT_TXT_TBL.TXT.nKenn = 0xffffffff; + } + ~SwSortUndoElement(); +}; + +SV_DECL_PTRARR_DEL(SwSortList, SwSortUndoElement*, 10,30) +SV_DECL_PTRARR(SwUndoSortList, SwNodeIndex*, 10,30) + +class SwUndoSort : public SwUndo, private SwUndRng +{ + SwSortOptions* pSortOpt; + SwSortList aSortList; + SwUndoAttrTbl* pUndoTblAttr; + SwRedlineData* pRedlData; + ULONG nTblNd; + +public: + SwUndoSort( const SwPaM&, const SwSortOptions& ); + SwUndoSort( ULONG nStt, ULONG nEnd, const SwTableNode&, + const SwSortOptions&, BOOL bSaveTable ); + + virtual ~SwUndoSort(); + + virtual void UndoImpl( ::sw::UndoRedoContext & ); + virtual void RedoImpl( ::sw::UndoRedoContext & ); + virtual void RepeatImpl( ::sw::RepeatContext & ); + + void Insert( const String& rOrgPos, const String& rNewPos ); + void Insert( ULONG nOrgPos, ULONG nNewPos ); + +}; + +#endif // SW_UNDO_SORT_HXX + diff --git a/sw/source/core/undo/unsort.cxx b/sw/source/core/undo/unsort.cxx index 47ab85af1f2c..d786a7c06e9e 100644 --- a/sw/source/core/undo/unsort.cxx +++ b/sw/source/core/undo/unsort.cxx @@ -28,6 +28,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_sw.hxx" +#include <UndoSort.hxx> + #include <doc.hxx> #include <swundo.hxx> // fuer die UndoIds #include <pam.hxx> |