LibreOffice Module sw (master)  1
UndoSplitMove.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
22 
23 #include <undobj.hxx>
24 
25 class SwUndoSplitNode: public SwUndo
26 {
27  std::unique_ptr<SwHistory> m_pHistory;
28  std::unique_ptr<SwRedlineData> pRedlData;
30  sal_Int32 const nContent;
31  bool bTableFlag : 1;
32  bool const bChkTableStt : 1;
33  sal_uInt32 nParRsid;
34 
35 public:
36  SwUndoSplitNode( SwDoc* pDoc, const SwPosition& rPos, bool bChkTable );
37 
38  virtual ~SwUndoSplitNode() override;
39 
40  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
41  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
42  virtual void RepeatImpl( ::sw::RepeatContext & ) override;
43 
44  void SetTableFlag() { bTableFlag = true; }
45 };
46 
47 class SwUndoMove : public SwUndo, private SwUndRng, private SwUndoSaveContent
48 {
49  // nDest.. - destination range of move (after move!)
50  // nIns.. - source Position of move (after move!)
51  // nMv.. - destination position of move (before move!); for REDO
54 
55  sal_uInt16 m_nFootnoteStart; // StartPos of Footnotes in History
56 
57  bool m_bJoinNext : 1,
58  m_bJoinPrev : 1,
59  m_bMoveRange : 1;
60 
61  bool m_bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
62 
63  void DelFootnote( const SwPaM& );
64 
65 public:
66  SwUndoMove( const SwPaM&, const SwPosition& );
67  SwUndoMove( SwDoc* pDoc, const SwNodeRange&, const SwNodeIndex& );
68 
69  virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
70  virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
71 
73  void SetDestRange( const SwPaM&, const SwPosition&, bool, bool );
74  void SetDestRange( const SwNodeIndex& rStt, const SwNodeIndex& rEnd,
75  const SwNodeIndex& rInsPos );
76 
77  bool IsMoveRange() const { return m_bMoveRange; }
78  sal_uLong GetEndNode() const { return nEndNode; }
80  sal_Int32 GetDestSttContent() const { return m_nDestStartContent; }
81 
82  void SetMoveRedlines( bool b ) { m_bMoveRedlines = b; }
83 };
84 
85 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
86 
87 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 m_nDestStartContent
SwUndoMove(const SwPaM &, const SwPosition &)
Definition: unmove.cxx:30
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unmove.cxx:186
Marks a position in the document model.
Definition: pam.hxx:35
virtual ~SwUndoSplitNode() override
Definition: unspnd.cxx:67
sal_uIntPtr sal_uLong
Definition: doc.hxx:185
sal_uLong m_nDestEndNode
std::unique_ptr< SwRedlineData > pRedlData
SwUndoSplitNode(SwDoc *pDoc, const SwPosition &rPos, bool bChkTable)
Definition: unspnd.cxx:39
sal_uLong nEndNode
Definition: undobj.hxx:216
std::unique_ptr< SwHistory > m_pHistory
virtual void RepeatImpl(::sw::RepeatContext &) override
Definition: unspnd.cxx:193
sal_Int32 GetDestSttContent() const
bool m_bMoveRedlines
void DelFootnote(const SwPaM &)
Definition: unmove.cxx:331
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unspnd.cxx:152
sal_Int32 const nContent
sal_uInt32 nParRsid
sal_Int32 m_nMoveDestContent
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
sal_Int32 m_nInsPosContent
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: unmove.cxx:279
bool const bChkTableStt
Marks a node in the document model.
Definition: ndindex.hxx:31
sal_uLong m_nDestStartNode
void SetDestRange(const SwPaM &, const SwPosition &, bool, bool)
set the destination range after the move
Definition: unmove.cxx:141
sal_uLong GetEndNode() const
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: unspnd.cxx:73
sal_uLong m_nMoveDestNode
sal_Int32 m_nDestEndContent
void SetMoveRedlines(bool b)
sal_uLong GetDestSttNode() const
bool IsMoveRange() const
sal_uInt16 m_nFootnoteStart
sal_uLong m_nInsPosNode