1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: extrusionbar.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_svx.hxx"
34 #ifndef _COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPEPARAMETERPARIR_HPP_
35 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
37 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
38 #include <com/sun/star/drawing/ShadeMode.hpp>
39 #include <com/sun/star/drawing/Position3D.hpp>
40 #include <com/sun/star/drawing/Direction3D.hpp>
41 #include <com/sun/star/drawing/ProjectionMode.hpp>
42 #include <svx/svdundo.hxx>
43 #include <sfx2/app.hxx>
44 #include <sfx2/request.hxx>
45 #include <sfx2/objface.hxx>
46 #include <sfx2/viewsh.hxx>
47 #include <sfx2/bindings.hxx>
48 #include <svx/xsflclit.hxx>
49 #include <svx/dialmgr.hxx>
50 #include <svx/svdoashp.hxx>
51 #ifndef _SVX_DIALOGS_HRC
52 #include <svx/dialogs.hrc>
54 #include <svx/svdview.hxx>
55 #include <svx/colritem.hxx>
56 #include "chrtitem.hxx"
58 #include <svx/extrusionbar.hxx>
59 #include "extrusioncontrols.hxx"
61 using namespace ::svx
;
62 using namespace ::rtl
;
63 using namespace ::cppu
;
64 using namespace ::com::sun::star::beans
;
65 using namespace ::com::sun::star::drawing
;
66 using namespace ::com::sun::star::uno
;
68 /*************************************************************************
70 |* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also
71 |* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt).
73 \************************************************************************/
75 #define ShellClass ExtrusionBar
77 SFX_SLOTMAP(ExtrusionBar
)
79 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }
82 SFX_IMPL_INTERFACE(ExtrusionBar
, SfxShell
, SVX_RES(RID_SVX_EXTRUSION_BAR
))
84 SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT
, SVX_RES(RID_SVX_EXTRUSION_BAR
) );
87 TYPEINIT1( ExtrusionBar
, SfxShell
);
90 /*************************************************************************
92 |* Standard-Konstruktor
94 \************************************************************************/
96 ExtrusionBar::ExtrusionBar(SfxViewShell
* pViewShell
)
97 : SfxShell(pViewShell
)
99 DBG_ASSERT( pViewShell
, "svx::ExtrusionBar::ExtrusionBar(), I need a viewshell!" );
101 SetPool(&pViewShell
->GetPool());
103 SetHelpId( SVX_INTERFACE_EXTRUSION_BAR
);
104 SetName( String( SVX_RES( RID_SVX_EXTRUSION_BAR
)));
108 /*************************************************************************
112 \************************************************************************/
114 ExtrusionBar::~ExtrusionBar()
116 SetRepeatTarget(NULL
);
119 void getLightingDirectionDefaults( const Direction3D
**pLighting1Defaults
, const Direction3D
**pLighting2Defaults
)
122 static const Direction3D aLighting1Defaults
[9] =
124 Direction3D( -50000, -50000, 10000 ),
125 Direction3D( 0, -50000, 10000 ),
126 Direction3D( 50000, -50000, 10000 ),
127 Direction3D( -50000, 0, 10000 ),
128 Direction3D( 0, 0, 10000 ),
129 Direction3D( 50000, 0, 10000 ),
130 Direction3D( -50000, 50000, 10000 ),
131 Direction3D( 0, 50000, 10000 ),
132 Direction3D( 50000, 50000, 10000 )
135 static const Direction3D aLighting2Defaults
[9] =
137 Direction3D( 50000,0, 10000 ),
138 Direction3D( 0, 50000, 10000 ),
139 Direction3D( -50000, 0, 10000 ),
140 Direction3D( 50000, 0, 10000 ),
141 Direction3D( 0, 0, 10000 ),
142 Direction3D( -50000, 0, 10000 ),
143 Direction3D( 50000, 0, 10000 ),
144 Direction3D( 0, -50000, 10000 ),
145 Direction3D( -50000, 0, 10000 )
148 *pLighting1Defaults
= (const Direction3D
*)aLighting1Defaults
;
149 *pLighting2Defaults
= (const Direction3D
*)aLighting2Defaults
;
152 static void impl_execute( SdrView
*, SfxRequest
& rReq
, SdrCustomShapeGeometryItem
& rGeometryItem
, SdrObject
* pObj
)
154 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
155 static const rtl::OUString
sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
156 static const rtl::OUString
sRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "RotateAngle" ) );
157 static const rtl::OUString
sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
158 static const rtl::OUString
sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) );
159 static const rtl::OUString
sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
160 static const rtl::OUString
sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
162 sal_uInt16 nSID
= rReq
.GetSlot();
165 case SID_EXTRUSION_TOOGLE
:
167 com::sun::star::uno::Any
* pAny
= rGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
178 com::sun::star::beans::PropertyValue aPropValue
;
179 aPropValue
.Name
= sExtrusion
;
180 aPropValue
.Value
<<= sal_True
;
181 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
186 case SID_EXTRUSION_TILT_DOWN
:
187 case SID_EXTRUSION_TILT_UP
:
188 case SID_EXTRUSION_TILT_LEFT
:
189 case SID_EXTRUSION_TILT_RIGHT
:
191 sal_Bool bHorizontal
= ( nSID
== SID_EXTRUSION_TILT_DOWN
) || ( nSID
== SID_EXTRUSION_TILT_UP
);
192 sal_Int32 nDiff
= ( nSID
== SID_EXTRUSION_TILT_LEFT
) || ( nSID
== SID_EXTRUSION_TILT_UP
) ? 5 : -5;
193 EnhancedCustomShapeParameterPair aRotateAnglePropPair
;
196 aRotateAnglePropPair
.First
.Value
<<= fX
;
197 aRotateAnglePropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
198 aRotateAnglePropPair
.Second
.Value
<<= fY
;
199 aRotateAnglePropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
200 com::sun::star::uno::Any
* pAny
= rGeometryItem
.GetPropertyValueByName( sExtrusion
, sRotateAngle
);
201 if( pAny
&& ( *pAny
>>= aRotateAnglePropPair
) )
203 aRotateAnglePropPair
.First
.Value
>>= fX
;
204 aRotateAnglePropPair
.Second
.Value
>>= fY
;
210 aRotateAnglePropPair
.First
.Value
<<= fX
;
211 aRotateAnglePropPair
.Second
.Value
<<= fY
;
212 com::sun::star::beans::PropertyValue aPropValue
;
213 aPropValue
.Name
= sRotateAngle
;
214 aPropValue
.Value
<<= aRotateAnglePropPair
;
215 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
219 case SID_EXTRUSION_DIRECTION
:
221 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_DIRECTION
) == SFX_ITEM_SET
)
223 sal_Int32 nSkew
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_DIRECTION
))->GetValue();
225 Position3D
aViewPoint( 3472, -3472, 25000 );
226 double fOriginX
= 0.50;
227 double fOriginY
= -0.50;
228 double fSkewAngle
= nSkew
;
234 aViewPoint
.PositionY
= 3472;
238 aViewPoint
.PositionX
= 0;
239 aViewPoint
.PositionY
= 3472;
244 aViewPoint
.PositionX
= -3472;
245 aViewPoint
.PositionY
= 3472;
250 aViewPoint
.PositionY
= 0;
254 aViewPoint
.PositionX
= 0;
255 aViewPoint
.PositionY
= 0;
261 aViewPoint
.PositionX
= -3472;
262 aViewPoint
.PositionY
= 0;
267 aViewPoint
.PositionX
= 0;
271 aViewPoint
.PositionX
= -3472;
276 com::sun::star::beans::PropertyValue aPropValue
;
278 aPropValue
.Name
= sViewPoint
;
279 aPropValue
.Value
<<= aViewPoint
;
280 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
283 EnhancedCustomShapeParameterPair aOriginPropPair
;
284 aOriginPropPair
.First
.Value
<<= fOriginX
;
285 aOriginPropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
286 aOriginPropPair
.Second
.Value
<<= fOriginY
;
287 aOriginPropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
288 aPropValue
.Name
= sOrigin
;
289 aPropValue
.Value
<<= aOriginPropPair
;
290 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
292 EnhancedCustomShapeParameterPair aSkewPropPair
;
293 aSkewPropPair
.First
.Value
<<= fSkew
;
294 aSkewPropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
295 aSkewPropPair
.Second
.Value
<<= fSkewAngle
;
296 aSkewPropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
297 aPropValue
.Name
= sSkew
;
298 aPropValue
.Value
<<= aSkewPropPair
;
299 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
303 case SID_EXTRUSION_PROJECTION
:
305 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_PROJECTION
) == SFX_ITEM_SET
)
307 sal_Int32 nProjection
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_PROJECTION
))->GetValue();
308 ProjectionMode eProjectionMode
= nProjection
== 1 ? ProjectionMode_PARALLEL
: ProjectionMode_PERSPECTIVE
;
309 com::sun::star::beans::PropertyValue aPropValue
;
310 aPropValue
.Name
= sProjectionMode
;
311 aPropValue
.Value
<<= eProjectionMode
;
312 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
316 case SID_EXTRUSION_DEPTH
:
318 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH
) == SFX_ITEM_SET
)
320 double fDepth
= ((const SvxDoubleItem
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_DEPTH
))->GetValue();
321 double fFraction
= 0.0;
322 EnhancedCustomShapeParameterPair aDepthPropPair
;
323 aDepthPropPair
.First
.Value
<<= fDepth
;
324 aDepthPropPair
.First
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
325 aDepthPropPair
.Second
.Value
<<= fFraction
;
326 aDepthPropPair
.Second
.Type
= EnhancedCustomShapeParameterType::NORMAL
;
328 com::sun::star::beans::PropertyValue aPropValue
;
329 aPropValue
.Name
= sDepth
;
330 aPropValue
.Value
<<= aDepthPropPair
;
331 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
335 case SID_EXTRUSION_3D_COLOR
:
337 static const rtl::OUString
sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
339 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_3D_COLOR
) == SFX_ITEM_SET
)
341 Color
aColor( ((const SvxColorItem
&)rReq
.GetArgs()->Get(SID_EXTRUSION_3D_COLOR
)).GetValue() );
343 const bool bAuto
= aColor
== COL_AUTO
;
345 com::sun::star::beans::PropertyValue aPropValue
;
346 aPropValue
.Name
= sExtrusionColor
;
347 aPropValue
.Value
<<= bAuto
? sal_False
: sal_True
;
348 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
352 pObj
->ClearMergedItem( XATTR_SECONDARYFILLCOLOR
);
356 pObj
->SetMergedItem( XSecondaryFillColorItem( String(), aColor
) );
358 pObj
->BroadcastObjectChange();
362 case SID_EXTRUSION_SURFACE
:
364 static const rtl::OUString
sShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
365 static const rtl::OUString
sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
366 static const rtl::OUString
sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
367 static const rtl::OUString
sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
369 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_SURFACE
) == SFX_ITEM_SET
)
371 sal_Int32 nSurface
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_SURFACE
))->GetValue();
373 ShadeMode
eShadeMode( ShadeMode_FLAT
);
374 sal_Bool bMetal
= sal_False
;
375 double fSpecularity
= 0;
376 double fDiffusion
= 0;
381 eShadeMode
= ShadeMode_DRAFT
;
386 fSpecularity
= 122.0;
390 fSpecularity
= 122.0;
395 com::sun::star::beans::PropertyValue aPropValue
;
396 aPropValue
.Name
= sShadeMode
;
397 aPropValue
.Value
<<= eShadeMode
;
398 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
400 aPropValue
.Name
= sMetal
;
401 aPropValue
.Value
<<= bMetal
;
402 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
404 aPropValue
.Name
= sSpecularity
;
405 aPropValue
.Value
<<= fSpecularity
;
406 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
408 aPropValue
.Name
= sDiffusion
;
409 aPropValue
.Value
<<= fDiffusion
;
410 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
414 case SID_EXTRUSION_LIGHTING_INTENSITY
:
416 static const rtl::OUString
sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
417 static const rtl::OUString
sLightFace( RTL_CONSTASCII_USTRINGPARAM ( "LightFace" ) );
418 static const rtl::OUString
sFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) );
419 static const rtl::OUString
sSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) );
420 static const rtl::OUString
sFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) );
421 static const rtl::OUString
sSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) );
423 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_INTENSITY
) == SFX_ITEM_SET
)
425 sal_Int32 nLevel
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_INTENSITY
))->GetValue();
454 com::sun::star::beans::PropertyValue aPropValue
;
455 aPropValue
.Name
= sBrightness
;
456 aPropValue
.Value
<<= fBrightness
;
457 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
459 aPropValue
.Name
= sLightFace
;
460 aPropValue
.Value
<<= sal_True
;
461 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
463 aPropValue
.Name
= sFirstLightHarsh
;
464 aPropValue
.Value
<<= sal_True
;
465 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
467 aPropValue
.Name
= sSecondLightHarsh
;
468 aPropValue
.Value
<<= bHarsh2
;
469 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
471 aPropValue
.Name
= sFirstLightLevel
;
472 aPropValue
.Value
<<= fLevel1
;
473 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
475 aPropValue
.Name
= sSecondLightLevel
;
476 aPropValue
.Value
<<= fLevel2
;
477 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
481 case SID_EXTRUSION_LIGHTING_DIRECTION
:
483 if( rReq
.GetArgs() && rReq
.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_DIRECTION
) == SFX_ITEM_SET
)
485 sal_Int32 nDirection
= ((const SfxInt32Item
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_DIRECTION
))->GetValue();
487 if((nDirection
>= 0) && (nDirection
< 9))
489 const rtl::OUString
sFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
490 const rtl::OUString
sSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
492 const Direction3D
* pLighting1Defaults
;
493 const Direction3D
* pLighting2Defaults
;
495 getLightingDirectionDefaults( &pLighting1Defaults
, &pLighting2Defaults
);
497 com::sun::star::beans::PropertyValue aPropValue
;
498 aPropValue
.Name
= sFirstLightDirection
;
499 aPropValue
.Value
<<= pLighting1Defaults
[nDirection
];
500 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
502 aPropValue
.Name
= sSecondLightDirection
;
503 aPropValue
.Value
<<= pLighting2Defaults
[nDirection
];
504 rGeometryItem
.SetPropertyValue( sExtrusion
, aPropValue
);
513 void ExtrusionBar::execute( SdrView
* pSdrView
, SfxRequest
& rReq
, SfxBindings
& rBindings
)
515 sal_uInt16 nSID
= rReq
.GetSlot();
516 sal_uInt16 nStrResId
= 0;
518 const bool bUndo
= pSdrView
&& pSdrView
->IsUndoEnabled();
522 case SID_EXTRUSION_TOOGLE
:
525 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ON_OFF
;
527 case SID_EXTRUSION_TILT_DOWN
:
530 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_DOWN
;
532 case SID_EXTRUSION_TILT_UP
:
535 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_UP
;
537 case SID_EXTRUSION_TILT_LEFT
:
540 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_LEFT
;
542 case SID_EXTRUSION_TILT_RIGHT
:
545 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ROTATE_RIGHT
;
547 case SID_EXTRUSION_DIRECTION
:
550 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_ORIENTATION
;
552 case SID_EXTRUSION_PROJECTION
:
555 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_PROJECTION
;
557 case SID_EXTRUSION_DEPTH
:
560 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_DEPTH
;
562 case SID_EXTRUSION_3D_COLOR
:
565 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_COLOR
;
567 case SID_EXTRUSION_SURFACE
:
570 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_SURFACE
;
572 case SID_EXTRUSION_LIGHTING_INTENSITY
:
575 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_BRIGHTNESS
;
577 case SID_EXTRUSION_LIGHTING_DIRECTION
:
580 nStrResId
= RID_SVXSTR_UNDO_APPLY_EXTRUSION_LIGHTING
;
582 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
583 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
585 for(i
=0; i
<nCount
; i
++)
587 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
588 if( pObj
->ISA(SdrObjCustomShape
) )
592 String
aStr( SVX_RES( nStrResId
) );
593 pSdrView
->BegUndo( aStr
);
594 pSdrView
->AddUndo( pSdrView
->GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( *pObj
) );
596 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
597 impl_execute( pSdrView
, rReq
, aGeometryItem
, pObj
);
598 pObj
->SetMergedItem( aGeometryItem
);
599 pObj
->BroadcastObjectChange();
603 // simulate a context change:
604 // force SelectionHasChanged() being called
605 // so that extrusion bar will be visible/hidden
606 pSdrView
->MarkListHasChanged();
612 case SID_EXTRUSION_DEPTH_DIALOG
:
613 if( rReq
.GetArgs() &&
614 (rReq
.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH
) == SFX_ITEM_SET
) &&
615 (rReq
.GetArgs()->GetItemState( SID_ATTR_METRIC
) == SFX_ITEM_SET
))
617 double fDepth
= ((const SvxDoubleItem
*)rReq
.GetArgs()->GetItem(SID_EXTRUSION_DEPTH
))->GetValue();
618 FieldUnit eUnit
= (FieldUnit
)((const SfxUInt16Item
*)rReq
.GetArgs()->GetItem(SID_ATTR_METRIC
))->GetValue();
620 ExtrusionDepthDialog
aDlg( 0L, fDepth
, eUnit
);
621 USHORT nRet
= aDlg
.Execute();
624 fDepth
= aDlg
.getDepth();
626 SvxDoubleItem
aItem( fDepth
, SID_EXTRUSION_DEPTH
);
627 SfxPoolItem
* aItems
[] = { &aItem
, 0 };
628 rBindings
.Execute( SID_EXTRUSION_DEPTH
, (const SfxPoolItem
**)aItems
);
634 if( nSID
== SID_EXTRUSION_TOOGLE
)
636 static USHORT SidArray
[] = {
637 SID_EXTRUSION_TILT_DOWN
,
638 SID_EXTRUSION_TILT_UP
,
639 SID_EXTRUSION_TILT_LEFT
,
640 SID_EXTRUSION_TILT_RIGHT
,
641 SID_EXTRUSION_DEPTH_FLOATER
,
642 SID_EXTRUSION_DIRECTION_FLOATER
,
643 SID_EXTRUSION_LIGHTING_FLOATER
,
644 SID_EXTRUSION_SURFACE_FLOATER
,
645 SID_EXTRUSION_3D_COLOR
,
647 SID_EXTRUSION_DIRECTION
,
648 SID_EXTRUSION_PROJECTION
,
649 SID_EXTRUSION_LIGHTING_DIRECTION
,
650 SID_EXTRUSION_LIGHTING_INTENSITY
,
651 SID_EXTRUSION_SURFACE
,
654 rBindings
.Invalidate( SidArray
);
658 void getExtrusionDirectionState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
660 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
661 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
663 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
664 static const rtl::OUString
sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) );
665 static const rtl::OUString
sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) );
666 static const rtl::OUString
sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) );
667 static const rtl::OUString
sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
669 com::sun::star::uno::Any
* pAny
;
671 double fFinalSkewAngle
= -1;
672 bool bHasCustomShape
= false;
674 for(i
=0;i
<nCount
; i
++)
676 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
677 if( pObj
->ISA(SdrObjCustomShape
) )
679 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
681 // see if this is an extruded customshape
682 if( !bHasCustomShape
)
684 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
686 *pAny_
>>= bHasCustomShape
;
688 if( !bHasCustomShape
)
692 sal_Bool bParallel
= sal_True
;
693 Position3D
aViewPoint( 3472, -3472, 25000 );
694 double fOriginX
= 0.50;
695 double fOriginY
= -0.50;
696 double fSkewAngle
= -135;
699 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sProjectionMode
);
700 sal_Int16 nProjectionMode
= sal_Int16();
701 if( pAny
&& ( *pAny
>>= nProjectionMode
) )
702 bParallel
= nProjectionMode
== ProjectionMode_PARALLEL
;
706 EnhancedCustomShapeParameterPair aSkewPropPair
;
707 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sSkew
);
708 if( pAny
&& ( *pAny
>>= aSkewPropPair
) )
710 aSkewPropPair
.First
.Value
>>= fSkew
;
711 aSkewPropPair
.Second
.Value
>>= fSkewAngle
;
715 else if ( fSkewAngle
== 0.0 )
720 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sViewPoint
);
722 *pAny
>>= aViewPoint
;
724 EnhancedCustomShapeParameterPair aOriginPropPair
;
725 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sOrigin
);
726 if( pAny
&& ( *pAny
>>= aOriginPropPair
) )
728 aOriginPropPair
.First
.Value
>>= fOriginX
;
729 aOriginPropPair
.Second
.Value
>>= fOriginY
;
732 const double e
= 0.0001;
733 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
) )
751 else if( aViewPoint
.PositionX
< -e
)
753 if( aViewPoint
.PositionY
< -e
)
755 if( ( fOriginX
< -e
) && ( fOriginY
< -e
) )
758 else if( aViewPoint
.PositionY
> e
)
760 if( ( fOriginX
< -e
) && ( fOriginY
> e
) )
765 if( ( fOriginX
< e
) && ( fOriginY
> -e
) && ( fOriginY
< e
) )
771 if( aViewPoint
.PositionY
< -e
)
773 if( ( fOriginX
> -e
) && ( fOriginX
< e
) && ( fOriginY
< -e
) )
776 else if( aViewPoint
.PositionY
> e
)
778 if( ( fOriginX
> -e
) && ( fOriginX
< e
) && ( fOriginY
> e
) )
783 if( ( fOriginX
> -e
) && ( fOriginX
< e
) && ( fOriginY
> -e
) && ( fOriginY
< e
) )
789 if( fFinalSkewAngle
== -1.0 )
791 fFinalSkewAngle
= fSkewAngle
;
793 else if( fSkewAngle
!= fFinalSkewAngle
)
795 fFinalSkewAngle
= -1.0;
798 if( fFinalSkewAngle
== -1.0 )
803 if( bHasCustomShape
)
804 rSet
.Put( SfxInt32Item( SID_EXTRUSION_DIRECTION
, (sal_Int32
)fFinalSkewAngle
) );
806 rSet
.DisableItem( SID_EXTRUSION_DIRECTION
);
809 void getExtrusionProjectionState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
811 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
812 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
814 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
815 static const rtl::OUString
sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) );
817 com::sun::star::uno::Any
* pAny
;
819 sal_Int32 nFinalProjection
= -1;
820 bool bHasCustomShape
= false;
822 for(i
=0;i
<nCount
; i
++)
824 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
825 if( pObj
->ISA(SdrObjCustomShape
) )
827 // see if this is an extruded customshape
828 if( !bHasCustomShape
)
830 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
831 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
833 *pAny_
>>= bHasCustomShape
;
835 if( !bHasCustomShape
)
839 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
841 sal_Bool bParallel
= sal_True
;
842 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sProjectionMode
);
843 ProjectionMode eProjectionMode
;
844 if( pAny
&& ( *pAny
>>= eProjectionMode
) )
845 bParallel
= eProjectionMode
== ProjectionMode_PARALLEL
;
847 if( nFinalProjection
== -1 )
849 nFinalProjection
= bParallel
;
851 else if( nFinalProjection
!= bParallel
)
853 nFinalProjection
= -1;
859 if( bHasCustomShape
)
860 rSet
.Put( SfxInt32Item( SID_EXTRUSION_PROJECTION
, nFinalProjection
) );
862 rSet
.DisableItem( SID_EXTRUSION_PROJECTION
);
865 void getExtrusionSurfaceState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
867 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
868 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
870 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
871 static const rtl::OUString
sShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) );
872 static const rtl::OUString
sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) );
873 static const rtl::OUString
sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) );
874 static const rtl::OUString
sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) );
876 com::sun::star::uno::Any
* pAny
;
878 sal_Int32 nFinalSurface
= -1;
879 bool bHasCustomShape
= false;
881 for(i
=0;i
<nCount
; i
++)
883 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
884 if( pObj
->ISA(SdrObjCustomShape
) )
886 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
888 // see if this is an extruded customshape
889 if( !bHasCustomShape
)
891 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
893 *pAny_
>>= bHasCustomShape
;
895 if( !bHasCustomShape
)
899 sal_Int32 nSurface
= 0; // wire frame
901 ShadeMode
eShadeMode( ShadeMode_FLAT
);
902 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sShadeMode
);
904 *pAny
>>= eShadeMode
;
906 if( eShadeMode
== ShadeMode_FLAT
)
908 sal_Bool bMetal
= sal_False
;
909 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sMetal
);
915 nSurface
= 3; // metal
919 double fSpecularity
= 0;
920 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sSpecularity
);
922 *pAny
>>= fSpecularity
;
924 const double e
= 0.0001;
925 if( (fSpecularity
> -e
) && (fSpecularity
< e
) )
927 nSurface
= 1; // matte
931 nSurface
= 2; // plastic
936 if( nFinalSurface
== -1 )
938 nFinalSurface
= nSurface
;
940 else if( nFinalSurface
!= nSurface
)
948 if( bHasCustomShape
)
949 rSet
.Put( SfxInt32Item( SID_EXTRUSION_SURFACE
, nFinalSurface
) );
951 rSet
.DisableItem( SID_EXTRUSION_SURFACE
);
954 void getExtrusionDepthState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
956 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
957 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
959 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
960 static const rtl::OUString
sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) );
962 com::sun::star::uno::Any
* pAny
;
964 double fFinalDepth
= -1;
965 bool bHasCustomShape
= false;
967 for(i
=0;i
<nCount
; i
++)
969 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
970 if( pObj
->ISA(SdrObjCustomShape
) )
972 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
974 // see if this is an extruded customshape
975 if( !bHasCustomShape
)
977 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
979 *pAny_
>>= bHasCustomShape
;
981 if( !bHasCustomShape
)
985 double fDepth
= 1270.0;
986 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sDepth
);
989 EnhancedCustomShapeParameterPair aDepthPropPair
;
990 if ( *pAny
>>= aDepthPropPair
)
991 aDepthPropPair
.First
.Value
>>= fDepth
;
994 if( fFinalDepth
== -1 )
996 fFinalDepth
= fDepth
;
998 else if( fFinalDepth
!= fDepth
)
1006 if( pSdrView
->GetModel() )
1008 FieldUnit eUnit
= pSdrView
->GetModel()->GetUIUnit();
1009 rSet
.Put( SfxUInt16Item( SID_ATTR_METRIC
, (USHORT
)eUnit
) );
1012 if( bHasCustomShape
)
1013 rSet
.Put( SvxDoubleItem( fFinalDepth
, SID_EXTRUSION_DEPTH
) );
1015 rSet
.DisableItem( SID_EXTRUSION_DEPTH
);
1018 static bool compare_direction( const Direction3D
& d1
, const Direction3D
& d2
)
1020 if( ((d1
.DirectionX
< 0) && (d2
.DirectionX
< 0)) || ((d1
.DirectionX
== 0) && (d2
.DirectionX
== 0)) || ((d1
.DirectionX
> 0) && (d2
.DirectionX
> 0)) )
1022 if( ((d1
.DirectionY
< 0) && (d2
.DirectionY
< 0)) || ((d1
.DirectionY
== 0) && (d2
.DirectionY
== 0)) || ((d1
.DirectionY
> 0) && (d2
.DirectionY
> 0)) )
1024 if( ((d1
.DirectionZ
< 0) && (d2
.DirectionZ
< 0)) || ((d1
.DirectionZ
== 0) && (d2
.DirectionZ
== 0)) || ((d1
.DirectionZ
> 0) && (d2
.DirectionZ
> 0)) )
1034 void getExtrusionLightingDirectionState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1036 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1037 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
1039 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
1040 static const rtl::OUString
sFirstLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightDirection" ) );
1041 static const rtl::OUString
sSecondLightDirection( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightDirection" ) );
1043 const Direction3D
* pLighting1Defaults
;
1044 const Direction3D
* pLighting2Defaults
;
1046 getLightingDirectionDefaults( &pLighting1Defaults
, &pLighting2Defaults
);
1048 com::sun::star::uno::Any
* pAny
;
1050 int nFinalDirection
= -1;
1051 bool bHasCustomShape
= false;
1053 for(i
=0;i
<nCount
; i
++)
1055 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1056 if( pObj
->ISA(SdrObjCustomShape
) )
1058 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1060 // see if this is an extruded customshape
1061 if( !bHasCustomShape
)
1063 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1065 *pAny_
>>= bHasCustomShape
;
1067 if( !bHasCustomShape
)
1071 Direction3D
aFirstLightDirection( 50000, 0, 10000 );
1072 Direction3D
aSecondLightDirection( -50000, 0, 10000 );
1074 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sFirstLightDirection
);
1076 *pAny
>>= aFirstLightDirection
;
1078 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sSecondLightDirection
);
1080 *pAny
>>= aSecondLightDirection
;
1082 int nDirection
= -1;
1085 for( j
= 0; j
< 9; j
++ )
1087 if( compare_direction( aFirstLightDirection
, pLighting1Defaults
[j
] ) &&
1088 compare_direction( aSecondLightDirection
, pLighting2Defaults
[j
] ))
1095 if( nFinalDirection
== -1 )
1097 nFinalDirection
= nDirection
;
1099 else if( nDirection
!= nFinalDirection
)
1101 nFinalDirection
= -1;
1104 if( nFinalDirection
== -1 )
1109 if( bHasCustomShape
)
1110 rSet
.Put( SfxInt32Item( SID_EXTRUSION_LIGHTING_DIRECTION
, (sal_Int32
)nFinalDirection
) );
1112 rSet
.DisableItem( SID_EXTRUSION_LIGHTING_DIRECTION
);
1115 void getExtrusionLightingIntensityState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1117 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1118 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
1120 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
1121 static const rtl::OUString
sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) );
1123 com::sun::star::uno::Any
* pAny
;
1125 int nFinalLevel
= -1;
1126 bool bHasCustomShape
= false;
1128 for(i
=0;i
<nCount
; i
++)
1130 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1131 if( pObj
->ISA(SdrObjCustomShape
) )
1133 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1135 // see if this is an extruded customshape
1136 if( !bHasCustomShape
)
1138 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1140 *pAny_
>>= bHasCustomShape
;
1142 if( !bHasCustomShape
)
1146 double fBrightness
= 22178.0 / 655.36;
1147 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sBrightness
);
1149 *pAny
>>= fBrightness
;
1152 if( fBrightness
>= 30.0 )
1154 nLevel
= 0; // Bright
1156 else if( fBrightness
>= 10.0 )
1158 nLevel
= 1; // Noraml;
1165 if( nFinalLevel
== -1 )
1167 nFinalLevel
= nLevel
;
1169 else if( nFinalLevel
!= nLevel
)
1177 if( bHasCustomShape
)
1178 rSet
.Put( SfxInt32Item( SID_EXTRUSION_LIGHTING_INTENSITY
, nFinalLevel
) );
1180 rSet
.DisableItem( SID_EXTRUSION_LIGHTING_INTENSITY
);
1183 void getExtrusionColorState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1185 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1186 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
1188 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
1189 static const rtl::OUString
sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) );
1191 com::sun::star::uno::Any
* pAny
;
1194 bool bAmbigius
= false;
1196 bool bHasCustomShape
= false;
1198 for(i
=0;i
<nCount
; i
++)
1200 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1201 if( pObj
->ISA(SdrObjCustomShape
) )
1203 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1205 // see if this is an extruded customshape
1206 if( !bHasCustomShape
)
1208 Any
* pAny_
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1210 *pAny_
>>= bHasCustomShape
;
1212 if( !bHasCustomShape
)
1218 bool bUseColor
= false;
1219 pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusionColor
);
1221 *pAny
>>= bUseColor
;
1225 const XSecondaryFillColorItem
& rItem
= *(XSecondaryFillColorItem
*)&(pObj
->GetMergedItem( XATTR_SECONDARYFILLCOLOR
));
1226 aColor
= rItem
.GetColorValue();
1235 aFinalColor
= aColor
;
1238 else if( aFinalColor
!= aColor
)
1247 aFinalColor
= COL_AUTO
;
1249 if( bHasCustomShape
)
1250 rSet
.Put( SvxColorItem( aFinalColor
, SID_EXTRUSION_3D_COLOR
) );
1252 rSet
.DisableItem( SID_EXTRUSION_3D_COLOR
);
1256 bool checkForSelectedCustomShapes( SdrView
* pSdrView
, bool bOnlyExtruded
)
1258 static const rtl::OUString
sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) );
1260 const SdrMarkList
& rMarkList
= pSdrView
->GetMarkedObjectList();
1261 ULONG nCount
= rMarkList
.GetMarkCount(), i
;
1262 bool bFound
= false;
1264 for(i
=0;(i
<nCount
) && !bFound
; i
++)
1266 SdrObject
* pObj
= rMarkList
.GetMark(i
)->GetMarkedSdrObj();
1267 if( pObj
->ISA(SdrObjCustomShape
) )
1271 SdrCustomShapeGeometryItem
aGeometryItem( (SdrCustomShapeGeometryItem
&)pObj
->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY
) );
1272 Any
* pAny
= aGeometryItem
.GetPropertyValueByName( sExtrusion
, sExtrusion
);
1287 void ExtrusionBar::getState( SdrView
* pSdrView
, SfxItemSet
& rSet
)
1289 if (rSet
.GetItemState(SID_EXTRUSION_DIRECTION
) != SFX_ITEM_UNKNOWN
)
1291 getExtrusionDirectionState( pSdrView
, rSet
);
1293 if (rSet
.GetItemState(SID_EXTRUSION_PROJECTION
) != SFX_ITEM_UNKNOWN
)
1295 getExtrusionProjectionState( pSdrView
, rSet
);
1297 const bool bOnlyExtrudedCustomShapes
=
1298 checkForSelectedCustomShapes( pSdrView
, true );
1299 if (rSet
.GetItemState(SID_EXTRUSION_TILT_DOWN
) != SFX_ITEM_UNKNOWN
)
1301 if (! bOnlyExtrudedCustomShapes
)
1302 rSet
.DisableItem( SID_EXTRUSION_TILT_DOWN
);
1304 if (rSet
.GetItemState(SID_EXTRUSION_TILT_DOWN
) != SFX_ITEM_UNKNOWN
)
1306 if (! bOnlyExtrudedCustomShapes
)
1307 rSet
.DisableItem( SID_EXTRUSION_TILT_DOWN
);
1309 if (rSet
.GetItemState(SID_EXTRUSION_TILT_UP
) != SFX_ITEM_UNKNOWN
)
1311 if (! bOnlyExtrudedCustomShapes
)
1312 rSet
.DisableItem( SID_EXTRUSION_TILT_UP
);
1314 if (rSet
.GetItemState(SID_EXTRUSION_TILT_LEFT
) != SFX_ITEM_UNKNOWN
)
1316 if (! bOnlyExtrudedCustomShapes
)
1317 rSet
.DisableItem( SID_EXTRUSION_TILT_LEFT
);
1319 if (rSet
.GetItemState(SID_EXTRUSION_TILT_RIGHT
) != SFX_ITEM_UNKNOWN
)
1321 if (! bOnlyExtrudedCustomShapes
)
1322 rSet
.DisableItem( SID_EXTRUSION_TILT_RIGHT
);
1324 if (rSet
.GetItemState(SID_EXTRUSION_3D_COLOR
) != SFX_ITEM_UNKNOWN
)
1326 if (! bOnlyExtrudedCustomShapes
)
1327 rSet
.DisableItem( SID_EXTRUSION_3D_COLOR
);
1329 if (rSet
.GetItemState(SID_EXTRUSION_DEPTH_FLOATER
) != SFX_ITEM_UNKNOWN
)
1331 if (! bOnlyExtrudedCustomShapes
)
1332 rSet
.DisableItem( SID_EXTRUSION_DEPTH_FLOATER
);
1334 if (rSet
.GetItemState(SID_EXTRUSION_DIRECTION_FLOATER
) != SFX_ITEM_UNKNOWN
)
1336 if (! bOnlyExtrudedCustomShapes
)
1337 rSet
.DisableItem( SID_EXTRUSION_DIRECTION_FLOATER
);
1339 if (rSet
.GetItemState(SID_EXTRUSION_LIGHTING_FLOATER
) != SFX_ITEM_UNKNOWN
)
1341 if (! bOnlyExtrudedCustomShapes
)
1342 rSet
.DisableItem( SID_EXTRUSION_LIGHTING_FLOATER
);
1344 if (rSet
.GetItemState(SID_EXTRUSION_SURFACE_FLOATER
) != SFX_ITEM_UNKNOWN
)
1346 if(! bOnlyExtrudedCustomShapes
)
1347 rSet
.DisableItem( SID_EXTRUSION_SURFACE_FLOATER
);
1349 if (rSet
.GetItemState(SID_EXTRUSION_TOOGLE
) != SFX_ITEM_UNKNOWN
)
1351 if( !checkForSelectedCustomShapes( pSdrView
, false ) )
1352 rSet
.DisableItem( SID_EXTRUSION_TOOGLE
);
1354 if (rSet
.GetItemState(SID_EXTRUSION_DEPTH
) != SFX_ITEM_UNKNOWN
)
1356 getExtrusionDepthState( pSdrView
, rSet
);
1358 if (rSet
.GetItemState(SID_EXTRUSION_SURFACE
) != SFX_ITEM_UNKNOWN
)
1360 getExtrusionSurfaceState( pSdrView
, rSet
);
1362 if (rSet
.GetItemState(SID_EXTRUSION_LIGHTING_INTENSITY
) != SFX_ITEM_UNKNOWN
)
1364 getExtrusionLightingIntensityState( pSdrView
, rSet
);
1367 if (rSet
.GetItemState(SID_EXTRUSION_LIGHTING_DIRECTION
) != SFX_ITEM_UNKNOWN
)
1369 getExtrusionLightingDirectionState( pSdrView
, rSet
);
1372 if (rSet
.GetItemState(SID_EXTRUSION_3D_COLOR
) != SFX_ITEM_UNKNOWN
)
1374 getExtrusionColorState( pSdrView
, rSet
);