xref: /trunk/main/sd/source/ui/func/fuoaprms.cxx (revision cf6516809c57e1bb0a940545cca99cdad54d4ce2)
1*5b190011SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*5b190011SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*5b190011SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*5b190011SAndrew Rist  * distributed with this work for additional information
6*5b190011SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*5b190011SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*5b190011SAndrew Rist  * "License"); you may not use this file except in compliance
9*5b190011SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*5b190011SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*5b190011SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*5b190011SAndrew Rist  * software distributed under the License is distributed on an
15*5b190011SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*5b190011SAndrew Rist  * KIND, either express or implied.  See the License for the
17*5b190011SAndrew Rist  * specific language governing permissions and limitations
18*5b190011SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*5b190011SAndrew Rist  *************************************************************/
21*5b190011SAndrew Rist 
22*5b190011SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sd.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include "fuoaprms.hxx"
29cdf0e10cSrcweir 
30cdf0e10cSrcweir #include "sdattr.hxx"
31cdf0e10cSrcweir #include <svx/svdpagv.hxx>
32cdf0e10cSrcweir #include <editeng/colritem.hxx>
33cdf0e10cSrcweir #include <svx/svdundo.hxx>
34cdf0e10cSrcweir #include <vcl/group.hxx>
35cdf0e10cSrcweir #include <vcl/fixed.hxx>
36cdf0e10cSrcweir #include <sfx2/objsh.hxx>
37cdf0e10cSrcweir #include <sfx2/request.hxx>
38cdf0e10cSrcweir #include <sfx2/viewfrm.hxx>
39cdf0e10cSrcweir #ifndef _MSGBOX_HXX //autogen
40cdf0e10cSrcweir #include <vcl/msgbox.hxx>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir #include <svl/aeitem.hxx>
43cdf0e10cSrcweir #include "svx/xtable.hxx"
44cdf0e10cSrcweir 
45cdf0e10cSrcweir #include "strings.hrc"
46cdf0e10cSrcweir #include "glob.hrc"
47cdf0e10cSrcweir #include "drawdoc.hxx"
48cdf0e10cSrcweir #include "ViewShell.hxx"
49cdf0e10cSrcweir #include "anminfo.hxx"
50cdf0e10cSrcweir #include "unoaprms.hxx"                 // Undo-Action
51cdf0e10cSrcweir #include "sdundogr.hxx"                 // Undo Gruppe
52cdf0e10cSrcweir #include "View.hxx"
53cdf0e10cSrcweir #include "sdabstdlg.hxx"
54cdf0e10cSrcweir #include "sdresid.hxx"
55cdf0e10cSrcweir #include <vcl/salbtype.hxx>     // FRound
56cdf0e10cSrcweir #include <basegfx/polygon/b2dpolygon.hxx>
57cdf0e10cSrcweir 
58cdf0e10cSrcweir using namespace ::com::sun::star;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir namespace sd {
61cdf0e10cSrcweir 
62cdf0e10cSrcweir TYPEINIT1( FuObjectAnimationParameters, FuPoor );
63cdf0e10cSrcweir 
64cdf0e10cSrcweir #define ATTR_MISSING    0       // Attribut nicht verfuegbar
65cdf0e10cSrcweir #define ATTR_MIXED      1       // Attribut uneindeutig (bei Mehrfachselektion)
66cdf0e10cSrcweir #define ATTR_SET        2       // Attribut eindeutig
67cdf0e10cSrcweir 
68cdf0e10cSrcweir /*************************************************************************
69cdf0e10cSrcweir |*
70cdf0e10cSrcweir |* Konstruktor
71cdf0e10cSrcweir |*
72cdf0e10cSrcweir \************************************************************************/
73cdf0e10cSrcweir 
FuObjectAnimationParameters(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * pView,SdDrawDocument * pDoc,SfxRequest & rReq)74cdf0e10cSrcweir FuObjectAnimationParameters::FuObjectAnimationParameters (
75cdf0e10cSrcweir     ViewShell*   pViewSh,
76cdf0e10cSrcweir     ::sd::Window*        pWin,
77cdf0e10cSrcweir     ::sd::View*      pView,
78cdf0e10cSrcweir     SdDrawDocument* pDoc,
79cdf0e10cSrcweir     SfxRequest&  rReq)
80cdf0e10cSrcweir     : FuPoor(pViewSh, pWin, pView, pDoc, rReq)
81cdf0e10cSrcweir {
82cdf0e10cSrcweir }
83cdf0e10cSrcweir 
Create(ViewShell * pViewSh,::sd::Window * pWin,::sd::View * pView,SdDrawDocument * pDoc,SfxRequest & rReq)84cdf0e10cSrcweir FunctionReference FuObjectAnimationParameters::Create( ViewShell* pViewSh, ::sd::Window* pWin, ::sd::View* pView, SdDrawDocument* pDoc, SfxRequest& rReq )
85cdf0e10cSrcweir {
86cdf0e10cSrcweir     FunctionReference xFunc( new FuObjectAnimationParameters( pViewSh, pWin, pView, pDoc, rReq ) );
87cdf0e10cSrcweir     xFunc->DoExecute(rReq);
88cdf0e10cSrcweir     return xFunc;
89cdf0e10cSrcweir }
90cdf0e10cSrcweir 
DoExecute(SfxRequest & rReq)91cdf0e10cSrcweir void FuObjectAnimationParameters::DoExecute( SfxRequest& rReq )
92cdf0e10cSrcweir {
93cdf0e10cSrcweir     ::svl::IUndoManager* pUndoMgr = mpViewShell->GetViewFrame()->GetObjectShell()->GetUndoManager();
94cdf0e10cSrcweir 
95cdf0e10cSrcweir     const SdrMarkList& rMarkList  = mpView->GetMarkedObjectList();
96cdf0e10cSrcweir     sal_uLong        nCount     = rMarkList.GetMarkCount();
97cdf0e10cSrcweir     sal_uLong        nObject    = 0;
98cdf0e10cSrcweir 
99cdf0e10cSrcweir     short nAnimationSet     = ATTR_MISSING;
100cdf0e10cSrcweir     short nEffectSet        = ATTR_MISSING;
101cdf0e10cSrcweir     short nTextEffectSet    = ATTR_MISSING;
102cdf0e10cSrcweir     short nSpeedSet         = ATTR_MISSING;
103cdf0e10cSrcweir     short nFadeColorSet     = ATTR_MISSING;
104cdf0e10cSrcweir     short nFadeOutSet       = ATTR_MISSING;
105cdf0e10cSrcweir     short nInvisibleSet     = ATTR_MISSING;
106cdf0e10cSrcweir     short nSoundOnSet       = ATTR_MISSING;
107cdf0e10cSrcweir     short nSoundFileSet     = ATTR_MISSING;
108cdf0e10cSrcweir     short nPlayFullSet      = ATTR_MISSING;
109cdf0e10cSrcweir     short nClickActionSet   = ATTR_MISSING;
110cdf0e10cSrcweir     short nBookmarkSet      = ATTR_MISSING;
111cdf0e10cSrcweir 
112cdf0e10cSrcweir     short nSecondEffectSet      = ATTR_MISSING;
113cdf0e10cSrcweir     short nSecondSpeedSet       = ATTR_MISSING;
114cdf0e10cSrcweir     short nSecondSoundOnSet     = ATTR_MISSING;
115cdf0e10cSrcweir     short nSecondPlayFullSet    = ATTR_MISSING;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir 
118cdf0e10cSrcweir 
119cdf0e10cSrcweir //    sal_Bool bDontKnow   = sal_False;
120cdf0e10cSrcweir 
121cdf0e10cSrcweir                                     // defaulten (fuer Undo-Aktion)
122cdf0e10cSrcweir     presentation::AnimationEffect eEffect         = presentation::AnimationEffect_NONE;
123cdf0e10cSrcweir     presentation::AnimationEffect eTextEffect     = presentation::AnimationEffect_NONE;
124cdf0e10cSrcweir     presentation::AnimationSpeed  eSpeed          = presentation::AnimationSpeed_MEDIUM;
125cdf0e10cSrcweir     sal_Bool            bActive         = sal_False;
126cdf0e10cSrcweir     sal_Bool            bFadeOut        = sal_False;
127cdf0e10cSrcweir     Color           aFadeColor      = COL_LIGHTGRAY;
128cdf0e10cSrcweir     sal_Bool            bInvisible      = sal_False;
129cdf0e10cSrcweir     sal_Bool            bSoundOn        = sal_False;
130cdf0e10cSrcweir     String          aSound;
131cdf0e10cSrcweir     sal_Bool            bPlayFull       = sal_False;
132cdf0e10cSrcweir     presentation::ClickAction     eClickAction    = presentation::ClickAction_NONE;
133cdf0e10cSrcweir     String          aBookmark;
134cdf0e10cSrcweir 
135cdf0e10cSrcweir     presentation::AnimationEffect eSecondEffect   = presentation::AnimationEffect_NONE;
136cdf0e10cSrcweir     presentation::AnimationSpeed  eSecondSpeed    = presentation::AnimationSpeed_MEDIUM;
137cdf0e10cSrcweir     sal_Bool            bSecondSoundOn  = sal_False;
138cdf0e10cSrcweir     sal_Bool            bSecondPlayFull = sal_False;
139cdf0e10cSrcweir 
140cdf0e10cSrcweir 
141cdf0e10cSrcweir     SdAnimationInfo* pInfo;
142cdf0e10cSrcweir     SdrMark* pMark;
143cdf0e10cSrcweir 
144cdf0e10cSrcweir     // das erste Objekt untersuchen
145cdf0e10cSrcweir     pMark = rMarkList.GetMark(0);
146cdf0e10cSrcweir     pInfo = mpDoc->GetAnimationInfo(pMark->GetMarkedSdrObj());
147cdf0e10cSrcweir     if( pInfo )
148cdf0e10cSrcweir     {
149cdf0e10cSrcweir         bActive             = pInfo->mbActive;
150cdf0e10cSrcweir         nAnimationSet       = ATTR_SET;
151cdf0e10cSrcweir 
152cdf0e10cSrcweir         eEffect             = pInfo->meEffect;
153cdf0e10cSrcweir         nEffectSet          = ATTR_SET;
154cdf0e10cSrcweir 
155cdf0e10cSrcweir         eTextEffect         = pInfo->meTextEffect;
156cdf0e10cSrcweir         nTextEffectSet      = ATTR_SET;
157cdf0e10cSrcweir 
158cdf0e10cSrcweir         eSpeed              = pInfo->meSpeed;
159cdf0e10cSrcweir         nSpeedSet           = ATTR_SET;
160cdf0e10cSrcweir 
161cdf0e10cSrcweir         bFadeOut            = pInfo->mbDimPrevious;
162cdf0e10cSrcweir         nFadeOutSet         = ATTR_SET;
163cdf0e10cSrcweir 
164cdf0e10cSrcweir         aFadeColor          = pInfo->maDimColor;
165cdf0e10cSrcweir         nFadeColorSet       = ATTR_SET;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir         bInvisible          = pInfo->mbDimHide;
168cdf0e10cSrcweir         nInvisibleSet       = ATTR_SET;
169cdf0e10cSrcweir 
170cdf0e10cSrcweir         bSoundOn            = pInfo->mbSoundOn;
171cdf0e10cSrcweir         nSoundOnSet         = ATTR_SET;
172cdf0e10cSrcweir 
173cdf0e10cSrcweir         aSound              = pInfo->maSoundFile;
174cdf0e10cSrcweir         nSoundFileSet       = ATTR_SET;
175cdf0e10cSrcweir 
176cdf0e10cSrcweir         bPlayFull           = pInfo->mbPlayFull;
177cdf0e10cSrcweir         nPlayFullSet        = ATTR_SET;
178cdf0e10cSrcweir 
179cdf0e10cSrcweir         eClickAction        = pInfo->meClickAction;
180cdf0e10cSrcweir         nClickActionSet     = ATTR_SET;
181cdf0e10cSrcweir 
182cdf0e10cSrcweir         aBookmark           = pInfo->GetBookmark();
183cdf0e10cSrcweir         nBookmarkSet        = ATTR_SET;
184cdf0e10cSrcweir 
185cdf0e10cSrcweir         eSecondEffect       = pInfo->meSecondEffect;
186cdf0e10cSrcweir         nSecondEffectSet    = ATTR_SET;
187cdf0e10cSrcweir 
188cdf0e10cSrcweir         eSecondSpeed        = pInfo->meSecondSpeed;
189cdf0e10cSrcweir         nSecondSpeedSet     = ATTR_SET;
190cdf0e10cSrcweir 
191cdf0e10cSrcweir         bSecondSoundOn      = pInfo->mbSecondSoundOn;
192cdf0e10cSrcweir         nSecondSoundOnSet   = ATTR_SET;
193cdf0e10cSrcweir 
194cdf0e10cSrcweir         bSecondPlayFull     = pInfo->mbSecondPlayFull;
195cdf0e10cSrcweir         nSecondPlayFullSet  = ATTR_SET;
196cdf0e10cSrcweir     }
197cdf0e10cSrcweir 
198cdf0e10cSrcweir     // ggfs. weitere Objekte untersuchen
199cdf0e10cSrcweir     for( nObject = 1; nObject < nCount; nObject++ )
200cdf0e10cSrcweir     {
201cdf0e10cSrcweir         pMark = rMarkList.GetMark( nObject );
202cdf0e10cSrcweir         SdrObject* pObject = pMark->GetMarkedSdrObj();
203cdf0e10cSrcweir         pInfo = mpDoc->GetAnimationInfo(pObject);
204cdf0e10cSrcweir         if( pInfo )
205cdf0e10cSrcweir         {
206cdf0e10cSrcweir             if( bActive != pInfo->mbActive )
207cdf0e10cSrcweir                 nAnimationSet = ATTR_MIXED;
208cdf0e10cSrcweir 
209cdf0e10cSrcweir             if( eEffect != pInfo->meEffect )
210cdf0e10cSrcweir                 nEffectSet = ATTR_MIXED;
211cdf0e10cSrcweir 
212cdf0e10cSrcweir             if( eTextEffect != pInfo->meTextEffect )
213cdf0e10cSrcweir                 nTextEffectSet = ATTR_MIXED;
214cdf0e10cSrcweir 
215cdf0e10cSrcweir             if( eSpeed != pInfo->meSpeed )
216cdf0e10cSrcweir                 nSpeedSet = ATTR_MIXED;
217cdf0e10cSrcweir 
218cdf0e10cSrcweir             if( bFadeOut != pInfo->mbDimPrevious )
219cdf0e10cSrcweir                 nFadeOutSet = ATTR_MIXED;
220cdf0e10cSrcweir 
221cdf0e10cSrcweir             if( aFadeColor != pInfo->maDimColor )
222cdf0e10cSrcweir                 nFadeColorSet = ATTR_MIXED;
223cdf0e10cSrcweir 
224cdf0e10cSrcweir             if( bInvisible != pInfo->mbDimHide )
225cdf0e10cSrcweir                 nInvisibleSet = ATTR_MIXED;
226cdf0e10cSrcweir 
227cdf0e10cSrcweir             if( bSoundOn != pInfo->mbSoundOn )
228cdf0e10cSrcweir                 nSoundOnSet = ATTR_MIXED;
229cdf0e10cSrcweir 
230cdf0e10cSrcweir             if( aSound != pInfo->maSoundFile )
231cdf0e10cSrcweir                 nSoundFileSet = ATTR_MIXED;
232cdf0e10cSrcweir 
233cdf0e10cSrcweir             if( bPlayFull != pInfo->mbPlayFull )
234cdf0e10cSrcweir                 nPlayFullSet = ATTR_MIXED;
235cdf0e10cSrcweir 
236cdf0e10cSrcweir             if( eClickAction != pInfo->meClickAction )
237cdf0e10cSrcweir                 nClickActionSet = ATTR_MIXED;
238cdf0e10cSrcweir 
239cdf0e10cSrcweir             if( aBookmark != pInfo->GetBookmark() )
240cdf0e10cSrcweir                 nBookmarkSet = ATTR_MIXED;
241cdf0e10cSrcweir 
242cdf0e10cSrcweir             if( eSecondEffect != pInfo->meSecondEffect )
243cdf0e10cSrcweir                 nSecondEffectSet = ATTR_MIXED;
244cdf0e10cSrcweir 
245cdf0e10cSrcweir             if( eSecondSpeed != pInfo->meSecondSpeed )
246cdf0e10cSrcweir                 nSecondSpeedSet = ATTR_MIXED;
247cdf0e10cSrcweir 
248cdf0e10cSrcweir             if( bSecondSoundOn != pInfo->mbSecondSoundOn )
249cdf0e10cSrcweir                 nSecondSoundOnSet = ATTR_MIXED;
250cdf0e10cSrcweir 
251cdf0e10cSrcweir             if( bSecondPlayFull != pInfo->mbSecondPlayFull )
252cdf0e10cSrcweir                 nSecondPlayFullSet = ATTR_MIXED;
253cdf0e10cSrcweir         }
254cdf0e10cSrcweir         else
255cdf0e10cSrcweir         {
256cdf0e10cSrcweir             if (nAnimationSet == ATTR_SET && bActive == sal_True)
257cdf0e10cSrcweir                 nAnimationSet = ATTR_MIXED;
258cdf0e10cSrcweir 
259cdf0e10cSrcweir             if (nEffectSet == ATTR_SET && eEffect != presentation::AnimationEffect_NONE)
260cdf0e10cSrcweir                 nEffectSet = ATTR_MIXED;
261cdf0e10cSrcweir 
262cdf0e10cSrcweir             if (nTextEffectSet == ATTR_SET && eTextEffect != presentation::AnimationEffect_NONE)
263cdf0e10cSrcweir                 nTextEffectSet = ATTR_MIXED;
264cdf0e10cSrcweir 
265cdf0e10cSrcweir             if (nSpeedSet == ATTR_SET)
266cdf0e10cSrcweir                 nSpeedSet = ATTR_MIXED;
267cdf0e10cSrcweir 
268cdf0e10cSrcweir             if (nFadeOutSet == ATTR_SET && bFadeOut == sal_True)
269cdf0e10cSrcweir                 nFadeOutSet = ATTR_MIXED;
270cdf0e10cSrcweir 
271cdf0e10cSrcweir             if (nFadeColorSet == ATTR_SET)
272cdf0e10cSrcweir                 nFadeColorSet = ATTR_MIXED;
273cdf0e10cSrcweir 
274cdf0e10cSrcweir             if (nInvisibleSet == ATTR_SET && bInvisible == sal_True)
275cdf0e10cSrcweir                 nInvisibleSet = ATTR_MIXED;
276cdf0e10cSrcweir 
277cdf0e10cSrcweir             if (nSoundOnSet == ATTR_SET && bSoundOn == sal_True)
278cdf0e10cSrcweir                 nSoundOnSet = ATTR_MIXED;
279cdf0e10cSrcweir 
280cdf0e10cSrcweir             if (nSoundFileSet == ATTR_SET)
281cdf0e10cSrcweir                 nSoundFileSet = ATTR_MIXED;
282cdf0e10cSrcweir 
283cdf0e10cSrcweir             if (nPlayFullSet == ATTR_SET && bPlayFull == sal_True)
284cdf0e10cSrcweir                 nPlayFullSet = ATTR_MIXED;
285cdf0e10cSrcweir 
286cdf0e10cSrcweir             if (nClickActionSet == ATTR_SET && eClickAction != presentation::ClickAction_NONE)
287cdf0e10cSrcweir                 nClickActionSet = ATTR_MIXED;
288cdf0e10cSrcweir 
289cdf0e10cSrcweir             if (nBookmarkSet == ATTR_SET)
290cdf0e10cSrcweir                 nBookmarkSet = ATTR_MIXED;
291cdf0e10cSrcweir 
292cdf0e10cSrcweir             if (nSecondEffectSet == ATTR_SET && eSecondEffect != presentation::AnimationEffect_NONE)
293cdf0e10cSrcweir                 nSecondEffectSet = ATTR_MIXED;
294cdf0e10cSrcweir 
295cdf0e10cSrcweir             if (nSecondSpeedSet == ATTR_SET)
296cdf0e10cSrcweir                 nSecondSpeedSet = ATTR_MIXED;
297cdf0e10cSrcweir 
298cdf0e10cSrcweir             if (nSecondSoundOnSet == ATTR_SET && bSecondSoundOn == sal_True)
299cdf0e10cSrcweir                 nSecondSoundOnSet = ATTR_MIXED;
300cdf0e10cSrcweir 
301cdf0e10cSrcweir             if (nSecondPlayFullSet == ATTR_SET && bSecondPlayFull == sal_True)
302cdf0e10cSrcweir                 nSecondPlayFullSet = ATTR_MIXED;
303cdf0e10cSrcweir         }
304cdf0e10cSrcweir     }
305cdf0e10cSrcweir 
306cdf0e10cSrcweir     // Genau zwei Objekte mit Pfadeffekt? Dann gilt nur die Animationsinfo
307cdf0e10cSrcweir     // am bewegten Objekt.
308cdf0e10cSrcweir     if (nCount == 2)
309cdf0e10cSrcweir     {
310cdf0e10cSrcweir         SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj();
311cdf0e10cSrcweir         SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj();
312cdf0e10cSrcweir         SdrObjKind eKind1   = (SdrObjKind)pObject1->GetObjIdentifier();
313cdf0e10cSrcweir         SdrObjKind eKind2   = (SdrObjKind)pObject2->GetObjIdentifier();
314cdf0e10cSrcweir         SdAnimationInfo* pInfo1 = mpDoc->GetAnimationInfo(pObject1);
315cdf0e10cSrcweir         SdAnimationInfo* pInfo2 = mpDoc->GetAnimationInfo(pObject2);
316cdf0e10cSrcweir         pInfo  = NULL;
317cdf0e10cSrcweir 
318cdf0e10cSrcweir         if (pObject1->GetObjInventor() == SdrInventor &&
319cdf0e10cSrcweir             ((eKind1 == OBJ_LINE) ||                        // 2-Punkt-Linie
320cdf0e10cSrcweir              (eKind1 == OBJ_PLIN) ||                        // Polygon
321cdf0e10cSrcweir              (eKind1 == OBJ_PATHLINE))                &&    // Bezier-Kurve
322cdf0e10cSrcweir              (pInfo2 && pInfo2->meEffect == presentation::AnimationEffect_PATH))
323cdf0e10cSrcweir         {
324cdf0e10cSrcweir             pInfo = pInfo2;
325cdf0e10cSrcweir         }
326cdf0e10cSrcweir 
327cdf0e10cSrcweir         if (pObject2->GetObjInventor() == SdrInventor &&
328cdf0e10cSrcweir             ((eKind2 == OBJ_LINE) ||                        // 2-Punkt-Linie
329cdf0e10cSrcweir              (eKind2 == OBJ_PLIN) ||                        // Polygon
330cdf0e10cSrcweir              (eKind2 == OBJ_PATHLINE))                &&    // Bezier-Kurve
331cdf0e10cSrcweir             (pInfo1 && pInfo1->meEffect == presentation::AnimationEffect_PATH))
332cdf0e10cSrcweir         {
333cdf0e10cSrcweir             pInfo = pInfo1;
334cdf0e10cSrcweir         }
335cdf0e10cSrcweir 
336cdf0e10cSrcweir         if (pInfo)
337cdf0e10cSrcweir         {
338cdf0e10cSrcweir             bActive         = pInfo->mbActive;          nAnimationSet       = ATTR_SET;
339cdf0e10cSrcweir             eEffect         = pInfo->meEffect;          nEffectSet          = ATTR_SET;
340cdf0e10cSrcweir             eTextEffect     = pInfo->meTextEffect;      nTextEffectSet      = ATTR_SET;
341cdf0e10cSrcweir             eSpeed          = pInfo->meSpeed;           nSpeedSet           = ATTR_SET;
342cdf0e10cSrcweir             bFadeOut        = pInfo->mbDimPrevious;     nFadeOutSet         = ATTR_SET;
343cdf0e10cSrcweir             aFadeColor      = pInfo->maDimColor;        nFadeColorSet       = ATTR_SET;
344cdf0e10cSrcweir             bInvisible      = pInfo->mbDimHide;         nInvisibleSet       = ATTR_SET;
345cdf0e10cSrcweir             bSoundOn        = pInfo->mbSoundOn;         nSoundOnSet         = ATTR_SET;
346cdf0e10cSrcweir             aSound          = pInfo->maSoundFile;       nSoundFileSet       = ATTR_SET;
347cdf0e10cSrcweir             bPlayFull       = pInfo->mbPlayFull;        nPlayFullSet        = ATTR_SET;
348cdf0e10cSrcweir             eClickAction    = pInfo->meClickAction;     nClickActionSet     = ATTR_SET;
349cdf0e10cSrcweir             aBookmark       = pInfo->GetBookmark();     nBookmarkSet        = ATTR_SET;
350cdf0e10cSrcweir             eSecondEffect   = pInfo->meSecondEffect;    nSecondEffectSet    = ATTR_SET;
351cdf0e10cSrcweir             eSecondSpeed    = pInfo->meSecondSpeed;     nSecondSpeedSet     = ATTR_SET;
352cdf0e10cSrcweir             bSecondSoundOn  = pInfo->mbSecondSoundOn;   nSecondSoundOnSet   = ATTR_SET;
353cdf0e10cSrcweir             bSecondPlayFull = pInfo->mbSecondPlayFull;  nSecondPlayFullSet  = ATTR_SET;
354cdf0e10cSrcweir         }
355cdf0e10cSrcweir     }
356cdf0e10cSrcweir 
357cdf0e10cSrcweir     const SfxItemSet* pArgs = rReq.GetArgs();
358cdf0e10cSrcweir 
359cdf0e10cSrcweir     if(!pArgs)
360cdf0e10cSrcweir     {
361cdf0e10cSrcweir         // ItemSet fuer Dialog fuellen
362cdf0e10cSrcweir         SfxItemSet aSet(mpDoc->GetPool(), ATTR_ANIMATION_START, ATTR_ACTION_END);
363cdf0e10cSrcweir 
364cdf0e10cSrcweir         // das Set besetzen
365cdf0e10cSrcweir         if (nAnimationSet == ATTR_SET)
366cdf0e10cSrcweir             aSet.Put( SfxBoolItem( ATTR_ANIMATION_ACTIVE, bActive));
367cdf0e10cSrcweir         else if (nAnimationSet == ATTR_MIXED)
368cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_ACTIVE);
369cdf0e10cSrcweir         else
370cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_ACTIVE, sal_False));
371cdf0e10cSrcweir 
372cdf0e10cSrcweir         if (nEffectSet == ATTR_SET)
373cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, (sal_uInt16)eEffect));
374cdf0e10cSrcweir         else if (nEffectSet == ATTR_MIXED)
375cdf0e10cSrcweir             aSet.InvalidateItem( ATTR_ANIMATION_EFFECT );
376cdf0e10cSrcweir         else
377cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_EFFECT, presentation::AnimationEffect_NONE));
378cdf0e10cSrcweir 
379cdf0e10cSrcweir         if (nTextEffectSet == ATTR_SET)
380cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, (sal_uInt16)eTextEffect));
381cdf0e10cSrcweir         else if (nTextEffectSet == ATTR_MIXED)
382cdf0e10cSrcweir             aSet.InvalidateItem( ATTR_ANIMATION_TEXTEFFECT );
383cdf0e10cSrcweir         else
384cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_TEXTEFFECT, presentation::AnimationEffect_NONE));
385cdf0e10cSrcweir 
386cdf0e10cSrcweir         if (nSpeedSet == ATTR_SET)
387cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ANIMATION_SPEED, (sal_uInt16)eSpeed));
388cdf0e10cSrcweir         else
389cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_SPEED);
390cdf0e10cSrcweir 
391cdf0e10cSrcweir         if (nFadeOutSet == ATTR_SET)
392cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_FADEOUT, bFadeOut));
393cdf0e10cSrcweir         else if (nFadeOutSet == ATTR_MIXED)
394cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_FADEOUT);
395cdf0e10cSrcweir         else
396cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_FADEOUT, sal_False));
397cdf0e10cSrcweir 
398cdf0e10cSrcweir         if (nFadeColorSet == ATTR_SET)
399cdf0e10cSrcweir             aSet.Put(SvxColorItem(aFadeColor, ATTR_ANIMATION_COLOR));
400cdf0e10cSrcweir         else if (nFadeColorSet == ATTR_MIXED)
401cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_COLOR);
402cdf0e10cSrcweir         else
403cdf0e10cSrcweir             aSet.Put(SvxColorItem(RGB_Color(COL_LIGHTGRAY), ATTR_ANIMATION_COLOR));
404cdf0e10cSrcweir 
405cdf0e10cSrcweir         if (nInvisibleSet == ATTR_SET)
406cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_INVISIBLE, bInvisible));
407cdf0e10cSrcweir         else if (nInvisibleSet == ATTR_MIXED)
408cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_INVISIBLE);
409cdf0e10cSrcweir         else
410cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_INVISIBLE, sal_False));
411cdf0e10cSrcweir 
412cdf0e10cSrcweir         if (nSoundOnSet == ATTR_SET)
413cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, bSoundOn));
414cdf0e10cSrcweir         else if (nSoundOnSet == ATTR_MIXED)
415cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_SOUNDON);
416cdf0e10cSrcweir         else
417cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_SOUNDON, sal_False));
418cdf0e10cSrcweir 
419cdf0e10cSrcweir         if (nSoundFileSet == ATTR_SET)
420cdf0e10cSrcweir             aSet.Put(SfxStringItem(ATTR_ANIMATION_SOUNDFILE, aSound));
421cdf0e10cSrcweir         else
422cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_SOUNDFILE);
423cdf0e10cSrcweir 
424cdf0e10cSrcweir         if (nPlayFullSet == ATTR_SET)
425cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, bPlayFull));
426cdf0e10cSrcweir         else if (nPlayFullSet == ATTR_MIXED)
427cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ANIMATION_PLAYFULL);
428cdf0e10cSrcweir         else
429cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ANIMATION_PLAYFULL, sal_False));
430cdf0e10cSrcweir 
431cdf0e10cSrcweir         if (nClickActionSet == ATTR_SET)
432cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ACTION, (sal_uInt16)eClickAction));
433cdf0e10cSrcweir         else if (nClickActionSet == ATTR_MIXED)
434cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ACTION);
435cdf0e10cSrcweir         else
436cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ACTION, presentation::ClickAction_NONE));
437cdf0e10cSrcweir 
438cdf0e10cSrcweir         if (nBookmarkSet == ATTR_SET)
439cdf0e10cSrcweir             aSet.Put(SfxStringItem(ATTR_ACTION_FILENAME, aBookmark));
440cdf0e10cSrcweir         else
441cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ACTION_FILENAME);
442cdf0e10cSrcweir 
443cdf0e10cSrcweir         if (nSecondEffectSet == ATTR_SET)
444cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, (sal_uInt16)eSecondEffect));
445cdf0e10cSrcweir         else if (nSecondEffectSet == ATTR_MIXED)
446cdf0e10cSrcweir             aSet.InvalidateItem( ATTR_ACTION_EFFECT );
447cdf0e10cSrcweir         else
448cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECT, presentation::AnimationEffect_NONE));
449cdf0e10cSrcweir 
450cdf0e10cSrcweir         if (nSecondSpeedSet == ATTR_SET)
451cdf0e10cSrcweir             aSet.Put(SfxAllEnumItem(ATTR_ACTION_EFFECTSPEED, (sal_uInt16)eSecondSpeed));
452cdf0e10cSrcweir         else
453cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ACTION_EFFECTSPEED);
454cdf0e10cSrcweir 
455cdf0e10cSrcweir         if (nSecondSoundOnSet == ATTR_SET)
456cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, bSecondSoundOn));
457cdf0e10cSrcweir         else if (nSecondSoundOnSet == ATTR_MIXED)
458cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ACTION_SOUNDON);
459cdf0e10cSrcweir         else
460cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ACTION_SOUNDON, sal_False));
461cdf0e10cSrcweir 
462cdf0e10cSrcweir         if (nSecondPlayFullSet == ATTR_SET)
463cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, bSecondPlayFull));
464cdf0e10cSrcweir         else if (nPlayFullSet == ATTR_MIXED)
465cdf0e10cSrcweir             aSet.InvalidateItem(ATTR_ACTION_PLAYFULL);
466cdf0e10cSrcweir         else
467cdf0e10cSrcweir             aSet.Put(SfxBoolItem(ATTR_ACTION_PLAYFULL, sal_False));
468cdf0e10cSrcweir 
469cdf0e10cSrcweir         SdAbstractDialogFactory* pFact = SdAbstractDialogFactory::Create();
470cdf0e10cSrcweir         SfxAbstractDialog* pDlg = pFact ? pFact->CreatSdActionDialog( NULL, &aSet, mpView ) : 0;
471cdf0e10cSrcweir 
472cdf0e10cSrcweir         sal_uInt16 nResult = pDlg ? pDlg->Execute() : RET_CANCEL;
473cdf0e10cSrcweir 
474cdf0e10cSrcweir         if( nResult == RET_OK )
475cdf0e10cSrcweir         {
476cdf0e10cSrcweir             rReq.Done( *( pDlg->GetOutputItemSet() ) );
477cdf0e10cSrcweir             pArgs = rReq.GetArgs();
478cdf0e10cSrcweir         }
479cdf0e10cSrcweir 
480cdf0e10cSrcweir         delete pDlg;
481cdf0e10cSrcweir 
482cdf0e10cSrcweir         if( nResult != RET_OK )
483cdf0e10cSrcweir             return;
484cdf0e10cSrcweir     }
485cdf0e10cSrcweir 
486cdf0e10cSrcweir     // Auswertung des ItemSets
487cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_ACTIVE) == SFX_ITEM_SET)
488cdf0e10cSrcweir     {
489cdf0e10cSrcweir         bActive = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_ACTIVE)).GetValue();
490cdf0e10cSrcweir         nAnimationSet = ATTR_SET;
491cdf0e10cSrcweir     }
492cdf0e10cSrcweir     else
493cdf0e10cSrcweir         nAnimationSet = ATTR_MISSING;
494cdf0e10cSrcweir 
495cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_EFFECT) == SFX_ITEM_SET)
496cdf0e10cSrcweir     {
497cdf0e10cSrcweir         eEffect = (presentation::AnimationEffect)((SfxAllEnumItem&) pArgs->
498cdf0e10cSrcweir                     Get(ATTR_ANIMATION_EFFECT)).GetValue();
499cdf0e10cSrcweir         nEffectSet = ATTR_SET;
500cdf0e10cSrcweir     }
501cdf0e10cSrcweir     else
502cdf0e10cSrcweir         nEffectSet = ATTR_MISSING;
503cdf0e10cSrcweir 
504cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_TEXTEFFECT) == SFX_ITEM_SET)
505cdf0e10cSrcweir     {
506cdf0e10cSrcweir         eTextEffect = (presentation::AnimationEffect)((SfxAllEnumItem&) pArgs->
507cdf0e10cSrcweir                         Get(ATTR_ANIMATION_TEXTEFFECT)).GetValue();
508cdf0e10cSrcweir         nTextEffectSet = ATTR_SET;
509cdf0e10cSrcweir     }
510cdf0e10cSrcweir     else
511cdf0e10cSrcweir         nTextEffectSet = ATTR_MISSING;
512cdf0e10cSrcweir 
513cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_SPEED) == SFX_ITEM_SET)
514cdf0e10cSrcweir     {
515cdf0e10cSrcweir         eSpeed  = (presentation::AnimationSpeed)((SfxAllEnumItem&) pArgs->
516cdf0e10cSrcweir                     Get(ATTR_ANIMATION_SPEED)).GetValue();
517cdf0e10cSrcweir         nSpeedSet = ATTR_SET;
518cdf0e10cSrcweir     }
519cdf0e10cSrcweir     else
520cdf0e10cSrcweir         nSpeedSet = ATTR_MISSING;
521cdf0e10cSrcweir 
522cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_FADEOUT) == SFX_ITEM_SET)
523cdf0e10cSrcweir     {
524cdf0e10cSrcweir         bFadeOut = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_FADEOUT)).GetValue();
525cdf0e10cSrcweir         nFadeOutSet = ATTR_SET;
526cdf0e10cSrcweir     }
527cdf0e10cSrcweir     else
528cdf0e10cSrcweir         nFadeOutSet = ATTR_MISSING;
529cdf0e10cSrcweir 
530cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_INVISIBLE) == SFX_ITEM_SET)
531cdf0e10cSrcweir     {
532cdf0e10cSrcweir         bInvisible = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_INVISIBLE)).GetValue();
533cdf0e10cSrcweir         nInvisibleSet = ATTR_SET;
534cdf0e10cSrcweir     }
535cdf0e10cSrcweir     else
536cdf0e10cSrcweir         nInvisibleSet = ATTR_MISSING;
537cdf0e10cSrcweir 
538cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_SOUNDON) == SFX_ITEM_SET)
539cdf0e10cSrcweir     {
540cdf0e10cSrcweir         bSoundOn = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_SOUNDON)).GetValue();
541cdf0e10cSrcweir         nSoundOnSet = ATTR_SET;
542cdf0e10cSrcweir     }
543cdf0e10cSrcweir     else
544cdf0e10cSrcweir         nSoundOnSet = ATTR_MISSING;
545cdf0e10cSrcweir 
546cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_SOUNDFILE) == SFX_ITEM_SET)
547cdf0e10cSrcweir     {
548cdf0e10cSrcweir         aSound =  ((SfxStringItem&)pArgs->Get(ATTR_ANIMATION_SOUNDFILE)).GetValue();
549cdf0e10cSrcweir         nSoundFileSet = ATTR_SET;
550cdf0e10cSrcweir     }
551cdf0e10cSrcweir     else
552cdf0e10cSrcweir         nSoundFileSet = ATTR_MISSING;
553cdf0e10cSrcweir 
554cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_COLOR) == SFX_ITEM_SET)
555cdf0e10cSrcweir     {
556cdf0e10cSrcweir         aFadeColor = ((SvxColorItem&)pArgs->Get(ATTR_ANIMATION_COLOR)).GetValue();
557cdf0e10cSrcweir         nFadeColorSet = ATTR_SET;
558cdf0e10cSrcweir     }
559cdf0e10cSrcweir     else
560cdf0e10cSrcweir         nFadeColorSet = ATTR_MISSING;
561cdf0e10cSrcweir 
562cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ANIMATION_PLAYFULL) == SFX_ITEM_SET)
563cdf0e10cSrcweir     {
564cdf0e10cSrcweir         bPlayFull = ((SfxBoolItem&)pArgs->Get(ATTR_ANIMATION_PLAYFULL)).GetValue();
565cdf0e10cSrcweir         nPlayFullSet = ATTR_SET;
566cdf0e10cSrcweir     }
567cdf0e10cSrcweir     else
568cdf0e10cSrcweir         nPlayFullSet = ATTR_MISSING;
569cdf0e10cSrcweir 
570cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ACTION) == SFX_ITEM_SET)
571cdf0e10cSrcweir     {
572cdf0e10cSrcweir         eClickAction = (presentation::ClickAction)((SfxAllEnumItem&)pArgs->
573cdf0e10cSrcweir                     Get(ATTR_ACTION)).GetValue();
574cdf0e10cSrcweir         nClickActionSet = ATTR_SET;
575cdf0e10cSrcweir     }
576cdf0e10cSrcweir     else
577cdf0e10cSrcweir         nClickActionSet = ATTR_MISSING;
578cdf0e10cSrcweir 
579cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ACTION_FILENAME) == SFX_ITEM_SET)
580cdf0e10cSrcweir     {
581cdf0e10cSrcweir         aBookmark = ((SfxStringItem&)pArgs->
582cdf0e10cSrcweir                         Get(ATTR_ACTION_FILENAME)).GetValue();
583cdf0e10cSrcweir         nBookmarkSet = ATTR_SET;
584cdf0e10cSrcweir     }
585cdf0e10cSrcweir     else
586cdf0e10cSrcweir         nBookmarkSet = ATTR_MISSING;
587cdf0e10cSrcweir 
588cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ACTION_EFFECT) == SFX_ITEM_SET)
589cdf0e10cSrcweir     {
590cdf0e10cSrcweir         eSecondEffect = (presentation::AnimationEffect)((SfxAllEnumItem&) pArgs->
591cdf0e10cSrcweir                     Get(ATTR_ACTION_EFFECT)).GetValue();
592cdf0e10cSrcweir         nSecondEffectSet = ATTR_SET;
593cdf0e10cSrcweir     }
594cdf0e10cSrcweir     else
595cdf0e10cSrcweir         nSecondEffectSet = ATTR_MISSING;
596cdf0e10cSrcweir 
597cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ACTION_EFFECTSPEED) == SFX_ITEM_SET)
598cdf0e10cSrcweir     {
599cdf0e10cSrcweir         eSecondSpeed  = (presentation::AnimationSpeed)((SfxAllEnumItem&) pArgs->
600cdf0e10cSrcweir                     Get(ATTR_ACTION_EFFECTSPEED)).GetValue();
601cdf0e10cSrcweir         nSecondSpeedSet = ATTR_SET;
602cdf0e10cSrcweir     }
603cdf0e10cSrcweir     else
604cdf0e10cSrcweir         nSecondSpeedSet = ATTR_MISSING;
605cdf0e10cSrcweir 
606cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ACTION_SOUNDON) == SFX_ITEM_SET)
607cdf0e10cSrcweir     {
608cdf0e10cSrcweir         bSecondSoundOn = ((SfxBoolItem&)pArgs->Get(ATTR_ACTION_SOUNDON)).GetValue();
609cdf0e10cSrcweir         nSecondSoundOnSet = ATTR_SET;
610cdf0e10cSrcweir     }
611cdf0e10cSrcweir     else
612cdf0e10cSrcweir         nSecondSoundOnSet = ATTR_MISSING;
613cdf0e10cSrcweir 
614cdf0e10cSrcweir     if (pArgs->GetItemState(ATTR_ACTION_PLAYFULL) == SFX_ITEM_SET)
615cdf0e10cSrcweir     {
616cdf0e10cSrcweir         bSecondPlayFull = ((SfxBoolItem&)pArgs->Get(ATTR_ACTION_PLAYFULL)).GetValue();
617cdf0e10cSrcweir         nSecondPlayFullSet = ATTR_SET;
618cdf0e10cSrcweir     }
619cdf0e10cSrcweir     else
620cdf0e10cSrcweir         nSecondPlayFullSet = ATTR_MISSING;
621cdf0e10cSrcweir 
622cdf0e10cSrcweir     // Wenn irgendwelche Attribute ausgewaehlt wurden
623cdf0e10cSrcweir     if (nEffectSet         == ATTR_SET  ||
624cdf0e10cSrcweir         nTextEffectSet     == ATTR_SET  ||
625cdf0e10cSrcweir         nSpeedSet          == ATTR_SET  ||
626cdf0e10cSrcweir         nAnimationSet      == ATTR_SET  ||
627cdf0e10cSrcweir         nFadeOutSet        == ATTR_SET  ||
628cdf0e10cSrcweir         nFadeColorSet      == ATTR_SET  ||
629cdf0e10cSrcweir         nInvisibleSet      == ATTR_SET  ||
630cdf0e10cSrcweir         nSoundOnSet        == ATTR_SET  ||
631cdf0e10cSrcweir         nSoundFileSet      == ATTR_SET  ||
632cdf0e10cSrcweir         nPlayFullSet       == ATTR_SET  ||
633cdf0e10cSrcweir         nClickActionSet    == ATTR_SET  ||
634cdf0e10cSrcweir         nBookmarkSet       == ATTR_SET  ||
635cdf0e10cSrcweir         nSecondEffectSet   == ATTR_SET  ||
636cdf0e10cSrcweir         nSecondSpeedSet    == ATTR_SET  ||
637cdf0e10cSrcweir         nSecondSoundOnSet  == ATTR_SET  ||
638cdf0e10cSrcweir         nSecondPlayFullSet == ATTR_SET)
639cdf0e10cSrcweir     {
640cdf0e10cSrcweir         // String fuer Undo-Group und List-Action
641cdf0e10cSrcweir         String aComment(SdResId(STR_UNDO_ANIMATION));
642cdf0e10cSrcweir 
643cdf0e10cSrcweir         // bei 'an Kurve entlang' gibt's noch eine extra UndoAction, darum
644cdf0e10cSrcweir         // hier klammern
645cdf0e10cSrcweir         pUndoMgr->EnterListAction(aComment, aComment);
646cdf0e10cSrcweir 
647cdf0e10cSrcweir         // Undo Gruppe erzeugen
648cdf0e10cSrcweir         SdUndoGroup* pUndoGroup = new SdUndoGroup(mpDoc);
649cdf0e10cSrcweir         pUndoGroup->SetComment(aComment);
650cdf0e10cSrcweir 
651cdf0e10cSrcweir 
652cdf0e10cSrcweir         // fuer den Pfad-Effekt einige Dinge merken
653cdf0e10cSrcweir         SdrObject*  pRunningObj = NULL;
654cdf0e10cSrcweir         SdrPathObj* pPath       = NULL;
655cdf0e10cSrcweir         if (eEffect == presentation::AnimationEffect_PATH && nEffectSet == ATTR_SET)
656cdf0e10cSrcweir         {
657cdf0e10cSrcweir             DBG_ASSERT(nCount == 2, "dieser Effekt braucht genau 2 selektierte Objekte");
658cdf0e10cSrcweir             SdrObject* pObject1 = rMarkList.GetMark(0)->GetMarkedSdrObj();
659cdf0e10cSrcweir             SdrObject* pObject2 = rMarkList.GetMark(1)->GetMarkedSdrObj();
660cdf0e10cSrcweir             SdrObjKind eKind1   = (SdrObjKind)pObject1->GetObjIdentifier();
661cdf0e10cSrcweir             SdrObjKind eKind2   = (SdrObjKind)pObject2->GetObjIdentifier();
662cdf0e10cSrcweir 
663cdf0e10cSrcweir             if (pObject1->GetObjInventor() == SdrInventor &&
664cdf0e10cSrcweir                 ((eKind1 == OBJ_LINE) ||        // 2-Punkt-Linie
665cdf0e10cSrcweir                  (eKind1 == OBJ_PLIN) ||        // Polygon
666cdf0e10cSrcweir                  (eKind1 == OBJ_PATHLINE)))     // Bezier-Kurve
667cdf0e10cSrcweir             {
668cdf0e10cSrcweir                 pPath = (SdrPathObj*)pObject1;
669cdf0e10cSrcweir                 pRunningObj = pObject2;
670cdf0e10cSrcweir             }
671cdf0e10cSrcweir 
672cdf0e10cSrcweir             if (pObject2->GetObjInventor() == SdrInventor &&
673cdf0e10cSrcweir                 ((eKind2 == OBJ_LINE) ||        // 2-Punkt-Linie
674cdf0e10cSrcweir                  (eKind2 == OBJ_PLIN) ||        // Polygon
675cdf0e10cSrcweir                  (eKind2 == OBJ_PATHLINE)))     // Bezier-Kurve
676cdf0e10cSrcweir             {
677cdf0e10cSrcweir                 pPath = (SdrPathObj*)pObject2;
678cdf0e10cSrcweir                 pRunningObj = pObject1;
679cdf0e10cSrcweir             }
680cdf0e10cSrcweir 
681cdf0e10cSrcweir             DBG_ASSERT(pPath, "keine Kurve gefunden");
682cdf0e10cSrcweir 
683cdf0e10cSrcweir 
684cdf0e10cSrcweir             // das laufende Objekt auf das Kurvenende schieben
685cdf0e10cSrcweir             Rectangle aCurRect(pRunningObj->GetLogicRect());
686cdf0e10cSrcweir             Point     aCurCenter(aCurRect.Center());
687cdf0e10cSrcweir             const ::basegfx::B2DPolyPolygon& rPolyPolygon = pPath->GetPathPoly();
688cdf0e10cSrcweir             sal_uInt32 nNoOfPolygons(rPolyPolygon.count());
689cdf0e10cSrcweir             const ::basegfx::B2DPolygon aPolygon(rPolyPolygon.getB2DPolygon(nNoOfPolygons - 1L));
690cdf0e10cSrcweir             sal_uInt32 nPoints(aPolygon.count());
691cdf0e10cSrcweir             const ::basegfx::B2DPoint aNewB2DCenter(aPolygon.getB2DPoint(nPoints - 1L));
692cdf0e10cSrcweir             const Point aNewCenter(FRound(aNewB2DCenter.getX()), FRound(aNewB2DCenter.getY()));
693cdf0e10cSrcweir             Size aDistance(aNewCenter.X() - aCurCenter.X(), aNewCenter.Y() - aCurCenter.Y());
694cdf0e10cSrcweir             pRunningObj->Move(aDistance);
695cdf0e10cSrcweir 
696cdf0e10cSrcweir             pUndoMgr->AddUndoAction(mpDoc->GetSdrUndoFactory().CreateUndoMoveObject( *pRunningObj, aDistance));
697cdf0e10cSrcweir         }
698cdf0e10cSrcweir 
699cdf0e10cSrcweir         for (nObject = 0; nObject < nCount; nObject++)
700cdf0e10cSrcweir         {
701cdf0e10cSrcweir             SdrObject* pObject = rMarkList.GetMark(nObject)->GetMarkedSdrObj();
702cdf0e10cSrcweir 
703cdf0e10cSrcweir             pInfo = mpDoc->GetAnimationInfo(pObject);
704cdf0e10cSrcweir 
705cdf0e10cSrcweir             sal_Bool bCreated = sal_False;
706cdf0e10cSrcweir             if( !pInfo )
707cdf0e10cSrcweir             {
708cdf0e10cSrcweir                 pInfo = SdDrawDocument::GetShapeUserData(*pObject,true);
709cdf0e10cSrcweir                 bCreated = sal_True;
710cdf0e10cSrcweir             }
711cdf0e10cSrcweir 
712cdf0e10cSrcweir             // das Pfadobjekt fuer 'an Kurve entlang'?
713cdf0e10cSrcweir             if (eEffect == presentation::AnimationEffect_PATH && pObject == pPath)
714cdf0e10cSrcweir             {
715cdf0e10cSrcweir                 SdAnimationPrmsUndoAction* pAction = new SdAnimationPrmsUndoAction
716cdf0e10cSrcweir                                                 (mpDoc, pObject, bCreated);
717cdf0e10cSrcweir                 pAction->SetActive(pInfo->mbActive, pInfo->mbActive);
718cdf0e10cSrcweir                 pAction->SetEffect(pInfo->meEffect, pInfo->meEffect);
719cdf0e10cSrcweir                 pAction->SetTextEffect(pInfo->meTextEffect, pInfo->meTextEffect);
720cdf0e10cSrcweir                 pAction->SetSpeed(pInfo->meSpeed, pInfo->meSpeed);
721cdf0e10cSrcweir                 pAction->SetDim(pInfo->mbDimPrevious, pInfo->mbDimPrevious);
722cdf0e10cSrcweir                 pAction->SetDimColor(pInfo->maDimColor, pInfo->maDimColor);
723cdf0e10cSrcweir                 pAction->SetDimHide(pInfo->mbDimHide, pInfo->mbDimHide);
724cdf0e10cSrcweir                 pAction->SetSoundOn(pInfo->mbSoundOn, pInfo->mbSoundOn);
725cdf0e10cSrcweir                 pAction->SetSound(pInfo->maSoundFile, pInfo->maSoundFile);
726cdf0e10cSrcweir                 pAction->SetPlayFull(pInfo->mbPlayFull, pInfo->mbPlayFull);
727cdf0e10cSrcweir //              pAction->SetPathObj(pInfo->mpPathObj, pInfo->mpPathObj);
728cdf0e10cSrcweir                 pAction->SetClickAction(pInfo->meClickAction, pInfo->meClickAction);
729cdf0e10cSrcweir                 pAction->SetBookmark(pInfo->GetBookmark(), pInfo->GetBookmark());
730cdf0e10cSrcweir //              pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation, sal_True);
731cdf0e10cSrcweir                 pAction->SetVerb(pInfo->mnVerb, pInfo->mnVerb);
732cdf0e10cSrcweir                 pAction->SetSecondEffect(pInfo->meSecondEffect, pInfo->meSecondEffect);
733cdf0e10cSrcweir                 pAction->SetSecondSpeed(pInfo->meSecondSpeed, pInfo->meSecondSpeed);
734cdf0e10cSrcweir                 pAction->SetSecondSoundOn(pInfo->mbSecondSoundOn, pInfo->mbSecondSoundOn);
735cdf0e10cSrcweir                 pAction->SetSecondPlayFull(pInfo->mbSecondPlayFull, pInfo->mbSecondPlayFull);
736cdf0e10cSrcweir                 pUndoGroup->AddAction(pAction);
737cdf0e10cSrcweir 
738cdf0e10cSrcweir //              pInfo->mbInvisibleInPresentation = sal_True;
739cdf0e10cSrcweir             }
740cdf0e10cSrcweir             else
741cdf0e10cSrcweir             {
742cdf0e10cSrcweir 
743cdf0e10cSrcweir                 // Undo-Action mit alten und neuen Groessen erzeugen
744cdf0e10cSrcweir                 SdAnimationPrmsUndoAction* pAction = new SdAnimationPrmsUndoAction
745cdf0e10cSrcweir                                                 (mpDoc, pObject, bCreated);
746cdf0e10cSrcweir                 pAction->SetActive(pInfo->mbActive, bActive);
747cdf0e10cSrcweir                 pAction->SetEffect(pInfo->meEffect, eEffect);
748cdf0e10cSrcweir                 pAction->SetTextEffect(pInfo->meTextEffect, eTextEffect);
749cdf0e10cSrcweir                 pAction->SetSpeed(pInfo->meSpeed, eSpeed);
750cdf0e10cSrcweir                 pAction->SetDim(pInfo->mbDimPrevious, bFadeOut);
751cdf0e10cSrcweir                 pAction->SetDimColor(pInfo->maDimColor, aFadeColor);
752cdf0e10cSrcweir                 pAction->SetDimHide(pInfo->mbDimHide, bInvisible);
753cdf0e10cSrcweir                 pAction->SetSoundOn(pInfo->mbSoundOn, bSoundOn);
754cdf0e10cSrcweir                 pAction->SetSound(pInfo->maSoundFile, aSound);
755cdf0e10cSrcweir                 pAction->SetPlayFull(pInfo->mbPlayFull, bPlayFull);
756cdf0e10cSrcweir                 pAction->SetPathObj(pInfo->mpPathObj, pPath);
757cdf0e10cSrcweir                 pAction->SetClickAction(pInfo->meClickAction, eClickAction);
758cdf0e10cSrcweir                 pAction->SetBookmark(pInfo->GetBookmark(), aBookmark);
759cdf0e10cSrcweir //              pAction->SetInvisibleInPres(pInfo->mbInvisibleInPresentation,
760cdf0e10cSrcweir //                                          pInfo->mbInvisibleInPresentation);
761cdf0e10cSrcweir                 pAction->SetVerb(pInfo->mnVerb, (sal_uInt16)pInfo->GetBookmark().ToInt32() );
762cdf0e10cSrcweir                 pAction->SetSecondEffect(pInfo->meSecondEffect, eSecondEffect);
763cdf0e10cSrcweir                 pAction->SetSecondSpeed(pInfo->meSecondSpeed, eSecondSpeed);
764cdf0e10cSrcweir                 pAction->SetSecondSoundOn(pInfo->mbSecondSoundOn, bSecondSoundOn);
765cdf0e10cSrcweir                 pAction->SetSecondPlayFull(pInfo->mbSecondPlayFull,bSecondPlayFull);
766cdf0e10cSrcweir                 pUndoGroup->AddAction(pAction);
767cdf0e10cSrcweir 
768cdf0e10cSrcweir                 // neue Werte am Infoblock des Objekts eintragen
769cdf0e10cSrcweir                 if (nAnimationSet == ATTR_SET)
770cdf0e10cSrcweir                     pInfo->mbActive = bActive;
771cdf0e10cSrcweir 
772cdf0e10cSrcweir                 if (nEffectSet == ATTR_SET)
773cdf0e10cSrcweir                     pInfo->meEffect = eEffect;
774cdf0e10cSrcweir 
775cdf0e10cSrcweir                 if (nTextEffectSet == ATTR_SET)
776cdf0e10cSrcweir                     pInfo->meTextEffect = eTextEffect;
777cdf0e10cSrcweir 
778cdf0e10cSrcweir                 if (nSpeedSet == ATTR_SET)
779cdf0e10cSrcweir                     pInfo->meSpeed = eSpeed;
780cdf0e10cSrcweir 
781cdf0e10cSrcweir                 if (nFadeOutSet == ATTR_SET)
782cdf0e10cSrcweir                     pInfo->mbDimPrevious = bFadeOut;
783cdf0e10cSrcweir 
784cdf0e10cSrcweir                 if (nFadeColorSet == ATTR_SET)
785cdf0e10cSrcweir                     pInfo->maDimColor = aFadeColor;
786cdf0e10cSrcweir 
787cdf0e10cSrcweir                 if (nInvisibleSet == ATTR_SET)
788cdf0e10cSrcweir                     pInfo->mbDimHide = bInvisible;
789cdf0e10cSrcweir 
790cdf0e10cSrcweir                 if (nSoundOnSet == ATTR_SET)
791cdf0e10cSrcweir                     pInfo->mbSoundOn = bSoundOn;
792cdf0e10cSrcweir 
793cdf0e10cSrcweir                 if (nSoundFileSet == ATTR_SET)
794cdf0e10cSrcweir                     pInfo->maSoundFile = aSound;
795cdf0e10cSrcweir 
796cdf0e10cSrcweir                 if (nPlayFullSet == ATTR_SET)
797cdf0e10cSrcweir                     pInfo->mbPlayFull = bPlayFull;
798cdf0e10cSrcweir 
799cdf0e10cSrcweir                 if (nClickActionSet == ATTR_SET)
800cdf0e10cSrcweir                     pInfo->meClickAction = eClickAction;
801cdf0e10cSrcweir 
802cdf0e10cSrcweir                 if (nBookmarkSet == ATTR_SET)
803cdf0e10cSrcweir                     pInfo->SetBookmark( aBookmark );
804cdf0e10cSrcweir 
805cdf0e10cSrcweir                 if (nSecondEffectSet == ATTR_SET)
806cdf0e10cSrcweir                     pInfo->meSecondEffect = eSecondEffect;
807cdf0e10cSrcweir 
808cdf0e10cSrcweir                 if (nSecondSpeedSet == ATTR_SET)
809cdf0e10cSrcweir                     pInfo->meSecondSpeed = eSecondSpeed;
810cdf0e10cSrcweir 
811cdf0e10cSrcweir                 if (nSecondSoundOnSet == ATTR_SET)
812cdf0e10cSrcweir                     pInfo->mbSecondSoundOn = bSecondSoundOn;
813cdf0e10cSrcweir 
814cdf0e10cSrcweir                 if (nSecondPlayFullSet == ATTR_SET)
815cdf0e10cSrcweir                     pInfo->mbSecondPlayFull = bSecondPlayFull;
816cdf0e10cSrcweir 
817cdf0e10cSrcweir                 // noch ein paar Spezialitaeten
818cdf0e10cSrcweir //              if (eEffect == presentation::AnimationEffect_PATH && nEffectSet == ATTR_SET)
819cdf0e10cSrcweir //                  pInfo->mSetPath(pPath);
820cdf0e10cSrcweir 
821cdf0e10cSrcweir                 if (eClickAction == presentation::ClickAction_VERB)
822cdf0e10cSrcweir                     pInfo->mnVerb = (sal_uInt16)aBookmark.ToInt32();
823cdf0e10cSrcweir             }
824cdf0e10cSrcweir         }
825cdf0e10cSrcweir         // Undo Gruppe dem Undo Manager uebergeben
826cdf0e10cSrcweir         pUndoMgr->AddUndoAction(pUndoGroup);
827cdf0e10cSrcweir         pUndoMgr->LeaveListAction();
828cdf0e10cSrcweir 
829cdf0e10cSrcweir         // Model geaendert
830cdf0e10cSrcweir         mpDoc->SetChanged();
831cdf0e10cSrcweir     }
832cdf0e10cSrcweir     // sieht man nicht, also muss an den Bindings nicht invalidiert werden
833cdf0e10cSrcweir }
834cdf0e10cSrcweir 
835cdf0e10cSrcweir } // end of namespace sd
836