configure.ac | 2 oox/source/export/chartexport.cxx | 4 - svgio/qa/cppunit/SvgImportTest.cxx | 31 +++++++++++++ svgio/qa/cppunit/data/tdf145896.svg | 12 +++++ svgio/qa/cppunit/data/tdf155833.svg | 31 +++++++++++++ svgio/source/svgreader/svgdocumenthandler.cxx | 17 +------ svgio/source/svgreader/svgimagenode.cxx | 60 +++++++++++--------------- svgio/source/svgreader/svgstylenode.cxx | 6 +- 8 files changed, 109 insertions(+), 54 deletions(-)
New commits: commit ff79c423495940f6070585c1c367586418821a99 Author: Andras Timar <[email protected]> AuthorDate: Fri Jun 23 18:34:31 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jun 23 18:49:12 2023 +0200 Bump version to 23.05.1.1 Change-Id: Ib82a73120573a25a01334a50b27324e70717b52d diff --git a/configure.ac b/configure.ac index 4aa1813a1486..5de94c69d5f5 100644 --- a/configure.ac +++ b/configure.ac @@ -9,7 +9,7 @@ dnl in order to create a configure script. # several non-alphanumeric characters, those are split off and used only for the # ABOUTBOXPRODUCTVERSIONSUFFIX in openoffice.lst. Why that is necessary, no idea. -AC_INIT([Collabora Office],[23.05.0.5],[],[],[https://collaboraoffice.com/]) +AC_INIT([Collabora Office],[23.05.1.1],[],[],[https://collaboraoffice.com/]) dnl libnumbertext needs autoconf 2.68, but that can pick up autoconf268 just fine if it is installed dnl whereas aclocal (as run by autogen.sh) insists on using autoconf and fails hard commit a341c8ab8f2c6bb11a2564d0a4c9f30f504ba516 Author: Xisco Fauli <[email protected]> AuthorDate: Thu Jun 15 10:10:38 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jun 23 18:49:12 2023 +0200 tdf#155833: apply transform to image even if target is equal to viewbox Change-Id: Ie820528384d096c6a332e2abd0095f68c7f64a0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153103 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> (cherry picked from commit 6dce36484bfcac711251710697dca961fd77ca20) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153082 Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153153 diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index ce9329b1a21a..16975f06f0b2 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -402,6 +402,19 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf45771) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[1]", "familyname", "Times New Roman"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf155833) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf155833.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + + CPPUNIT_ASSERT (pDocument); + + assertXPath(pDocument, "/primitive2D/transform/mask/transform/transform/transform/transform/transform/bitmap", 1); +} + CPPUNIT_TEST_FIXTURE(Test, testTdf97941) { //Check tspan fontsize when using relative units diff --git a/svgio/qa/cppunit/data/tdf155833.svg b/svgio/qa/cppunit/data/tdf155833.svg new file mode 100644 index 000000000000..8cc908424af0 --- /dev/null +++ b/svgio/qa/cppunit/data/tdf155833.svg @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + width="32.677876mm" + height="32.677876mm" + viewBox="0 0 32.677876 32.677876" + version="1.1" + id="svg1126" + xmlns:xlink="http://www.w3.org/1999/xlink" + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg"> + <g + id="layer1" + transform="translate(-80.317197,-107.43993)"> + <g + id="g18033" + transform="matrix(0.35277777,0,0,-0.35277777,71.799819,211.06676)"> + <g + id="g18041" + transform="matrix(92.88,0,0,92.88,24.14375,201.11516)"> + <image + width="1" + height="1" + transform="matrix(1,0,0,-1,0,1)" + xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIEAAACBCAYAAADnoNlQAAAABHNCSVQICAgIfAhkiAAAAUJJREFUeJzt3EENAkEQRcG3aMAjMpYzBgjqSDCyWJhbZ5IqBf/w0sc+6rzaxnN6wLpzesC62/QA5okAESACEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAiojvv12+at7aPP9IRlO211CRABIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAdVzvtnlr22t6wLrnd3rBOpcAESACEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBFR/ALUM7y9VYLsAAAAASUVORK5CYII=" + id="image18043" /> + </g> + </g> + </g> +</svg> diff --git a/svgio/source/svgreader/svgimagenode.cxx b/svgio/source/svgreader/svgimagenode.cxx index ed7b81cef61a..19c8c9404541 100644 --- a/svgio/source/svgreader/svgimagenode.cxx +++ b/svgio/source/svgreader/svgimagenode.cxx @@ -310,45 +310,37 @@ namespace svgio::svgreader if(aNewTarget.empty()) return; - if(aTarget.equal(aViewBox)) - { - // just add to rTarget - rTarget.append(aNewTarget); - } - else - { - // create mapping - const SvgAspectRatio& rRatio = maSvgAspectRatio; + // create mapping + const SvgAspectRatio& rRatio = maSvgAspectRatio; - // even when ratio is not set, use the defaults - // let mapping be created from SvgAspectRatio - const basegfx::B2DHomMatrix aEmbeddingTransform(rRatio.createMapping(aTarget, aViewBox)); + // even when ratio is not set, use the defaults + // let mapping be created from SvgAspectRatio + const basegfx::B2DHomMatrix aEmbeddingTransform(rRatio.createMapping(aTarget, aViewBox)); - if(!aEmbeddingTransform.isIdentity()) - { - const drawinglayer::primitive2d::Primitive2DReference xRef( - new drawinglayer::primitive2d::TransformPrimitive2D( - aEmbeddingTransform, - std::move(aNewTarget))); - - aNewTarget = drawinglayer::primitive2d::Primitive2DContainer { xRef }; - } + if(!aEmbeddingTransform.isIdentity()) + { + const drawinglayer::primitive2d::Primitive2DReference xRef( + new drawinglayer::primitive2d::TransformPrimitive2D( + aEmbeddingTransform, + std::move(aNewTarget))); - if(!rRatio.isMeetOrSlice()) - { - // need to embed in MaskPrimitive2D to ensure clipping - const drawinglayer::primitive2d::Primitive2DReference xMask( - new drawinglayer::primitive2d::MaskPrimitive2D( - basegfx::B2DPolyPolygon( - basegfx::utils::createPolygonFromRect(aTarget)), - std::move(aNewTarget))); - - aNewTarget = drawinglayer::primitive2d::Primitive2DContainer { xMask }; - } + aNewTarget = drawinglayer::primitive2d::Primitive2DContainer { xRef }; + } - // embed and add to rTarget, take local extra-transform into account - pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); + if(!rRatio.isMeetOrSlice()) + { + // need to embed in MaskPrimitive2D to ensure clipping + const drawinglayer::primitive2d::Primitive2DReference xMask( + new drawinglayer::primitive2d::MaskPrimitive2D( + basegfx::B2DPolyPolygon( + basegfx::utils::createPolygonFromRect(aTarget)), + std::move(aNewTarget))); + + aNewTarget = drawinglayer::primitive2d::Primitive2DContainer { xMask }; } + + // embed and add to rTarget, take local extra-transform into account + pStyle->add_postProcess(rTarget, std::move(aNewTarget), getTransform()); } } // end of namespace svgio::svgreader commit 66d92943fd2ec8b9e4068326785455102a8bae35 Author: Xisco Fauli <[email protected]> AuthorDate: Mon Jun 19 16:17:00 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jun 23 18:49:12 2023 +0200 tdf#145896: set style to 'text/css' by default This is a regression from 4c31a0be1d8048bf3340acbb59248185e4b93041 "Resolves: #i125326# accept CssStyles with missing type attribute" Calling setTextCss(true) when there are no attributes is wrong, since it might have attributes like 'id'. The unittest added also covers i125326 is still fixed Change-Id: Ic5e4899211ae98c866f64f17e69a3a8cd24e4959 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153279 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> Signed-off-by: Xisco Fauli <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153310 diff --git a/svgio/qa/cppunit/SvgImportTest.cxx b/svgio/qa/cppunit/SvgImportTest.cxx index c8305517ce00..ce9329b1a21a 100644 --- a/svgio/qa/cppunit/SvgImportTest.cxx +++ b/svgio/qa/cppunit/SvgImportTest.cxx @@ -273,6 +273,24 @@ CPPUNIT_TEST_FIXTURE(Test, testFontsizeRelative) assertXPath(pDocument, "/primitive2D/transform/textsimpleportion[2]", "familyname", "serif"); } +CPPUNIT_TEST_FIXTURE(Test, testTdf145896) +{ + Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/tdf145896.svg"); + CPPUNIT_ASSERT_EQUAL(1, static_cast<int>(aSequence.getLength())); + + drawinglayer::Primitive2dXmlDump dumper; + xmlDocUniquePtr pDocument = dumper.dumpAndParse(aSequence); + + CPPUNIT_ASSERT (pDocument); + + // Without the fix in place, this test would have failed with + // - Expected: #ffff00 + // - Actual : #000000 + assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[1]", "color", "#ffff00"); + assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[2]", "color", "#008000"); + assertXPath(pDocument, "/primitive2D/transform/polypolygoncolor[3]", "color", "#0000ff"); +} + CPPUNIT_TEST_FIXTURE(Test, testMarkerOrient) { Primitive2DSequence aSequence = parseSvg(u"/svgio/qa/cppunit/data/MarkerOrient.svg"); diff --git a/svgio/qa/cppunit/data/tdf145896.svg b/svgio/qa/cppunit/data/tdf145896.svg new file mode 100644 index 000000000000..d434a961b9d0 --- /dev/null +++ b/svgio/qa/cppunit/data/tdf145896.svg @@ -0,0 +1,12 @@ +<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="-0 0 300 300"> + + <style id="style2"> + .st0{fill:yellow;}.st1{fill:green;} + </style> + <style type="text/some-unknown-styling-language"> + .st2{fill:red;} + </style> + <rect x="0" y="0" height="50" width="50" class="st0" fill="blue"></rect> + <rect x="60" y="0" height="50" width="50" class="st1" fill="blue"></rect> + <rect x="120" y="0" height="50" width="50" class="st2" fill="blue"></rect> +</svg> diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx index dc2dd6fa7c6b..fffc4106c768 100644 --- a/svgio/source/svgreader/svgdocumenthandler.cxx +++ b/svgio/source/svgreader/svgdocumenthandler.cxx @@ -299,21 +299,10 @@ namespace { SvgStyleNode* pNew = new SvgStyleNode(maDocument, mpTarget); mpTarget = pNew; - const sal_uInt32 nAttributes(xAttribs->getLength()); - if(0 == nAttributes) - { - // #i125326# no attributes, thus also no type="text/css". This is allowed to be missing, - // thus do mark this style as CssStyle. This is required to read the contained - // text (which defines the css style) - pNew->setTextCss(true); - } - else - { - // #i125326# there are attributes, read them. This will set isTextCss to true if - // a type="text/css" is contained as exact match, else not - mpTarget->parseAttributes(xAttribs); - } + // #i125326# there are attributes, read them. This will set isTextCss to false if + // type attibute is different to "text/css" + mpTarget->parseAttributes(xAttribs); if(pNew->isTextCss()) { diff --git a/svgio/source/svgreader/svgstylenode.cxx b/svgio/source/svgreader/svgstylenode.cxx index ef25e6a83b47..b11f7129e0b3 100644 --- a/svgio/source/svgreader/svgstylenode.cxx +++ b/svgio/source/svgreader/svgstylenode.cxx @@ -28,7 +28,7 @@ namespace svgio::svgreader SvgDocument& rDocument, SvgNode* pParent) : SvgNode(SVGToken::Style, rDocument, pParent), - mbTextCss(false) + mbTextCss(true) { } @@ -57,9 +57,9 @@ namespace svgio::svgreader { if(!aContent.isEmpty()) { - if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"text/css")) + if(!o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"text/css")) { - setTextCss(true); + setTextCss(false); } } break; commit 31bb86fe8be035cbf71ca2e2d7b5db92c55b6cf3 Author: Tünde Tóth <[email protected]> AuthorDate: Thu Jun 1 15:25:45 2023 +0200 Commit: Andras Timar <[email protected]> CommitDate: Fri Jun 23 18:49:12 2023 +0200 tdf#145651 Chart OOXML export: fix write error in exportSolidFill Don't export the background color, if the FillColor property is empty. Steps to reproduce: 1. E.g. in Impress, insert a chart (Insert > Chart...). 2. In chart editing mode, select the legend, use the "sidebar > Area > Fill" and change from "none" to "color". Notice how the default blue that is used does not correspond to the colour in the colour picker right underneath. 3. Save as > OOXML format. Change-Id: I33a060d8fc6c49708029008393e2e22e3d5335b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152951 Tested-by: László Németh <[email protected]> Reviewed-by: László Németh <[email protected]> (cherry picked from commit 6b3e29536ca770d7c2c42429390785c326d223ae) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/153333 Tested-by: Jenkins diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index e3704845407a..26a72e64e490 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1889,9 +1889,9 @@ void ChartExport::exportSolidFill(const Reference< XPropertySet >& xPropSet) // Similar to DrawingML::WriteSolidFill, but gradient access via name // and currently no InteropGrabBag // get fill color - if (!GetProperty( xPropSet, "FillColor" )) + sal_uInt32 nFillColor = 0; + if (!GetProperty(xPropSet, "FillColor") || !(mAny >>= nFillColor)) return; - sal_uInt32 nFillColor = mAny.get<sal_uInt32>(); sal_Int32 nAlpha = MAX_PERCENT; if (GetProperty( xPropSet, "FillTransparence" ))
