svx/source/customshapes/EnhancedCustomShape3d.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit f1aa554cd0b471e0c9424ece7ab3d9b3d7723a1d
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Oct 6 17:19:28 2023 +0200
Commit:     Julien Nabet <serval2...@yahoo.fr>
CommitDate: Fri Oct 6 20:04:01 2023 +0200

    tdf#157532: deal "ProjectionMode" for extruded custom shapes via BASIC macro
    
    I took example on SdrTextAniDirectionItem::PutValue from 
svx/source/svdraw/svdattr.cxx
    
    Change-Id: I9165b9a310ff6bee287e7fb817502c0c99f0747b
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157654
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>

diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 468a1c66fa93..e543f490ca8a 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -332,8 +332,17 @@ rtl::Reference<SdrObject> 
EnhancedCustomShape3d::Create3DObject(
 
         drawing::ProjectionMode eProjectionMode( 
drawing::ProjectionMode_PARALLEL );
         const Any* pAny = rGeometryItem.GetPropertyValueByName( "Extrusion", 
"ProjectionMode" );
-        if ( pAny )
-            *pAny >>= eProjectionMode;
+        if (pAny)
+        {
+            if(!(*pAny >>= eProjectionMode))
+            {
+                sal_Int32 nEnum = 0;
+                if(*pAny >>= nEnum)
+                {
+                    eProjectionMode = 
static_cast<drawing::ProjectionMode>(nEnum);
+                }
+            }
+        }
         // pShape2d Convert in scenes which include 3D Objects
         E3dDefaultAttributes a3DDefaultAttr;
         a3DDefaultAttr.SetDefaultLatheCharacterMode( true );

Reply via email to