From ce331935c79e36569c883aa27ecb5ac3bb98e927 Mon Sep 17 00:00:00 2001 From: Kurosawa Takeshi Date: Sat, 22 Jan 2011 09:22:32 +0900 Subject: [PATCH] Don't export presentation placeholder texts on a master page If a shapes is neither a TitleTextPage or an OutlinerShape on a master page, mark it as a hide object. The code is based on FlashExporter::exportShape. --- filter/source/svg/svgexport.cxx | 22 +++++++++++++++++----- filter/source/svg/svgfilter.hxx | 6 ++++-- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index bc8bea7..a87761a 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -536,7 +536,7 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages, mpSVGWriter->WriteMetaFile( aNullPt, rMtf.GetPrefSize(), rMtf, SVGWRITER_WRITE_FILL ); } - bRet = implExportShapes( xShapes ) || bRet; + bRet = implExportShapes( xShapes, bMaster ) || bRet; } } } @@ -547,7 +547,8 @@ sal_Bool SVGFilter::implExportPages( const Reference< XDrawPages >& rxPages, // ----------------------------------------------------------------------------- -sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes ) +sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes, + sal_Bool bMaster ) { Reference< XShape > xShape; sal_Bool bRet = sal_False; @@ -555,7 +556,7 @@ sal_Bool SVGFilter::implExportShapes( const Reference< XShapes >& rxShapes ) for( sal_Int32 i = 0, nCount = rxShapes->getCount(); i < nCount; ++i ) { if( ( rxShapes->getByIndex( i ) >>= xShape ) && xShape.is() ) - bRet = implExportShape( xShape ) || bRet; + bRet = implExportShape( xShape, bMaster ) || bRet; xShape = NULL; } @@ -565,7 +566,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 ); sal_Bool bRet = sal_False; @@ -594,6 +596,16 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) Any aProperty; bool bValue = sal_False; + // don't export presentation placeholders on masterpage + if( bMaster ) + { + if( ( aShapeType.lastIndexOf( B2UCONST( "presentation.TitleTextShape" ) ) != -1 ) || + ( aShapeType.lastIndexOf( B2UCONST( "presentation.OutlinerShape" ) ) != -1 ) ) + { + bHideObj = true; + } + } + if( ( aShapeType.lastIndexOf( B2UCONST( "presentation.HeaderShape" ) ) != -1 ) && xPagePropSetInfo->hasPropertyByName( aHeaderString ) && ( ( aProperty = xDefaultPagePropertySet->getPropertyValue( aHeaderString ) ) >>= bValue ) && @@ -648,7 +660,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape ) xExtDocHandler->unknown( B2UCONST( "Group" ) ); } - bRet = implExportShapes( xShapes ); + bRet = implExportShapes( xShapes, bMaster ); } } diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx index 231c215..3bdeed7 100644 --- a/filter/source/svg/svgfilter.hxx +++ b/filter/source/svg/svgfilter.hxx @@ -212,8 +212,10 @@ private: sal_Int32 nFirstPage, sal_Int32 nLastPage, sal_Int32 nVisiblePage, sal_Bool bMaster ); - sal_Bool implExportShapes( const Reference< XShapes >& rxShapes ); - sal_Bool implExportShape( const Reference< XShape >& rxShape ); + sal_Bool implExportShapes( const Reference< XShapes >& rxShapes, + sal_Bool bMaster ); + sal_Bool implExportShape( const Reference< XShape >& rxShape, + sal_Bool bMaster ); sal_Bool implCreateObjects( const Reference< XDrawPages >& rxMasterPages, const Reference< XDrawPages >& rxDrawPages, -- 1.7.1