Kaydet (Commit) be7c599a authored tarafından Kurosawa Takeshi's avatar Kurosawa Takeshi Kaydeden (comit) Thorsten Behrens

fdo#33243 Fix SVG export presentation placeholder texts exported

Change-Id: I3eea9989128635616bc154466f169aed201bb5dc
üst 1e3bc292
...@@ -1552,12 +1552,12 @@ sal_Bool SVGFilter::implExportPage( const OUString & sPageId, ...@@ -1552,12 +1552,12 @@ sal_Bool SVGFilter::implExportPage( const OUString & sPageId,
SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
// append all shapes that make up the Master Slide // append all shapes that make up the Master Slide
bRet = implExportShapes( xShapes ) || bRet; bRet = implExportShapes( xShapes, true ) || bRet;
} // append the </g> closing tag related to the Background Objects } // append the </g> closing tag related to the Background Objects
else else
{ {
// append all shapes that make up the Slide // append all shapes that make up the Slide
bRet = implExportShapes( xShapes ) || bRet; bRet = implExportShapes( xShapes, false ) || bRet;
} }
} // append the </g> closing tag related to the Slide/Master_Slide } // append the </g> closing tag related to the Slide/Master_Slide
...@@ -1567,7 +1567,8 @@ sal_Bool SVGFilter::implExportPage( const OUString & sPageId, ...@@ -1567,7 +1567,8 @@ sal_Bool SVGFilter::implExportPage( const OUString & sPageId,
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes ) sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes,
sal_Bool bMaster )
{ {
Reference< XShape > xShape; Reference< XShape > xShape;
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
...@@ -1575,7 +1576,7 @@ sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes ) ...@@ -1575,7 +1576,7 @@ sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes )
for( sal_Int32 i = 0, nCount = rxShapes->getCount(); i < nCount; ++i ) for( sal_Int32 i = 0, nCount = rxShapes->getCount(); i < nCount; ++i )
{ {
if( ( rxShapes->getByIndex( i ) >>= xShape ) && xShape.is() ) if( ( rxShapes->getByIndex( i ) >>= xShape ) && xShape.is() )
bRet = implExportShape( xShape ) || bRet; bRet = implExportShape( xShape, bMaster ) || bRet;
xShape = NULL; xShape = NULL;
} }
...@@ -1585,7 +1586,8 @@ sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes ) ...@@ -1585,7 +1586,8 @@ sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes )
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape,
sal_Bool bMaster )
{ {
Reference< XPropertySet > xShapePropSet( rxShape, UNO_QUERY ); Reference< XPropertySet > xShapePropSet( rxShape, UNO_QUERY );
sal_Bool bRet = sal_False; sal_Bool bRet = sal_False;
...@@ -1600,6 +1602,13 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ...@@ -1600,6 +1602,13 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
xShapePropSet->getPropertyValue( "IsEmptyPresentationObject" ) >>= bHideObj; xShapePropSet->getPropertyValue( "IsEmptyPresentationObject" ) >>= bHideObj;
} }
OUString aShapeClass = implGetClassFromShape( rxShape );
if( bMaster )
{
if( aShapeClass == "TitleText" || aShapeClass == "Outline" )
bHideObj = true;
}
if( !bHideObj ) if( !bHideObj )
{ {
if( aShapeType.lastIndexOf( "drawing.GroupShape" ) != -1 ) if( aShapeType.lastIndexOf( "drawing.GroupShape" ) != -1 )
...@@ -1611,7 +1620,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ...@@ -1611,7 +1620,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Group" ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Group" );
SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True ); SvXMLElementExport aExp( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
bRet = implExportShapes( xShapes ); bRet = implExportShapes( xShapes, bMaster );
} }
} }
...@@ -1630,7 +1639,6 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) ...@@ -1630,7 +1639,6 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
if( rMtf.GetActionSize() ) if( rMtf.GetActionSize() )
{ // for text field shapes we set up text-adjust attributes { // for text field shapes we set up text-adjust attributes
// and set visibility to hidden // and set visibility to hidden
OUString aShapeClass = implGetClassFromShape( rxShape );
if( mbPresentation ) if( mbPresentation )
{ {
sal_Bool bIsPageNumber = ( aShapeClass == "Slide_Number" ); sal_Bool bIsPageNumber = ( aShapeClass == "Slide_Number" );
...@@ -1994,6 +2002,10 @@ OUString SVGFilter::implGetClassFromShape( const Reference< XShape >& rxShape ) ...@@ -1994,6 +2002,10 @@ OUString SVGFilter::implGetClassFromShape( const Reference< XShape >& rxShape )
aRet = "Date/Time"; aRet = "Date/Time";
else if( aShapeType.lastIndexOf( "presentation.SlideNumberShape" ) != -1 ) else if( aShapeType.lastIndexOf( "presentation.SlideNumberShape" ) != -1 )
aRet = "Slide_Number"; aRet = "Slide_Number";
else if( aShapeType.lastIndexOf( "presentation.TitleTextShape" ) != -1 )
aRet = "TitleText";
else if( aShapeType.lastIndexOf( "presentation.OutlinerShape" ) != -1 )
aRet = "Outline";
else else
aRet = aShapeType; aRet = aShapeType;
......
...@@ -289,8 +289,10 @@ private: ...@@ -289,8 +289,10 @@ private:
const Reference< XShapes > & xShapes, const Reference< XShapes > & xShapes,
sal_Bool bMaster ); sal_Bool bMaster );
sal_Bool implExportShapes( const Reference< XShapes >& rxShapes ); sal_Bool implExportShapes( const Reference< XShapes >& rxShapes,
sal_Bool implExportShape( const Reference< XShape >& rxShape ); sal_Bool bMaster );
sal_Bool implExportShape( const Reference< XShape >& rxShape,
sal_Bool bMaster );
sal_Bool implCreateObjects(); sal_Bool implCreateObjects();
sal_Bool implCreateObjectsFromShapes( const Reference< XDrawPage > & rxPage, const Reference< XShapes >& rxShapes ); sal_Bool implCreateObjectsFromShapes( const Reference< XDrawPage > & rxPage, const Reference< XShapes >& rxShapes );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment