summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorMarco Cecchetti <mrcekets@gmail.com>2012-05-21 16:08:11 +0200
committerMarco Cecchetti <mrcekets@gmail.com>2012-06-15 10:14:58 +0200
commitd6b82f7bcb5123db56eb9acf4a3f3c2c90319606 (patch)
tree7ec19f5b6dd995bd0deab0d62d8081ef347af2ff /filter
parent6e0d7ce9410658dfe3e0ff53f2b98349b075e91e (diff)
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.
Diffstat (limited to 'filter')
-rw-r--r--filter/source/svg/svgexport.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index c6611a824667..0e80740addbb 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -707,6 +707,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( " " );