filter/qa/unit/data/dashedline.fodg | 28 ++++++++++++++++++++++++++++ filter/qa/unit/svg.cxx | 14 ++++++++++++++ filter/source/svg/svgwriter.cxx | 12 ++++++++++++ oox/source/export/vmlexport.cxx | 2 +- oox/source/vml/vmlshapecontext.cxx | 7 ++++++- 5 files changed, 61 insertions(+), 2 deletions(-)
New commits: commit c6719b653145a327e9bf1958f1c3d78a0ff826b2 Author: Noel Grandin <[email protected]> AuthorDate: Thu Jan 15 16:03:07 2026 +0200 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Jan 20 16:39:54 2026 +0100 officeotron: attribute signinginstructions should not have a namespace prefix we end up with <o:signatureline ... o:signinginstructions="Check the machines!" where the "o:" prefix on signinginstructions is incorrect. Just to be safe, when loading, try both the old and the new style. However, this does mean that creating such data on a new version of LO, and then sending it to someone with an old version of LO, this data will be lost. Change-Id: I3ec366a2de1ba4945aae1ff67656eda0868333e1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197427 Tested-by: Jenkins Reviewed-by: Michael Stahl <[email protected]> (cherry picked from commit bf5cc0ae565fb3a11c4cb6b081f99f6daea26dfb) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197562 Reviewed-by: Xisco Fauli <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197646 diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index 529e6d99e82b..d995e7e61c9e 100644 --- a/oox/source/export/vmlexport.cxx +++ b/oox/source/export/vmlexport.cxx @@ -711,7 +711,7 @@ void VMLExport::Commit( EscherPropertyContainer& rProps, const tools::Rectangle& { pAttrListSignatureLine->add(XML_signinginstructionsset, "t"); pAttrListSignatureLine->add( - FSNS(XML_o, XML_signinginstructions), + XML_signinginstructions, pSdrGrafObj->getSignatureLineSigningInstructions()); } pAttrListSignatureLine->add( diff --git a/oox/source/vml/vmlshapecontext.cxx b/oox/source/vml/vmlshapecontext.cxx index 85c70347e0e8..35517bc95452 100644 --- a/oox/source/vml/vmlshapecontext.cxx +++ b/oox/source/vml/vmlshapecontext.cxx @@ -585,7 +585,12 @@ ContextHandlerRef ShapeContext::onCreateContext( sal_Int32 nElement, const Attri mrShapeModel.maSignatureLineSuggestedSignerEmail = rAttribs.getStringDefaulted(O_TOKEN(suggestedsigneremail)); mrShapeModel.maSignatureLineSigningInstructions - = rAttribs.getStringDefaulted(O_TOKEN(signinginstructions)); + = rAttribs.getStringDefaulted(XML_signinginstructions); + // we used to save this with an "o:" prefix, which is incorrect, so to support older + // data, try the older way if the correct way is empty. + if (mrShapeModel.maSignatureLineSigningInstructions.isEmpty()) + mrShapeModel.maSignatureLineSigningInstructions + = rAttribs.getStringDefaulted(O_TOKEN(signinginstructions)); mrShapeModel.mbSignatureLineShowSignDate = ConversionHelper::decodeBool( rAttribs.getString(XML_showsigndate, u"t"_ustr)); // default is true mrShapeModel.mbSignatureLineCanAddComment = ConversionHelper::decodeBool( commit afe5809395480b0da18555092118dcd3a9ea239f Author: Mike Kaganski <[email protected]> AuthorDate: Tue Jan 20 12:11:45 2026 +0500 Commit: Xisco Fauli <[email protected]> CommitDate: Tue Jan 20 16:39:42 2026 +0100 tdf#170396: implement SVG export support for dashed lines Commit b71d9a6d15cfb8a50afdea5ac064f40d84c561f8 (do not apply line dashing in drawinglayer (tdf#136957), 2021-04-29) made sure that metafiles pass dashing information in LineInfo of MetaPolyLineAction, instead of altering the polyline itself. Since SVG export ignored dashing information in MetaPolyLineAction, the exported lines were solid since that patch. This patch introduces respective export support, emitting stroke-dasharray attribute. As far as I see, it has exactly the same semantics, and renders correctly in chrome and firefox. It also imports OK into Draw. Ref: https://developer.mozilla.org/en-US/docs/Web/SVG/Reference/Attribute/stroke-dasharray Change-Id: Ifb634a4f3608ee5c2c76727ef4416b80f8f90709 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197618 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> (cherry picked from commit c103d337bd41eaa44b65accabe978fe542e41d06) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197639 Reviewed-by: Xisco Fauli <[email protected]> (cherry picked from commit 1bc488dffee9f5415615c926028b0e95e989ae32) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/197656 diff --git a/filter/qa/unit/data/dashedline.fodg b/filter/qa/unit/data/dashedline.fodg new file mode 100644 index 000000000000..73ca01124945 --- /dev/null +++ b/filter/qa/unit/data/dashedline.fodg @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<office:document xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.graphics"> + <office:styles> + <draw:stroke-dash draw:name="DoubleDashDotDot" draw:style="rect" draw:dots1="1" draw:dots1-length="800%" draw:dots2="2" draw:dots2-length="90%" draw:distance="300%"/> + <style:style style:name="standard" style:family="graphic"> + <style:graphic-properties draw:stroke="solid" svg:stroke-width="1mm" svg:stroke-color="#008000" draw:fill="none" draw:shadow="hidden"/> + </style:style> + </office:styles> + <office:automatic-styles> + <style:page-layout style:name="PM0"> + <style:page-layout-properties fo:margin-top="1cm" fo:margin-bottom="1cm" fo:margin-left="1cm" fo:margin-right="1cm" fo:page-width="14cm" fo:page-height="4cm"/> + </style:page-layout> + <style:style style:name="gr1" style:family="graphic" style:parent-style-name="standard"> + <style:graphic-properties draw:stroke="dash" draw:stroke-dash="DoubleDashDotDot" draw:textarea-vertical-align="middle"/> + </style:style> + </office:automatic-styles> + <office:master-styles> + <style:master-page style:name="Default" style:page-layout-name="PM0"/> + </office:master-styles> + <office:body> + <office:drawing> + <draw:page draw:name="page1" draw:master-page-name="Default"> + <draw:line draw:style-name="gr1" svg:x1="2cm" svg:y1="2cm" svg:x2="12cm" svg:y2="2cm"/> + </draw:page> + </office:drawing> + </office:body> +</office:document> \ No newline at end of file diff --git a/filter/qa/unit/svg.cxx b/filter/qa/unit/svg.cxx index 4fab96055822..7f6b24a33683 100644 --- a/filter/qa/unit/svg.cxx +++ b/filter/qa/unit/svg.cxx @@ -395,6 +395,20 @@ CPPUNIT_TEST_FIXTURE(SvgFilterTest, testTdf166789) CPPUNIT_ASSERT_DOUBLES_EQUAL(7000, length.toInt32(), 70); // allow 1% for rounding errors } +CPPUNIT_TEST_FIXTURE(SvgFilterTest, testDashedLine) +{ + // A dashed line + loadFromFile(u"dashedline.fodg"); + + save(TestFilter::SVG_DRAW); + + xmlDocUniquePtr pXmlDoc = parseExportedFile(); + CPPUNIT_ASSERT(pXmlDoc); + + // The result must include 'stroke-dasharray' attribute + assertXPath(pXmlDoc, "/svg:svg/svg:g//svg:path", "stroke-dasharray", u"800,300,90,300,90,300"); +} + CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index fd09508efd93..884819f8ca1a 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -2142,6 +2142,18 @@ void SVGActionWriter::ImplAddLineAttr( const LineInfo &rAttrs ) } } + if (rAttrs.GetStyle() == LineStyle::Dash) + { + OUStringBuffer aDashArrayStr; + for (double x : rAttrs.GetDotDashArray()) + { + if (!aDashArrayStr.isEmpty()) + aDashArrayStr.append(","); + aDashArrayStr.append(x); + } + if (!aDashArrayStr.isEmpty()) + mrExport.AddAttribute(u"stroke-dasharray"_ustr, aDashArrayStr.makeStringAndClear()); + } }
