LibreOffice Module sw (master) 1
SwUndoFmt.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_SWUNDOFMT_HXX
21#define INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
22
23#include <undobj.hxx>
24#include <swundo.hxx>
25#include <numrule.hxx>
26#include <memory>
27
28class SwDoc;
31class SwRewriter;
32
34{
35protected:
39 mutable OUString m_sNewName;
40 std::unique_ptr<SfxItemSet> m_pNewSet;
41 sal_uInt16 m_nId; // FormatId related
42 bool m_bAuto;
43
44public:
45 SwUndoFormatCreate(SwUndoId nUndoId, SwFormat * pNew, SwFormat const * pDerivedFrom,
46 SwDoc& rDoc);
47 virtual ~SwUndoFormatCreate() override;
48
49 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
50 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
51
52 virtual SwRewriter GetRewriter() const override;
53
54 virtual SwFormat * Create(SwFormat * pDerivedFrom) = 0;
55 virtual void Delete() = 0;
56 virtual SwFormat * Find(const OUString & rName) const = 0;
57};
58
60{
61protected:
64 OUString m_sOldName;
66 sal_uInt16 m_nId; // FormatId related
67 bool m_bAuto;
68
69public:
70 SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const * pOld, SwDoc& rDoc);
71 virtual ~SwUndoFormatDelete() override;
72
73 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
74 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
75
76 virtual SwRewriter GetRewriter() const override;
77
78 virtual SwFormat * Create(SwFormat * pDerivedFrom) = 0;
79 virtual void Delete(SwFormat * pFormat) = 0;
80 virtual SwFormat * Find(const OUString & rName) const = 0;
81};
82
84{
85protected:
88
89public:
90 SwUndoRenameFormat(SwUndoId nUndoId, OUString sOldName,
91 OUString sNewName,
92 SwDoc& rDoc);
93 virtual ~SwUndoRenameFormat() override;
94
95 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
96 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
97
98 SwRewriter GetRewriter() const override;
99
100 virtual SwFormat * Find(const OUString & rName) const = 0;
101};
102
104{
105public:
107 SwDoc& rDoc);
108
109 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
110 virtual void Delete() override;
111 virtual SwFormat * Find(const OUString & rName) const override;
112};
113
115{
116public:
118
119 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
120 virtual void Delete(SwFormat * pFormat) override;
121 virtual SwFormat * Find(const OUString & rName) const override;
122};
123
125{
126public:
128 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
129};
130
132{
133public:
135 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
136};
137
139{
140public:
141 SwUndoRenameFormatColl(const OUString & sOldName,
142 const OUString & sNewName,
143 SwDoc& rDoc);
144
145 virtual SwFormat * Find(const OUString & rName) const override;
146};
147
149{
150public:
151 SwUndoCharFormatCreate(SwCharFormat * pNew, SwCharFormat const * pDerivedFrom,
152 SwDoc& rDoc);
153
154 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
155 virtual void Delete() override;
156 virtual SwFormat * Find(const OUString & rName) const override;
157};
158
160{
161public:
162 SwUndoCharFormatDelete(SwCharFormat const * pOld, SwDoc& rDoc);
163
164 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
165 virtual void Delete(SwFormat * pFormat) override;
166 virtual SwFormat * Find(const OUString & rName) const override;
167};
168
170{
171public:
172 SwUndoRenameCharFormat(const OUString & sOldName,
173 const OUString & sNewName,
174 SwDoc& rDoc);
175
176 virtual SwFormat * Find(const OUString & rName) const override;
177};
178
180{
181public:
182 SwUndoFrameFormatCreate(SwFrameFormat * pNew, SwFrameFormat const * pDerivedFrom,
183 SwDoc& rDoc);
184
185 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
186 virtual void Delete() override;
187 virtual SwFormat * Find(const OUString & rName) const override;
188};
189
191{
192public:
193 SwUndoFrameFormatDelete(SwFrameFormat const * pOld, SwDoc& rDoc);
194
195 virtual SwFormat * Create(SwFormat * pDerivedFrom) override;
196 virtual void Delete(SwFormat * pFormat) override;
197 virtual SwFormat * Find(const OUString & rName) const override;
198};
199
201{
202public:
203 SwUndoRenameFrameFormat(const OUString & sOldName,
204 const OUString & sNewName,
205 SwDoc& rDoc);
206
207 virtual SwFormat * Find(const OUString & rName) const override;
208};
209
210class SwUndoNumruleCreate final : public SwUndo
211{
215 mutable bool m_bInitialized;
216
217public:
218 SwUndoNumruleCreate(const SwNumRule * pNew, SwDoc& rDoc);
219
220 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
221 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
222
223 SwRewriter GetRewriter() const override;
224};
225
226class SwUndoNumruleDelete final : public SwUndo
227{
230
231public:
232 SwUndoNumruleDelete(const SwNumRule& rRule, SwDoc& rDoc);
233
234 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
235 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
236
237 SwRewriter GetRewriter() const override;
238};
239
240class SwUndoNumruleRename final : public SwUndo
241{
244
245 public:
246 SwUndoNumruleRename(OUString aOldName, OUString aNewName,
247 SwDoc& rDoc);
248
249 virtual void UndoImpl( ::sw::UndoRedoContext & ) override;
250 virtual void RedoImpl( ::sw::UndoRedoContext & ) override;
251
252 SwRewriter GetRewriter() const override;
253};
254
255#endif // INCLUDED_SW_SOURCE_CORE_INC_SWUNDOFMT_HXX
256
257/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Represents the style of a text portion.
Definition: charfmt.hxx:27
Definition: doc.hxx:192
Base class for various Writer styles.
Definition: format.hxx:47
Style of a layout element.
Definition: frmfmt.hxx:62
Represents the style of a paragraph.
Definition: fmtcol.hxx:59
virtual void Delete() override
Definition: SwUndoFmt.cxx:279
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:274
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:284
SwUndoCharFormatCreate(SwCharFormat *pNew, SwCharFormat const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:267
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:299
SwUndoCharFormatDelete(SwCharFormat const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:289
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:294
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:304
SwUndoCondTextFormatCollCreate(SwConditionTextFormatColl *pNew, SwTextFormatColl const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:233
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:239
SwUndoCondTextFormatCollDelete(SwTextFormatColl const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:244
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:250
sal_uInt16 m_nId
Definition: SwUndoFmt.hxx:41
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:45
std::unique_ptr< SfxItemSet > m_pNewSet
Definition: SwUndoFmt.hxx:40
virtual SwFormat * Create(SwFormat *pDerivedFrom)=0
virtual SwFormat * Find(const OUString &rName) const =0
OUString m_sNewName
Definition: SwUndoFmt.hxx:39
virtual void Delete()=0
SwUndoFormatCreate(SwUndoId nUndoId, SwFormat *pNew, SwFormat const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:33
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:85
SwFormat * m_pNew
Definition: SwUndoFmt.hxx:36
OUString m_sDerivedFrom
Definition: SwUndoFmt.hxx:37
virtual ~SwUndoFormatCreate() override
Definition: SwUndoFmt.cxx:41
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:66
virtual SwFormat * Create(SwFormat *pDerivedFrom)=0
virtual void Delete(SwFormat *pFormat)=0
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:128
sal_uInt16 m_nId
Definition: SwUndoFmt.hxx:66
virtual SwFormat * Find(const OUString &rName) const =0
OUString m_sOldName
Definition: SwUndoFmt.hxx:64
virtual SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:138
virtual ~SwUndoFormatDelete() override
Definition: SwUndoFmt.cxx:108
SfxItemSet m_aOldSet
Definition: SwUndoFmt.hxx:65
SwUndoFormatDelete(SwUndoId nUndoId, SwFormat const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:98
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:112
OUString m_sDerivedFrom
Definition: SwUndoFmt.hxx:62
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:328
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:338
SwUndoFrameFormatCreate(SwFrameFormat *pNew, SwFrameFormat const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:321
virtual void Delete() override
Definition: SwUndoFmt.cxx:333
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:353
SwUndoFrameFormatDelete(SwFrameFormat const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:343
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:358
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:348
const SwNumRule * m_pNew
Definition: SwUndoFmt.hxx:212
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:393
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:382
SwUndoNumruleCreate(const SwNumRule *pNew, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:375
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:398
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:419
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:424
SwUndoNumruleDelete(const SwNumRule &rRule, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:413
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:429
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:451
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:456
SwUndoNumruleRename(OUString aOldName, OUString aNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:438
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:446
SwUndoRenameCharFormat(const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:309
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:316
SwUndoRenameFormatColl(const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:255
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:262
OUString m_sNewName
Definition: SwUndoFmt.hxx:86
SwUndoRenameFormat(SwUndoId nUndoId, OUString sOldName, OUString sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:147
virtual ~SwUndoRenameFormat() override
Definition: SwUndoFmt.cxx:156
OUString m_sOldName
Definition: SwUndoFmt.hxx:86
SwRewriter GetRewriter() const override
Returns the rewriter for this object.
Definition: SwUndoFmt.cxx:180
virtual void RedoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:170
virtual void UndoImpl(::sw::UndoRedoContext &) override
Definition: SwUndoFmt.cxx:160
virtual SwFormat * Find(const OUString &rName) const =0
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:370
SwUndoRenameFrameFormat(const OUString &sOldName, const OUString &sNewName, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:363
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:207
virtual void Delete() override
Definition: SwUndoFmt.cxx:202
SwUndoTextFormatCollCreate(SwTextFormatColl *pNew, SwTextFormatColl const *pDerivedFrom, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:192
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:197
virtual void Delete(SwFormat *pFormat) override
Definition: SwUndoFmt.cxx:223
virtual SwFormat * Find(const OUString &rName) const override
Definition: SwUndoFmt.cxx:228
SwUndoTextFormatCollDelete(SwTextFormatColl const *pOld, SwDoc &rDoc)
Definition: SwUndoFmt.cxx:212
virtual SwFormat * Create(SwFormat *pDerivedFrom) override
Definition: SwUndoFmt.cxx:218
SwUndoId
Definition: swundo.hxx:30