summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2021-02-23 16:41:15 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-03-01 13:58:04 +0100
commit0229d1e058c4688abaef59c8932c902457800b8f (patch)
tree5bdcf6a7db2ff886d9c970afe82fe24f12ace83a /oox
parent7ca91edcb5e6f2fd744d15cdb67800eb99b19504 (diff)
Prevent the unnecessary lclCropGraphic call.
In case text::GraphicCrop aGraphCrop( 0, 0, 0, 0 ) we don't need to call lclCropGraphic. Change-Id: I9960900f9b5c5b770824c76ffeb9ec9b51cbaef3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111401 Tested-by: Jenkins Reviewed-by: Gülşah Köse <gulsah.kose@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111565 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/fillproperties.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index bdd81e1d0434..a67f9278b34e 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -764,7 +764,8 @@ void FillProperties::pushToPropMap( ShapePropertyMap& rPropMap,
aGraphCrop.Bottom = static_cast< sal_Int32 >( ( static_cast< double >( aOriginalSize.Height ) * aFillRect.Y2 ) / 100000 );
rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
- if(bIsCustomShape)
+ if(bIsCustomShape &&
+ ( aGraphCrop.Left != 0 || aGraphCrop.Right != 0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0))
{
xGraphic = lclCropGraphic(xGraphic, aFillRect);
rPropMap.setProperty(ShapeProperty::FillBitmap, xGraphic);
@@ -871,17 +872,17 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
if ( oClipRect.Y2 )
aGraphCrop.Bottom = rtl::math::round( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 100000 );
rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
- }
- if(mbIsCustomShape)
- {
- geometry::IntegerRectangle2D aCropRect = oClipRect;
- lclCalculateCropPercentage(xGraphic, aCropRect);
- xGraphic = lclCropGraphic(xGraphic, aCropRect);
+ if(mbIsCustomShape &&
+ ( aGraphCrop.Left != 0 || aGraphCrop.Right != 0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0))
+ {
+ geometry::IntegerRectangle2D aCropRect = oClipRect;
+ lclCalculateCropPercentage(xGraphic, aCropRect);
+ xGraphic = lclCropGraphic(xGraphic, aCropRect);
- rPropMap.setProperty(PROP_FillBitmap, xGraphic);
+ rPropMap.setProperty(PROP_FillBitmap, xGraphic);
+ }
}
-
}
if(mbIsCustomShape)