Version 6.1.0.2, tag libreoffice-6.1.0.2
[LibreOffice.git] / sd / source / ui / func / unoaprms.cxx
blobab46b90ac8ee5a88a08144740e5cf203e1559ea1
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
20 #include <drawdoc.hxx>
21 #include <unoaprms.hxx>
22 #include <anminfo.hxx>
25 void SdAnimationPrmsUndoAction::Undo()
27 // no new info created: restore data
28 if (!bInfoCreated)
30 SdDrawDocument* pDoc(dynamic_cast< SdDrawDocument* >(&pObject->getSdrModelFromSdrObject()));
31 if( pDoc )
33 SdAnimationInfo* pInfo = SdDrawDocument::GetAnimationInfo( pObject );
35 pInfo->mbActive = bOldActive;
36 pInfo->meEffect = eOldEffect;
37 pInfo->meTextEffect = eOldTextEffect;
38 pInfo->meSpeed = eOldSpeed;
39 pInfo->mbDimPrevious = bOldDimPrevious;
40 pInfo->maDimColor = aOldDimColor;
41 pInfo->mbDimHide = bOldDimHide;
42 pInfo->mbSoundOn = bOldSoundOn;
43 pInfo->maSoundFile = aOldSoundFile;
44 pInfo->mbPlayFull = bOldPlayFull;
45 pInfo->meClickAction = eOldClickAction;
46 pInfo->SetBookmark( aOldBookmark );
47 pInfo->mnVerb = nOldVerb;
49 pInfo->meSecondEffect = eOldSecondEffect;
50 pInfo->meSecondSpeed = eOldSecondSpeed;
51 pInfo->mbSecondSoundOn = bOldSecondSoundOn;
52 pInfo->mbSecondPlayFull = bOldSecondPlayFull;
55 // info was created by action: delete info
56 else
58 pObject->DeleteUserData(0);
60 // force ModelHasChanged() in order to update effect window (animation order)
61 pObject->SetChanged();
62 pObject->BroadcastObjectChange();
65 void SdAnimationPrmsUndoAction::Redo()
67 SdAnimationInfo* pInfo = nullptr;
69 pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
71 pInfo->mbActive = bNewActive;
72 pInfo->meEffect = eNewEffect;
73 pInfo->meTextEffect = eNewTextEffect;
74 pInfo->meSpeed = eNewSpeed;
75 pInfo->mbDimPrevious = bNewDimPrevious;
76 pInfo->maDimColor = aNewDimColor;
77 pInfo->mbDimHide = bNewDimHide;
78 pInfo->mbSoundOn = bNewSoundOn;
79 pInfo->maSoundFile = aNewSoundFile;
80 pInfo->mbPlayFull = bNewPlayFull;
81 pInfo->meClickAction = eNewClickAction;
82 pInfo->SetBookmark( aNewBookmark );
83 pInfo->mnVerb = nNewVerb;
85 pInfo->meSecondEffect = eNewSecondEffect;
86 pInfo->meSecondSpeed = eNewSecondSpeed;
87 pInfo->mbSecondSoundOn = bNewSecondSoundOn;
88 pInfo->mbSecondPlayFull = bNewSecondPlayFull;
90 // force ModelHasChanged() in order to update effect window (animation order)
91 pObject->SetChanged();
92 pObject->BroadcastObjectChange();
95 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()
99 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */