[Libreoffice-commits] core.git: filter/source

Kurosawa Takeshi taken.spc at gmail.com
Fri Nov 15 16:29:02 PST 2013


 filter/source/svg/svgexport.cxx |   26 +++++++++++++++++++-------
 filter/source/svg/svgfilter.hxx |    6 ++++--
 2 files changed, 23 insertions(+), 9 deletions(-)

New commits:
commit be7c599a125df6946c1b5a1233cda27740081273
Author: Kurosawa Takeshi <taken.spc at gmail.com>
Date:   Sat Nov 16 01:25:50 2013 +0100

    fdo#33243 Fix SVG export presentation placeholder texts exported
    
    Change-Id: I3eea9989128635616bc154466f169aed201bb5dc

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 6bdfdb1..6065416 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -1552,12 +1552,12 @@ sal_Bool SVGFilter::implExportPage( const OUString & sPageId,
             SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );
 
             // 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
         else
         {
             // 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
 
@@ -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;
     sal_Bool            bRet = sal_False;
@@ -1575,7 +1576,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;
     }
@@ -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 );
     sal_Bool                    bRet = sal_False;
@@ -1600,6 +1602,13 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
             xShapePropSet->getPropertyValue( "IsEmptyPresentationObject" )  >>= bHideObj;
         }
 
+        OUString aShapeClass = implGetClassFromShape( rxShape );
+        if( bMaster )
+        {
+            if( aShapeClass == "TitleText" || aShapeClass == "Outline" )
+                bHideObj = true;
+        }
+
         if( !bHideObj )
         {
             if( aShapeType.lastIndexOf( "drawing.GroupShape" ) != -1 )
@@ -1611,7 +1620,7 @@ sal_Bool SVGFilter::implExportShape( const Reference< XShape >& rxShape )
                     mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "Group" );
                     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 )
                 if( rMtf.GetActionSize() )
                 {   // for text field shapes we set up text-adjust attributes
                     // and set visibility to hidden
-                    OUString aShapeClass = implGetClassFromShape( rxShape );
                     if( mbPresentation )
                     {
                         sal_Bool bIsPageNumber  = ( aShapeClass == "Slide_Number" );
@@ -1994,6 +2002,10 @@ OUString SVGFilter::implGetClassFromShape( const Reference< XShape >& rxShape )
         aRet = "Date/Time";
     else if( aShapeType.lastIndexOf( "presentation.SlideNumberShape" ) != -1 )
         aRet = "Slide_Number";
+    else if( aShapeType.lastIndexOf( "presentation.TitleTextShape" ) != -1 )
+        aRet = "TitleText";
+    else if( aShapeType.lastIndexOf( "presentation.OutlinerShape" ) != -1 )
+        aRet = "Outline";
     else
         aRet = aShapeType;
 
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index c4d133b..85fab2b 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -289,8 +289,10 @@ private:
                                                         const Reference< XShapes > & xShapes,
                                                         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();
     sal_Bool                            implCreateObjectsFromShapes( const Reference< XDrawPage > & rxPage, const Reference< XShapes >& rxShapes );


More information about the Libreoffice-commits mailing list