summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-04-12 10:30:11 +0200
committerAndras Timar <andras.timar@collabora.com>2016-04-14 08:09:14 +0000
commita21fe59a2ad15fe579b535e58fcf2e310694d33a (patch)
tree0edd154070cdc86b79fde2813e9c8a79cd3bef31
parent11a448da6d1efae8258c4a470719aadcb72cf84d (diff)
tdf#99224 PPTX export: implement support for images with text
In case an image had text, then ShapeExport::WriteGraphicObjectShapePart() wanted to write "only the text", but PowerPointShapeExport::WriteTextShape() had no idea how to write an image, so at the end nothing was exported. (cherry picked from commit fc70e4c4e192372f77511bc6ce2bc77b9c9539be) Conflicts: sd/qa/unit/export-tests.cxx Change-Id: I6c1ad0b41d4c5dc260b952322fb8a59e7f175603 Reviewed-on: https://gerrit.libreoffice.org/24016 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--sd/qa/unit/data/odp/tdf99224.odpbin0 -> 11212 bytes
-rw-r--r--sd/qa/unit/export-tests.cxx12
-rw-r--r--sd/source/filter/eppt/pptx-epptooxml.cxx4
3 files changed, 15 insertions, 1 deletions
diff --git a/sd/qa/unit/data/odp/tdf99224.odp b/sd/qa/unit/data/odp/tdf99224.odp
new file mode 100644
index 000000000000..e52a000dec54
--- /dev/null
+++ b/sd/qa/unit/data/odp/tdf99224.odp
Binary files differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index e07693b0ff79..2c2634030167 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -145,6 +145,7 @@ public:
void testMathObjectPPT2010();
void testTdf80224();
void testTdf92527();
+ void testTdf99224();
CPPUNIT_TEST_SUITE(SdExportTest);
CPPUNIT_TEST(testFdo90607);
@@ -188,6 +189,7 @@ public:
CPPUNIT_TEST(testExportTransitionsPPTX);
CPPUNIT_TEST(testTdf92527);
+ CPPUNIT_TEST(testTdf99224);
CPPUNIT_TEST_SUITE_END();
@@ -1478,6 +1480,16 @@ void SdExportTest::testTdf92527()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf99224()
+{
+ sd::DrawDocShellRef xShell = loadURL(getURLFromSrc("/sd/qa/unit/data/odp/tdf99224.odp"), ODP);
+ xShell = saveAndReload(xShell, PPTX);
+ uno::Reference<drawing::XDrawPage> xPage = getPage(0, xShell);
+ // This was 0: the image with text was lost on export.
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xPage->getCount());
+ xShell->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sd/source/filter/eppt/pptx-epptooxml.cxx b/sd/source/filter/eppt/pptx-epptooxml.cxx
index e9b02e85cdc7..fc04a5ac9f1c 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -236,7 +236,7 @@ ShapeExport& PowerPointShapeExport::WriteTextShape( Reference< XShape > xShape )
DBG(printf( "shape(text): %s\n", USS(sShapeType) ));
- if ( sShapeType == "com.sun.star.drawing.TextShape" )
+ if ( sShapeType == "com.sun.star.drawing.TextShape" || sShapeType == "com.sun.star.drawing.GraphicObjectShape" )
{
ShapeExport::WriteTextShape( xShape );
}
@@ -277,6 +277,8 @@ ShapeExport& PowerPointShapeExport::WriteTextShape( Reference< XShape > xShape )
if( !WritePlaceholder( xShape, Title, mbMaster ) )
ShapeExport::WriteTextShape( xShape );
}
+ else
+ SAL_WARN("sd.filter", "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored");
return *this;
}