bump product version to 4.1.6.2
[LibreOffice.git] / sd / source / ui / func / unoaprms.cxx
blob9f5321e18e5e83356c9b235ff4b27f7ce729d764
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 TYPEINIT1(SdAnimationPrmsUndoAction, SdUndoAction);
28 void SdAnimationPrmsUndoAction::Undo()
30 // no new info created: restore data
31 if (!bInfoCreated)
33 SdDrawDocument* pDoc = (SdDrawDocument*)pObject->GetModel();
34 if( pDoc )
36 SdAnimationInfo* pInfo = pDoc->GetAnimationInfo( pObject );
38 pInfo->mbActive = bOldActive;
39 pInfo->meEffect = eOldEffect;
40 pInfo->meTextEffect = eOldTextEffect;
41 pInfo->meSpeed = eOldSpeed;
42 pInfo->mbDimPrevious = bOldDimPrevious;
43 pInfo->maDimColor = aOldDimColor;
44 pInfo->mbDimHide = bOldDimHide;
45 pInfo->mbSoundOn = bOldSoundOn;
46 pInfo->maSoundFile = aOldSoundFile;
47 pInfo->mbPlayFull = bOldPlayFull;
48 pInfo->meClickAction = eOldClickAction;
49 pInfo->SetBookmark( aOldBookmark );
50 pInfo->mnVerb = nOldVerb;
51 pInfo->mnPresOrder = nOldPresOrder;
53 pInfo->meSecondEffect = eOldSecondEffect;
54 pInfo->meSecondSpeed = eOldSecondSpeed;
55 pInfo->mbSecondSoundOn = bOldSecondSoundOn;
56 pInfo->mbSecondPlayFull = bOldSecondPlayFull;
59 // info was created by action: delete info
60 else
62 pObject->DeleteUserData(0);
64 // force ModelHasChanged() in order to update effect window (animation order)
65 pObject->SetChanged();
66 pObject->BroadcastObjectChange();
69 void SdAnimationPrmsUndoAction::Redo()
71 SdAnimationInfo* pInfo = NULL;
73 pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
75 pInfo->mbActive = bNewActive;
76 pInfo->meEffect = eNewEffect;
77 pInfo->meTextEffect = eNewTextEffect;
78 pInfo->meSpeed = eNewSpeed;
79 pInfo->mbDimPrevious = bNewDimPrevious;
80 pInfo->maDimColor = aNewDimColor;
81 pInfo->mbDimHide = bNewDimHide;
82 pInfo->mbSoundOn = bNewSoundOn;
83 pInfo->maSoundFile = aNewSoundFile;
84 pInfo->mbPlayFull = bNewPlayFull;
85 pInfo->meClickAction = eNewClickAction;
86 pInfo->SetBookmark( aNewBookmark );
87 pInfo->mnVerb = nNewVerb;
88 pInfo->mnPresOrder = nNewPresOrder;
90 pInfo->meSecondEffect = eNewSecondEffect;
91 pInfo->meSecondSpeed = eNewSecondSpeed;
92 pInfo->mbSecondSoundOn = bNewSecondSoundOn;
93 pInfo->mbSecondPlayFull = bNewSecondPlayFull;
95 // force ModelHasChanged() in order to update effect window (animation order)
96 pObject->SetChanged();
97 pObject->BroadcastObjectChange();
100 SdAnimationPrmsUndoAction::~SdAnimationPrmsUndoAction()
105 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */