summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-06-08 09:27:32 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-06-08 22:57:37 +0200
commitaecab50c291a535bc0ccfd30b86060faf6bea994 (patch)
treef61fb4459b176577560c51e0c2145572ba049035 /sd
parente15f7b3f670a5146516beeb05269227c0dde75cf (diff)
tdf#118037 PPT import: fix lost crop of graphic
Regression from commit b11188835d3b87cd9d2a8cdb3da204cfda5d3e6e (DOC import: lazy-read images, 2018-04-20). (cherry picked from commit 11d542352e1088a2c870b0e73e14e10266276483) Change-Id: Ie2155c971d94153352a9372a9795cbb9d820dd40 Reviewed-on: https://gerrit.libreoffice.org/55468 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/ppt/crop.pptbin0 -> 147456 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx21
2 files changed, 21 insertions, 0 deletions
diff --git a/sd/qa/unit/data/ppt/crop.ppt b/sd/qa/unit/data/ppt/crop.ppt
new file mode 100644
index 000000000000..844a4392a1d4
--- /dev/null
+++ b/sd/qa/unit/data/ppt/crop.ppt
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index 28474a88d4bb..cc2c11b01813 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -74,6 +74,7 @@
#include <com/sun/star/table/XTableRows.hpp>
#include <com/sun/star/style/NumberingType.hpp>
#include <com/sun/star/frame/Desktop.hpp>
+#include <com/sun/star/text/GraphicCrop.hpp>
#include <stlpool.hxx>
#include <comphelper/processfactory.hxx>
@@ -186,6 +187,7 @@ public:
bool checkPattern(sd::DrawDocShellRef const & rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
+ void testPptCrop();
CPPUNIT_TEST_SUITE(SdImportTest);
@@ -267,6 +269,7 @@ public:
CPPUNIT_TEST(testTdf116899);
CPPUNIT_TEST(testTdf77747);
CPPUNIT_TEST(testTdf116266);
+ CPPUNIT_TEST(testPptCrop);
CPPUNIT_TEST_SUITE_END();
};
@@ -633,6 +636,24 @@ void SdImportTest::testFdo68594()
xDocShRef->DoClose();
}
+void SdImportTest::testPptCrop()
+{
+ sd::DrawDocShellRef xDocShRef
+ = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/ppt/crop.ppt"), PPT);
+
+ uno::Reference<beans::XPropertySet> xPropertySet(
+ getShapeFromPage(/*nShape=*/1, /*nPage=*/0, xDocShRef));
+ text::GraphicCrop aCrop;
+ xPropertySet->getPropertyValue("GraphicCrop") >>= aCrop;
+ // These were all 0, lazy-loading broke cropping.
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(0), aCrop.Top);
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(0), aCrop.Bottom);
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(0), aCrop.Left);
+ CPPUNIT_ASSERT_GREATER(static_cast<sal_Int32>(0), aCrop.Right);
+
+ xDocShRef->DoClose();
+}
+
void SdImportTest::testFdo72998()
{
sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("/sd/qa/unit/data/pptx/cshapes.pptx"), PPTX);