diff options
author | Noel Grandin <noel@peralex.com> | 2014-11-03 14:03:54 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2014-11-05 08:44:19 +0200 |
commit | 705c48d32eec0aa5180e60ca157daca4b154e4a3 (patch) | |
tree | 97f43496f4b429a2b8d03b1e71cb2a1c33142a15 /svgio | |
parent | b7d8a58ff2698ffc6e22943f64aa97c5ea253bd9 (diff) |
fdo#38835 strip out OUString globals
they are largely unnecessary these days, since our OUString infrastructure
gained optimised handling for static char constants.
Change-Id: I07f73484f82d0582252cb4324d4107c998432c37
Diffstat (limited to 'svgio')
-rw-r--r-- | svgio/inc/svgio/svgreader/svgtoken.hxx | 4 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtoken.cxx | 270 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtools.cxx | 50 | ||||
-rw-r--r-- | svgio/source/svguno/xsvgparser.cxx | 7 |
4 files changed, 165 insertions, 166 deletions
diff --git a/svgio/inc/svgio/svgreader/svgtoken.hxx b/svgio/inc/svgio/svgreader/svgtoken.hxx index 8d6084776488..e755449ea0e0 100644 --- a/svgio/inc/svgio/svgreader/svgtoken.hxx +++ b/svgio/inc/svgio/svgreader/svgtoken.hxx @@ -186,8 +186,8 @@ namespace svgio SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent); - const OUString& getStrTitle(); - const OUString& getStrDesc(); + const OUString getStrTitle(); + const OUString getStrDesc(); } // end of namespace svgreader } // end of namespace svgio diff --git a/svgio/source/svgreader/svgtoken.cxx b/svgio/source/svgreader/svgtoken.cxx index 9d90bbcb6a46..989847433104 100644 --- a/svgio/source/svgreader/svgtoken.cxx +++ b/svgio/source/svgreader/svgtoken.cxx @@ -23,145 +23,145 @@ namespace svgio { namespace svgreader { - static OUString aSVGStrWidth("width"); - static OUString aSVGStrHeight("height"); - static OUString aSVGStrViewBox("viewBox"); - static OUString aSVGStrTransform("transform"); - static OUString aSVGStrStyle("style"); - static OUString aSVGStrDisplay("display"); // #i121656# - static OUString aSVGStrD("d"); - static OUString aSVGStrX("x"); - static OUString aSVGStrY("y"); - static OUString aSVGStrXmlns("xmlns"); - static OUString aSVGStrVersion("version"); - static OUString aSVGStrId("id"); - static OUString aSVGStrRx("rx"); - static OUString aSVGStrRy("ry"); - static OUString aSVGStrPoints("points"); - static OUString aSVGStrDx("dx"); - static OUString aSVGStrDy("dy"); - static OUString aSVGStrRotate("rotate"); - static OUString aSVGStrTextLength("textLength"); - static OUString aSVGStrLengthAdjust("lengthAdjust"); - static OUString aSVGStrFont("font"); - static OUString aSVGStrFontFamily("font-family"); - static OUString aSVGStrFontSize("font-size"); - static OUString aSVGStrFontSizeAdjust("font-size-adjust"); - static OUString aSVGStrFontStretch("font-stretch"); - static OUString aSVGStrFontStyle("font-style"); - static OUString aSVGStrFontVariant("font-variant"); - static OUString aSVGStrFontWeight("font-weight"); - static OUString aSVGStrDirection("direction"); - static OUString aSVGStrLetterSpacing("letter-spacing"); - static OUString aSVGStrTextDecoration("text-decoration"); - static OUString aSVGStrUnicodeBidi("unicode-bidi"); - static OUString aSVGStrWordSpacing("word-spacing"); - static OUString aSVGStrTspan("tspan"); - static OUString aSVGStrTref("tref"); - static OUString aSVGStrTextPath("textPath"); - static OUString aSVGStrStartOffset("startOffset"); - static OUString aSVGStrMethod("method"); - static OUString aSVGStrSpacing("spacing"); - static OUString aSVGStrTextAlign("text-align"); - static OUString aSVGStrPathLength("pathLength"); - static OUString aSVGStrType("type"); - static OUString aSVGStrClass("class"); - static OUString aSVGStrTextAnchor("text-anchor"); - static OUString aSVGStrXmlSpace("xml:space"); - static OUString aSVGStrColor("color"); - static OUString aSVGStrClipPathNode("clipPath"); - static OUString aSVGStrClipPathProperty("clip-path"); - static OUString aSVGStrMask("mask"); - static OUString aSVGStrClipPathUnits("clipPathUnits"); - static OUString aSVGStrMaskUnits("maskUnits"); - static OUString aSVGStrMaskContentUnits("maskContentUnits"); - static OUString aSVGStrClipRule("clip-rule"); - static OUString aSVGStrMarker("marker"); - static OUString aSVGStrMarkerStart("marker-start"); - static OUString aSVGStrMarkerMid("marker-mid"); - static OUString aSVGStrMarkerEnd("marker-end"); - static OUString aSVGStrRefX("refX"); - static OUString aSVGStrRefY("refY"); - static OUString aSVGStrMarkerUnits("markerUnits"); - static OUString aSVGStrMarkerWidth("markerWidth"); - static OUString aSVGStrMarkerHeight("markerHeight"); - static OUString aSVGStrOrient("orient"); - static OUString aSVGStrPattern("pattern"); - static OUString aSVGStrPatternUnits("patternUnits"); - static OUString aSVGStrPatternContentUnits("patternContentUnits"); - static OUString aSVGStrPatternTransform("patternTransform"); - static OUString aSVGStrOpacity("opacity"); - static OUString aSVGStrVisibility("visibility"); - static OUString aSVGStrTitle("title"); - static OUString aSVGStrDesc("desc"); + static const char aSVGStrWidth[] = "width"; + static const char aSVGStrHeight[] = "height"; + static const char aSVGStrViewBox[] = "viewBox"; + static const char aSVGStrTransform[] = "transform"; + static const char aSVGStrStyle[] = "style"; + static const char aSVGStrDisplay[] = "display"; // #i121656# + static const char aSVGStrD[] = "d"; + static const char aSVGStrX[] = "x"; + static const char aSVGStrY[] = "y"; + static const char aSVGStrXmlns[] = "xmlns"; + static const char aSVGStrVersion[] = "version"; + static const char aSVGStrId[] = "id"; + static const char aSVGStrRx[] = "rx"; + static const char aSVGStrRy[] = "ry"; + static const char aSVGStrPoints[] = "points"; + static const char aSVGStrDx[] = "dx"; + static const char aSVGStrDy[] = "dy"; + static const char aSVGStrRotate[] = "rotate"; + static const char aSVGStrTextLength[] = "textLength"; + static const char aSVGStrLengthAdjust[] = "lengthAdjust"; + static const char aSVGStrFont[] = "font"; + static const char aSVGStrFontFamily[] = "font-family"; + static const char aSVGStrFontSize[] = "font-size"; + static const char aSVGStrFontSizeAdjust[] = "font-size-adjust"; + static const char aSVGStrFontStretch[] = "font-stretch"; + static const char aSVGStrFontStyle[] = "font-style"; + static const char aSVGStrFontVariant[] = "font-variant"; + static const char aSVGStrFontWeight[] = "font-weight"; + static const char aSVGStrDirection[] = "direction"; + static const char aSVGStrLetterSpacing[] = "letter-spacing"; + static const char aSVGStrTextDecoration[] = "text-decoration"; + static const char aSVGStrUnicodeBidi[] = "unicode-bidi"; + static const char aSVGStrWordSpacing[] = "word-spacing"; + static const char aSVGStrTspan[] = "tspan"; + static const char aSVGStrTref[] = "tref"; + static const char aSVGStrTextPath[] = "textPath"; + static const char aSVGStrStartOffset[] = "startOffset"; + static const char aSVGStrMethod[] = "method"; + static const char aSVGStrSpacing[] = "spacing"; + static const char aSVGStrTextAlign[] = "text-align"; + static const char aSVGStrPathLength[] = "pathLength"; + static const char aSVGStrType[] = "type"; + static const char aSVGStrClass[] = "class"; + static const char aSVGStrTextAnchor[] = "text-anchor"; + static const char aSVGStrXmlSpace[] = "xml:space"; + static const char aSVGStrColor[] = "color"; + static const char aSVGStrClipPathNode[] = "clipPath"; + static const char aSVGStrClipPathProperty[] = "clip-path"; + static const char aSVGStrMask[] = "mask"; + static const char aSVGStrClipPathUnits[] = "clipPathUnits"; + static const char aSVGStrMaskUnits[] = "maskUnits"; + static const char aSVGStrMaskContentUnits[] = "maskContentUnits"; + static const char aSVGStrClipRule[] = "clip-rule"; + static const char aSVGStrMarker[] = "marker"; + static const char aSVGStrMarkerStart[] = "marker-start"; + static const char aSVGStrMarkerMid[] = "marker-mid"; + static const char aSVGStrMarkerEnd[] = "marker-end"; + static const char aSVGStrRefX[] = "refX"; + static const char aSVGStrRefY[] = "refY"; + static const char aSVGStrMarkerUnits[] = "markerUnits"; + static const char aSVGStrMarkerWidth[] = "markerWidth"; + static const char aSVGStrMarkerHeight[] = "markerHeight"; + static const char aSVGStrOrient[] = "orient"; + static const char aSVGStrPattern[] = "pattern"; + static const char aSVGStrPatternUnits[] = "patternUnits"; + static const char aSVGStrPatternContentUnits[] = "patternContentUnits"; + static const char aSVGStrPatternTransform[] = "patternTransform"; + static const char aSVGStrOpacity[] = "opacity"; + static const char aSVGStrVisibility[] = "visibility"; + static const char aSVGStrTitle[] = "title"; + static const char aSVGStrDesc[] = "desc"; - static OUString aSVGStrPreserveAspectRatio("preserveAspectRatio"); - static OUString aSVGStrDefer("defer"); - static OUString aSVGStrNone("none"); - static OUString aSVGStrXMinYMin("xMinYMin"); - static OUString aSVGStrXMidYMin("xMidYMin"); - static OUString aSVGStrXMaxYMin("xMaxYMin"); - static OUString aSVGStrXMinYMid("xMinYMid"); - static OUString aSVGStrXMidYMid("xMidYMid"); - static OUString aSVGStrXMaxYMid("xMaxYMid"); - static OUString aSVGStrXMinYMax("xMinYMax"); - static OUString aSVGStrXMidYMax("xMidYMax"); - static OUString aSVGStrXMaxYMax("xMaxYMax"); - static OUString aSVGStrMeet("meet"); - static OUString aSVGStrSlice("slice"); + static const char aSVGStrPreserveAspectRatio[] = "preserveAspectRatio"; + static const char aSVGStrDefer[] = "defer"; + static const char aSVGStrNone[] = "none"; + static const char aSVGStrXMinYMin[] = "xMinYMin"; + static const char aSVGStrXMidYMin[] = "xMidYMin"; + static const char aSVGStrXMaxYMin[] = "xMaxYMin"; + static const char aSVGStrXMinYMid[] = "xMinYMid"; + static const char aSVGStrXMidYMid[] = "xMidYMid"; + static const char aSVGStrXMaxYMid[] = "xMaxYMid"; + static const char aSVGStrXMinYMax[] = "xMinYMax"; + static const char aSVGStrXMidYMax[] = "xMidYMax"; + static const char aSVGStrXMaxYMax[] = "xMaxYMax"; + static const char aSVGStrMeet[] = "meet"; + static const char aSVGStrSlice[] = "slice"; - static OUString aSVGStrDefs("defs"); - static OUString aSVGStrG("g"); - static OUString aSVGStrSvg("svg"); - static OUString aSVGStrSymbol("symbol"); - static OUString aSVGStrUse("use"); + static const char aSVGStrDefs[] = "defs"; + static const char aSVGStrG[] = "g"; + static const char aSVGStrSvg[] = "svg"; + static const char aSVGStrSymbol[] = "symbol"; + static const char aSVGStrUse[] = "use"; - static OUString aSVGStrCircle("circle"); - static OUString aSVGStrEllipse("ellipse"); - static OUString aSVGStrLine("line"); - static OUString aSVGStrPath("path"); - static OUString aSVGStrPolygon("polygon"); - static OUString aSVGStrPolyline("polyline"); - static OUString aSVGStrRect("rect"); - static OUString aSVGStrImage("image"); + static const char aSVGStrCircle[] = "circle"; + static const char aSVGStrEllipse[] = "ellipse"; + static const char aSVGStrLine[] = "line"; + static const char aSVGStrPath[] = "path"; + static const char aSVGStrPolygon[] = "polygon"; + static const char aSVGStrPolyline[] = "polyline"; + static const char aSVGStrRect[] = "rect"; + static const char aSVGStrImage[] = "image"; - static OUString aSVGStrLinearGradient("linearGradient"); - static OUString aSVGStrRadialGradient("radialGradient"); - static OUString aSVGStrStop("stop"); - static OUString aSVGStrOffset("offset"); - static OUString aSVGStrX1("x1"); - static OUString aSVGStrY1("y1"); - static OUString aSVGStrX2("x2"); - static OUString aSVGStrY2("y2"); - static OUString aSVGStrCx("cx"); - static OUString aSVGStrCy("cy"); - static OUString aSVGStrFx("fx"); - static OUString aSVGStrFy("fy"); - static OUString aSVGStrR("r"); - static OUString aSVGStrGradientUnits("gradientUnits"); - static OUString aSVGStrGradientTransform("gradientTransform"); - static OUString aSVGStrSpreadMethod("spreadMethod"); - static OUString aSVGStrXlinkHref("xlink:href"); - static OUString aSVGStrStopColor("stop-color"); - static OUString aSVGStrStopOpacity("stop-opacity"); + static const char aSVGStrLinearGradient[] = "linearGradient"; + static const char aSVGStrRadialGradient[] = "radialGradient"; + static const char aSVGStrStop[] = "stop"; + static const char aSVGStrOffset[] = "offset"; + static const char aSVGStrX1[] = "x1"; + static const char aSVGStrY1[] = "y1"; + static const char aSVGStrX2[] = "x2"; + static const char aSVGStrY2[] = "y2"; + static const char aSVGStrCx[] = "cx"; + static const char aSVGStrCy[] = "cy"; + static const char aSVGStrFx[] = "fx"; + static const char aSVGStrFy[] = "fy"; + static const char aSVGStrR[] = "r"; + static const char aSVGStrGradientUnits[] = "gradientUnits"; + static const char aSVGStrGradientTransform[] = "gradientTransform"; + static const char aSVGStrSpreadMethod[] = "spreadMethod"; + static const char aSVGStrXlinkHref[] = "xlink:href"; + static const char aSVGStrStopColor[] = "stop-color"; + static const char aSVGStrStopOpacity[] = "stop-opacity"; - static OUString aSVGStrFill("fill"); - static OUString aSVGStrFillOpacity("fill-opacity"); - static OUString aSVGStrFillRule("fill-rule"); + static const char aSVGStrFill[] = "fill"; + static const char aSVGStrFillOpacity[] = "fill-opacity"; + static const char aSVGStrFillRule[] = "fill-rule"; - static OUString aSVGStrStroke("stroke"); - static OUString aSVGStrStrokeDasharray("stroke-dasharray"); - static OUString aSVGStrStrokeDashoffset("stroke-dashoffset"); - static OUString aSVGStrStrokeLinecap("stroke-linecap"); - static OUString aSVGStrStrokeLinejoin("stroke-linejoin"); - static OUString aSVGStrStrokeMiterlimit("stroke-miterlimit"); - static OUString aSVGStrStrokeOpacity("stroke-opacity"); - static OUString aSVGStrStrokeWidth("stroke-width"); + static const char aSVGStrStroke[] = "stroke"; + static const char aSVGStrStrokeDasharray[] = "stroke-dasharray"; + static const char aSVGStrStrokeDashoffset[] = "stroke-dashoffset"; + static const char aSVGStrStrokeLinecap[] = "stroke-linecap"; + static const char aSVGStrStrokeLinejoin[] = "stroke-linejoin"; + static const char aSVGStrStrokeMiterlimit[] = "stroke-miterlimit"; + static const char aSVGStrStrokeOpacity[] = "stroke-opacity"; + static const char aSVGStrStrokeWidth[] = "stroke-width"; - static OUString aSVGStrText("text"); - static OUString aSVGStrBaselineShift("baseline-shift"); + static const char aSVGStrText[] = "text"; + static const char aSVGStrBaselineShift[] = "baseline-shift"; - static OUString aSVGStrFlowRoot("flowRoot"); + static const char aSVGStrFlowRoot[] = "flowRoot"; SVGToken StrToSVGToken(const OUString& rStr, bool bCaseIndependent) { @@ -350,14 +350,14 @@ namespace svgio } } - const OUString& getStrTitle() + const OUString getStrTitle() { - return aSVGStrTitle; + return OUString(aSVGStrTitle); } - const OUString& getStrDesc() + const OUString getStrDesc() { - return aSVGStrDesc; + return OUString(aSVGStrDesc); } } // end of namespace svgreader } // end of namespace svgio diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx index a4d594a3d437..b856cb65b36e 100644 --- a/svgio/source/svgreader/svgtools.cxx +++ b/svgio/source/svgreader/svgtools.cxx @@ -565,8 +565,8 @@ namespace svgio if(nPos < nLen) { const sal_Unicode aChar(rCandidate[nPos]); - static OUString aStrGrad("grad"); - static OUString aStrRad("rad"); + static const char aStrGrad[] = "grad"; + static const char aStrRad[] = "rad"; switch(aChar) { @@ -576,7 +576,7 @@ namespace svgio if(rCandidate.matchIgnoreAsciiCase(aStrGrad, nPos)) { // angle in grad - nPos += aStrGrad.getLength(); + nPos += strlen(aStrGrad); aType = grad; } break; @@ -587,7 +587,7 @@ namespace svgio if(rCandidate.matchIgnoreAsciiCase(aStrRad, nPos)) { // angle in radians - nPos += aStrRad.getLength(); + nPos += strlen(aStrRad); aType = rad; } break; @@ -860,12 +860,12 @@ namespace svgio } else { - static OUString aStrRgb("rgb"); + static const char aStrRgb[] = "rgb"; if(rCandidate.matchIgnoreAsciiCase(aStrRgb, 0)) { // rgb definition - sal_Int32 nPos(aStrRgb.getLength()); + sal_Int32 nPos(strlen(aStrRgb)); skip_char(rCandidate, ' ', '(', nPos, nLen); double fR(0.0); @@ -986,12 +986,12 @@ namespace svgio { const sal_Unicode aChar(rCandidate[nPos]); const sal_Int32 nInitPos(nPos); - static OUString aStrMatrix("matrix"); - static OUString aStrTranslate("translate"); - static OUString aStrScale("scale"); - static OUString aStrRotate("rotate"); - static OUString aStrSkewX("skewX"); - static OUString aStrSkewY("skewY"); + static const char aStrMatrix[] = "matrix"; + static const char aStrTranslate[] = "translate"; + static const char aStrScale[] = "scale"; + static const char aStrRotate[] = "rotate"; + static const char aStrSkewX[] = "skewX"; + static const char aStrSkewY[] = "skewY"; switch(aChar) { @@ -1000,7 +1000,7 @@ namespace svgio if(rCandidate.match(aStrMatrix, nPos)) { // matrix element - nPos += aStrMatrix.getLength(); + nPos += strlen(aStrMatrix); skip_char(rCandidate, ' ', '(', nPos, nLen); SvgNumber aVal; basegfx::B2DHomMatrix aNew; @@ -1054,7 +1054,7 @@ namespace svgio if(rCandidate.match(aStrTranslate, nPos)) { // translate element - nPos += aStrTranslate.getLength(); + nPos += strlen(aStrTranslate); skip_char(rCandidate, ' ', '(', nPos, nLen); SvgNumber aTransX; @@ -1078,7 +1078,7 @@ namespace svgio if(rCandidate.match(aStrScale, nPos)) { // scale element - nPos += aStrScale.getLength(); + nPos += strlen(aStrScale); skip_char(rCandidate, ' ', '(', nPos, nLen); SvgNumber aScaleX; @@ -1098,7 +1098,7 @@ namespace svgio else if(rCandidate.match(aStrSkewX, nPos)) { // skewx element - nPos += aStrSkewX.getLength(); + nPos += strlen(aStrSkewX); skip_char(rCandidate, ' ', '(', nPos, nLen); double fSkewX(0.0); @@ -1113,7 +1113,7 @@ namespace svgio else if(rCandidate.match(aStrSkewY, nPos)) { // skewy element - nPos += aStrSkewY.getLength(); + nPos += strlen(aStrSkewY); skip_char(rCandidate, ' ', '(', nPos, nLen); double fSkewY(0.0); @@ -1132,7 +1132,7 @@ namespace svgio if(rCandidate.match(aStrRotate, nPos)) { // rotate element - nPos += aStrRotate.getLength(); + nPos += strlen(aStrRotate); skip_char(rCandidate, ' ', '(', nPos, nLen); double fAngle(0.0); @@ -1187,12 +1187,12 @@ namespace svgio bool readLocalUrl(const OUString& rCandidate, OUString& rURL) { - static OUString aStrUrl("url"); + static const char aStrUrl[] = "url"; if(rCandidate.startsWith(aStrUrl)) { const sal_Int32 nLen(rCandidate.getLength()); - sal_Int32 nPos(aStrUrl.getLength()); + sal_Int32 nPos(strlen(aStrUrl)); skip_char(rCandidate, '(', '#', nPos, nLen); OUStringBuffer aTokenValue; @@ -1424,12 +1424,12 @@ namespace svgio } else { - static OUString aStrData("data:"); + static const char aStrData[] = "data:"; if(rCandidate.match(aStrData, 0)) { // embedded data - sal_Int32 nPos(aStrData.getLength()); + sal_Int32 nPos(strlen(aStrData)); sal_Int32 nLen(rCandidate.getLength()); OUStringBuffer aBuffer; @@ -1441,18 +1441,18 @@ namespace svgio if(!rMimeType.isEmpty() && nPos < nLen) { - static OUString aStrImage("image"); + static const char aStrImage[] = "image"; if(rMimeType.match(aStrImage, 0)) { // image data OUString aData(rCandidate.copy(nPos)); - static OUString aStrBase64("base64"); + static const char aStrBase64[] = "base64"; if(aData.match(aStrBase64, 0)) { // base64 encoded - nPos = aStrBase64.getLength(); + nPos = strlen(aStrBase64); nLen = aData.getLength(); skip_char(aData, ' ', ',', nPos, nLen); diff --git a/svgio/source/svguno/xsvgparser.cxx b/svgio/source/svguno/xsvgparser.cxx index 988469889668..29ece61e2777 100644 --- a/svgio/source/svguno/xsvgparser.cxx +++ b/svgio/source/svguno/xsvgparser.cxx @@ -70,10 +70,9 @@ namespace svgio { uno::Sequence< OUString > XSvgParser_getSupportedServiceNames() { - static OUString aServiceName("com.sun.star.graphic.SvgTools" ); - static uno::Sequence< OUString > aServiceNames( &aServiceName, 1 ); - - return( aServiceNames ); + OUString aServiceName("com.sun.star.graphic.SvgTools" ); + uno::Sequence< OUString > aServiceNames( &aServiceName, 1 ); + return aServiceNames; } OUString XSvgParser_getImplementationName() |