android: Update app-specific/MIME type icons
[LibreOffice.git] / sd / source / ui / func / unoaprms.cxx
blob3bf7d98a61136dd53c7a2331859e28814e0c2fde
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 SdAnimationInfo* pInfo = pDoc ? SdDrawDocument::GetAnimationInfo(pObject) : nullptr;
32 if (pInfo)
34 pInfo->mbActive = bOldActive;
35 pInfo->meEffect = eOldEffect;
36 pInfo->meTextEffect = eOldTextEffect;
37 pInfo->meSpeed = eOldSpeed;
38 pInfo->mbDimPrevious = bOldDimPrevious;
39 pInfo->maDimColor = aOldDimColor;
40 pInfo->mbDimHide = bOldDimHide;
41 pInfo->mbSoundOn = bOldSoundOn;
42 pInfo->maSoundFile = aOldSoundFile;
43 pInfo->mbPlayFull = bOldPlayFull;
44 pInfo->meClickAction = eOldClickAction;
45 pInfo->SetBookmark( aOldBookmark );
46 pInfo->mnVerb = nOldVerb;
48 pInfo->meSecondEffect = eOldSecondEffect;
49 pInfo->meSecondSpeed = eOldSecondSpeed;
50 pInfo->mbSecondSoundOn = bOldSecondSoundOn;
51 pInfo->mbSecondPlayFull = bOldSecondPlayFull;
54 // info was created by action: delete info
55 else
57 pObject->DeleteUserData(0);
59 // force ModelHasChanged() in order to update effect window (animation order)
60 pObject->SetChanged();
61 pObject->BroadcastObjectChange();
64 void SdAnimationPrmsUndoAction::Redo()
66 SdAnimationInfo* pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
68 pInfo->mbActive = bNewActive;
69 pInfo->meEffect = eNewEffect;
70 pInfo->meTextEffect = eNewTextEffect;
71 pInfo->meSpeed = eNewSpeed;
72 pInfo->mbDimPrevious = bNewDimPrevious;
73 pInfo->maDimColor = aNewDimColor;
74 pInfo->mbDimHide = bNewDimHide;
75 pInfo->mbSoundOn = bNewSoundOn;
76 pInfo->maSoundFile = aNewSoundFile;
77 pInfo->mbPlayFull = bNewPlayFull;
78 pInfo->meClickAction = eNewClickAction;
79 pInfo->SetBookmark( aNewBookmark );
80 pInfo->mnVerb = nNewVerb;
82 pInfo->meSecondEffect = eNewSecondEffect;
83 pInfo->meSecondSpeed = eNewSecondSpeed;
84 pInfo->mbSecondSoundOn = bNewSecondSoundOn;
85 pInfo->mbSecondPlayFull = bNewSecondPlayFull;
87 // force ModelHasChanged() in order to update effect window (animation order)
88 pObject->SetChanged();
89 pObject->BroadcastObjectChange();
92 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()
96 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */