/src/libreoffice/sd/source/ui/func/unoaprms.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 <drawdoc.hxx> |
21 | | #include <unoaprms.hxx> |
22 | | #include <anminfo.hxx> |
23 | | |
24 | | |
25 | | void SdAnimationPrmsUndoAction::Undo() |
26 | 0 | { |
27 | | // no new info created: restore data |
28 | 0 | if (!bInfoCreated) |
29 | 0 | { |
30 | 0 | SdDrawDocument* pDoc(dynamic_cast< SdDrawDocument* >(&pObject->getSdrModelFromSdrObject())); |
31 | 0 | SdAnimationInfo* pInfo = pDoc ? SdDrawDocument::GetAnimationInfo(pObject) : nullptr; |
32 | 0 | if (pInfo) |
33 | 0 | { |
34 | 0 | pInfo->mbActive = bOldActive; |
35 | 0 | pInfo->meEffect = eOldEffect; |
36 | 0 | pInfo->meTextEffect = eOldTextEffect; |
37 | 0 | pInfo->meSpeed = eOldSpeed; |
38 | 0 | pInfo->mbDimPrevious = bOldDimPrevious; |
39 | 0 | pInfo->maDimColor = aOldDimColor; |
40 | 0 | pInfo->mbDimHide = bOldDimHide; |
41 | 0 | pInfo->mbSoundOn = bOldSoundOn; |
42 | 0 | pInfo->maSoundFile = aOldSoundFile; |
43 | 0 | pInfo->mbPlayFull = bOldPlayFull; |
44 | 0 | pInfo->meClickAction = eOldClickAction; |
45 | 0 | pInfo->SetBookmark( aOldBookmark ); |
46 | 0 | pInfo->mnVerb = nOldVerb; |
47 | |
|
48 | 0 | pInfo->meSecondEffect = eOldSecondEffect; |
49 | 0 | pInfo->meSecondSpeed = eOldSecondSpeed; |
50 | 0 | pInfo->mbSecondSoundOn = bOldSecondSoundOn; |
51 | 0 | pInfo->mbSecondPlayFull = bOldSecondPlayFull; |
52 | 0 | } |
53 | 0 | } |
54 | | // info was created by action: delete info |
55 | 0 | else |
56 | 0 | { |
57 | 0 | pObject->DeleteUserData(0); |
58 | 0 | } |
59 | | // force ModelHasChanged() in order to update effect window (animation order) |
60 | 0 | pObject->SetChanged(); |
61 | 0 | pObject->BroadcastObjectChange(); |
62 | 0 | } |
63 | | |
64 | | void SdAnimationPrmsUndoAction::Redo() |
65 | 0 | { |
66 | 0 | SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObject,true); |
67 | |
|
68 | 0 | pInfo->mbActive = bNewActive; |
69 | 0 | pInfo->meEffect = eNewEffect; |
70 | 0 | pInfo->meTextEffect = eNewTextEffect; |
71 | 0 | pInfo->meSpeed = eNewSpeed; |
72 | 0 | pInfo->mbDimPrevious = bNewDimPrevious; |
73 | 0 | pInfo->maDimColor = aNewDimColor; |
74 | 0 | pInfo->mbDimHide = bNewDimHide; |
75 | 0 | pInfo->mbSoundOn = bNewSoundOn; |
76 | 0 | pInfo->maSoundFile = aNewSoundFile; |
77 | 0 | pInfo->mbPlayFull = bNewPlayFull; |
78 | 0 | pInfo->meClickAction = eNewClickAction; |
79 | 0 | pInfo->SetBookmark( aNewBookmark ); |
80 | 0 | pInfo->mnVerb = nNewVerb; |
81 | |
|
82 | 0 | pInfo->meSecondEffect = eNewSecondEffect; |
83 | 0 | pInfo->meSecondSpeed = eNewSecondSpeed; |
84 | 0 | pInfo->mbSecondSoundOn = bNewSecondSoundOn; |
85 | 0 | pInfo->mbSecondPlayFull = bNewSecondPlayFull; |
86 | | |
87 | | // force ModelHasChanged() in order to update effect window (animation order) |
88 | 0 | pObject->SetChanged(); |
89 | 0 | pObject->BroadcastObjectChange(); |
90 | 0 | } |
91 | | |
92 | | SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction() |
93 | 0 | { |
94 | 0 | } |
95 | | |
96 | | /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |