SVG: debugging svg export

Chr. Rossmanith ChrRossmanith at gmx.de
Tue Feb 28 13:36:40 PST 2012


Hi,

I'm currently debugging SVGFilter::implExportPages() especially around 
line 1336

                     // In case we are dealing with a master page we need to to group all its shapes

                     // into a group element, this group will make up the so named "background objects"

                     if( bMaster )

                     {

                         // background objects id = "bo-" + page id

                         OUString sBackgroundObjectsId = B2UCONST( "bo-" );

                         sBackgroundObjectsId += sPageId;

                         mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", sBackgroundObjectsId );

                         if( i == nVisiblePage&&  mVisiblePagePropSet.bAreBackgroundObjectsVisible )

                             aAttrVisibilityValue = B2UCONST( "visible" );

                         else

                             aAttrVisibilityValue = B2UCONST( "hidden" );

                         mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "visibility", aAttrVisibilityValue );

                         mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class",  B2UCONST( "BackgroundObjects" ) );

                         // insert the<g>  open tag related to the Background Objects

  **                     SvXMLElementExport aExp2( *mpSVGExport, XML_NAMESPACE_NONE, "g", sal_True, sal_True );

                         // append all shapes that make up the Master Slide

                         bRet = implExportShapes( xShapes ) || bRet;

                     }   // append the</g>  closing tag related to the Background Objects


The tag opened in the line marked with ** is never closed. (It should be 
closed by the destructor.) I've tested the export with a drawing 
containing a single letter 'a' and in that case there are no background 
objects. So maybe testing if xShapes has no shapes could avoid exporting 
an empty block? But how would I test if xShapes has any shapes?

Any hint concerning the never called destructor for aExp2 and retrieving 
information from xShapes is welcome.

Christina


More information about the LibreOffice mailing list