1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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_UNDODELETE_HXX
21 #define INCLUDED_SW_SOURCE_CORE_INC_UNDODELETE_HXX
24 #include <rtl/ustring.hxx>
28 class SwRedlineSaveDatas
;
30 typedef struct _xmlTextWriter
* xmlTextWriterPtr
;
33 class MetadatableUndo
;
39 , private SwUndoSaveContent
41 std::unique_ptr
<SwNodeIndex
> m_pMvStt
; // Position of Nodes in UndoNodes-Array
42 std::optional
<OUString
> m_aSttStr
, m_aEndStr
;
43 std::unique_ptr
<SwRedlineSaveDatas
> m_pRedlSaveData
;
44 std::shared_ptr
< ::sfx2::MetadatableUndo
> m_pMetadataUndoStart
;
45 std::shared_ptr
< ::sfx2::MetadatableUndo
> m_pMetadataUndoEnd
;
47 OUString m_sTableName
;
50 sal_uLong m_nNdDiff
; // difference of Nodes before/after Delete
51 sal_uLong m_nSectDiff
; // diff. of Nodes before/after Move w/ SectionNodes
52 sal_uLong m_nReplaceDummy
; // diff. to a temporary dummy object
55 bool m_bGroup
: 1; // TRUE: is already Grouped; see CanGrouping()
56 bool m_bBackSp
: 1; // TRUE: if Grouped and preceding content deleted
57 bool m_bJoinNext
: 1; // TRUE: if range is selected forwards
58 bool m_bTableDelLastNd
: 1; // TRUE: TextNode following Table inserted/deleted
59 bool m_bDelFullPara
: 1; // TRUE: entire Nodes were deleted
60 bool m_bResetPgDesc
: 1; // TRUE: reset PgDsc on following node
61 bool m_bResetPgBrk
: 1; // TRUE: reset PgBreak on following node
62 bool m_bFromTableCopy
: 1; // TRUE: called by SwUndoTableCpyTable
64 bool SaveContent( const SwPosition
* pStt
, const SwPosition
* pEnd
,
65 SwTextNode
* pSttTextNd
, SwTextNode
* pEndTextNd
);
70 bool bFullPara
= false,
71 bool bCalledByTableCpy
= false );
72 virtual ~SwUndoDelete() override
;
74 virtual void UndoImpl( ::sw::UndoRedoContext
& ) override
;
75 virtual void RedoImpl( ::sw::UndoRedoContext
& ) override
;
76 virtual void RepeatImpl( ::sw::RepeatContext
& ) override
;
78 Returns rewriter for this undo object.
80 The rewriter consists of the following rule:
82 $1 -> '<deleted text>'
84 <deleted text> is shortened to nUndoStringLength characters.
86 @return rewriter for this undo object
88 virtual SwRewriter
GetRewriter() const override
;
90 bool CanGrouping( SwDoc
&, const SwPaM
& );
92 void SetTableDelLastNd() { m_bTableDelLastNd
= true; }
94 // for PageDesc/PageBreak Attributes of a table
95 void SetPgBrkFlags( bool bPageBreak
, bool bPageDesc
)
96 { m_bResetPgDesc
= bPageDesc
; m_bResetPgBrk
= bPageBreak
; }
98 void SetTableName(const OUString
& rName
);
100 // SwUndoTableCpyTable needs this information:
101 bool IsDelFullPara() const { return m_bDelFullPara
; }
103 void dumpAsXml(xmlTextWriterPtr pWriter
) const override
;
106 #endif // INCLUDED_SW_SOURCE_CORE_INC_UNDODELETE_HXX
108 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */