svgio: use IgnoreAsciiCase when checking these values
They are also valid when uppercase OTOH, use equalsIgnoreAsciiCase along with trim() instead of startsWithIgnoreAsciiCase since " round " should be valid but "rounded" shouldn't Change-Id: If4060a23a1cf41833264051094103e37927d14c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/136881 Tested-by: Jenkins Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
This commit is contained in:
@@ -25,6 +25,7 @@
|
||||
#include <drawinglayer/primitive2d/textbreakuphelper.hxx>
|
||||
#include <drawinglayer/primitive2d/textdecoratedprimitive2d.hxx>
|
||||
#include <utility>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
using namespace drawinglayer::primitive2d;
|
||||
@@ -123,11 +124,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("spacing"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"spacing"))
|
||||
{
|
||||
setLengthAdjust(true);
|
||||
}
|
||||
else if(aContent.startsWith("spacingAndGlyphs"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"spacingAndGlyphs"))
|
||||
{
|
||||
setLengthAdjust(false);
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include <drawinglayer/processor2d/contourextractor2d.hxx>
|
||||
#include <basegfx/polygon/b2dpolypolygoncutter.hxx>
|
||||
#include <basegfx/polygon/b2dpolygontools.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
namespace svgio::svgreader
|
||||
{
|
||||
@@ -76,11 +77,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setClipPathUnits(SvgUnits::userSpaceOnUse);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrObjectBoundingBox))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrObjectBoundingBox))
|
||||
{
|
||||
setClipPathUnits(SvgUnits::objectBoundingBox);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
#include <svggradientnode.hxx>
|
||||
#include <svgdocument.hxx>
|
||||
#include <svggradientstopnode.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
namespace svgio::svgreader
|
||||
@@ -171,11 +172,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setGradientUnits(SvgUnits::userSpaceOnUse);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrObjectBoundingBox))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrObjectBoundingBox))
|
||||
{
|
||||
setGradientUnits(SvgUnits::objectBoundingBox);
|
||||
}
|
||||
@@ -186,15 +187,15 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("pad"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"pad"))
|
||||
{
|
||||
setSpreadMethod(drawinglayer::primitive2d::SpreadMethod::Pad);
|
||||
}
|
||||
else if(aContent.startsWith("reflect"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"reflect"))
|
||||
{
|
||||
setSpreadMethod(drawinglayer::primitive2d::SpreadMethod::Reflect);
|
||||
}
|
||||
else if(aContent.startsWith("repeat"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"repeat"))
|
||||
{
|
||||
setSpreadMethod(drawinglayer::primitive2d::SpreadMethod::Repeat);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
|
||||
#include <svgmarkernode.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
namespace svgio::svgreader
|
||||
{
|
||||
@@ -100,11 +101,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("strokeWidth"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"strokeWidth"))
|
||||
{
|
||||
setMarkerUnits(MarkerUnits::strokeWidth);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setMarkerUnits(MarkerUnits::userSpaceOnUse);
|
||||
}
|
||||
@@ -143,7 +144,7 @@ namespace svgio::svgreader
|
||||
|
||||
if(nLen)
|
||||
{
|
||||
if(aContent.startsWith("auto"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"auto"))
|
||||
{
|
||||
mbOrientAuto = true;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
|
||||
#include <basegfx/polygon/b2dpolygontools.hxx>
|
||||
#include <basegfx/polygon/b2dpolygon.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
namespace svgio::svgreader
|
||||
{
|
||||
@@ -128,11 +129,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setMaskUnits(SvgUnits::userSpaceOnUse);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrObjectBoundingBox))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrObjectBoundingBox))
|
||||
{
|
||||
setMaskUnits(SvgUnits::objectBoundingBox);
|
||||
}
|
||||
@@ -143,11 +144,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setMaskContentUnits(SvgUnits::userSpaceOnUse);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrObjectBoundingBox))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrObjectBoundingBox))
|
||||
{
|
||||
setMaskContentUnits(SvgUnits::objectBoundingBox);
|
||||
}
|
||||
|
||||
@@ -441,11 +441,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("default"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"default"))
|
||||
{
|
||||
setXmlSpace(XmlSpace::Default);
|
||||
}
|
||||
else if(aContent.startsWith("preserve"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"preserve"))
|
||||
{
|
||||
setXmlSpace(XmlSpace::Preserve);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <svgpatternnode.hxx>
|
||||
#include <svgdocument.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
|
||||
namespace svgio::svgreader
|
||||
{
|
||||
@@ -130,11 +131,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setPatternUnits(SvgUnits::userSpaceOnUse);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrObjectBoundingBox))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrObjectBoundingBox))
|
||||
{
|
||||
setPatternUnits(SvgUnits::objectBoundingBox);
|
||||
}
|
||||
@@ -145,11 +146,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrUserSpaceOnUse))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrUserSpaceOnUse))
|
||||
{
|
||||
setPatternContentUnits(SvgUnits::userSpaceOnUse);
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrObjectBoundingBox))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrObjectBoundingBox))
|
||||
{
|
||||
setPatternContentUnits(SvgUnits::objectBoundingBox);
|
||||
}
|
||||
|
||||
@@ -43,6 +43,7 @@
|
||||
#include <basegfx/polygon/b2dpolygontools.hxx>
|
||||
#include <drawinglayer/primitive2d/maskprimitive2d.hxx>
|
||||
#include <drawinglayer/primitive2d/pagehierarchyprimitive2d.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <o3tl/unit_conversion.hxx>
|
||||
|
||||
const int nStyleDepthLimit = 1024;
|
||||
@@ -1329,11 +1330,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrNonzero))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrNonzero))
|
||||
{
|
||||
maFillRule = FillRule::nonzero;
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrEvenOdd))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrEvenOdd))
|
||||
{
|
||||
maFillRule = FillRule::evenodd;
|
||||
}
|
||||
@@ -1366,7 +1367,7 @@ namespace svgio::svgreader
|
||||
{
|
||||
SvgNumberVector aVector;
|
||||
|
||||
if(aContent.startsWith("none"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"none"))
|
||||
{
|
||||
// #121221# The special value 'none' needs to be handled
|
||||
// in the sense that *when* it is set, the parent shall not
|
||||
@@ -1398,15 +1399,15 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("butt"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"butt"))
|
||||
{
|
||||
setStrokeLinecap(StrokeLinecap::butt);
|
||||
}
|
||||
else if(aContent.startsWith("round"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"round"))
|
||||
{
|
||||
setStrokeLinecap(StrokeLinecap::round);
|
||||
}
|
||||
else if(aContent.startsWith("square"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"square"))
|
||||
{
|
||||
setStrokeLinecap(StrokeLinecap::square);
|
||||
}
|
||||
@@ -1417,15 +1418,15 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("miter"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"miter"))
|
||||
{
|
||||
setStrokeLinejoin(StrokeLinejoin::miter);
|
||||
}
|
||||
else if(aContent.startsWith("round"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"round"))
|
||||
{
|
||||
setStrokeLinejoin(StrokeLinejoin::round);
|
||||
}
|
||||
else if(aContent.startsWith("bevel"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"bevel"))
|
||||
{
|
||||
setStrokeLinejoin(StrokeLinejoin::bevel);
|
||||
}
|
||||
@@ -1516,43 +1517,43 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("xx-small"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"xx-small"))
|
||||
{
|
||||
setFontSize(FontSize::xx_small);
|
||||
}
|
||||
else if(aContent.startsWith("x-small"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"x-small"))
|
||||
{
|
||||
setFontSize(FontSize::x_small);
|
||||
}
|
||||
else if(aContent.startsWith("small"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"small"))
|
||||
{
|
||||
setFontSize(FontSize::small);
|
||||
}
|
||||
else if(aContent.startsWith("smaller"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"smaller"))
|
||||
{
|
||||
setFontSize(FontSize::smaller);
|
||||
}
|
||||
else if(aContent.startsWith("medium"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"medium"))
|
||||
{
|
||||
setFontSize(FontSize::medium);
|
||||
}
|
||||
else if(aContent.startsWith("larger"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"larger"))
|
||||
{
|
||||
setFontSize(FontSize::larger);
|
||||
}
|
||||
else if(aContent.startsWith("large"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"large"))
|
||||
{
|
||||
setFontSize(FontSize::large);
|
||||
}
|
||||
else if(aContent.startsWith("x-large"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"x-large"))
|
||||
{
|
||||
setFontSize(FontSize::x_large);
|
||||
}
|
||||
else if(aContent.startsWith("xx-large"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"xx-large"))
|
||||
{
|
||||
setFontSize(FontSize::xx_large);
|
||||
}
|
||||
else if(aContent.startsWith("initial"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"initial"))
|
||||
{
|
||||
setFontSize(FontSize::initial);
|
||||
}
|
||||
@@ -1576,47 +1577,47 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("normal"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"normal"))
|
||||
{
|
||||
setFontStretch(FontStretch::normal);
|
||||
}
|
||||
else if(aContent.startsWith("wider"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"wider"))
|
||||
{
|
||||
setFontStretch(FontStretch::wider);
|
||||
}
|
||||
else if(aContent.startsWith("narrower"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"narrower"))
|
||||
{
|
||||
setFontStretch(FontStretch::narrower);
|
||||
}
|
||||
else if(aContent.startsWith("ultra-condensed"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"ultra-condensed"))
|
||||
{
|
||||
setFontStretch(FontStretch::ultra_condensed);
|
||||
}
|
||||
else if(aContent.startsWith("extra-condensed"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"extra-condensed"))
|
||||
{
|
||||
setFontStretch(FontStretch::extra_condensed);
|
||||
}
|
||||
else if(aContent.startsWith("condensed"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"condensed"))
|
||||
{
|
||||
setFontStretch(FontStretch::condensed);
|
||||
}
|
||||
else if(aContent.startsWith("semi-condensed"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"semi-condensed"))
|
||||
{
|
||||
setFontStretch(FontStretch::semi_condensed);
|
||||
}
|
||||
else if(aContent.startsWith("semi-expanded"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"semi-expanded"))
|
||||
{
|
||||
setFontStretch(FontStretch::semi_expanded);
|
||||
}
|
||||
else if(aContent.startsWith("expanded"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"expanded"))
|
||||
{
|
||||
setFontStretch(FontStretch::expanded);
|
||||
}
|
||||
else if(aContent.startsWith("extra-expanded"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"extra-expanded"))
|
||||
{
|
||||
setFontStretch(FontStretch::extra_expanded);
|
||||
}
|
||||
else if(aContent.startsWith("ultra-expanded"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"ultra-expanded"))
|
||||
{
|
||||
setFontStretch(FontStretch::ultra_expanded);
|
||||
}
|
||||
@@ -1627,15 +1628,15 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("normal"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"normal"))
|
||||
{
|
||||
setFontStyle(FontStyle::normal);
|
||||
}
|
||||
else if(aContent.startsWith("italic"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"italic"))
|
||||
{
|
||||
setFontStyle(FontStyle::italic);
|
||||
}
|
||||
else if(aContent.startsWith("oblique"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"oblique"))
|
||||
{
|
||||
setFontStyle(FontStyle::oblique);
|
||||
}
|
||||
@@ -1650,47 +1651,47 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("100"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"100"))
|
||||
{
|
||||
setFontWeight(FontWeight::N100);
|
||||
}
|
||||
else if(aContent.startsWith("200"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"200"))
|
||||
{
|
||||
setFontWeight(FontWeight::N200);
|
||||
}
|
||||
else if(aContent.startsWith("300"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"300"))
|
||||
{
|
||||
setFontWeight(FontWeight::N300);
|
||||
}
|
||||
else if(aContent.startsWith("400") || aContent.startsWith("normal"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"400") || o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"normal"))
|
||||
{
|
||||
setFontWeight(FontWeight::N400);
|
||||
}
|
||||
else if(aContent.startsWith("500"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"500"))
|
||||
{
|
||||
setFontWeight(FontWeight::N500);
|
||||
}
|
||||
else if(aContent.startsWith("600"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"600"))
|
||||
{
|
||||
setFontWeight(FontWeight::N600);
|
||||
}
|
||||
else if(aContent.startsWith("700") || aContent.startsWith("bold"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"700") || o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"bold"))
|
||||
{
|
||||
setFontWeight(FontWeight::N700);
|
||||
}
|
||||
else if(aContent.startsWith("800"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"800"))
|
||||
{
|
||||
setFontWeight(FontWeight::N800);
|
||||
}
|
||||
else if(aContent.startsWith("900"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"900"))
|
||||
{
|
||||
setFontWeight(FontWeight::N900);
|
||||
}
|
||||
else if(aContent.startsWith("bolder"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"bolder"))
|
||||
{
|
||||
setFontWeight(FontWeight::bolder);
|
||||
}
|
||||
else if(aContent.startsWith("lighter"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"lighter"))
|
||||
{
|
||||
setFontWeight(FontWeight::lighter);
|
||||
}
|
||||
@@ -1709,23 +1710,23 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("none"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"none"))
|
||||
{
|
||||
setTextDecoration(TextDecoration::none);
|
||||
}
|
||||
else if(aContent.startsWith("underline"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"underline"))
|
||||
{
|
||||
setTextDecoration(TextDecoration::underline);
|
||||
}
|
||||
else if(aContent.startsWith("overline"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"overline"))
|
||||
{
|
||||
setTextDecoration(TextDecoration::overline);
|
||||
}
|
||||
else if(aContent.startsWith("line-through"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"line-through"))
|
||||
{
|
||||
setTextDecoration(TextDecoration::line_through);
|
||||
}
|
||||
else if(aContent.startsWith("blink"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"blink"))
|
||||
{
|
||||
setTextDecoration(TextDecoration::blink);
|
||||
}
|
||||
@@ -1744,15 +1745,15 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("start"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"start"))
|
||||
{
|
||||
setTextAnchor(TextAnchor::start);
|
||||
}
|
||||
else if(aContent.startsWith("middle"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"middle"))
|
||||
{
|
||||
setTextAnchor(TextAnchor::middle);
|
||||
}
|
||||
else if(aContent.startsWith("end"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"end"))
|
||||
{
|
||||
setTextAnchor(TextAnchor::end);
|
||||
}
|
||||
@@ -1763,19 +1764,19 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("left"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"left"))
|
||||
{
|
||||
setTextAlign(TextAlign::left);
|
||||
}
|
||||
else if(aContent.startsWith("right"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"right"))
|
||||
{
|
||||
setTextAlign(TextAlign::right);
|
||||
}
|
||||
else if(aContent.startsWith("center"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"center"))
|
||||
{
|
||||
setTextAlign(TextAlign::center);
|
||||
}
|
||||
else if(aContent.startsWith("justify"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"justify"))
|
||||
{
|
||||
setTextAlign(TextAlign::justify);
|
||||
}
|
||||
@@ -1812,19 +1813,19 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("visible"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"visible"))
|
||||
{
|
||||
setVisibility(Visibility::visible);
|
||||
}
|
||||
else if(aContent.startsWith("hidden"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"hidden"))
|
||||
{
|
||||
setVisibility(Visibility::hidden);
|
||||
}
|
||||
else if(aContent.startsWith("collapse"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"collapse"))
|
||||
{
|
||||
setVisibility(Visibility::collapse);
|
||||
}
|
||||
else if(aContent.startsWith("inherit"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"inherit"))
|
||||
{
|
||||
setVisibility(Visibility::inherit);
|
||||
}
|
||||
@@ -1855,11 +1856,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.match(commonStrings::aStrNonzero))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrNonzero))
|
||||
{
|
||||
maClipRule = FillRule::nonzero;
|
||||
}
|
||||
else if(aContent.match(commonStrings::aStrEvenOdd))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), commonStrings::aStrEvenOdd))
|
||||
{
|
||||
maClipRule = FillRule::evenodd;
|
||||
}
|
||||
@@ -1908,11 +1909,11 @@ namespace svgio::svgreader
|
||||
{
|
||||
SvgNumber aNum;
|
||||
|
||||
if(aContent.startsWith("sub"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"sub"))
|
||||
{
|
||||
setBaselineShift(BaselineShift::Sub);
|
||||
}
|
||||
else if(aContent.startsWith("super"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"super"))
|
||||
{
|
||||
setBaselineShift(BaselineShift::Super);
|
||||
}
|
||||
@@ -2474,7 +2475,7 @@ namespace svgio::svgreader
|
||||
|
||||
const SvgStringVector& SvgStyleAttributes::getFontFamily() const
|
||||
{
|
||||
if(!maFontFamily.empty() && !maFontFamily[0].startsWith("inherit"))
|
||||
if(!maFontFamily.empty() && !o3tl::equalsIgnoreAsciiCase(o3tl::trim(maFontFamily[0]), u"inherit"))
|
||||
{
|
||||
return maFontFamily;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
|
||||
#include <svgstylenode.hxx>
|
||||
#include <svgdocument.hxx>
|
||||
#include <o3tl/string_view.hxx>
|
||||
#include <osl/diagnose.h>
|
||||
|
||||
namespace svgio::svgreader
|
||||
@@ -56,7 +57,7 @@ namespace svgio::svgreader
|
||||
{
|
||||
if(!aContent.isEmpty())
|
||||
{
|
||||
if(aContent.startsWith("text/css"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(aContent), u"text/css"))
|
||||
{
|
||||
setTextCss(true);
|
||||
}
|
||||
|
||||
@@ -869,7 +869,7 @@ namespace svgio::svgreader
|
||||
{
|
||||
case u'm' :
|
||||
{
|
||||
if(rCandidate.match(aStrMatrix, nPos))
|
||||
if(rCandidate.matchIgnoreAsciiCase(aStrMatrix, nPos))
|
||||
{
|
||||
// matrix element
|
||||
nPos += strlen(aStrMatrix);
|
||||
@@ -923,7 +923,7 @@ namespace svgio::svgreader
|
||||
}
|
||||
case u't' :
|
||||
{
|
||||
if(rCandidate.match(aStrTranslate, nPos))
|
||||
if(rCandidate.matchIgnoreAsciiCase(aStrTranslate, nPos))
|
||||
{
|
||||
// translate element
|
||||
nPos += strlen(aStrTranslate);
|
||||
@@ -947,7 +947,7 @@ namespace svgio::svgreader
|
||||
}
|
||||
case u's' :
|
||||
{
|
||||
if(rCandidate.match(aStrScale, nPos))
|
||||
if(rCandidate.matchIgnoreAsciiCase(aStrScale, nPos))
|
||||
{
|
||||
// scale element
|
||||
nPos += strlen(aStrScale);
|
||||
@@ -967,7 +967,7 @@ namespace svgio::svgreader
|
||||
aScaleY.solve(rInfoProvider));
|
||||
}
|
||||
}
|
||||
else if(rCandidate.match(aStrSkewX, nPos))
|
||||
else if(rCandidate.matchIgnoreAsciiCase(aStrSkewX, nPos))
|
||||
{
|
||||
// skewx element
|
||||
nPos += strlen(aStrSkewX);
|
||||
@@ -982,7 +982,7 @@ namespace svgio::svgreader
|
||||
aMatrix = aMatrix * basegfx::utils::createShearXB2DHomMatrix(tan(fSkewX));
|
||||
}
|
||||
}
|
||||
else if(rCandidate.match(aStrSkewY, nPos))
|
||||
else if(rCandidate.matchIgnoreAsciiCase(aStrSkewY, nPos))
|
||||
{
|
||||
// skewy element
|
||||
nPos += strlen(aStrSkewY);
|
||||
@@ -1001,7 +1001,7 @@ namespace svgio::svgreader
|
||||
}
|
||||
case u'r' :
|
||||
{
|
||||
if(rCandidate.match(aStrRotate, nPos))
|
||||
if(rCandidate.matchIgnoreAsciiCase(aStrRotate, nPos))
|
||||
{
|
||||
// rotate element
|
||||
nPos += strlen(aStrRotate);
|
||||
@@ -1108,7 +1108,7 @@ namespace svgio::svgreader
|
||||
}
|
||||
else
|
||||
{
|
||||
if(rCandidate.startsWith("none"))
|
||||
if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(rCandidate), u"none"))
|
||||
{
|
||||
rSvgPaint = SvgPaint(aColor, true, false, false);
|
||||
return true;
|
||||
@@ -1118,7 +1118,7 @@ namespace svgio::svgreader
|
||||
/// Url is copied to rURL, but needs to be solved outside this helper
|
||||
return false;
|
||||
}
|
||||
else if(rCandidate.startsWith("currentColor"))
|
||||
else if(o3tl::equalsIgnoreAsciiCase(o3tl::trim(rCandidate), u"currentColor"))
|
||||
{
|
||||
rSvgPaint = SvgPaint(aColor, true, true, true);
|
||||
return true;
|
||||
@@ -1317,7 +1317,7 @@ namespace svgio::svgreader
|
||||
{
|
||||
static const char aStrData[] = "data:";
|
||||
|
||||
if(rCandidate.match(aStrData, 0))
|
||||
if(rCandidate.matchIgnoreAsciiCase(aStrData, 0))
|
||||
{
|
||||
// embedded data
|
||||
sal_Int32 nPos(strlen(aStrData));
|
||||
|
||||
Reference in New Issue
Block a user