diff options
author | Tor Lillqvist <tml@collabora.com> | 2015-05-05 10:27:00 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2015-05-05 10:59:11 +0300 |
commit | 3363f828d63775a11073276dce927b9538b57be6 (patch) | |
tree | 66bfbffde18147a5d7188e4cf4dce0cd47112395 /basegfx/source | |
parent | 259820af718fe15ea5080711f77918dad8f14fbb (diff) |
Drop misused lcl_ prefix
If used at all, lcl_ is supposed to be used for static functions truly local
to one source files. The functions here occur in several source files (well,
two, the one where they are defined and one other) so they are not "local" in
that sense. (But they could be local in the one file that uses them...) Also,
they are already in a basegfx::internal namespace.
While at it, drop the :: prefix eyesore from basegfx::internal, and align
parameter lists consistently.
Change-Id: I68b91075e0b1779ac0fa884d8f9e956f1ab7b308
Diffstat (limited to 'basegfx/source')
-rw-r--r-- | basegfx/source/inc/stringconversiontools.hxx | 69 | ||||
-rw-r--r-- | basegfx/source/polygon/b2dsvgpolypolygon.cxx | 162 | ||||
-rw-r--r-- | basegfx/source/tools/stringconversiontools.cxx | 49 |
3 files changed, 143 insertions, 137 deletions
diff --git a/basegfx/source/inc/stringconversiontools.hxx b/basegfx/source/inc/stringconversiontools.hxx index 04b9f8344819..92713bf598c0 100644 --- a/basegfx/source/inc/stringconversiontools.hxx +++ b/basegfx/source/inc/stringconversiontools.hxx @@ -27,15 +27,17 @@ namespace basegfx { namespace internal { - void lcl_skipSpaces(sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen); + void skipSpaces(sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen); - void lcl_skipSpacesAndCommas(sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen); + void skipSpacesAndCommas(sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen); - inline bool lcl_isOnNumberChar(const sal_Unicode aChar, bool bSignAllowed = true, bool bDotAllowed = true) + inline bool isOnNumberChar(const sal_Unicode aChar, + bool bSignAllowed = true, + bool bDotAllowed = true) { const bool bPredicate( (sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar) || (bSignAllowed && sal_Unicode('+') == aChar) @@ -45,40 +47,43 @@ namespace basegfx return bPredicate; } - inline bool lcl_isOnNumberChar(const OUString& rStr, const sal_Int32 nPos, bool bSignAllowed = true, bool bDotAllowed = true) + inline bool isOnNumberChar(const OUString& rStr, + const sal_Int32 nPos, + bool bSignAllowed = true, + bool bDotAllowed = true) { - return lcl_isOnNumberChar(rStr[nPos], bSignAllowed, bDotAllowed); + return isOnNumberChar(rStr[nPos], bSignAllowed, bDotAllowed); } - bool lcl_getDoubleChar(double& o_fRetval, - sal_Int32& io_rPos, - const OUString& rStr); + bool getDoubleChar(double& o_fRetval, + sal_Int32& io_rPos, + const OUString& rStr); - bool lcl_importDoubleAndSpaces( double& o_fRetval, - sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen ); + bool importDoubleAndSpaces(double& o_fRetval, + sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen ); - bool lcl_importFlagAndSpaces(sal_Int32& o_nRetval, - sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen); + bool importFlagAndSpaces(sal_Int32& o_nRetval, + sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen); - void lcl_skipNumber(sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen); + void skipNumber(sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen); - void lcl_skipDouble(sal_Int32& io_rPos, - const OUString& rStr); + void skipDouble(sal_Int32& io_rPos, + const OUString& rStr); - void lcl_putNumberCharWithSpace( OUStringBuffer& rStr, - double fValue, - double fOldValue, - bool bUseRelativeCoordinates ); + void putNumberCharWithSpace(OUStringBuffer& rStr, + double fValue, + double fOldValue, + bool bUseRelativeCoordinates); - inline sal_Unicode lcl_getCommand( sal_Char cUpperCaseCommand, - sal_Char cLowerCaseCommand, - bool bUseRelativeCoordinates ) + inline sal_Unicode getCommand(sal_Char cUpperCaseCommand, + sal_Char cLowerCaseCommand, + bool bUseRelativeCoordinates) { return bUseRelativeCoordinates ? cLowerCaseCommand : cUpperCaseCommand; } diff --git a/basegfx/source/polygon/b2dsvgpolypolygon.cxx b/basegfx/source/polygon/b2dsvgpolypolygon.cxx index fac3b78b8e28..7a76f075c6e4 100644 --- a/basegfx/source/polygon/b2dsvgpolypolygon.cxx +++ b/basegfx/source/polygon/b2dsvgpolypolygon.cxx @@ -56,7 +56,7 @@ namespace basegfx B2DPolygon aCurrPoly; // skip initial whitespace - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); while(nPos < nLen) { @@ -78,7 +78,7 @@ namespace basegfx { // consume CurrChar and whitespace nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); // create closed polygon and reset import values if(aCurrPoly.count()) @@ -122,14 +122,14 @@ namespace basegfx // consume CurrChar and whitespace nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -155,13 +155,13 @@ namespace basegfx case 'H' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY(nLastY); - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -185,13 +185,13 @@ namespace basegfx case 'V' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX(nLastX), nY; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -215,17 +215,17 @@ namespace basegfx case 'S' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY; double nX2, nY2; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -274,20 +274,20 @@ namespace basegfx case 'C' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY; double nX1, nY1; double nX2, nY2; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -324,17 +324,17 @@ namespace basegfx case 'Q' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY; double nX1, nY1; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -375,14 +375,14 @@ namespace basegfx case 'T' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -449,21 +449,21 @@ namespace basegfx case 'A' : { nPos++; - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen); + basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen); - while(nPos < nLen && ::basegfx::internal::lcl_isOnNumberChar(rSvgDStatement, nPos)) + while(nPos < nLen && basegfx::internal::isOnNumberChar(rSvgDStatement, nPos)) { double nX, nY; double fRX, fRY, fPhi; sal_Int32 bLargeArcFlag, bSweepFlag; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(fRX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(fRY, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(fPhi, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importFlagAndSpaces(bLargeArcFlag, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importFlagAndSpaces(bSweepFlag, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(fRX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(fRY, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(fPhi, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importFlagAndSpaces(bLargeArcFlag, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importFlagAndSpaces(bSweepFlag, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false; if(bRelative) { @@ -647,18 +647,18 @@ namespace basegfx double nX, nY; // skip initial whitespace - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgPointsAttribute, nLen); + basegfx::internal::skipSpaces(nPos, rSvgPointsAttribute, nLen); while(nPos < nLen) { - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgPointsAttribute, nLen)) return false; - if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgPointsAttribute, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgPointsAttribute, nLen)) return false; + if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgPointsAttribute, nLen)) return false; // add point o_rPoly.append(B2DPoint(nX, nY)); // skip to next number, or finish - ::basegfx::internal::lcl_skipSpaces(nPos, rSvgPointsAttribute, nLen); + basegfx::internal::skipSpaces(nPos, rSvgPointsAttribute, nLen); } return true; @@ -722,10 +722,10 @@ namespace basegfx } // Write 'moveto' and the 1st coordinates, set aLastSVGCommand to 'lineto' - aResult.append(::basegfx::internal::lcl_getCommand('M', 'm', bUseRelativeCoordinatesForFirstPoint)); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinatesForFirstPoint); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinatesForFirstPoint); - aLastSVGCommand = ::basegfx::internal::lcl_getCommand('L', 'l', bUseRelativeCoordinatesForFirstPoint); + aResult.append(basegfx::internal::getCommand('M', 'm', bUseRelativeCoordinatesForFirstPoint)); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinatesForFirstPoint); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinatesForFirstPoint); + aLastSVGCommand = basegfx::internal::getCommand('L', 'l', bUseRelativeCoordinatesForFirstPoint); aCurrentSVGPosition = aEdgeStart; for(sal_uInt32 nIndex(0); nIndex < nEdgeCount; nIndex++) @@ -779,7 +779,7 @@ namespace basegfx // approximately equal, export as quadratic bezier if(bSymmetricAtEdgeStart) { - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('T', 't', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('T', 't', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -787,14 +787,14 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); aLastSVGCommand = aCommand; aCurrentSVGPosition = aEdgeEnd; } else { - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('Q', 'q', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('Q', 'q', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -802,10 +802,10 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aLeft.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aLeft.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aLeft.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aLeft.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); aLastSVGCommand = aCommand; aCurrentSVGPosition = aEdgeEnd; } @@ -815,7 +815,7 @@ namespace basegfx // export as cubic bezier if(bSymmetricAtEdgeStart) { - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('S', 's', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('S', 's', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -823,16 +823,16 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); aLastSVGCommand = aCommand; aCurrentSVGPosition = aEdgeEnd; } else { - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('C', 'c', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('C', 'c', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -840,12 +840,12 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); aLastSVGCommand = aCommand; aCurrentSVGPosition = aEdgeEnd; } @@ -871,7 +871,7 @@ namespace basegfx else if(bXEqual) { // export as vertical line - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('V', 'v', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('V', 'v', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -879,13 +879,13 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); aCurrentSVGPosition = aEdgeEnd; } else if(bYEqual) { // export as horizontal line - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('H', 'h', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('H', 'h', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -893,13 +893,13 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); aCurrentSVGPosition = aEdgeEnd; } else { // export as line - const sal_Unicode aCommand(::basegfx::internal::lcl_getCommand('L', 'l', bUseRelativeCoordinates)); + const sal_Unicode aCommand(basegfx::internal::getCommand('L', 'l', bUseRelativeCoordinates)); if(aLastSVGCommand != aCommand) { @@ -907,8 +907,8 @@ namespace basegfx aLastSVGCommand = aCommand; } - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); - ::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates); + basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates); aCurrentSVGPosition = aEdgeEnd; } } @@ -921,7 +921,7 @@ namespace basegfx // close path if closed poly (Z and z are equivalent here, but looks nicer when case is matched) if(aPolygon.isClosed()) { - aResult.append(::basegfx::internal::lcl_getCommand('Z', 'z', bUseRelativeCoordinates)); + aResult.append(basegfx::internal::getCommand('Z', 'z', bUseRelativeCoordinates)); } if(!bHandleRelativeNextPointCompatible) diff --git a/basegfx/source/tools/stringconversiontools.cxx b/basegfx/source/tools/stringconversiontools.cxx index 040c358337b2..4fcbbc77e9c2 100644 --- a/basegfx/source/tools/stringconversiontools.cxx +++ b/basegfx/source/tools/stringconversiontools.cxx @@ -24,9 +24,9 @@ namespace basegfx { namespace internal { - void lcl_skipSpaces(sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen) + void skipSpaces(sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen) { while( io_rPos < nLen && ' ' == rStr[io_rPos] ) @@ -35,9 +35,9 @@ namespace basegfx } } - void lcl_skipSpacesAndCommas(sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen) + void skipSpacesAndCommas(sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen) { while(io_rPos < nLen && (' ' == rStr[io_rPos] || ',' == rStr[io_rPos])) @@ -46,7 +46,9 @@ namespace basegfx } } - bool lcl_getDoubleChar(double& o_fRetval, sal_Int32& io_rPos, const OUString& rStr) + bool getDoubleChar(double& o_fRetval, + sal_Int32& io_rPos, + const OUString& rStr) { sal_Unicode aChar( rStr[io_rPos] ); OUStringBuffer sNumberString; @@ -120,23 +122,23 @@ namespace basegfx return false; } - bool lcl_importDoubleAndSpaces( double& o_fRetval, - sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen ) + bool importDoubleAndSpaces(double& o_fRetval, + sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen ) { - if( !lcl_getDoubleChar(o_fRetval, io_rPos, rStr) ) + if( !getDoubleChar(o_fRetval, io_rPos, rStr) ) return false; - lcl_skipSpacesAndCommas(io_rPos, rStr, nLen); + skipSpacesAndCommas(io_rPos, rStr, nLen); return true; } - bool lcl_importFlagAndSpaces(sal_Int32& o_nRetval, - sal_Int32& io_rPos, - const OUString& rStr, - const sal_Int32 nLen) + bool importFlagAndSpaces(sal_Int32& o_nRetval, + sal_Int32& io_rPos, + const OUString& rStr, + const sal_Int32 nLen) { sal_Unicode aChar( rStr[io_rPos] ); @@ -153,15 +155,15 @@ namespace basegfx else return false; - lcl_skipSpacesAndCommas(io_rPos, rStr, nLen); + skipSpacesAndCommas(io_rPos, rStr, nLen); return true; } - void lcl_putNumberCharWithSpace( OUStringBuffer& rStr, - double fValue, - double fOldValue, - bool bUseRelativeCoordinates ) + void putNumberCharWithSpace(OUStringBuffer& rStr, + double fValue, + double fOldValue, + bool bUseRelativeCoordinates ) { if( bUseRelativeCoordinates ) fValue -= fOldValue; @@ -169,7 +171,7 @@ namespace basegfx const sal_Int32 aLen( rStr.getLength() ); if(aLen) { - if( lcl_isOnNumberChar(rStr[aLen - 1], false, true) && + if( isOnNumberChar(rStr[aLen - 1], false, true) && fValue >= 0.0 ) { rStr.append( ' ' ); @@ -178,7 +180,6 @@ namespace basegfx rStr.append(fValue); } - } // namespace internal } |