diff options
author | Jan Holesovsky <kendy@suse.cz> | 2013-05-15 09:37:27 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2013-05-15 09:43:07 +0200 |
commit | 1a357b7394ac7b48b72821bff1aae4706265d7a4 (patch) | |
tree | c169311cfbd3d60a7d4267d1f5971a198e0c4d3c | |
parent | 5b9c27b6e5def4b55cd832626624c6c41df08989 (diff) |
fdo#64586: Fix incorrect import non-empty placeholders + unit test.
Change-Id: Ibcb61dfa12c67fd9f93713ba7eb93f947b122f07
-rw-r--r-- | include/filter/msfilter/svdfppt.hxx | 2 | ||||
-rw-r--r-- | sd/qa/unit/data/fdo64586.ppt | bin | 0 -> 71680 bytes | |||
-rw-r--r-- | sd/qa/unit/data/xml/fdo64586_0.xml | 31 | ||||
-rw-r--r-- | sd/qa/unit/import-tests.cxx | 3 | ||||
-rw-r--r-- | sd/source/filter/ppt/pptin.cxx | 3 |
5 files changed, 35 insertions, 4 deletions
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 Binary files differnew file mode 100644 index 000000000000..62a4b11a1f23 --- /dev/null +++ b/sd/qa/unit/data/fdo64586.ppt 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 @@ +<?xml version="1.0"?> +<XShapes> + <XShape positionX="1397" positionY="963" sizeX="25197" sizeY="3508" type="com.sun.star.presentation.TitleTextShape" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="0" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="3508" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName=""> + <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillHatch style="SINGLE" color="3433903" distance="20" angle="0"/> + <FillBitmap/> + <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> + <LineStart/> + <LineEnd/> + <Transformation> + <Line1 column1="25198.000000" column2="0.000000" column3="1397.000000"/> + <Line2 column1="0.000000" column2="3509.000000" column3="963.000000"/> + <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> + </Transformation> + </XShape> + <XShape positionX="1397" positionY="4912" sizeX="25197" sizeY="12181" type="com.sun.star.presentation.SubtitleShape" text="Blah" textAutoGrowHeight="true" textAutoGrowWidth="false" textContourFrame="false" textFitToSize="NONE" textHorizontalAdjust="BLOCK" textVerticalAdjust="CENTER" textLeftDistance="0" textRightDistance="0" textUpperDistance="78" textLowerDistance="0" textMaximumFrameHeight="0" textMaximumFrameWidth="0" textMinimumFrameHeight="12103" textMinimumFrameWidth="0" textAnimationAmount="0" textAnimationCount="0" textAnimationDelay="0" textAnimationDirection="LEFT" textAnimationKind="NONE" textAnimationStartInside="false" textAnimationStopInside="false" textWritingMode="LR_TB" fillStyle="NONE" fillColor="16777215" fillTransparence="0" fillTransparenceGradientName=""> + <FillTransparenceGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillGradient style="LINEAR" startColor="0" endColor="16777215" angle="0" border="0" xOffset="50" yOffset="50" startIntensity="100" endIntensity="100" stepCount="0"/> + <FillHatch style="SINGLE" color="3433903" distance="20" angle="0"/> + <FillBitmap/> + <LineDash style="RECT" dots="1" dotLen="20" dashes="1" dashLen="20" distance="20"/> + <LineStart/> + <LineEnd/> + <Transformation> + <Line1 column1="25198.000000" column2="0.000000" column3="1397.000000"/> + <Line2 column1="0.000000" column2="12182.000000" column3="4912.000000"/> + <Line3 column1="0.000000" column2="0.000000" column3="1.000000"/> + </Transformation> + </XShape> +</XShapes> 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; }; } } |