[Libreoffice-commits] core.git: filter/source svx/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 13 16:42:51 UTC 2021


 filter/source/msfilter/svdfppt.cxx   |   12 +++----
 svx/source/svdraw/svdoashp.cxx       |   28 ++++++++--------
 svx/source/toolbars/extrusionbar.cxx |   60 +++++++++++++++++------------------
 svx/source/toolbars/fontworkbar.cxx  |    8 ++--
 4 files changed, 54 insertions(+), 54 deletions(-)

New commits:
commit 851505db4f0514c2651d9fee6d5de9f63dd73217
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Tue Apr 13 16:10:04 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 13 18:42:00 2021 +0200

    no need to make copies of these objects
    
    when querying their values. The copy triggers heap allocation,
    which shows up when loading lots of shapes.
    
    Change-Id: I4b70e0c64b2397a97216065bd6da61daaac7f3ba
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114054
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index c2c8b8b25070..341198369bac 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -7421,16 +7421,16 @@ static void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell > const
                 {
                     eFS = css::drawing::FillStyle_BITMAP;
 
-                    const XFillBitmapItem aXFillBitmapItem(pObj->GetMergedItem( XATTR_FILLBITMAP ));
-                    uno::Reference<graphic::XGraphic> xGraphic = aXFillBitmapItem.GetGraphicObject().GetGraphic().GetXGraphic();
+                    const XFillBitmapItem & rXFillBitmapItem(pObj->GetMergedItem( XATTR_FILLBITMAP ));
+                    uno::Reference<graphic::XGraphic> xGraphic = rXFillBitmapItem.GetGraphicObject().GetGraphic().GetXGraphic();
                     uno::Reference<awt::XBitmap> xBitmap(xGraphic, uno::UNO_QUERY);
                     xPropSet->setPropertyValue("FillBitmap", uno::makeAny(xBitmap));
 
-                    const XFillBmpStretchItem aStretchItem(pObj->GetMergedItem( XATTR_FILLBMP_STRETCH ));
-                    const XFillBmpTileItem aTileItem(pObj->GetMergedItem( XATTR_FILLBMP_TILE ));
-                    if( aTileItem.GetValue() )
+                    const XFillBmpStretchItem & rStretchItem(pObj->GetMergedItem( XATTR_FILLBMP_STRETCH ));
+                    const XFillBmpTileItem & rTileItem(pObj->GetMergedItem( XATTR_FILLBMP_TILE ));
+                    if( rTileItem.GetValue() )
                         xPropSet->setPropertyValue("FillBitmapMode", uno::makeAny(drawing::BitmapMode_REPEAT));
-                    else if( aStretchItem.GetValue() )
+                    else if( rStretchItem.GetValue() )
                         xPropSet->setPropertyValue("FillBitmapMode", uno::makeAny(drawing::BitmapMode_STRETCH));
                     else
                         xPropSet->setPropertyValue("FillBitmapMode", uno::makeAny(drawing::BitmapMode_NO_REPEAT));
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 88058049cf4e..855d6e0e12ec 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -468,8 +468,8 @@ bool SdrObjCustomShape::UseNoFillStyle() const
 bool SdrObjCustomShape::IsMirroredX() const
 {
     bool bMirroredX = false;
-    SdrCustomShapeGeometryItem aGeometryItem( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-    css::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( "MirroredX" );
+    const SdrCustomShapeGeometryItem & rGeometryItem( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+    const css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "MirroredX" );
     if ( pAny )
         *pAny >>= bMirroredX;
     return bMirroredX;
@@ -477,8 +477,8 @@ bool SdrObjCustomShape::IsMirroredX() const
 bool SdrObjCustomShape::IsMirroredY() const
 {
     bool bMirroredY = false;
-    SdrCustomShapeGeometryItem aGeometryItem( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-    css::uno::Any* pAny = aGeometryItem.GetPropertyValueByName( "MirroredY" );
+    const SdrCustomShapeGeometryItem & rGeometryItem( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+    const css::uno::Any* pAny = rGeometryItem.GetPropertyValueByName( "MirroredY" );
     if ( pAny )
         *pAny >>= bMirroredY;
     return bMirroredY;
@@ -1101,9 +1101,9 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
     bool bIsDefaultGeometry = false;
 
     OUString sShapeType;
-    const SdrCustomShapeGeometryItem aGeometryItem( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+    const SdrCustomShapeGeometryItem & rGeometryItem( GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
-    const Any *pAny = aGeometryItem.GetPropertyValueByName( "Type" );
+    const Any *pAny = rGeometryItem.GetPropertyValueByName( "Type" );
     if ( pAny )
         *pAny >>= sShapeType;
 
@@ -1115,7 +1115,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
     {
         case DefaultType::Viewbox :
         {
-            const Any* pViewBox = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( "ViewBox" );
+            const Any* pViewBox = rGeometryItem.GetPropertyValueByName( "ViewBox" );
             css::awt::Rectangle aViewBox;
             if (pViewBox && (*pViewBox >>= aViewBox) && pDefCustomShape)
             {
@@ -1128,7 +1128,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
 
         case DefaultType::Path :
         {
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, "Coordinates" );
+            pAny = rGeometryItem.GetPropertyValueByName( sPath, "Coordinates" );
             if ( pAny && pDefCustomShape && pDefCustomShape->nVertices && pDefCustomShape->pVertices )
             {
                 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqCoordinates1, seqCoordinates2;
@@ -1152,7 +1152,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
 
         case DefaultType::Gluepoints :
         {
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, "GluePoints" );
+            pAny = rGeometryItem.GetPropertyValueByName( sPath, "GluePoints" );
             if ( pAny && pDefCustomShape && pDefCustomShape->nGluePoints && pDefCustomShape->pGluePoints )
             {
                 css::uno::Sequence< css::drawing::EnhancedCustomShapeParameterPair> seqGluePoints1, seqGluePoints2;
@@ -1177,7 +1177,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
         case DefaultType::Segments :
         {
             // Path/Segments
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, "Segments" );
+            pAny = rGeometryItem.GetPropertyValueByName( sPath, "Segments" );
             if ( pAny )
             {
                 css::uno::Sequence< css::drawing::EnhancedCustomShapeSegment > seqSegments1, seqSegments2;
@@ -1220,7 +1220,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
 
         case DefaultType::StretchX :
         {
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, "StretchX" );
+            pAny = rGeometryItem.GetPropertyValueByName( sPath, "StretchX" );
             if ( pAny && pDefCustomShape )
             {
                 sal_Int32 nStretchX = 0;
@@ -1237,7 +1237,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
 
         case DefaultType::StretchY :
         {
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, "StretchY" );
+            pAny = rGeometryItem.GetPropertyValueByName( sPath, "StretchY" );
             if ( pAny && pDefCustomShape )
             {
                 sal_Int32 nStretchY = 0;
@@ -1254,7 +1254,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
 
         case DefaultType::Equations :
         {
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( "Equations" );
+            pAny = rGeometryItem.GetPropertyValueByName( "Equations" );
             if ( pAny && pDefCustomShape && pDefCustomShape->nCalculation && pDefCustomShape->pCalculation )
             {
                 css::uno::Sequence< OUString > seqEquations1, seqEquations2;
@@ -1278,7 +1278,7 @@ bool SdrObjCustomShape::IsDefaultGeometry( const DefaultType eDefaultType ) cons
 
         case DefaultType::TextFrames :
         {
-            pAny = const_cast<SdrCustomShapeGeometryItem&>(aGeometryItem).GetPropertyValueByName( sPath, "TextFrames" );
+            pAny = rGeometryItem.GetPropertyValueByName( sPath, "TextFrames" );
             if ( pAny && pDefCustomShape && pDefCustomShape->nTextRect && pDefCustomShape->pTextRect )
             {
                 css::uno::Sequence< css::drawing::EnhancedCustomShapeTextFrame > seqTextFrames1, seqTextFrames2;
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 82d42ddb81ef..6fe0da43449d 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -627,12 +627,12 @@ static void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rS
         SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -644,7 +644,7 @@ static void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rS
             Position3D  aViewPoint( 3472, -3472, 25000 );
             double      fSkewAngle = -135;
 
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "ProjectionMode" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "ProjectionMode" );
             sal_Int16 nProjectionMode = sal_Int16();
             if( pAny && ( *pAny >>= nProjectionMode ) )
                 bParallel = static_cast<ProjectionMode>(nProjectionMode) == ProjectionMode_PARALLEL;
@@ -653,7 +653,7 @@ static void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rS
             {
                 double      fSkew = 50.0;
                 EnhancedCustomShapeParameterPair aSkewPropPair;
-                pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Skew" );
+                pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Skew" );
                 if( pAny && ( *pAny >>= aSkewPropPair ) )
                 {
                     aSkewPropPair.First.Value >>= fSkew;
@@ -668,12 +668,12 @@ static void getExtrusionDirectionState( SdrView const * pSdrView, SfxItemSet& rS
             {
                 double      fOriginX = 0.50;
                 double      fOriginY = -0.50;
-                pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "ViewPoint" );
+                pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "ViewPoint" );
                 if( pAny )
                     *pAny >>= aViewPoint;
 
                 EnhancedCustomShapeParameterPair aOriginPropPair;
-                pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Origin" );
+                pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Origin" );
                 if( pAny && ( *pAny >>= aOriginPropPair ) )
                 {
                     aOriginPropPair.First.Value >>= fOriginX;
@@ -777,8 +777,8 @@ static void getExtrusionProjectionState( SdrView const * pSdrView, SfxItemSet& r
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -786,10 +786,10 @@ static void getExtrusionProjectionState( SdrView const * pSdrView, SfxItemSet& r
                     continue;
             }
 
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             bool    bParallel = true;
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "ProjectionMode" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "ProjectionMode" );
             ProjectionMode eProjectionMode;
             if( pAny && ( *pAny >>= eProjectionMode ) )
                 bParallel = eProjectionMode == ProjectionMode_PARALLEL;
@@ -829,12 +829,12 @@ static void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet
         SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -845,14 +845,14 @@ static void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet
             sal_Int32 nSurface = 0; // wire frame
 
             ShadeMode eShadeMode( ShadeMode_FLAT );
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "ShadeMode" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "ShadeMode" );
             if( pAny )
                 *pAny >>= eShadeMode;
 
             if( eShadeMode == ShadeMode_FLAT )
             {
                 bool bMetal = false;
-                pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Metal" );
+                pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Metal" );
                 if( pAny )
                     *pAny >>= bMetal;
 
@@ -863,7 +863,7 @@ static void getExtrusionSurfaceState( SdrView const * pSdrView, SfxItemSet& rSet
                 else
                 {
                     double fSpecularity = 0;
-                    pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Specularity" );
+                    pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Specularity" );
                     if( pAny )
                         *pAny >>= fSpecularity;
 
@@ -914,12 +914,12 @@ static void getExtrusionDepthState( SdrView const * pSdrView, SfxItemSet& rSet )
         SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -928,7 +928,7 @@ static void getExtrusionDepthState( SdrView const * pSdrView, SfxItemSet& rSet )
             }
 
             double fDepth = 1270.0;
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Depth" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Depth" );
             if( pAny )
             {
                 EnhancedCustomShapeParameterPair aDepthPropPair;
@@ -998,12 +998,12 @@ static void getExtrusionLightingDirectionState( SdrView const * pSdrView, SfxIte
         SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -1014,11 +1014,11 @@ static void getExtrusionLightingDirectionState( SdrView const * pSdrView, SfxIte
             Direction3D aFirstLightDirection( 50000, 0, 10000 );
             Direction3D aSecondLightDirection( -50000, 0, 10000 );
 
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "FirstLightDirection" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "FirstLightDirection" );
             if( pAny )
                 *pAny >>= aFirstLightDirection;
 
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "SecondLightDirection" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "SecondLightDirection" );
             if( pAny )
                 *pAny >>= aSecondLightDirection;
 
@@ -1072,12 +1072,12 @@ static void getExtrusionLightingIntensityState( SdrView const * pSdrView, SfxIte
         SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -1086,7 +1086,7 @@ static void getExtrusionLightingIntensityState( SdrView const * pSdrView, SfxIte
             }
 
             double fBrightness = 22178.0 / 655.36;
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Brightness" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Brightness" );
             if( pAny )
                 *pAny >>= fBrightness;
 
@@ -1141,12 +1141,12 @@ static void getExtrusionColorState( SdrView const * pSdrView, SfxItemSet& rSet )
         SdrObject* pObj = rMarkList.GetMark(i)->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
 
             // see if this is an extruded customshape
             if( !bHasCustomShape )
             {
-                const Any* pAny_ = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const Any* pAny_ = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny_ )
                     *pAny_ >>= bHasCustomShape;
 
@@ -1157,7 +1157,7 @@ static void getExtrusionColorState( SdrView const * pSdrView, SfxItemSet& rSet )
             Color aColor;
 
             bool bUseColor = false;
-            pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, "Color" );
+            pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, "Color" );
             if( pAny )
                 *pAny >>= bUseColor;
 
@@ -1209,8 +1209,8 @@ bool checkForSelectedCustomShapes( SdrView const * pSdrView, bool bOnlyExtruded
         {
             if( bOnlyExtruded )
             {
-                const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-                const Any* pAny = aGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
+                const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+                const Any* pAny = rGeometryItem.GetPropertyValueByName( sExtrusion, sExtrusion );
                 if( pAny )
                     *pAny >>= bFound;
             }
diff --git a/svx/source/toolbars/fontworkbar.cxx b/svx/source/toolbars/fontworkbar.cxx
index 0fc4da30e1bf..4bb7a769ec05 100644
--- a/svx/source/toolbars/fontworkbar.cxx
+++ b/svx/source/toolbars/fontworkbar.cxx
@@ -151,8 +151,8 @@ static void SetFontWorkShapeTypeState( SdrView const * pSdrView, SfxItemSet& rSe
         SdrObject* pObj = rMarkList.GetMark( i )->GetMarkedSdrObj();
         if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
         {
-            const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-            const Any* pAny = aGeometryItem.GetPropertyValueByName( "Type" );
+            const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+            const Any* pAny = rGeometryItem.GetPropertyValueByName( "Type" );
             if( pAny )
             {
                 OUString aType;
@@ -212,8 +212,8 @@ bool checkForFontWork( SdrObject* pObj )
 
     if( dynamic_cast<const SdrObjCustomShape*>( pObj) !=  nullptr )
     {
-        const SdrCustomShapeGeometryItem aGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-        const Any* pAny = aGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
+        const SdrCustomShapeGeometryItem & rGeometryItem( pObj->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+        const Any* pAny = rGeometryItem.GetPropertyValueByName( sTextPath, sTextPath );
         if( pAny )
             *pAny >>= bFound;
     }


More information about the Libreoffice-commits mailing list