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/func/undopage.cxx
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
#include <undopage.hxx>
21
#include <sdpage.hxx>
22
23
24
SdPageFormatUndoAction::~SdPageFormatUndoAction()
25
0
{
26
0
}
27
28
void SdPageFormatUndoAction::Undo()
29
0
{
30
0
    ::tools::Rectangle aOldBorderRect(mnOldLeft, mnOldUpper, mnOldRight, mnOldLower);
31
0
    mpPage->ScaleObjects(maOldSize, aOldBorderRect, mbNewScale);
32
0
    mpPage->SetSize(maOldSize);
33
0
    mpPage->SetLeftBorder(mnOldLeft);
34
0
    mpPage->SetRightBorder(mnOldRight);
35
0
    mpPage->SetUpperBorder(mnOldUpper);
36
0
    mpPage->SetLowerBorder(mnOldLower);
37
0
    mpPage->SetOrientation(meOldOrientation);
38
0
    mpPage->SetPaperBin( mnOldPaperBin );
39
40
0
    mpPage->SetBackgroundFullSize( mbOldFullSize );
41
0
    if( !mpPage->IsMasterPage() )
42
0
        static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbOldFullSize );
43
44
0
}
45
46
void SdPageFormatUndoAction::Redo()
47
0
{
48
0
    ::tools::Rectangle aNewBorderRect(mnNewLeft, mnNewUpper, mnNewRight, mnNewLower);
49
0
    mpPage->ScaleObjects(maNewSize, aNewBorderRect, mbNewScale);
50
0
    mpPage->SetSize(maNewSize);
51
0
    mpPage->SetLeftBorder(mnNewLeft);
52
0
    mpPage->SetRightBorder(mnNewRight);
53
0
    mpPage->SetUpperBorder(mnNewUpper);
54
0
    mpPage->SetLowerBorder(mnNewLower);
55
0
    mpPage->SetOrientation(meNewOrientation);
56
0
    mpPage->SetPaperBin( mnNewPaperBin );
57
58
0
    mpPage->SetBackgroundFullSize( mbNewFullSize );
59
0
    if( !mpPage->IsMasterPage() )
60
0
        static_cast<SdPage&>( mpPage->TRG_GetMasterPage() ).SetBackgroundFullSize( mbNewFullSize );
61
62
0
}
63
64
SdPageLRUndoAction::~SdPageLRUndoAction()
65
0
{
66
0
}
67
68
void SdPageLRUndoAction::Undo()
69
0
{
70
0
    mpPage->SetLeftBorder(mnOldLeft);
71
0
    mpPage->SetRightBorder(mnOldRight);
72
0
}
73
74
void SdPageLRUndoAction::Redo()
75
0
{
76
0
    mpPage->SetLeftBorder(mnNewLeft);
77
0
    mpPage->SetRightBorder(mnNewRight);
78
0
}
79
80
SdPageULUndoAction::~SdPageULUndoAction()
81
0
{
82
0
}
83
84
void SdPageULUndoAction::Undo()
85
0
{
86
0
    mpPage->SetUpperBorder(mnOldUpper);
87
0
    mpPage->SetLowerBorder(mnOldLower);
88
0
}
89
90
/**
91
 * UL-Redo()
92
 */
93
void SdPageULUndoAction::Redo()
94
0
{
95
0
    mpPage->SetUpperBorder(mnNewUpper);
96
0
    mpPage->SetLowerBorder(mnNewLower);
97
0
}
98
99
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */