LibreOffice Module sd (master) 1
undolayer.cxx
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#include <undolayer.hxx>
21
22#include <DrawDocShell.hxx>
23#include <drawdoc.hxx>
24#include <DrawViewShell.hxx>
25#include <strings.hrc>
26#include <sdresid.hxx>
27#include <utility>
28
29
31 SdDrawDocument* _pDoc, SdrLayer* pLayer,
32 OUString aOldLayerName, OUString aOldLayerTitle, OUString aOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable,
33 OUString aNewLayerName, OUString aNewLayerTitle, OUString aNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable )
34: SdUndoAction( _pDoc ),
35 mpLayer( pLayer ),
36 maOldLayerName(std::move( aOldLayerName )),
37 maOldLayerTitle(std::move( aOldLayerTitle )),
38 maOldLayerDesc(std::move( aOldLayerDesc )),
39 mbOldIsVisible( bOldIsVisible ),
40 mbOldIsLocked( bOldIsLocked ),
41 mbOldIsPrintable( bOldIsPrintable ),
42 maNewLayerName(std::move( aNewLayerName )),
43 maNewLayerTitle(std::move( aNewLayerTitle )),
44 maNewLayerDesc(std::move( aNewLayerDesc )),
45 mbNewIsVisible( bNewIsVisible ),
46 mbNewIsLocked( bNewIsLocked ),
47 mbNewIsPrintable( bNewIsPrintable )
48{
49 OUString aString(SdResId(STR_MODIFYLAYER));
50 SetComment(aString);
51}
52
54{
56 if( pDocSh )
57 {
58 ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell*> ( pDocSh->GetViewShell() );
59 if( pDrViewSh )
60 {
62 }
63 }
64}
65
67{
69 if( pDocSh )
70 {
71 ::sd::DrawViewShell* pDrViewSh = dynamic_cast< ::sd::DrawViewShell* >( pDocSh->GetViewShell() );
72 if( pDrViewSh )
73 {
75 }
76 }
77}
78
79/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SAL_DLLPRIVATE::sd::DrawDocShell * GetDocSh() const
Definition: drawdoc.hxx:242
virtual void Undo() override
Definition: undolayer.cxx:53
SdLayerModifyUndoAction(SdDrawDocument *_pDoc, SdrLayer *pLayer, OUString aOldLayerName, OUString aOldLayerTitle, OUString aOldLayerDesc, bool bOldIsVisible, bool bOldIsLocked, bool bOldIsPrintable, OUString aNewLayerName, OUString aNewLayerTitle, OUString aNewLayerDesc, bool bNewIsVisible, bool bNewIsLocked, bool bNewIsPrintable)
Definition: undolayer.cxx:30
virtual void Redo() override
Definition: undolayer.cxx:66
void SetComment(const OUString &rStr)
Definition: sdundo.hxx:32
SdDrawDocument * mpDoc
Definition: sdundo.hxx:39
sd::ViewShell * GetViewShell()
Base class of the stacked shells that provide graphical views to Draw and Impress documents and editi...
void ModifyLayer(SdrLayer *pLayer, const OUString &rLayerName, const OUString &rLayerTitle, const OUString &rLayerDesc, bool bIsVisible, bool bIsLocked, bool bIsPrintable)
modifies the given layer with the given values
Definition: drviewsb.cxx:130
OUString SdResId(TranslateId aId)
Definition: sdmod.cxx:83