forked from amazingfate/loongoffice
That recently introduced test systematically failed on my Fedora 36 machine with > /home/sbergman/lo2/core/test/source/xmltesttools.cxx:89:(anonymous namespace)::Test::testCssClassRedefinition > equality assertion failed > - Expected: 1 > - Actual : 0 > - In <>, XPath '/primitive2D/transform/textsimpleportion[1]' number of nodes is incorrect because the dumped data was > <?xml version="1.0" encoding="UTF-8"?> > <primitive2D> > <transform xy11="26" xy12="0" xy13="0" xy21="0" xy22="26" xy23="0" xy31="0" xy32="0" xy33="1"> > <mask> > <polypolygon height="100" width="50" minx="0" miny="0" maxx="50" maxy="100" path="m0 0h50v100h-50z"> > <polygon> > <point x="0" y="0"/> > <point x="50" y="0"/> > <point x="50" y="100"/> > <point x="0" y="100"/> > </polygon> > </polypolygon> > <textsimpleportion width="16" height="16" x="20" y="20" text="test" fontcolor="#ff0000" familyname="Sans"/> > </mask> > </transform> > </primitive2D> rather than the expected > <?xml version="1.0" encoding="UTF-8"?> > <primitive2D> > <transform xy11="26" xy12="0" xy13="0" xy21="0" xy22="26" xy23="0" xy31="0" xy32="0" xy33="1"> > <textsimpleportion width="16" height="16" x="20" y="20" text="test" fontcolor="#ff0000" familyname="Sans"/> > <hiddengeometry> > <polygonhairline color="#000000"> > <polygon>0,0 50,0 50,100 0,100</polygon> > </polygonhairline> > </hiddengeometry> > </transform> > </primitive2D> because in SvgSvgNode::decomposeSvgNode (svgio/source/svgreader/svgsvgnode.cxx) aSvgCanvasRange = 50x100@(0,0) vs. aContentRange = 31x11@(20,9) did not match the > if(aSvgCanvasRange.isInside(aContentRange)) branch ("no clip needed, but an invisible HiddenGeometryPrimitive2D...") but rather the > else if(aSvgCanvasRange.overlaps(aContentRange)) branch ("Clip is necessary") introducing the additional <mask> element. The size of aContentRange (and thus whether it is contained in or merely overlaps aSvgCanvasRange) is apparently affected by what actual font gets substituted for "Sans" in any given environment. The only font that is guaranteed to always be available and is not subject to --with-fonts (which isn't already demanded via gb_CppunitTest_use_more_fonts in svgio/CppunitTest_svgio.mk) appears to be "Open Symbol" (cf. extras/Package_fonts.mk), so use that (even if it doesn't have glyphs for the given text, but which should be irrelevant for this test). Change-Id: If6f6fdc481b313aa08803b4b3f406e01ff0be1ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136350 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
14 lines
497 B
XML
14 lines
497 B
XML