1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 .
21 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
22 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
23 #include <com/sun/star/drawing/ShadeMode.hpp>
24 #include <com/sun/star/drawing/Position3D.hpp>
25 #include <com/sun/star/drawing/Direction3D.hpp>
26 #include <com/sun/star/drawing/ProjectionMode.hpp>
27 #include <svx/svdundo.hxx>
28 #include <sfx2/app.hxx>
29 #include <sfx2/request.hxx>
30 #include <sfx2/objface.hxx>
31 #include <sfx2/viewsh.hxx>
32 #include <sfx2/bindings.hxx>
33 #include <svx/xsflclit.hxx>
34 #include <svx/dialmgr.hxx>
35 #include <svx/svdoashp.hxx>
36 #include <svx/dialogs.hrc>
37 #include <svx/svdview.hxx>
38 #include <editeng/colritem.hxx>
39 #include "svx/chrtitem.hxx"
41 #include <svx/extrusionbar.hxx>
42 #include "extrusiondepthdialog.hxx"
45 using namespace ::svx
;
46 using namespace ::rtl
;
47 using namespace ::cppu
;
48 using namespace ::com::sun::star::beans
;
49 using namespace ::com::sun::star::drawing
;
50 using namespace ::com::sun::star::uno
;
52 /*************************************************************************
54 |* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also
55 |* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt).
57 \************************************************************************/
59 SFX_SLOTMAP(ExtrusionBar
)
61 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
64 SFX_IMPL_INTERFACE(ExtrusionBar
, SfxShell
, SVX_RES(RID_SVX_EXTRUSION_BAR
))
66 SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT
, SVX_RES(RID_SVX_EXTRUSION_BAR
) );
69 TYPEINIT1( ExtrusionBar
, SfxShell
);
72 /*************************************************************************
74 |* Standard-Konstruktor
76 \************************************************************************/
78 ExtrusionBar::ExtrusionBar(SfxViewShell
* pViewShell
)
79 : SfxShell(pViewShell
)
81 DBG_ASSERT( pViewShell
, "svx::ExtrusionBar::ExtrusionBar(), I need a viewshell!" );
83 SetPool(&pViewShell
->GetPool());
85 SetHelpId( SVX_INTERFACE_EXTRUSION_BAR
);
86 SetName( String( SVX_RES( RID_SVX_EXTRUSION_BAR
)));
90 /*************************************************************************
94 \************************************************************************/
96 ExtrusionBar::~ExtrusionBar()
98 SetRepeatTarget(NULL
);
101 void getLightingDirectionDefaults( const Direction3D
**pLighting1Defaults
, const Direction3D
**pLighting2Defaults
)
104 static const Direction3D aLighting1Defaults
[9] =
106 Direction3D( -50000, -50000, 10000 ),
107 Direction3D( 0, -50000, 10000 ),
108 Direction3D( 50000, -50000, 10000 ),
109 Direction3D( -50000, 0, 10000 ),
110 Direction3D( 0, 0, 10000 ),
111 Direction3D( 50000, 0, 10000 ),
112 Direction3D( -50000, 50000, 10000 ),
113 Direction3D( 0, 50000, 10000 ),
114 Direction3D( 50000, 50000, 10000 )
117 static const Direction3D aLighting2Defaults
[9] =
119 Direction3D( 50000,0, 10000 ),
120 Direction3D( 0, 50000, 10000 ),
121 Direction3D( -50000, 0, 10000 ),
122 Direction3D( 50000, 0, 10000 ),
123 Direction3D( 0, 0, 10000 ),
124 Direction3D( -50000, 0, 10000 ),
125 Direction3D( 50000, 0, 10000 ),
126 Direction3D( 0, -50000, 10000 ),
127 Direction3D( -50000, 0, 10000 )
130 *pLighting1Defaults
= (const Direction3D
*)aLighting1Defaults
;
131 *pLighting2Defaults
= (const Direction3D
*)aLighting2Defaults
;
134 static void impl_execute( SdrView
*, SfxRequest
& rReq
, SdrCustomShapeGeometryItem
& rGeometryItem
, SdrObject
* pObj
)
136 static const OUString
sExtrusion( "Extrusion" );
137 static const OUString
sProjectionMode( "ProjectionMode" );
138 static const OUString
sRotateAngle( "RotateAngle" );
139 static const OUString
sViewPoint( "ViewPoint" );
140 static const OUString
sOrigin( "Origin" );
141 static const OUString
sSkew( "Skew" );
142 static const OUString
sDepth( "Depth" );
144 sal_uInt16 nSID
= rReq
.GetSlot();
147 case SID_EXTRUSION_TOOGLE
:
149 com::sun::star::uno::Any
* pAny
= rGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
160 com::sun::star::beans::PropertyValue aPropValue
;
161 aPropValue
.Name
= sExtrusion
;
162 aPropValue
.Value
<<= sal_True
;
163 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
168 case SID_EXTRUSION_TILT_DOWN
:
169 case SID_EXTRUSION_TILT_UP
:
170 case SID_EXTRUSION_TILT_LEFT
:
171 case SID_EXTRUSION_TILT_RIGHT
:
173 bool bHorizontal
= ( nSID
== SID_EXTRUSION_TILT_DOWN
) || ( nSID
== SID_EXTRUSION_TILT_UP
);
174 sal_Int32 nDiff
= ( nSID
== SID_EXTRUSION_TILT_LEFT
) || ( nSID
== SID_EXTRUSION_TILT_UP
) ? 5 : -5;
175 EnhancedCustomShapeParameterPair aRotateAnglePropPair
;
178 aRotateAnglePropPair
.First
.Value
<<= fX
;
179 aRotateAnglePropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
180 aRotateAnglePropPair
.Second
.Value
<<= fY
;
181 aRotateAnglePropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
182 com::sun::star::uno::Any
* pAny
= rGeometryItem
.GetPropertyValueByName( sExtrusion
, sRotateAngle
);
183 if( pAny
&& ( *pAny
>>= aRotateAnglePropPair
) )
185 aRotateAnglePropPair
.First
.Value
>>= fX
;
186 aRotateAnglePropPair
.Second
.Value
>>= fY
;
192 aRotateAnglePropPair
.First
.Value
<<= fX
;
193 aRotateAnglePropPair
.Second
.Value
<<= fY
;
194 com::sun::star::beans::PropertyValue aPropValue
;
195 aPropValue
.Name
= sRotateAngle
;
196 aPropValue
.Value
<<= aRotateAnglePropPair
;
197 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
201 case SID_EXTRUSION_DIRECTION
:
203 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_DIRECTION
) == SFX_ITEM_SET
)
205 sal_Int32 nSkew
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_DIRECTION
))->GetValue();
207 Position3D
aViewPoint( 3472, -3472, 25000 );
208 double fOriginX
= 0.50;
209 double fOriginY
= -0.50;
210 double fSkewAngle
= nSkew
;
216 aViewPoint
.PositionY
= 3472;
220 aViewPoint
.PositionX
= 0;
221 aViewPoint
.PositionY
= 3472;
226 aViewPoint
.PositionX
= -3472;
227 aViewPoint
.PositionY
= 3472;
232 aViewPoint
.PositionY
= 0;
236 aViewPoint
.PositionX
= 0;
237 aViewPoint
.PositionY
= 0;
243 aViewPoint
.PositionX
= -3472;
244 aViewPoint
.PositionY
= 0;
249 aViewPoint
.PositionX
= 0;
253 aViewPoint
.PositionX
= -3472;
258 com::sun::star::beans::PropertyValue aPropValue
;
260 aPropValue
.Name
= sViewPoint
;
261 aPropValue
.Value
<<= aViewPoint
;
262 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
265 EnhancedCustomShapeParameterPair aOriginPropPair
;
266 aOriginPropPair
.First
.Value
<<= fOriginX
;
267 aOriginPropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
268 aOriginPropPair
.Second
.Value
<<= fOriginY
;
269 aOriginPropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
270 aPropValue
.Name
= sOrigin
;
271 aPropValue
.Value
<<= aOriginPropPair
;
272 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
274 EnhancedCustomShapeParameterPair aSkewPropPair
;
275 aSkewPropPair
.First
.Value
<<= fSkew
;
276 aSkewPropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
277 aSkewPropPair
.Second
.Value
<<= fSkewAngle
;
278 aSkewPropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
279 aPropValue
.Name
= sSkew
;
280 aPropValue
.Value
<<= aSkewPropPair
;
281 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
285 case SID_EXTRUSION_PROJECTION
:
287 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_PROJECTION
) == SFX_ITEM_SET
)
289 sal_Int32 nProjection
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_PROJECTION
))->GetValue();
290 ProjectionMode eProjectionMode
= nProjection
== 1 ? ProjectionMode_PARALLEL
: ProjectionMode_PERSPECTIVE
;
291 com::sun::star::beans::PropertyValue aPropValue
;
292 aPropValue
.Name
= sProjectionMode
;
293 aPropValue
.Value
<<= eProjectionMode
;
294 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
298 case SID_EXTRUSION_DEPTH
:
300 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH
) == SFX_ITEM_SET
)
302 double fDepth
= ((const SvxDoubleItem
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_DEPTH
))->GetValue();
303 double fFraction
= 0.0;
304 EnhancedCustomShapeParameterPair aDepthPropPair
;
305 aDepthPropPair
.First
.Value
<<= fDepth
;
306 aDepthPropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
307 aDepthPropPair
.Second
.Value
<<= fFraction
;
308 aDepthPropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
310 com::sun::star::beans::PropertyValue aPropValue
;
311 aPropValue
.Name
= sDepth
;
312 aPropValue
.Value
<<= aDepthPropPair
;
313 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
317 case SID_EXTRUSION_3D_COLOR
:
319 static const OUString
sExtrusionColor( "Color" );
321 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_3D_COLOR
) == SFX_ITEM_SET
)
323 Color
aColor( ((const SvxColorItem
&)rReq
.GetArgs()->Get(SID_EXTRUSION_3D_COLOR
)).GetValue() );
325 const bool bAuto
= aColor
== COL_AUTO
;
327 com::sun::star::beans::PropertyValue aPropValue
;
328 aPropValue
.Name
= sExtrusionColor
;
329 aPropValue
.Value
<<= bAuto
? sal_False
: sal_True
;
330 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
334 pObj
->ClearMergedItem( XATTR_SECONDARYFILLCOLOR
);
338 pObj
->SetMergedItem( XSecondaryFillColorItem( String(), aColor
) );
340 pObj
->BroadcastObjectChange();
344 case SID_EXTRUSION_SURFACE
:
346 static const OUString
sShadeMode( "ShadeMode" );
347 static const OUString
sSpecularity( "Specularity" );
348 static const OUString
sDiffusion( "Diffusion" );
349 static const OUString
sMetal( "Metal" );
351 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_SURFACE
) == SFX_ITEM_SET
)
353 sal_Int32 nSurface
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_SURFACE
))->GetValue();
355 ShadeMode
eShadeMode( ShadeMode_FLAT
);
356 sal_Bool bMetal
= sal_False
;
357 double fSpecularity
= 0;
358 double fDiffusion
= 0;
363 eShadeMode
= ShadeMode_DRAFT
;
368 fSpecularity
= 122.0;
372 fSpecularity
= 122.0;
377 com::sun::star::beans::PropertyValue aPropValue
;
378 aPropValue
.Name
= sShadeMode
;
379 aPropValue
.Value
<<= eShadeMode
;
380 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
382 aPropValue
.Name
= sMetal
;
383 aPropValue
.Value
<<= bMetal
;
384 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
386 aPropValue
.Name
= sSpecularity
;
387 aPropValue
.Value
<<= fSpecularity
;
388 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
390 aPropValue
.Name
= sDiffusion
;
391 aPropValue
.Value
<<= fDiffusion
;
392 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
396 case SID_EXTRUSION_LIGHTING_INTENSITY
:
398 static const OUString
sBrightness( "Brightness" );
399 static const OUString
sLightFace( "LightFace" );
400 static const OUString
sFirstLightHarsh( "FirstLightHarsh" );
401 static const OUString
sSecondLightHarsh( "SecondLightHarsh" );
402 static const OUString
sFirstLightLevel( "FirstLightLevel" );
403 static const OUString
sSecondLightLevel( "SecondLightLevel" );
405 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_INTENSITY
) == SFX_ITEM_SET
)
407 sal_Int32 nLevel
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_INTENSITY
))->GetValue();
436 com::sun::star::beans::PropertyValue aPropValue
;
437 aPropValue
.Name
= sBrightness
;
438 aPropValue
.Value
<<= fBrightness
;
439 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
441 aPropValue
.Name
= sLightFace
;
442 aPropValue
.Value
<<= sal_True
;
443 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
445 aPropValue
.Name
= sFirstLightHarsh
;
446 aPropValue
.Value
<<= sal_True
;
447 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
449 aPropValue
.Name
= sSecondLightHarsh
;
450 aPropValue
.Value
<<= bHarsh2
;
451 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
453 aPropValue
.Name
= sFirstLightLevel
;
454 aPropValue
.Value
<<= fLevel1
;
455 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
457 aPropValue
.Name
= sSecondLightLevel
;
458 aPropValue
.Value
<<= fLevel2
;
459 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
463 case SID_EXTRUSION_LIGHTING_DIRECTION
:
465 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_DIRECTION
) == SFX_ITEM_SET
)
467 sal_Int32 nDirection
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_DIRECTION
))->GetValue();
469 if((nDirection
>= 0) && (nDirection
< 9))
471 const OUString
sFirstLightDirection( "FirstLightDirection" );
472 const OUString
sSecondLightDirection( "SecondLightDirection" );
474 const Direction3D
* pLighting1Defaults
;
475 const Direction3D
* pLighting2Defaults
;
477 getLightingDirectionDefaults( &pLighting1Defaults
, &pLighting2Defaults
);
479 com::sun::star::beans::PropertyValue aPropValue
;
480 aPropValue
.Name
= sFirstLightDirection
;
481 aPropValue
.Value
<<= pLighting1Defaults
[nDirection
];
482 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
484 aPropValue
.Name
= sSecondLightDirection
;
485 aPropValue
.Value
<<= pLighting2Defaults
[nDirection
];
486 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
495 void ExtrusionBar::execute( SdrView
* pSdrView
, SfxRequest
& rReq
, SfxBindings
& rBindings
)
497 sal_uInt16 nSID
= rReq
.GetSlot();
498 sal_uInt16 nStrResId
= 0;
500 const bool bUndo
= pSdrView
&& pSdrView
->IsUndoEnabled();
504 case SID_EXTRUSION_TOOGLE
:
507 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF
;
509 case SID_EXTRUSION_TILT_DOWN
:
512 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN
;
514 case SID_EXTRUSION_TILT_UP
:
517 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP
;
519 case SID_EXTRUSION_TILT_LEFT
:
522 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT
;
524 case SID_EXTRUSION_TILT_RIGHT
:
527 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT
;
529 case SID_EXTRUSION_DIRECTION
:
532 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION
;
534 case SID_EXTRUSION_PROJECTION
:
537 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION
;
539 case SID_EXTRUSION_DEPTH
:
542 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH
;
544 case SID_EXTRUSION_3D_COLOR
:
547 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR
;
549 case SID_EXTRUSION_SURFACE
:
552 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE
;
554 case SID_EXTRUSION_LIGHTING_INTENSITY
:
557 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS
;
559 case SID_EXTRUSION_LIGHTING_DIRECTION
:
562 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING
;
564 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
565 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
567 for(i
=0; i
<nCount
; i
++)
569 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
570 if( pObj
->ISA(SdrObjCustomShape
) )
574 String
aStr( SVX_RES( nStrResId
) );
575 pSdrView
->BegUndo( aStr
);
576 pSdrView
->AddUndo( pSdrView
->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj
) );
578 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
579 impl_execute( pSdrView
, rReq
, aGeometryItem
, pObj
);
580 pObj
->SetMergedItem( aGeometryItem
);
581 pObj
->BroadcastObjectChange();
585 // simulate a context change:
586 // force SelectionHasChanged() being called
587 // so that extrusion bar will be visible/hidden
588 pSdrView
->MarkListHasChanged();
594 case SID_EXTRUSION_DEPTH_DIALOG
:
595 if( rReq
.GetArgs() &&
596 (rReq
.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH
) == SFX_ITEM_SET
) &&
597 (rReq
.GetArgs()->GetItemState( SID_ATTR_METRIC
) == SFX_ITEM_SET
))
599 double fDepth
= ((const SvxDoubleItem
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_DEPTH
))->GetValue();
600 FieldUnit eUnit
= (FieldUnit
)((const SfxUInt16Item
*)rReq
.GetArgs()->GetItem(SID_ATTR_METRIC
))->GetValue();
602 ExtrusionDepthDialog
aDlg( 0L, fDepth
, eUnit
);
603 sal_uInt16 nRet
= aDlg
.Execute();
606 fDepth
= aDlg
.getDepth();
608 SvxDoubleItem
aItem( fDepth
, SID_EXTRUSION_DEPTH
);
609 SfxPoolItem
* aItems
[] = { &aItem
, 0 };
610 rBindings
.Execute( SID_EXTRUSION_DEPTH
, (const SfxPoolItem
**)aItems
);
616 if( nSID
== SID_EXTRUSION_TOOGLE
)
618 static sal_uInt16 SidArray
[] = {
619 SID_EXTRUSION_TILT_DOWN
,
620 SID_EXTRUSION_TILT_UP
,
621 SID_EXTRUSION_TILT_LEFT
,
622 SID_EXTRUSION_TILT_RIGHT
,
623 SID_EXTRUSION_DEPTH_FLOATER
,
624 SID_EXTRUSION_DIRECTION_FLOATER
,
625 SID_EXTRUSION_LIGHTING_FLOATER
,
626 SID_EXTRUSION_SURFACE_FLOATER
,
627 SID_EXTRUSION_3D_COLOR
,
629 SID_EXTRUSION_DIRECTION
,
630 SID_EXTRUSION_PROJECTION
,
631 SID_EXTRUSION_LIGHTING_DIRECTION
,
632 SID_EXTRUSION_LIGHTING_INTENSITY
,
633 SID_EXTRUSION_SURFACE
,
636 rBindings
.Invalidate( SidArray
);
640 void getExtrusionDirectionState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
642 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
643 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
645 static const OUString
sExtrusion( "Extrusion" );
646 static const OUString
sViewPoint( "ViewPoint" );
647 static const OUString
sOrigin( "Origin" );
648 static const OUString
sSkew( "Skew" );
649 static const OUString
sProjectionMode( "ProjectionMode" );
651 com::sun::star::uno::Any
* pAny
;
653 double fFinalSkewAngle
= -1;
654 bool bHasCustomShape
= false;
656 for(i
=0;i
<nCount
; i
++)
658 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
659 if( pObj
->ISA(SdrObjCustomShape
) )
661 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
663 // see if this is an extruded customshape
664 if( !bHasCustomShape
)
666 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
668 *pAny_
>>= bHasCustomShape
;
670 if( !bHasCustomShape
)
674 bool bParallel
= true;
675 Position3D
aViewPoint( 3472, -3472, 25000 );
676 double fSkewAngle
= -135;
678 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sProjectionMode
);
679 sal_Int16 nProjectionMode
= sal_Int16();
680 if( pAny
&& ( *pAny
>>= nProjectionMode
) )
681 bParallel
= nProjectionMode
== ProjectionMode_PARALLEL
;
686 EnhancedCustomShapeParameterPair aSkewPropPair
;
687 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sSkew
);
688 if( pAny
&& ( *pAny
>>= aSkewPropPair
) )
690 aSkewPropPair
.First
.Value
>>= fSkew
;
691 aSkewPropPair
.Second
.Value
>>= fSkewAngle
;
695 else if ( fSkewAngle
== 0.0 )
700 double fOriginX
= 0.50;
701 double fOriginY
= -0.50;
702 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sViewPoint
);
704 *pAny
>>= aViewPoint
;
706 EnhancedCustomShapeParameterPair aOriginPropPair
;
707 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sOrigin
);
708 if( pAny
&& ( *pAny
>>= aOriginPropPair
) )
710 aOriginPropPair
.First
.Value
>>= fOriginX
;
711 aOriginPropPair
.Second
.Value
>>= fOriginY
;
714 const double e
= 0.0001;
715 if( aViewPoint
.PositionX
> e
)
717 if( aViewPoint
.PositionY
> e
)
719 if( (fOriginX
> e
) && ( fOriginY
> e
) )
722 else if( aViewPoint
.PositionY
< -e
)
724 if( ( fOriginX
> e
) && ( fOriginY
< -e
) )
729 if( ( fOriginX
> e
) && ( fOriginY
> -e
) && ( fOriginY
< e
) )
733 else if( aViewPoint
.PositionX
< -e
)
735 if( aViewPoint
.PositionY
< -e
)
737 if( ( fOriginX
< -e
) && ( fOriginY
< -e
) )
740 else if( aViewPoint
.PositionY
> e
)
742 if( ( fOriginX
< -e
) && ( fOriginY
> e
) )
747 if( ( fOriginX
< e
) && ( fOriginY
> -e
) && ( fOriginY
< e
) )
753 if( aViewPoint
.PositionY
< -e
)
755 if( ( fOriginX
> -e
) && ( fOriginX
< e
) && ( fOriginY
< -e
) )
758 else if( aViewPoint
.PositionY
> e
)
760 if( ( fOriginX
> -e
) && ( fOriginX
< e
) && ( fOriginY
> e
) )
765 if( ( fOriginX
> -e
) && ( fOriginX
< e
) && ( fOriginY
> -e
) && ( fOriginY
< e
) )
771 if( fFinalSkewAngle
== -1.0 )
773 fFinalSkewAngle
= fSkewAngle
;
775 else if( fSkewAngle
!= fFinalSkewAngle
)
777 fFinalSkewAngle
= -1.0;
780 if( fFinalSkewAngle
== -1.0 )
785 if( bHasCustomShape
)
786 rSet
.Put( SfxInt32Item( SID_EXTRUSION_DIRECTION
, (sal_Int32
)fFinalSkewAngle
) );
788 rSet
.DisableItem( SID_EXTRUSION_DIRECTION
);
791 void getExtrusionProjectionState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
793 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
794 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
796 static const OUString
sExtrusion( "Extrusion" );
797 static const OUString
sProjectionMode( "ProjectionMode" );
799 com::sun::star::uno::Any
* pAny
;
801 sal_Int32 nFinalProjection
= -1;
802 bool bHasCustomShape
= false;
804 for(i
=0;i
<nCount
; i
++)
806 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
807 if( pObj
->ISA(SdrObjCustomShape
) )
809 // see if this is an extruded customshape
810 if( !bHasCustomShape
)
812 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
813 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
815 *pAny_
>>= bHasCustomShape
;
817 if( !bHasCustomShape
)
821 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
823 sal_Bool bParallel
= sal_True
;
824 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sProjectionMode
);
825 ProjectionMode eProjectionMode
;
826 if( pAny
&& ( *pAny
>>= eProjectionMode
) )
827 bParallel
= eProjectionMode
== ProjectionMode_PARALLEL
;
829 if( nFinalProjection
== -1 )
831 nFinalProjection
= bParallel
;
833 else if( nFinalProjection
!= bParallel
)
835 nFinalProjection
= -1;
841 if( bHasCustomShape
)
842 rSet
.Put( SfxInt32Item( SID_EXTRUSION_PROJECTION
, nFinalProjection
) );
844 rSet
.DisableItem( SID_EXTRUSION_PROJECTION
);
847 void getExtrusionSurfaceState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
849 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
850 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
852 static const OUString
sExtrusion( "Extrusion" );
853 static const OUString
sShadeMode( "ShadeMode" );
854 static const OUString
sSpecularity( "Specularity" );
855 static const OUString
sMetal( "Metal" );
857 com::sun::star::uno::Any
* pAny
;
859 sal_Int32 nFinalSurface
= -1;
860 bool bHasCustomShape
= false;
862 for(i
=0;i
<nCount
; i
++)
864 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
865 if( pObj
->ISA(SdrObjCustomShape
) )
867 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
869 // see if this is an extruded customshape
870 if( !bHasCustomShape
)
872 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
874 *pAny_
>>= bHasCustomShape
;
876 if( !bHasCustomShape
)
880 sal_Int32 nSurface
= 0; // wire frame
882 ShadeMode
eShadeMode( ShadeMode_FLAT
);
883 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sShadeMode
);
885 *pAny
>>= eShadeMode
;
887 if( eShadeMode
== ShadeMode_FLAT
)
889 sal_Bool bMetal
= sal_False
;
890 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sMetal
);
896 nSurface
= 3; // metal
900 double fSpecularity
= 0;
901 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sSpecularity
);
903 *pAny
>>= fSpecularity
;
905 const double e
= 0.0001;
906 if( (fSpecularity
> -e
) && (fSpecularity
< e
) )
908 nSurface
= 1; // matte
912 nSurface
= 2; // plastic
917 if( nFinalSurface
== -1 )
919 nFinalSurface
= nSurface
;
921 else if( nFinalSurface
!= nSurface
)
929 if( bHasCustomShape
)
930 rSet
.Put( SfxInt32Item( SID_EXTRUSION_SURFACE
, nFinalSurface
) );
932 rSet
.DisableItem( SID_EXTRUSION_SURFACE
);
935 void getExtrusionDepthState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
937 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
938 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
940 static const OUString
sExtrusion( "Extrusion" );
941 static const OUString
sDepth( "Depth" );
943 com::sun::star::uno::Any
* pAny
;
945 double fFinalDepth
= -1;
946 bool bHasCustomShape
= false;
948 for(i
=0;i
<nCount
; i
++)
950 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
951 if( pObj
->ISA(SdrObjCustomShape
) )
953 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
955 // see if this is an extruded customshape
956 if( !bHasCustomShape
)
958 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
960 *pAny_
>>= bHasCustomShape
;
962 if( !bHasCustomShape
)
966 double fDepth
= 1270.0;
967 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sDepth
);
970 EnhancedCustomShapeParameterPair aDepthPropPair
;
971 if ( *pAny
>>= aDepthPropPair
)
972 aDepthPropPair
.First
.Value
>>= fDepth
;
975 if( fFinalDepth
== -1 )
977 fFinalDepth
= fDepth
;
979 else if( fFinalDepth
!= fDepth
)
987 if( pSdrView
->GetModel() )
989 FieldUnit eUnit
= pSdrView
->GetModel()->GetUIUnit();
990 rSet
.Put( SfxUInt16Item( SID_ATTR_METRIC
, (sal_uInt16
)eUnit
) );
993 if( bHasCustomShape
)
994 rSet
.Put( SvxDoubleItem( fFinalDepth
, SID_EXTRUSION_DEPTH
) );
996 rSet
.DisableItem( SID_EXTRUSION_DEPTH
);
999 static bool compare_direction( const Direction3D
& d1
, const Direction3D
& d2
)
1001 if( ((d1
.DirectionX
< 0) && (d2
.DirectionX
< 0)) || ((d1
.DirectionX
== 0) && (d2
.DirectionX
== 0)) || ((d1
.DirectionX
> 0) && (d2
.DirectionX
> 0)) )
1003 if( ((d1
.DirectionY
< 0) && (d2
.DirectionY
< 0)) || ((d1
.DirectionY
== 0) && (d2
.DirectionY
== 0)) || ((d1
.DirectionY
> 0) && (d2
.DirectionY
> 0)) )
1005 if( ((d1
.DirectionZ
< 0) && (d2
.DirectionZ
< 0)) || ((d1
.DirectionZ
== 0) && (d2
.DirectionZ
== 0)) || ((d1
.DirectionZ
> 0) && (d2
.DirectionZ
> 0)) )
1015 void getExtrusionLightingDirectionState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1017 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1018 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
1020 static const OUString
sExtrusion( "Extrusion" );
1021 static const OUString
sFirstLightDirection( "FirstLightDirection" );
1022 static const OUString
sSecondLightDirection( "SecondLightDirection" );
1024 const Direction3D
* pLighting1Defaults
;
1025 const Direction3D
* pLighting2Defaults
;
1027 getLightingDirectionDefaults( &pLighting1Defaults
, &pLighting2Defaults
);
1029 com::sun::star::uno::Any
* pAny
;
1031 int nFinalDirection
= -1;
1032 bool bHasCustomShape
= false;
1034 for(i
=0;i
<nCount
; i
++)
1036 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1037 if( pObj
->ISA(SdrObjCustomShape
) )
1039 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1041 // see if this is an extruded customshape
1042 if( !bHasCustomShape
)
1044 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1046 *pAny_
>>= bHasCustomShape
;
1048 if( !bHasCustomShape
)
1052 Direction3D
aFirstLightDirection( 50000, 0, 10000 );
1053 Direction3D
aSecondLightDirection( -50000, 0, 10000 );
1055 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sFirstLightDirection
);
1057 *pAny
>>= aFirstLightDirection
;
1059 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sSecondLightDirection
);
1061 *pAny
>>= aSecondLightDirection
;
1063 int nDirection
= -1;
1066 for( j
= 0; j
< 9; j
++ )
1068 if( compare_direction( aFirstLightDirection
, pLighting1Defaults
[j
] ) &&
1069 compare_direction( aSecondLightDirection
, pLighting2Defaults
[j
] ))
1076 if( nFinalDirection
== -1 )
1078 nFinalDirection
= nDirection
;
1080 else if( nDirection
!= nFinalDirection
)
1082 nFinalDirection
= -1;
1085 if( nFinalDirection
== -1 )
1090 if( bHasCustomShape
)
1091 rSet
.Put( SfxInt32Item( SID_EXTRUSION_LIGHTING_DIRECTION
, (sal_Int32
)nFinalDirection
) );
1093 rSet
.DisableItem( SID_EXTRUSION_LIGHTING_DIRECTION
);
1096 void getExtrusionLightingIntensityState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1098 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1099 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
1101 static const OUString
sExtrusion( "Extrusion" );
1102 static const OUString
sBrightness( "Brightness" );
1104 com::sun::star::uno::Any
* pAny
;
1106 int nFinalLevel
= -1;
1107 bool bHasCustomShape
= false;
1109 for(i
=0;i
<nCount
; i
++)
1111 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1112 if( pObj
->ISA(SdrObjCustomShape
) )
1114 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1116 // see if this is an extruded customshape
1117 if( !bHasCustomShape
)
1119 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1121 *pAny_
>>= bHasCustomShape
;
1123 if( !bHasCustomShape
)
1127 double fBrightness
= 22178.0 / 655.36;
1128 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sBrightness
);
1130 *pAny
>>= fBrightness
;
1133 if( fBrightness
>= 30.0 )
1135 nLevel
= 0; // Bright
1137 else if( fBrightness
>= 10.0 )
1139 nLevel
= 1; // Noraml;
1146 if( nFinalLevel
== -1 )
1148 nFinalLevel
= nLevel
;
1150 else if( nFinalLevel
!= nLevel
)
1158 if( bHasCustomShape
)
1159 rSet
.Put( SfxInt32Item( SID_EXTRUSION_LIGHTING_INTENSITY
, nFinalLevel
) );
1161 rSet
.DisableItem( SID_EXTRUSION_LIGHTING_INTENSITY
);
1164 void getExtrusionColorState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1166 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1167 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
1169 static const OUString
sExtrusion( "Extrusion" );
1170 static const OUString
sExtrusionColor( "Color" );
1172 com::sun::star::uno::Any
* pAny
;
1175 bool bAmbigius
= false;
1177 bool bHasCustomShape
= false;
1179 for(i
=0;i
<nCount
; i
++)
1181 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1182 if( pObj
->ISA(SdrObjCustomShape
) )
1184 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1186 // see if this is an extruded customshape
1187 if( !bHasCustomShape
)
1189 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1191 *pAny_
>>= bHasCustomShape
;
1193 if( !bHasCustomShape
)
1199 bool bUseColor
= false;
1200 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusionColor
);
1202 *pAny
>>= bUseColor
;
1206 const XSecondaryFillColorItem
& rItem
= *(XSecondaryFillColorItem
*)&(pObj
->GetMergedItem( XATTR_SECONDARYFILLCOLOR
));
1207 aColor
= rItem
.GetColorValue();
1216 aFinalColor
= aColor
;
1219 else if( aFinalColor
!= aColor
)
1228 aFinalColor
= COL_AUTO
;
1230 if( bHasCustomShape
)
1231 rSet
.Put( SvxColorItem( aFinalColor
, SID_EXTRUSION_3D_COLOR
) );
1233 rSet
.DisableItem( SID_EXTRUSION_3D_COLOR
);
1237 bool checkForSelectedCustomShapes( SdrView
* pSdrView
, bool bOnlyExtruded
)
1239 static const OUString
sExtrusion( "Extrusion" );
1241 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1242 sal_uIntPtr nCount
= rMarkList
.GetMarkCount(), i
;
1243 bool bFound
= false;
1245 for(i
=0;(i
<nCount
) && !bFound
; i
++)
1247 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1248 if( pObj
->ISA(SdrObjCustomShape
) )
1252 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1253 Any
* pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1268 void ExtrusionBar::getState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1270 if (rSet
.GetItemState(SID_EXTRUSION_DIRECTION
) != SFX_ITEM_UNKNOWN
)
1272 getExtrusionDirectionState( pSdrView
, rSet
);
1274 if (rSet
.GetItemState(SID_EXTRUSION_PROJECTION
) != SFX_ITEM_UNKNOWN
)
1276 getExtrusionProjectionState( pSdrView
, rSet
);
1278 const bool bOnlyExtrudedCustomShapes
=
1279 checkForSelectedCustomShapes( pSdrView
, true );
1280 if (rSet
.GetItemState(SID_EXTRUSION_TILT_DOWN
) != SFX_ITEM_UNKNOWN
)
1282 if (! bOnlyExtrudedCustomShapes
)
1283 rSet
.DisableItem( SID_EXTRUSION_TILT_DOWN
);
1285 if (rSet
.GetItemState(SID_EXTRUSION_TILT_DOWN
) != SFX_ITEM_UNKNOWN
)
1287 if (! bOnlyExtrudedCustomShapes
)
1288 rSet
.DisableItem( SID_EXTRUSION_TILT_DOWN
);
1290 if (rSet
.GetItemState(SID_EXTRUSION_TILT_UP
) != SFX_ITEM_UNKNOWN
)
1292 if (! bOnlyExtrudedCustomShapes
)
1293 rSet
.DisableItem( SID_EXTRUSION_TILT_UP
);
1295 if (rSet
.GetItemState(SID_EXTRUSION_TILT_LEFT
) != SFX_ITEM_UNKNOWN
)
1297 if (! bOnlyExtrudedCustomShapes
)
1298 rSet
.DisableItem( SID_EXTRUSION_TILT_LEFT
);
1300 if (rSet
.GetItemState(SID_EXTRUSION_TILT_RIGHT
) != SFX_ITEM_UNKNOWN
)
1302 if (! bOnlyExtrudedCustomShapes
)
1303 rSet
.DisableItem( SID_EXTRUSION_TILT_RIGHT
);
1305 if (rSet
.GetItemState(SID_EXTRUSION_3D_COLOR
) != SFX_ITEM_UNKNOWN
)
1307 if (! bOnlyExtrudedCustomShapes
)
1308 rSet
.DisableItem( SID_EXTRUSION_3D_COLOR
);
1310 if (rSet
.GetItemState(SID_EXTRUSION_DEPTH_FLOATER
) != SFX_ITEM_UNKNOWN
)
1312 if (! bOnlyExtrudedCustomShapes
)
1313 rSet
.DisableItem( SID_EXTRUSION_DEPTH_FLOATER
);
1315 if (rSet
.GetItemState(SID_EXTRUSION_DIRECTION_FLOATER
) != SFX_ITEM_UNKNOWN
)
1317 if (! bOnlyExtrudedCustomShapes
)
1318 rSet
.DisableItem( SID_EXTRUSION_DIRECTION_FLOATER
);
1320 if (rSet
.GetItemState(SID_EXTRUSION_LIGHTING_FLOATER
) != SFX_ITEM_UNKNOWN
)
1322 if (! bOnlyExtrudedCustomShapes
)
1323 rSet
.DisableItem( SID_EXTRUSION_LIGHTING_FLOATER
);
1325 if (rSet
.GetItemState(SID_EXTRUSION_SURFACE_FLOATER
) != SFX_ITEM_UNKNOWN
)
1327 if(! bOnlyExtrudedCustomShapes
)
1328 rSet
.DisableItem( SID_EXTRUSION_SURFACE_FLOATER
);
1330 if (rSet
.GetItemState(SID_EXTRUSION_TOOGLE
) != SFX_ITEM_UNKNOWN
)
1332 if( !checkForSelectedCustomShapes( pSdrView
, false ) )
1333 rSet
.DisableItem( SID_EXTRUSION_TOOGLE
);
1335 if (rSet
.GetItemState(SID_EXTRUSION_DEPTH
) != SFX_ITEM_UNKNOWN
)
1337 getExtrusionDepthState( pSdrView
, rSet
);
1339 if (rSet
.GetItemState(SID_EXTRUSION_SURFACE
) != SFX_ITEM_UNKNOWN
)
1341 getExtrusionSurfaceState( pSdrView
, rSet
);
1343 if (rSet
.GetItemState(SID_EXTRUSION_LIGHTING_INTENSITY
) != SFX_ITEM_UNKNOWN
)
1345 getExtrusionLightingIntensityState( pSdrView
, rSet
);
1348 if (rSet
.GetItemState(SID_EXTRUSION_LIGHTING_DIRECTION
) != SFX_ITEM_UNKNOWN
)
1350 getExtrusionLightingDirectionState( pSdrView
, rSet
);
1353 if (rSet
.GetItemState(SID_EXTRUSION_3D_COLOR
) != SFX_ITEM_UNKNOWN
)
1355 getExtrusionColorState( pSdrView
, rSet
);
1359 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */