Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / sw / source / core / inc / UndoSplitMove.hxx
blobcd8b653df9fabf9ed58f10fbde62d7171c01ecbd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #ifndef INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
23 #include <undobj.hxx>
25 class SwUndoSplitNode final : public SwUndo
27 std::unique_ptr<SwHistory> m_pHistory;
28 std::unique_ptr<SwRedlineData> m_pRedlineData;
29 SwNodeOffset m_nNode;
30 sal_Int32 m_nContent;
31 bool m_bTableFlag : 1;
32 bool m_bCheckTableStart : 1;
33 sal_uInt32 m_nParRsid;
35 public:
36 SwUndoSplitNode( SwDoc& rDoc, const SwPosition& rPos, bool bChkTable );
38 virtual ~SwUndoSplitNode() override;
40 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
41 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
42 virtual void RepeatImpl( ::sw::RepeatContext & ) override;
44 void SetTableFlag() { m_bTableFlag = true; }
47 class SwUndoMove final : public SwUndo, private SwUndRng, private SwUndoSaveContent
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
52 SwNodeOffset m_nDestStartNode, m_nDestEndNode, m_nInsPosNode, m_nMoveDestNode;
53 sal_Int32 m_nDestStartContent, m_nDestEndContent, m_nInsPosContent, m_nMoveDestContent;
55 sal_uInt16 m_nFootnoteStart; // StartPos of Footnotes in History
57 bool m_bJoinNext : 1,
58 m_bMoveRange : 1;
60 bool m_bMoveRedlines; // use DOC_MOVEREDLINES when calling SwDoc::Move
62 void DelFootnote( const SwPaM& );
64 public:
65 SwUndoMove( const SwPaM&, const SwPosition& );
66 SwUndoMove( SwDoc& rDoc, const SwNodeRange&, const SwNode& );
68 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
69 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
71 /// set the destination range after the move
72 void SetDestRange( const SwNode& rStt, const SwNode& rEnd,
73 const SwNodeIndex& rInsPos );
75 bool IsMoveRange() const { return m_bMoveRange; }
76 SwNodeOffset GetEndNode() const { return m_nEndNode; }
77 SwNodeOffset GetDestSttNode() const { return m_nDestStartNode; }
78 sal_Int32 GetDestSttContent() const { return m_nDestStartContent; }
80 void SetMoveRedlines( bool b ) { m_bMoveRedlines = b; }
83 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDOSPLITMOVE_HXX
85 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */