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 .
23 #include <svl/style.hxx>
24 #include <svl/itemset.hxx>
25 #include "undobase.hxx"
34 std::optional
<SfxItemSet
> moItems
;
38 ScStyleSaveData( const ScStyleSaveData
& rOther
);
39 ScStyleSaveData
& operator=( const ScStyleSaveData
& rOther
);
41 void InitFromStyle( const SfxStyleSheetBase
* pSource
);
43 const OUString
& GetName() const { return aName
; }
44 const OUString
& GetParent() const { return aParent
; }
45 const std::optional
<SfxItemSet
>& GetItems() const { return moItems
; }
48 class ScUndoModifyStyle
: public ScSimpleUndo
51 SfxStyleFamily eFamily
;
52 ScStyleSaveData aOldData
;
53 ScStyleSaveData aNewData
;
55 static void DoChange( ScDocShell
* pDocSh
,
56 const OUString
& rName
, SfxStyleFamily eStyleFamily
,
57 const ScStyleSaveData
& rData
);
60 ScUndoModifyStyle( ScDocShell
* pDocSh
,
62 const ScStyleSaveData
& rOld
,
63 const ScStyleSaveData
& rNew
);
64 virtual ~ScUndoModifyStyle() override
;
66 virtual void Undo() override
;
67 virtual void Redo() override
;
68 virtual void Repeat(SfxRepeatTarget
& rTarget
) override
;
69 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const override
;
71 virtual OUString
GetComment() const override
;
74 class ScUndoApplyPageStyle
: public ScSimpleUndo
77 ScUndoApplyPageStyle( ScDocShell
* pDocSh
, OUString aNewStyle
);
78 virtual ~ScUndoApplyPageStyle() override
;
80 void AddSheetAction( SCTAB nTab
, const OUString
& rOld
);
82 virtual void Undo() override
;
83 virtual void Redo() override
;
84 virtual void Repeat(SfxRepeatTarget
& rTarget
) override
;
85 virtual bool CanRepeat(SfxRepeatTarget
& rTarget
) const override
;
87 virtual OUString
GetComment() const override
;
90 struct ApplyStyleEntry
94 explicit ApplyStyleEntry( SCTAB nTab
, OUString aOldStyle
);
96 typedef ::std::vector
< ApplyStyleEntry
> ApplyStyleVec
;
98 ApplyStyleVec maEntries
;
102 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */