Kaydet (Commit) 1e9bbd1b authored tarafından Chr. Rossmanith's avatar Chr. Rossmanith Kaydeden (comit) Thorsten Behrens

tdf#56467 / tdf#88117: SVG export further improved

omitting the clip-path from the <svg> element and keeping it only in
the slides enables rendering of exported selection in viewers like
firefox and inkscape

Change-Id: If296a78a3f948728e8b2ec257849be129bec5d92
Reviewed-on: https://gerrit.libreoffice.org/15155Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarThorsten Behrens <Thorsten.Behrens@CIB.de>
üst 9c3d4419
...@@ -796,13 +796,9 @@ bool SVGFilter::implExportDocument() ...@@ -796,13 +796,9 @@ bool SVGFilter::implExportDocument()
aAttr += OUString::number(nDocWidth) + " " + OUString::number(nDocHeight); aAttr += OUString::number(nDocWidth) + " " + OUString::number(nDocHeight);
msClipPathId = "presentation_clip_path";
OUString sClipPathAttrValue = "url(#" + msClipPathId + ")";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "viewBox", aAttr );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", "xMidYMid" ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "preserveAspectRatio", "xMidYMid" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", "evenodd" ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "fill-rule", "evenodd" );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clip-path", sClipPathAttrValue );
// standard line width is based on 1 pixel on a 90 DPI device (0.28222mmm) // standard line width is based on 1 pixel on a 90 DPI device (0.28222mmm)
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-width", OUString::number( 28.222 ) ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "stroke-width", OUString::number( 28.222 ) );
...@@ -819,6 +815,7 @@ bool SVGFilter::implExportDocument() ...@@ -819,6 +815,7 @@ bool SVGFilter::implExportDocument()
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "ClipPathGroup" ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "class", "ClipPathGroup" );
SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true ); SvXMLElementExport aDefsElem( *mpSVGExport, XML_NAMESPACE_NONE, "defs", true, true );
{ {
msClipPathId = "presentation_clip_path";
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", msClipPathId ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "id", msClipPathId );
mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" ); mpSVGExport->AddAttribute( XML_NAMESPACE_NONE, "clipPathUnits", "userSpaceOnUse" );
SvXMLElementExport aClipPathElem( *mpSVGExport, XML_NAMESPACE_NONE, "clipPath", true, true ); SvXMLElementExport aClipPathElem( *mpSVGExport, XML_NAMESPACE_NONE, "clipPath", true, true );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment