From f1aa554cd0b471e0c9424ece7ab3d9b3d7723a1d Mon Sep 17 00:00:00 2001 From: Julien Nabet Date: Fri, 6 Oct 2023 17:19:28 +0200 Subject: 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 --- svx/source/customshapes/EnhancedCustomShape3d.cxx | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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 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(nEnum); + } + } + } // pShape2d Convert in scenes which include 3D Objects E3dDefaultAttributes a3DDefaultAttr; a3DDefaultAttr.SetDefaultLatheCharacterMode( true ); -- cgit