extrusionbar.cxx (f6e50924) | extrusionbar.cxx (5ffb42a1) |
---|---|
1/************************************************************** | 1/************************************************************** |
2 * | 2 * |
3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at | 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance 9 * with the License. You may obtain a copy of the License at |
10 * | 10 * |
11 * http://www.apache.org/licenses/LICENSE-2.0 | 11 * http://www.apache.org/licenses/LICENSE-2.0 |
12 * | 12 * |
13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. | 13 * Unless required by applicable law or agreed to in writing, 14 * software distributed under the License is distributed on an 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16 * KIND, either express or implied. See the License for the 17 * specific language governing permissions and limitations 18 * under the License. |
19 * | 19 * |
20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26 27#ifndef _COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPEPARAMETERPARIR_HPP_ --- 27 unchanged lines hidden (view full) --- 55using namespace ::svx; 56using namespace ::rtl; 57using namespace ::cppu; 58using namespace ::com::sun::star::beans; 59using namespace ::com::sun::star::drawing; 60using namespace ::com::sun::star::uno; 61 62/************************************************************************* | 20 *************************************************************/ 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_svx.hxx" 26 27#ifndef _COM_SUN_STAR_DRAWING_ENHANCEDCUSTOMSHAPEPARAMETERPARIR_HPP_ --- 27 unchanged lines hidden (view full) --- 55using namespace ::svx; 56using namespace ::rtl; 57using namespace ::cppu; 58using namespace ::com::sun::star::beans; 59using namespace ::com::sun::star::drawing; 60using namespace ::com::sun::star::uno; 61 62/************************************************************************* |
63|* | |
64|* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also 65|* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt). | 63|* Standardinterface deklarieren (Die Slotmap darf nicht leer sein, also 64|* tragen wir etwas ein, was hier (hoffentlich) nie vorkommt). |
66|* | |
67\************************************************************************/ 68 69#define ShellClass ExtrusionBar 70 71SFX_SLOTMAP(ExtrusionBar) 72{ 73 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } 74}; 75 76SFX_IMPL_INTERFACE(ExtrusionBar, SfxShell, SVX_RES(RID_SVX_EXTRUSION_BAR)) 77{ 78 SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT, SVX_RES(RID_SVX_EXTRUSION_BAR) ); 79} 80 81TYPEINIT1( ExtrusionBar, SfxShell ); 82 83 84/************************************************************************* | 65\************************************************************************/ 66 67#define ShellClass ExtrusionBar 68 69SFX_SLOTMAP(ExtrusionBar) 70{ 71 { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } 72}; 73 74SFX_IMPL_INTERFACE(ExtrusionBar, SfxShell, SVX_RES(RID_SVX_EXTRUSION_BAR)) 75{ 76 SFX_OBJECTBAR_REGISTRATION( SFX_OBJECTBAR_OBJECT, SVX_RES(RID_SVX_EXTRUSION_BAR) ); 77} 78 79TYPEINIT1( ExtrusionBar, SfxShell ); 80 81 82/************************************************************************* |
85|* | |
86|* Standard-Konstruktor | 83|* Standard-Konstruktor |
87|* | |
88\************************************************************************/ 89 90ExtrusionBar::ExtrusionBar(SfxViewShell* pViewShell ) 91: SfxShell(pViewShell) 92{ 93 DBG_ASSERT( pViewShell, "svx::ExtrusionBar::ExtrusionBar(), I need a viewshell!" ); 94 if( pViewShell ) 95 SetPool(&pViewShell->GetPool()); 96 97 SetHelpId( SVX_INTERFACE_EXTRUSION_BAR ); 98 SetName( String( SVX_RES( RID_SVX_EXTRUSION_BAR ))); 99} 100 101 102/************************************************************************* | 84\************************************************************************/ 85 86ExtrusionBar::ExtrusionBar(SfxViewShell* pViewShell ) 87: SfxShell(pViewShell) 88{ 89 DBG_ASSERT( pViewShell, "svx::ExtrusionBar::ExtrusionBar(), I need a viewshell!" ); 90 if( pViewShell ) 91 SetPool(&pViewShell->GetPool()); 92 93 SetHelpId( SVX_INTERFACE_EXTRUSION_BAR ); 94 SetName( String( SVX_RES( RID_SVX_EXTRUSION_BAR ))); 95} 96 97 98/************************************************************************* |
103|* | |
104|* Destruktor | 99|* Destruktor |
105|* | |
106\************************************************************************/ 107 108ExtrusionBar::~ExtrusionBar() 109{ 110 SetRepeatTarget(NULL); 111} 112 113void getLightingDirectionDefaults( const Direction3D **pLighting1Defaults, const Direction3D **pLighting2Defaults ) --- 32 unchanged lines hidden (view full) --- 146static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj ) 147{ 148 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 149 static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) ); 150 static const rtl::OUString sRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "RotateAngle" ) ); 151 static const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) ); 152 static const rtl::OUString sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) ); 153 static const rtl::OUString sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) ); | 100\************************************************************************/ 101 102ExtrusionBar::~ExtrusionBar() 103{ 104 SetRepeatTarget(NULL); 105} 106 107void getLightingDirectionDefaults( const Direction3D **pLighting1Defaults, const Direction3D **pLighting2Defaults ) --- 32 unchanged lines hidden (view full) --- 140static void impl_execute( SdrView*, SfxRequest& rReq, SdrCustomShapeGeometryItem& rGeometryItem, SdrObject* pObj ) 141{ 142 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 143 static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) ); 144 static const rtl::OUString sRotateAngle( RTL_CONSTASCII_USTRINGPARAM ( "RotateAngle" ) ); 145 static const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) ); 146 static const rtl::OUString sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) ); 147 static const rtl::OUString sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) ); |
154 static const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) ); | 148 static const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) ); |
155 156 sal_uInt16 nSID = rReq.GetSlot(); 157 switch( nSID ) 158 { 159 case SID_EXTRUSION_TOOGLE: 160 { 161 com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion ); 162 --- 105 unchanged lines hidden (view full) --- 268 } 269 270 com::sun::star::beans::PropertyValue aPropValue; 271 272 aPropValue.Name = sViewPoint; 273 aPropValue.Value <<= aViewPoint; 274 rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); 275 | 149 150 sal_uInt16 nSID = rReq.GetSlot(); 151 switch( nSID ) 152 { 153 case SID_EXTRUSION_TOOGLE: 154 { 155 com::sun::star::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion ); 156 --- 105 unchanged lines hidden (view full) --- 262 } 263 264 com::sun::star::beans::PropertyValue aPropValue; 265 266 aPropValue.Name = sViewPoint; 267 aPropValue.Value <<= aViewPoint; 268 rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); 269 |
276 | 270 |
277 EnhancedCustomShapeParameterPair aOriginPropPair; 278 aOriginPropPair.First.Value <<= fOriginX; 279 aOriginPropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL; 280 aOriginPropPair.Second.Value <<= fOriginY; 281 aOriginPropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL; 282 aPropValue.Name = sOrigin; 283 aPropValue.Value <<= aOriginPropPair; 284 rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); --- 38 unchanged lines hidden (view full) --- 323 aPropValue.Name = sDepth; 324 aPropValue.Value <<= aDepthPropPair; 325 rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); 326 } 327 } 328 break; 329 case SID_EXTRUSION_3D_COLOR: 330 { | 271 EnhancedCustomShapeParameterPair aOriginPropPair; 272 aOriginPropPair.First.Value <<= fOriginX; 273 aOriginPropPair.First.Type = EnhancedCustomShapeParameterType::NORMAL; 274 aOriginPropPair.Second.Value <<= fOriginY; 275 aOriginPropPair.Second.Type = EnhancedCustomShapeParameterType::NORMAL; 276 aPropValue.Name = sOrigin; 277 aPropValue.Value <<= aOriginPropPair; 278 rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); --- 38 unchanged lines hidden (view full) --- 317 aPropValue.Name = sDepth; 318 aPropValue.Value <<= aDepthPropPair; 319 rGeometryItem.SetPropertyValue( sExtrusion, aPropValue ); 320 } 321 } 322 break; 323 case SID_EXTRUSION_3D_COLOR: 324 { |
331 static const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) ); | 325 static const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) ); |
332 333 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_3D_COLOR ) == SFX_ITEM_SET) 334 { 335 Color aColor( ((const SvxColorItem&)rReq.GetArgs()->Get(SID_EXTRUSION_3D_COLOR)).GetValue() ); 336 337 const bool bAuto = aColor == COL_AUTO; 338 339 com::sun::star::beans::PropertyValue aPropValue; --- 72 unchanged lines hidden (view full) --- 412 static const rtl::OUString sFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) ); 413 static const rtl::OUString sSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) ); 414 static const rtl::OUString sFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) ); 415 static const rtl::OUString sSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) ); 416 417 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_INTENSITY ) == SFX_ITEM_SET) 418 { 419 sal_Int32 nLevel = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_INTENSITY))->GetValue(); | 326 327 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_3D_COLOR ) == SFX_ITEM_SET) 328 { 329 Color aColor( ((const SvxColorItem&)rReq.GetArgs()->Get(SID_EXTRUSION_3D_COLOR)).GetValue() ); 330 331 const bool bAuto = aColor == COL_AUTO; 332 333 com::sun::star::beans::PropertyValue aPropValue; --- 72 unchanged lines hidden (view full) --- 406 static const rtl::OUString sFirstLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightHarsh" ) ); 407 static const rtl::OUString sSecondLightHarsh( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightHarsh" ) ); 408 static const rtl::OUString sFirstLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "FirstLightLevel" ) ); 409 static const rtl::OUString sSecondLightLevel( RTL_CONSTASCII_USTRINGPARAM ( "SecondLightLevel" ) ); 410 411 if( rReq.GetArgs() && rReq.GetArgs()->GetItemState( SID_EXTRUSION_LIGHTING_INTENSITY ) == SFX_ITEM_SET) 412 { 413 sal_Int32 nLevel = ((const SfxInt32Item*)rReq.GetArgs()->GetItem(SID_EXTRUSION_LIGHTING_INTENSITY))->GetValue(); |
420 | 414 |
421 double fBrightness; 422 sal_Bool bHarsh2; 423 double fLevel1; 424 double fLevel2; 425 426 switch( nLevel ) 427 { 428 case 0: // bright --- 160 unchanged lines hidden (view full) --- 589 } 590 SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); 591 impl_execute( pSdrView, rReq, aGeometryItem, pObj ); 592 pObj->SetMergedItem( aGeometryItem ); 593 pObj->BroadcastObjectChange(); 594 if( bUndo ) 595 pSdrView->EndUndo(); 596 | 415 double fBrightness; 416 sal_Bool bHarsh2; 417 double fLevel1; 418 double fLevel2; 419 420 switch( nLevel ) 421 { 422 case 0: // bright --- 160 unchanged lines hidden (view full) --- 583 } 584 SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) ); 585 impl_execute( pSdrView, rReq, aGeometryItem, pObj ); 586 pObj->SetMergedItem( aGeometryItem ); 587 pObj->BroadcastObjectChange(); 588 if( bUndo ) 589 pSdrView->EndUndo(); 590 |
597 // simulate a context change: 598 // force SelectionHasChanged() being called 599 // so that extrusion bar will be visible/hidden 600 pSdrView->MarkListHasChanged(); | 591 // simulate a context change: 592 // force SelectionHasChanged() being called 593 // so that extrusion bar will be visible/hidden 594 pSdrView->MarkListHasChanged(); |
601 } 602 } 603 } 604 break; 605 606 case SID_EXTRUSION_DEPTH_DIALOG: | 595 } 596 } 597 } 598 break; 599 600 case SID_EXTRUSION_DEPTH_DIALOG: |
607 if( rReq.GetArgs() && | 601 if( rReq.GetArgs() && |
608 (rReq.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH ) == SFX_ITEM_SET) && 609 (rReq.GetArgs()->GetItemState( SID_ATTR_METRIC ) == SFX_ITEM_SET)) 610 { 611 double fDepth = ((const SvxDoubleItem*)rReq.GetArgs()->GetItem(SID_EXTRUSION_DEPTH))->GetValue(); 612 FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)rReq.GetArgs()->GetItem(SID_ATTR_METRIC))->GetValue(); 613 614 ExtrusionDepthDialog aDlg( 0L, fDepth, eUnit ); 615 sal_uInt16 nRet = aDlg.Execute(); --- 7 unchanged lines hidden (view full) --- 623 } 624 } 625 break; 626 } 627 628 if( nSID == SID_EXTRUSION_TOOGLE ) 629 { 630 static sal_uInt16 SidArray[] = { | 602 (rReq.GetArgs()->GetItemState( SID_EXTRUSION_DEPTH ) == SFX_ITEM_SET) && 603 (rReq.GetArgs()->GetItemState( SID_ATTR_METRIC ) == SFX_ITEM_SET)) 604 { 605 double fDepth = ((const SvxDoubleItem*)rReq.GetArgs()->GetItem(SID_EXTRUSION_DEPTH))->GetValue(); 606 FieldUnit eUnit = (FieldUnit)((const SfxUInt16Item*)rReq.GetArgs()->GetItem(SID_ATTR_METRIC))->GetValue(); 607 608 ExtrusionDepthDialog aDlg( 0L, fDepth, eUnit ); 609 sal_uInt16 nRet = aDlg.Execute(); --- 7 unchanged lines hidden (view full) --- 617 } 618 } 619 break; 620 } 621 622 if( nSID == SID_EXTRUSION_TOOGLE ) 623 { 624 static sal_uInt16 SidArray[] = { |
631 SID_EXTRUSION_TILT_DOWN, | 625 SID_EXTRUSION_TILT_DOWN, |
632 SID_EXTRUSION_TILT_UP, 633 SID_EXTRUSION_TILT_LEFT, 634 SID_EXTRUSION_TILT_RIGHT, 635 SID_EXTRUSION_DEPTH_FLOATER, 636 SID_EXTRUSION_DIRECTION_FLOATER, 637 SID_EXTRUSION_LIGHTING_FLOATER, 638 SID_EXTRUSION_SURFACE_FLOATER, 639 SID_EXTRUSION_3D_COLOR, --- 14 unchanged lines hidden (view full) --- 654 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 655 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 656 657 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 658 static const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) ); 659 static const rtl::OUString sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) ); 660 static const rtl::OUString sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) ); 661 static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) ); | 626 SID_EXTRUSION_TILT_UP, 627 SID_EXTRUSION_TILT_LEFT, 628 SID_EXTRUSION_TILT_RIGHT, 629 SID_EXTRUSION_DEPTH_FLOATER, 630 SID_EXTRUSION_DIRECTION_FLOATER, 631 SID_EXTRUSION_LIGHTING_FLOATER, 632 SID_EXTRUSION_SURFACE_FLOATER, 633 SID_EXTRUSION_3D_COLOR, --- 14 unchanged lines hidden (view full) --- 648 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 649 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 650 651 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 652 static const rtl::OUString sViewPoint( RTL_CONSTASCII_USTRINGPARAM ( "ViewPoint" ) ); 653 static const rtl::OUString sOrigin( RTL_CONSTASCII_USTRINGPARAM ( "Origin" ) ); 654 static const rtl::OUString sSkew( RTL_CONSTASCII_USTRINGPARAM ( "Skew" ) ); 655 static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) ); |
662 | 656 |
663 com::sun::star::uno::Any* pAny; 664 665 double fFinalSkewAngle = -1; 666 bool bHasCustomShape = false; 667 668 for(i=0;i<nCount; i++) 669 { 670 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 131 unchanged lines hidden (view full) --- 802 803void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet ) 804{ 805 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 806 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 807 808 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 809 static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) ); | 657 com::sun::star::uno::Any* pAny; 658 659 double fFinalSkewAngle = -1; 660 bool bHasCustomShape = false; 661 662 for(i=0;i<nCount; i++) 663 { 664 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 131 unchanged lines hidden (view full) --- 796 797void getExtrusionProjectionState( SdrView* pSdrView, SfxItemSet& rSet ) 798{ 799 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 800 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 801 802 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 803 static const rtl::OUString sProjectionMode( RTL_CONSTASCII_USTRINGPARAM ( "ProjectionMode" ) ); |
810 | 804 |
811 com::sun::star::uno::Any* pAny; 812 813 sal_Int32 nFinalProjection = -1; 814 bool bHasCustomShape = false; 815 816 for(i=0;i<nCount; i++) 817 { 818 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 42 unchanged lines hidden (view full) --- 861 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 862 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 863 864 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 865 static const rtl::OUString sShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) ); 866 static const rtl::OUString sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) ); 867 static const rtl::OUString sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) ); 868 static const rtl::OUString sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) ); | 805 com::sun::star::uno::Any* pAny; 806 807 sal_Int32 nFinalProjection = -1; 808 bool bHasCustomShape = false; 809 810 for(i=0;i<nCount; i++) 811 { 812 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 42 unchanged lines hidden (view full) --- 855 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 856 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 857 858 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 859 static const rtl::OUString sShadeMode( RTL_CONSTASCII_USTRINGPARAM ( "ShadeMode" ) ); 860 static const rtl::OUString sSpecularity( RTL_CONSTASCII_USTRINGPARAM ( "Specularity" ) ); 861 static const rtl::OUString sDiffusion( RTL_CONSTASCII_USTRINGPARAM ( "Diffusion" ) ); 862 static const rtl::OUString sMetal( RTL_CONSTASCII_USTRINGPARAM ( "Metal" ) ); |
869 | 863 |
870 com::sun::star::uno::Any* pAny; 871 872 sal_Int32 nFinalSurface = -1; 873 bool bHasCustomShape = false; 874 875 for(i=0;i<nCount; i++) 876 { 877 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 7 unchanged lines hidden (view full) --- 885 Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion ); 886 if( pAny_ ) 887 *pAny_ >>= bHasCustomShape; 888 889 if( !bHasCustomShape ) 890 continue; 891 } 892 | 864 com::sun::star::uno::Any* pAny; 865 866 sal_Int32 nFinalSurface = -1; 867 bool bHasCustomShape = false; 868 869 for(i=0;i<nCount; i++) 870 { 871 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 7 unchanged lines hidden (view full) --- 879 Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion ); 880 if( pAny_ ) 881 *pAny_ >>= bHasCustomShape; 882 883 if( !bHasCustomShape ) 884 continue; 885 } 886 |
893 sal_Int32 nSurface = 0; // wire frame | 887 sal_Int32 nSurface = 0; // wireframe |
894 895 ShadeMode eShadeMode( ShadeMode_FLAT ); 896 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sShadeMode ); 897 if( pAny ) 898 *pAny >>= eShadeMode; 899 900 if( eShadeMode == ShadeMode_FLAT ) 901 { 902 sal_Bool bMetal = sal_False; 903 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sMetal ); 904 if( pAny ) 905 *pAny >>= bMetal; 906 907 if( bMetal ) 908 { 909 nSurface = 3; // metal 910 } 911 else | 888 889 ShadeMode eShadeMode( ShadeMode_FLAT ); 890 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sShadeMode ); 891 if( pAny ) 892 *pAny >>= eShadeMode; 893 894 if( eShadeMode == ShadeMode_FLAT ) 895 { 896 sal_Bool bMetal = sal_False; 897 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sMetal ); 898 if( pAny ) 899 *pAny >>= bMetal; 900 901 if( bMetal ) 902 { 903 nSurface = 3; // metal 904 } 905 else |
912 { | 906 { |
913 double fSpecularity = 0; 914 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sSpecularity ); 915 if( pAny ) 916 *pAny >>= fSpecularity; 917 918 const double e = 0.0001; 919 if( (fSpecularity > -e) && (fSpecularity < e) ) 920 { --- 26 unchanged lines hidden (view full) --- 947 948void getExtrusionDepthState( SdrView* pSdrView, SfxItemSet& rSet ) 949{ 950 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 951 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 952 953 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 954 static const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) ); | 907 double fSpecularity = 0; 908 pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sSpecularity ); 909 if( pAny ) 910 *pAny >>= fSpecularity; 911 912 const double e = 0.0001; 913 if( (fSpecularity > -e) && (fSpecularity < e) ) 914 { --- 26 unchanged lines hidden (view full) --- 941 942void getExtrusionDepthState( SdrView* pSdrView, SfxItemSet& rSet ) 943{ 944 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 945 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 946 947 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 948 static const rtl::OUString sDepth( RTL_CONSTASCII_USTRINGPARAM ( "Depth" ) ); |
955 | 949 |
956 com::sun::star::uno::Any* pAny; 957 958 double fFinalDepth = -1; 959 bool bHasCustomShape = false; 960 961 for(i=0;i<nCount; i++) 962 { 963 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 144 unchanged lines hidden (view full) --- 1108 1109void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet ) 1110{ 1111 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 1112 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 1113 1114 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 1115 static const rtl::OUString sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) ); | 950 com::sun::star::uno::Any* pAny; 951 952 double fFinalDepth = -1; 953 bool bHasCustomShape = false; 954 955 for(i=0;i<nCount; i++) 956 { 957 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 144 unchanged lines hidden (view full) --- 1102 1103void getExtrusionLightingIntensityState( SdrView* pSdrView, SfxItemSet& rSet ) 1104{ 1105 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 1106 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 1107 1108 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); 1109 static const rtl::OUString sBrightness( RTL_CONSTASCII_USTRINGPARAM ( "Brightness" ) ); |
1116 | 1110 |
1117 com::sun::star::uno::Any* pAny; 1118 1119 int nFinalLevel = -1; 1120 bool bHasCustomShape = false; 1121 1122 for(i=0;i<nCount; i++) 1123 { 1124 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 19 unchanged lines hidden (view full) --- 1144 1145 int nLevel; 1146 if( fBrightness >= 30.0 ) 1147 { 1148 nLevel = 0; // Bright 1149 } 1150 else if( fBrightness >= 10.0 ) 1151 { | 1111 com::sun::star::uno::Any* pAny; 1112 1113 int nFinalLevel = -1; 1114 bool bHasCustomShape = false; 1115 1116 for(i=0;i<nCount; i++) 1117 { 1118 SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj(); --- 19 unchanged lines hidden (view full) --- 1138 1139 int nLevel; 1140 if( fBrightness >= 30.0 ) 1141 { 1142 nLevel = 0; // Bright 1143 } 1144 else if( fBrightness >= 10.0 ) 1145 { |
1152 nLevel = 1; // Noraml; | 1146 nLevel = 1; // Normal |
1153 } 1154 else 1155 { 1156 nLevel = 2; // Dim 1157 } 1158 1159 if( nFinalLevel == -1 ) 1160 { --- 14 unchanged lines hidden (view full) --- 1175} 1176 1177void getExtrusionColorState( SdrView* pSdrView, SfxItemSet& rSet ) 1178{ 1179 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 1180 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 1181 1182 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); | 1147 } 1148 else 1149 { 1150 nLevel = 2; // Dim 1151 } 1152 1153 if( nFinalLevel == -1 ) 1154 { --- 14 unchanged lines hidden (view full) --- 1169} 1170 1171void getExtrusionColorState( SdrView* pSdrView, SfxItemSet& rSet ) 1172{ 1173 const SdrMarkList& rMarkList = pSdrView->GetMarkedObjectList(); 1174 sal_uIntPtr nCount = rMarkList.GetMarkCount(), i; 1175 1176 static const rtl::OUString sExtrusion( RTL_CONSTASCII_USTRINGPARAM ( "Extrusion" ) ); |
1183 static const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) ); | 1177 static const rtl::OUString sExtrusionColor( RTL_CONSTASCII_USTRINGPARAM ( "Color" ) ); |
1184 1185 com::sun::star::uno::Any* pAny; 1186 1187 bool bInit = false; 1188 bool bAmbigius = false; 1189 Color aFinalColor; 1190 bool bHasCustomShape = false; 1191 --- 91 unchanged lines hidden (view full) --- 1283 if (rSet.GetItemState(SID_EXTRUSION_DIRECTION) != SFX_ITEM_UNKNOWN) 1284 { 1285 getExtrusionDirectionState( pSdrView, rSet ); 1286 } 1287 if (rSet.GetItemState(SID_EXTRUSION_PROJECTION) != SFX_ITEM_UNKNOWN) 1288 { 1289 getExtrusionProjectionState( pSdrView, rSet ); 1290 } | 1178 1179 com::sun::star::uno::Any* pAny; 1180 1181 bool bInit = false; 1182 bool bAmbigius = false; 1183 Color aFinalColor; 1184 bool bHasCustomShape = false; 1185 --- 91 unchanged lines hidden (view full) --- 1277 if (rSet.GetItemState(SID_EXTRUSION_DIRECTION) != SFX_ITEM_UNKNOWN) 1278 { 1279 getExtrusionDirectionState( pSdrView, rSet ); 1280 } 1281 if (rSet.GetItemState(SID_EXTRUSION_PROJECTION) != SFX_ITEM_UNKNOWN) 1282 { 1283 getExtrusionProjectionState( pSdrView, rSet ); 1284 } |
1291 const bool bOnlyExtrudedCustomShapes = 1292 checkForSelectedCustomShapes( pSdrView, true ); | 1285 const bool bOnlyExtrudedCustomShapes = 1286 checkForSelectedCustomShapes( pSdrView, true ); |
1293 if (rSet.GetItemState(SID_EXTRUSION_TILT_DOWN) != SFX_ITEM_UNKNOWN) 1294 { 1295 if (! bOnlyExtrudedCustomShapes) 1296 rSet.DisableItem( SID_EXTRUSION_TILT_DOWN ); 1297 } 1298 if (rSet.GetItemState(SID_EXTRUSION_TILT_DOWN) != SFX_ITEM_UNKNOWN) 1299 { 1300 if (! bOnlyExtrudedCustomShapes) --- 16 unchanged lines hidden (view full) --- 1317 } 1318 if (rSet.GetItemState(SID_EXTRUSION_3D_COLOR) != SFX_ITEM_UNKNOWN) 1319 { 1320 if (! bOnlyExtrudedCustomShapes) 1321 rSet.DisableItem( SID_EXTRUSION_3D_COLOR ); 1322 } 1323 if (rSet.GetItemState(SID_EXTRUSION_DEPTH_FLOATER) != SFX_ITEM_UNKNOWN) 1324 { | 1287 if (rSet.GetItemState(SID_EXTRUSION_TILT_DOWN) != SFX_ITEM_UNKNOWN) 1288 { 1289 if (! bOnlyExtrudedCustomShapes) 1290 rSet.DisableItem( SID_EXTRUSION_TILT_DOWN ); 1291 } 1292 if (rSet.GetItemState(SID_EXTRUSION_TILT_DOWN) != SFX_ITEM_UNKNOWN) 1293 { 1294 if (! bOnlyExtrudedCustomShapes) --- 16 unchanged lines hidden (view full) --- 1311 } 1312 if (rSet.GetItemState(SID_EXTRUSION_3D_COLOR) != SFX_ITEM_UNKNOWN) 1313 { 1314 if (! bOnlyExtrudedCustomShapes) 1315 rSet.DisableItem( SID_EXTRUSION_3D_COLOR ); 1316 } 1317 if (rSet.GetItemState(SID_EXTRUSION_DEPTH_FLOATER) != SFX_ITEM_UNKNOWN) 1318 { |
1325 if (! bOnlyExtrudedCustomShapes) | 1319 if (! bOnlyExtrudedCustomShapes) |
1326 rSet.DisableItem( SID_EXTRUSION_DEPTH_FLOATER ); 1327 } 1328 if (rSet.GetItemState(SID_EXTRUSION_DIRECTION_FLOATER) != SFX_ITEM_UNKNOWN) 1329 { 1330 if (! bOnlyExtrudedCustomShapes) 1331 rSet.DisableItem( SID_EXTRUSION_DIRECTION_FLOATER ); 1332 } 1333 if (rSet.GetItemState(SID_EXTRUSION_LIGHTING_FLOATER) != SFX_ITEM_UNKNOWN) --- 37 unchanged lines hidden --- | 1320 rSet.DisableItem( SID_EXTRUSION_DEPTH_FLOATER ); 1321 } 1322 if (rSet.GetItemState(SID_EXTRUSION_DIRECTION_FLOATER) != SFX_ITEM_UNKNOWN) 1323 { 1324 if (! bOnlyExtrudedCustomShapes) 1325 rSet.DisableItem( SID_EXTRUSION_DIRECTION_FLOATER ); 1326 } 1327 if (rSet.GetItemState(SID_EXTRUSION_LIGHTING_FLOATER) != SFX_ITEM_UNKNOWN) --- 37 unchanged lines hidden --- |