svx/source/customshapes/EnhancedCustomShape3d.cxx |   24 +++++++++++++++++++---
 1 file changed, 21 insertions(+), 3 deletions(-)

New commits:
commit 249751d2bc4c6c6704c00c83a807a3a0c0a31288
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Oct 6 17:19:28 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Oct 21 17:31:26 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>
    (cherry picked from commit 1f7220ffdf0a6188c30402cf38dab7b1f8142390)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157623
    Reviewed-by: Patrick Luby <plub...@neooffice.org>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 758953a0f64e..a401246277cc 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -341,8 +341,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 );
commit 03d40c7e9cb377a1aa93a431f8f670f78aa6fe38
Author:     Julien Nabet <serval2...@yahoo.fr>
AuthorDate: Fri Oct 6 17:29:54 2023 +0200
Commit:     Caolán McNamara <caolan.mcnam...@collabora.com>
CommitDate: Sat Oct 21 17:31:13 2023 +0200

    Related tdf#157532: deal "ShadeMode" for extruded custom shapes via BASIC 
macro
    
    Change-Id: I9ff65f58d48c2b61819533f62c42e2ab07ad4fb1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157655
    Tested-by: Jenkins
    Reviewed-by: Julien Nabet <serval2...@yahoo.fr>
    (cherry picked from commit ba86d112d01db86c1269a2db9cdb9b89e4845bbf)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157625
    Reviewed-by: Patrick Luby <plub...@neooffice.org>
    Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com>

diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx 
b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 468a1c66fa93..758953a0f64e 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -141,7 +141,16 @@ drawing::ShadeMode GetShadeMode( const 
SdrCustomShapeGeometryItem& rItem, const
     drawing::ShadeMode eRet( eDefault );
     const Any* pAny = rItem.GetPropertyValueByName( "Extrusion", "ShadeMode" );
     if ( pAny )
-        *pAny >>= eRet;
+    {
+        if (!(*pAny >>= eRet))
+        {
+            sal_Int32 nEnum = 0;
+            if(*pAny >>= nEnum)
+            {
+                eRet = static_cast<drawing::ShadeMode>(nEnum);
+            }
+        }
+    }
     return eRet;
 }
 

Reply via email to