summaryrefslogtreecommitdiff
path: root/sd/qa
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2022-06-27 15:29:25 +0300
committerXisco Fauli <xiscofauli@libreoffice.org>2022-06-28 18:18:26 +0200
commitc0c1145d9f7aa82417bfa8194de0a27c2c556aab (patch)
tree40f65bf71074db4dcee3d45f156f33b9375173cc /sd/qa
parent66ae8a2c0e6d01d06a01fa877cf03507c0656f8d (diff)
Integer division could cancel small values of wrong sign
... as seen at some documents where the values are like -1. There the checks in pushToPropMap may pass (the division result would be 0), but the original small negative values would fail the asserts that were introduced in commit 5772cef244dbee5834efbc693bc714d89ae6301d Author Mike Kaganski <mike.kaganski@collabora.com> Date Wed Jun 15 18:33:38 2022 +0300 tdf#134210: Reimplement cropping from srcRect and fillRect Change-Id: I114588862b5cfd2b2e4491424430cc139bdbaae9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136492 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> (cherry picked from commit 2d9f3c066a065d6aa98f1e594dcf8a091fec2bde) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136471 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org> Signed-off-by: Xisco Fauli <xiscofauli@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136556
Diffstat (limited to 'sd/qa')
-rw-r--r--sd/qa/unit/data/pptx/croppedTo0.pptxbin32741 -> 12974 bytes
-rw-r--r--sd/qa/unit/import-tests2.cxx1
2 files changed, 1 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/croppedTo0.pptx b/sd/qa/unit/data/pptx/croppedTo0.pptx
index fecf53559b1f..081661f48601 100644
--- a/sd/qa/unit/data/pptx/croppedTo0.pptx
+++ b/sd/qa/unit/data/pptx/croppedTo0.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests2.cxx b/sd/qa/unit/import-tests2.cxx
index 29ef8d7c3ce9..142599fa945d 100644
--- a/sd/qa/unit/import-tests2.cxx
+++ b/sd/qa/unit/import-tests2.cxx
@@ -1996,6 +1996,7 @@ void SdImportTest2::testDefaultTabStop()
void SdImportTest2::testCropToZero()
{
// Must not crash because of division by zero
+ // Also must not fail assertions because of passing negative value to CropQuotientsFromSrcRect
loadURL(m_directories.getURLFromSrc(u"/sd/qa/unit/data/pptx/croppedTo0.pptx"), PPTX);
}