From 1a357b7394ac7b48b72821bff1aae4706265d7a4 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Wed, 15 May 2013 09:37:27 +0200 Subject: fdo#64586: Fix incorrect import non-empty placeholders + unit test. Change-Id: Ibcb61dfa12c67fd9f93713ba7eb93f947b122f07 --- include/filter/msfilter/svdfppt.hxx | 2 +- sd/qa/unit/data/fdo64586.ppt | Bin 0 -> 71680 bytes sd/qa/unit/data/xml/fdo64586_0.xml | 31 +++++++++++++++++++++++++++++++ sd/qa/unit/import-tests.cxx | 3 ++- sd/source/filter/ppt/pptin.cxx | 3 +-- 5 files changed, 35 insertions(+), 4 deletions(-) create mode 100644 sd/qa/unit/data/fdo64586.ppt create mode 100644 sd/qa/unit/data/xml/fdo64586_0.xml diff --git a/include/filter/msfilter/svdfppt.hxx b/include/filter/msfilter/svdfppt.hxx index 6fc22afe05cd..c32b9de25556 100644 --- a/include/filter/msfilter/svdfppt.hxx +++ b/include/filter/msfilter/svdfppt.hxx @@ -1199,7 +1199,7 @@ struct ImplPPTTextObj explicit ImplPPTTextObj( PptSlidePersistEntry& rPersistEntry ) : mrPersistEntry ( rPersistEntry ) {}; }; -class PPTTextObj +class MSFILTER_DLLPUBLIC PPTTextObj { ImplPPTTextObj* mpImplTextObj; void ImplClear(); diff --git a/sd/qa/unit/data/fdo64586.ppt b/sd/qa/unit/data/fdo64586.ppt new file mode 100644 index 000000000000..62a4b11a1f23 Binary files /dev/null and b/sd/qa/unit/data/fdo64586.ppt differ diff --git a/sd/qa/unit/data/xml/fdo64586_0.xml b/sd/qa/unit/data/xml/fdo64586_0.xml new file mode 100644 index 000000000000..695fbd9ef167 --- /dev/null +++ b/sd/qa/unit/data/xml/fdo64586_0.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/sd/qa/unit/import-tests.cxx b/sd/qa/unit/import-tests.cxx index 0c6d8a72a89d..d8c8204bcb2f 100644 --- a/sd/qa/unit/import-tests.cxx +++ b/sd/qa/unit/import-tests.cxx @@ -53,7 +53,8 @@ void SdFiltersTest::testDocumentLayout() { { "odp/shapes-test.odp", "xml/shapes-test_page" }, { "pptx/fdo47434-all.pptx", "pptx/xml/fdo47434_page" }, - { "n758621.ppt", "xml/n758621_" } + { "n758621.ppt", "xml/n758621_" }, + { "fdo64586.ppt", "xml/fdo64586_" } }; for ( int i = 0; i < static_cast< int >( SAL_N_ELEMENTS( aFilesToCompare ) ); ++i ) diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx index 76b5d676eadc..9e3eab593647 100644 --- a/sd/source/filter/ppt/pptin.cxx +++ b/sd/source/filter/ppt/pptin.cxx @@ -2332,6 +2332,7 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj sal_Bool bVertical = sal_False; if ( ( pTextObj->GetShapeType() == mso_sptRectangle ) || ( pTextObj->GetShapeType() == mso_sptTextBox ) ) { + bEmptyPresObj = ( pTextObj->Count() == 0 ) || ( pTextObj->Count() == 1 && pTextObj->First()->GetTextSize() == 0 ); switch ( nPlaceholderId ) { case PPT_PLACEHOLDER_NOTESBODY : ePresObjKind = PRESOBJ_NOTES; break; @@ -2358,8 +2359,6 @@ SdrObject* ImplSdPPTImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj* pObj case PPT_PLACEHOLDER_ORGANISZATIONCHART : ePresObjKind = PRESOBJ_ORGCHART; break; } } - else - bEmptyPresObj = sal_False; }; } } -- cgit