diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2016-10-29 15:31:29 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2016-10-29 16:17:06 +0000 |
commit | 1c708eee636c0cdf3da2ec62849618f3262044bc (patch) | |
tree | 9591959c2b6e3e5172d4f2189f8628c4c0f21db1 /sd | |
parent | 8a0318e4f81ed4ec8871010669a300f6aff4e80d (diff) |
tdf#103473: Ensure positive rectangle size
Also remove conversion of both negative scales into rotation,
because it is handled by flip; use strict comparison instead of
approximate float less because it's correct here, and also because
basegfx::fTools::less ultimately uses rtl_math_approxEqual, which
description states: attention
approxEqual( value!=0.0, 0.0 ) _never_ yields true.
Unit test included.
Change-Id: Ia878fce360cf8aed539d95f2d4a1a3ad94379978
Reviewed-on: https://gerrit.libreoffice.org/30373
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/qa/unit/data/pptx/tdf103473.pptx | bin | 0 -> 26752 bytes | |||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 18 |
2 files changed, 18 insertions, 0 deletions
diff --git a/sd/qa/unit/data/pptx/tdf103473.pptx b/sd/qa/unit/data/pptx/tdf103473.pptx Binary files differnew file mode 100644 index 000000000000..5b31b761d22c --- /dev/null +++ b/sd/qa/unit/data/pptx/tdf103473.pptx diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 1d0eef1adf7f..7fded515c189 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -126,6 +126,7 @@ public: void testTdf95932(); void testTdf99030(); void testTdf49561(); + void testTdf103473(); CPPUNIT_TEST_SUITE(SdImportTest); @@ -177,6 +178,7 @@ public: CPPUNIT_TEST(testTdf95932); CPPUNIT_TEST(testTdf99030); CPPUNIT_TEST(testTdf49561); + CPPUNIT_TEST(testTdf103473); CPPUNIT_TEST_SUITE_END(); }; @@ -1486,6 +1488,22 @@ void SdImportTest::testTdf49561() xDocShRef->DoClose(); } +void SdImportTest::testTdf103473() +{ + sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/tdf103473.pptx"), PPTX); + + const SdrPage *pPage = GetPage(1, xDocShRef); + SdrTextObj *const pObj = dynamic_cast<SdrTextObj *const>(pPage->GetObj(0)); + CPPUNIT_ASSERT(pObj); + Rectangle aRect = pObj->GetGeoRect(); + CPPUNIT_ASSERT_EQUAL(3629L, aRect.Left()); + CPPUNIT_ASSERT_EQUAL(4431L, aRect.Top()); + CPPUNIT_ASSERT_EQUAL(8353L, aRect.Right()); + CPPUNIT_ASSERT_EQUAL(9155L, aRect.Bottom()); + + xDocShRef->DoClose(); +} + CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); |