[Libreoffice-commits] .: Branch 'feature/svg-export' - filter/source
Marco Cecchetti
mcecchetti at kemper.freedesktop.org
Mon May 21 07:29:52 PDT 2012
filter/source/svg/svgexport.cxx | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
New commits:
commit 0fb8a4ef462f53ec8ac8aa0ff8bc78884e0d223d
Author: Marco Cecchetti <mrcekets at gmail.com>
Date: Mon May 21 16:08:11 2012 +0200
In order to fix bug 43060 the width and height attributes are exported with units (mm) for the <svg> element when a single slide/page is exported.
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index e73074a..39e8feb 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -704,6 +704,24 @@ sal_Bool SVGFilter::implExportDocument()
if( mpSVGExport->IsUseTinyProfile() )
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "baseProfile", B2UCONST( "tiny" ) );
+ // enabling _SVG_WRITE_EXTENTS means that the slide size is not adapted
+ // to the size of the browser window, moreover the slide is top left aligned
+ // instead of centered.
+ #define _SVG_WRITE_EXTENTS
+ #ifdef _SVG_WRITE_EXTENTS
+ if( mbSinglePage )
+ {
+ aAttr = OUString::valueOf( nDocWidth * 0.01 );
+ aAttr += B2UCONST( "mm" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "width", aAttr );
+
+ aAttr = OUString::valueOf( nDocHeight * 0.01 );
+ aAttr += B2UCONST( "mm" );
+ mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "height", aAttr );
+ }
+ #endif
+
+
aAttr = B2UCONST( "0 0 " );
aAttr += OUString::valueOf( nDocWidth );
aAttr += B2UCONST( " " );
More information about the Libreoffice-commits
mailing list