Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sd/source/ui/inc/undopage.hxx
Line
Count
Source
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 <tools/gen.hxx>
23
#include <vcl/prntypes.hxx>
24
25
#include <sdundo.hxx>
26
27
class SdDrawDocument;
28
class SdPage;
29
30
/************************************************************************/
31
32
class SdPageFormatUndoAction final : public SdUndoAction
33
{
34
    SdPage*     mpPage;
35
36
    Size        maOldSize;
37
    sal_Int32       mnOldLeft;
38
    sal_Int32       mnOldRight;
39
    sal_Int32       mnOldUpper;
40
    sal_Int32       mnOldLower;
41
    Orientation meOldOrientation;
42
    sal_uInt16      mnOldPaperBin;
43
    bool        mbOldFullSize;
44
45
    Size        maNewSize;
46
    sal_Int32       mnNewLeft;
47
    sal_Int32       mnNewRight;
48
    sal_Int32       mnNewUpper;
49
    sal_Int32       mnNewLower;
50
    bool        mbNewScale;
51
    Orientation meNewOrientation;
52
    sal_uInt16      mnNewPaperBin;
53
    bool        mbNewFullSize;
54
55
public:
56
    SdPageFormatUndoAction( SdDrawDocument& rDoc,
57
                            SdPage*         pThePage,
58
                            const Size&     rOldSz,
59
                            sal_Int32           nOldLft,
60
                            sal_Int32           nOldRgt,
61
                            sal_Int32           nOldUpr,
62
                            sal_Int32           nOldLwr,
63
                            Orientation     eOldOrient,
64
                            sal_uInt16          nOPaperBin,
65
                            bool            bOFullSize,
66
67
                            const Size&     rNewSz,
68
                            sal_Int32           nNewLft,
69
                            sal_Int32           nNewRgt,
70
                            sal_Int32           nNewUpr,
71
                            sal_Int32           nNewLwr,
72
                            bool            bNewScl,
73
                            Orientation     eNewOrient,
74
                            sal_uInt16          nNPaperBin,
75
                            bool            bNFullSize
76
                            ) :
77
0
        SdUndoAction(rDoc),
78
0
        mpPage      (pThePage),
79
0
        maOldSize   (rOldSz),
80
0
        mnOldLeft   (nOldLft),
81
0
        mnOldRight  (nOldRgt),
82
0
        mnOldUpper  (nOldUpr),
83
0
        mnOldLower  (nOldLwr),
84
0
        meOldOrientation(eOldOrient),
85
0
        mnOldPaperBin (nOPaperBin),
86
0
        mbOldFullSize (bOFullSize),
87
88
0
        maNewSize   (rNewSz),
89
0
        mnNewLeft   (nNewLft),
90
0
        mnNewRight  (nNewRgt),
91
0
        mnNewUpper  (nNewUpr),
92
0
        mnNewLower   (nNewLwr),
93
0
        mbNewScale   (bNewScl),
94
0
        meNewOrientation(eNewOrient),
95
0
        mnNewPaperBin (nNPaperBin),
96
0
        mbNewFullSize (bNFullSize)
97
98
0
        {}
99
    virtual ~SdPageFormatUndoAction() override;
100
101
    virtual void Undo() override;
102
    virtual void Redo() override;
103
};
104
105
/************************************************************************/
106
107
class SdPageLRUndoAction final : public SdUndoAction
108
{
109
    SdPage* mpPage;
110
111
    sal_Int32   mnOldLeft;
112
    sal_Int32   mnOldRight;
113
    sal_Int32   mnNewLeft;
114
    sal_Int32   mnNewRight;
115
116
public:
117
    SdPageLRUndoAction( SdDrawDocument& rDoc, SdPage* pThePage,
118
                        sal_Int32 nOldLft, sal_Int32 nOldRgt,
119
                        sal_Int32 nNewLft, sal_Int32 nNewRgt ) :
120
0
        SdUndoAction(rDoc),
121
0
        mpPage      (pThePage),
122
0
        mnOldLeft   (nOldLft),
123
0
        mnOldRight  (nOldRgt),
124
0
        mnNewLeft   (nNewLft),
125
0
        mnNewRight  (nNewRgt)
126
0
        {}
127
    virtual ~SdPageLRUndoAction() override;
128
129
    virtual void Undo() override;
130
    virtual void Redo() override;
131
};
132
133
/************************************************************************/
134
135
class SdPageULUndoAction final : public SdUndoAction
136
{
137
    SdPage* mpPage;
138
139
    sal_Int32   mnOldUpper;
140
    sal_Int32   mnOldLower;
141
    sal_Int32   mnNewUpper;
142
    sal_Int32   mnNewLower;
143
144
public:
145
    SdPageULUndoAction( SdDrawDocument& rDoc, SdPage* pThePage,
146
                        sal_Int32 nOldUpr, sal_Int32 nOldLwr,
147
                        sal_Int32 nNewUpr, sal_Int32 nNewLwr ) :
148
0
        SdUndoAction(rDoc),
149
0
        mpPage      (pThePage),
150
0
        mnOldUpper  (nOldUpr),
151
0
        mnOldLower  (nOldLwr),
152
0
        mnNewUpper  (nNewUpr),
153
0
        mnNewLower  (nNewLwr)
154
0
        {}
155
    virtual ~SdPageULUndoAction() override;
156
157
    virtual void Undo() override;
158
    virtual void Redo() override;
159
};
160
161
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */