LibreOffice Module sc (master) 1
undostyl.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#pragma once
21
22#include <optional>
23#include <svl/style.hxx>
24#include <svl/itemset.hxx>
25#include "undobase.hxx"
26
27class ScDocShell;
28
30{
31private:
32 OUString aName;
33 OUString aParent;
34 std::optional<SfxItemSet> moItems;
35
36public:
38 ScStyleSaveData( const ScStyleSaveData& rOther );
40
41 void InitFromStyle( const SfxStyleSheetBase* pSource );
42
43 const OUString& GetName() const { return aName; }
44 const OUString& GetParent() const { return aParent; }
45 const std::optional<SfxItemSet>& GetItems() const { return moItems; }
46};
47
49{
50private:
54
55 static void DoChange( ScDocShell* pDocSh,
56 const OUString& rName, SfxStyleFamily eStyleFamily,
57 const ScStyleSaveData& rData );
58
59public:
61 SfxStyleFamily eFam,
62 const ScStyleSaveData& rOld,
63 const ScStyleSaveData& rNew );
64 virtual ~ScUndoModifyStyle() override;
65
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;
70
71 virtual OUString GetComment() const override;
72};
73
75{
76public:
77 ScUndoApplyPageStyle( ScDocShell* pDocSh, OUString aNewStyle );
78 virtual ~ScUndoApplyPageStyle() override;
79
80 void AddSheetAction( SCTAB nTab, const OUString& rOld );
81
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;
86
87 virtual OUString GetComment() const override;
88
89private:
91 {
93 OUString maOldStyle;
94 explicit ApplyStyleEntry( SCTAB nTab, OUString aOldStyle );
95 };
96 typedef ::std::vector< ApplyStyleEntry > ApplyStyleVec;
97
99 OUString maNewStyle;
100};
101
102/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScStyleSaveData & operator=(const ScStyleSaveData &rOther)
Definition: undostyl.cxx:49
const std::optional< SfxItemSet > & GetItems() const
Definition: undostyl.hxx:45
OUString aParent
Definition: undostyl.hxx:33
const OUString & GetParent() const
Definition: undostyl.hxx:44
void InitFromStyle(const SfxStyleSheetBase *pSource)
Definition: undostyl.cxx:63
OUString aName
Definition: undostyl.hxx:32
const OUString & GetName() const
Definition: undostyl.hxx:43
std::optional< SfxItemSet > moItems
Definition: undostyl.hxx:34
void AddSheetAction(SCTAB nTab, const OUString &rOld)
Definition: undostyl.cxx:243
virtual void Undo() override
Definition: undostyl.cxx:253
::std::vector< ApplyStyleEntry > ApplyStyleVec
Definition: undostyl.hxx:96
ScUndoApplyPageStyle(ScDocShell *pDocSh, OUString aNewStyle)
Definition: undostyl.cxx:233
ApplyStyleVec maEntries
Definition: undostyl.hxx:98
virtual OUString GetComment() const override
Definition: undostyl.cxx:248
virtual void Redo() override
Definition: undostyl.cxx:264
virtual ~ScUndoApplyPageStyle() override
Definition: undostyl.cxx:239
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undostyl.cxx:280
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undostyl.cxx:275
virtual OUString GetComment() const override
Definition: undostyl.cxx:92
ScStyleSaveData aNewData
Definition: undostyl.hxx:53
SfxStyleFamily eFamily
Definition: undostyl.hxx:51
virtual bool CanRepeat(SfxRepeatTarget &rTarget) const override
Definition: undostyl.cxx:220
virtual void Repeat(SfxRepeatTarget &rTarget) override
Definition: undostyl.cxx:216
ScUndoModifyStyle(ScDocShell *pDocSh, SfxStyleFamily eFam, const ScStyleSaveData &rOld, const ScStyleSaveData &rNew)
Definition: undostyl.cxx:79
static void DoChange(ScDocShell *pDocSh, const OUString &rName, SfxStyleFamily eStyleFamily, const ScStyleSaveData &rData)
Definition: undostyl.cxx:118
virtual ~ScUndoModifyStyle() override
Definition: undostyl.cxx:88
ScStyleSaveData aOldData
Definition: undostyl.hxx:52
virtual void Redo() override
Definition: undostyl.cxx:209
virtual void Undo() override
Definition: undostyl.cxx:202
FilterGroup & rTarget
ApplyStyleEntry(SCTAB nTab, OUString aOldStyle)
Definition: undostyl.cxx:227
SfxStyleFamily
sal_Int16 SCTAB
Definition: types.hxx:22