summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2023-08-15 14:42:20 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2023-08-15 16:45:47 +0200
commit6c06c8a2be3d8cbbcb8ab1aaaeb04db95114dfcb (patch)
treeda573528dfb4f0526c1aa920ff36af4dd19fafb4 /oox
parent54c158ff35ab5a0b5fa538562755638e052d51f2 (diff)
tdf#153008: srcRect may have some members negative
The overly strict check (implying that all members must be non-negative, to perform the crop) excluded valid cases where some of the members were negative, and some positive. Change-Id: I629689bdccedf9e37632a9fe14654778c0f14a6f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155717 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/fillproperties.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/oox/source/drawingml/fillproperties.cxx b/oox/source/drawingml/fillproperties.cxx
index 7e2f5185b7f6..5edc71b8bc12 100644
--- a/oox/source/drawingml/fillproperties.cxx
+++ b/oox/source/drawingml/fillproperties.cxx
@@ -826,13 +826,11 @@ void GraphicProperties::pushToPropMap( PropertyMap& rPropMap, const GraphicHelpe
aGraphCrop.Bottom = rtl::math::round( ( static_cast< double >( aOriginalSize.Height ) * oClipRect.Y2 ) / 100000 );
rPropMap.setProperty(PROP_GraphicCrop, aGraphCrop);
- bool bHasCropValues = aGraphCrop.Left != 0 || aGraphCrop.Right !=0 || aGraphCrop.Top != 0 || aGraphCrop.Bottom != 0;
- // Positive GraphicCrop values means "crop" here.
- bool bNeedCrop = aGraphCrop.Left >= 0 && aGraphCrop.Right >= 0 && aGraphCrop.Top >= 0 && aGraphCrop.Bottom >= 0;
-
- if(mbIsCustomShape && bHasCropValues && bNeedCrop)
+ if(mbIsCustomShape)
{
- xGraphic = lclCropGraphic(xGraphic, CropQuotientsFromSrcRect(oClipRect));
+ // Positive GraphicCrop values means "crop" here.
+ if (aGraphCrop.Left > 0 || aGraphCrop.Right > 0 || aGraphCrop.Top > 0 || aGraphCrop.Bottom > 0)
+ xGraphic = lclCropGraphic(xGraphic, CropQuotientsFromSrcRect(oClipRect));
}
}
}