[Libreoffice-commits] core.git: sd/qa sd/source
Miklos Vajna
vmiklos at collabora.co.uk
Tue Apr 12 08:31:03 UTC 2016
sd/qa/unit/data/odp/tdf99224.odp |binary
sd/qa/unit/export-tests.cxx | 12 ++++++++++++
sd/source/filter/eppt/pptx-epptooxml.cxx | 4 +++-
3 files changed, 15 insertions(+), 1 deletion(-)
New commits:
commit fc70e4c4e192372f77511bc6ce2bc77b9c9539be
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Tue Apr 12 10:30:11 2016 +0200
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.
Change-Id: I6c1ad0b41d4c5dc260b952322fb8a59e7f175603
diff --git a/sd/qa/unit/data/odp/tdf99224.odp b/sd/qa/unit/data/odp/tdf99224.odp
new file mode 100644
index 0000000..e52a000
Binary files /dev/null and b/sd/qa/unit/data/odp/tdf99224.odp differ
diff --git a/sd/qa/unit/export-tests.cxx b/sd/qa/unit/export-tests.cxx
index 59e49d2..624d290 100644
--- a/sd/qa/unit/export-tests.cxx
+++ b/sd/qa/unit/export-tests.cxx
@@ -154,6 +154,7 @@ public:
void testMathObjectPPT2010();
void testTdf80224();
void testTdf92527();
+ void testTdf99224();
CPPUNIT_TEST_SUITE(SdExportTest);
CPPUNIT_TEST(testFdo90607);
@@ -207,6 +208,7 @@ public:
CPPUNIT_TEST(testSlideNameField);
CPPUNIT_TEST(testExtFileField);
CPPUNIT_TEST(testAuthorField);
+ CPPUNIT_TEST(testTdf99224);
CPPUNIT_TEST_SUITE_END();
@@ -1690,6 +1692,16 @@ void SdExportTest::testAuthorField()
xDocShRef->DoClose();
}
+void SdExportTest::testTdf99224()
+{
+ sd::DrawDocShellRef xShell = loadURL(m_directories.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 e968e33..fdd1d4e 100644
--- a/sd/source/filter/eppt/pptx-epptooxml.cxx
+++ b/sd/source/filter/eppt/pptx-epptooxml.cxx
@@ -245,7 +245,7 @@ ShapeExport& PowerPointShapeExport::WriteTextShape( const Reference< XShape >& x
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 );
}
@@ -286,6 +286,8 @@ ShapeExport& PowerPointShapeExport::WriteTextShape( const Reference< XShape >& x
if( !WritePlaceholder( xShape, Title, mbMaster ) )
ShapeExport::WriteTextShape( xShape );
}
+ else
+ SAL_WARN("sd.filter", "PowerPointShapeExport::WriteTextShape: shape of type '" << sShapeType << "' is ignored");
return *this;
}
More information about the Libreoffice-commits
mailing list