xref: /trunk/main/sw/source/core/inc/UndoSplitMove.hxx (revision 1d2dbeb0)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 
24 #ifndef SW_UNDO_MOVE_HXX
25 #define SW_UNDO_MOVE_HXX
26 
27 #include <undobj.hxx>
28 
29 
30 class SwUndoSplitNode: public SwUndo
31 {
32     SwHistory* pHistory;
33     SwRedlineData* pRedlData;
34     sal_uLong nNode;
35     xub_StrLen nCntnt;
36     sal_Bool bTblFlag : 1;
37     sal_Bool bChkTblStt : 1;
38 
39 public:
40     SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, sal_Bool bChkTbl );
41 
42     virtual ~SwUndoSplitNode();
43 
44     virtual void UndoImpl( ::sw::UndoRedoContext & );
45     virtual void RedoImpl( ::sw::UndoRedoContext & );
46     virtual void RepeatImpl( ::sw::RepeatContext & );
47 
SetTblFlag()48     void SetTblFlag()       { bTblFlag = sal_True; }
49 };
50 
51 
52 class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveCntnt
53 {
54     // nDest.. - destination range of move (after move!)
55     // nIns..  - source Position of move (after move!)
56     // nMv..   - destination position of move (before move!); for REDO
57     sal_uLong nDestSttNode, nDestEndNode, nInsPosNode, nMvDestNode;
58     xub_StrLen nDestSttCntnt, nDestEndCntnt, nInsPosCntnt, nMvDestCntnt;
59 
60     sal_uInt16 nFtnStt; // StartPos of Footnotes in History
61 
62     sal_Bool bJoinNext : 1,
63          bJoinPrev : 1,
64          bMoveRange : 1;
65 
66     bool bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
67 
68     void DelFtn( const SwPaM& );
69 
70 public:
71     SwUndoMove( const SwPaM&, const SwPosition& );
72     SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& );
73 
74     virtual void UndoImpl( ::sw::UndoRedoContext & );
75     virtual void RedoImpl( ::sw::UndoRedoContext & );
76 
77     /// set the destination range after the move
78     void SetDestRange( const SwPaM&, const SwPosition&, sal_Bool, sal_Bool );
79     void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
80                         const SwNodeIndex& rInsPos );
81 
IsMoveRange() const82     sal_Bool IsMoveRange() const        { return bMoveRange; }
GetEndNode() const83     sal_uLong GetEndNode() const        { return nEndNode; }
GetDestSttNode() const84     sal_uLong GetDestSttNode() const    { return nDestSttNode; }
GetDestSttCntnt() const85     xub_StrLen GetDestSttCntnt() const  { return nDestSttCntnt; }
86 
SetMoveRedlines(bool b)87     void SetMoveRedlines( bool b )       { bMoveRedlines = b; }
88 
89 };
90 
91 #endif // SW_UNDO_MOVE_HXX
92 
93