summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Trojahn <paul.trojahn@gmail.com>2017-06-06 23:05:10 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2017-06-20 22:18:18 +0200
commitc2da33ead8b093b12ebb9a0ea9c06d156c41a3e6 (patch)
tree389912e48bfbf49fd346647f5c3be4fef79ac590
parenttdf#45904 Move remaining XCellSeries test code to C++ (diff)
downloadcore-c2da33ead8b093b12ebb9a0ea9c06d156c41a3e6.tar.gz
core-c2da33ead8b093b12ebb9a0ea9c06d156c41a3e6.zip
tdf#89064 Fix import of pages with comments and notes
importSlide removes the shapes on the page. It was used to import the comments and authors, which resulted in an empty notes page. Change-Id: I7d68085b482e5497d46e92328c413c87440714a0 Reviewed-on: https://gerrit.libreoffice.org/38648 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
-rw-r--r--oox/source/ppt/presentationfragmenthandler.cxx4
-rw-r--r--sd/qa/unit/data/pptx/tdf89064.pptxbin0 -> 24629 bytes
-rw-r--r--sd/qa/unit/import-tests.cxx13
3 files changed, 15 insertions, 2 deletions
diff --git a/oox/source/ppt/presentationfragmenthandler.cxx b/oox/source/ppt/presentationfragmenthandler.cxx
index 32a48548bac0..a41284c3177f 100644
--- a/oox/source/ppt/presentationfragmenthandler.cxx
+++ b/oox/source/ppt/presentationfragmenthandler.cxx
@@ -301,7 +301,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
pCommentAuthorsPersistPtr,
Slide ) );
- importSlide( xCommentAuthorsFragmentHandler, pCommentAuthorsPersistPtr );
+ getFilter().importFragment( xCommentAuthorsFragmentHandler );
maAuthorList.setValues( pCommentAuthorsPersistPtr->getCommentAuthors() );
}
if( !aCommentFragmentPath.isEmpty() )
@@ -323,7 +323,7 @@ void PresentationFragmentHandler::importSlide(sal_uInt32 nSlide, bool bFirstPage
pCommentsPersistPtr,
Slide ) );
pCommentsPersistPtr->getCommentsList().cmLst.clear();
- importSlide( xCommentsFragmentHandler, pCommentsPersistPtr );
+ getFilter().importFragment( xCommentsFragmentHandler );
if (!pCommentsPersistPtr->getCommentsList().cmLst.empty())
{
diff --git a/sd/qa/unit/data/pptx/tdf89064.pptx b/sd/qa/unit/data/pptx/tdf89064.pptx
new file mode 100644
index 000000000000..312496f79ad0
--- /dev/null
+++ b/sd/qa/unit/data/pptx/tdf89064.pptx
Binary files differ
diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx
index d955373ed503..73e89b3d13ff 100644
--- a/sd/qa/unit/import-tests.cxx
+++ b/sd/qa/unit/import-tests.cxx
@@ -44,6 +44,7 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XEventsSupplier.hpp>
#include <com/sun/star/presentation/ClickAction.hpp>
+#include <com/sun/star/presentation/XPresentationPage.hpp>
#include <com/sun/star/drawing/GraphicExportFilter.hpp>
#include <com/sun/star/drawing/XDrawPage.hpp>
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
@@ -158,6 +159,7 @@ public:
void testTdf105150();
void testTdf105150PPT();
void testTdf100926();
+ void testTdf89064();
bool checkPattern(sd::DrawDocShellRef& rDocRef, int nShapeNumber, std::vector<sal_uInt8>& rExpected);
void testPatternImport();
@@ -225,6 +227,7 @@ public:
CPPUNIT_TEST(testTdf105150PPT);
CPPUNIT_TEST(testTdf100926);
CPPUNIT_TEST(testPatternImport);
+ CPPUNIT_TEST(testTdf89064);
CPPUNIT_TEST_SUITE_END();
};
@@ -2183,6 +2186,16 @@ void SdImportTest::testTdf100926()
xDocShRef->DoClose();
}
+void SdImportTest::testTdf89064()
+{
+ sd::DrawDocShellRef xDocShRef = loadURL(m_directories.getURLFromSrc("sd/qa/unit/data/pptx/tdf89064.pptx"), PPTX);
+ uno::Reference< presentation::XPresentationPage > xPage (getPage(0, xDocShRef), uno::UNO_QUERY_THROW);
+ uno::Reference< drawing::XDrawPage > xNotesPage (xPage->getNotesPage(), uno::UNO_QUERY_THROW);
+ CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xNotesPage->getCount());
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();