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
This commit is contained in:
@@ -27,15 +27,17 @@ namespace basegfx
|
|||||||
{
|
{
|
||||||
namespace internal
|
namespace internal
|
||||||
{
|
{
|
||||||
void lcl_skipSpaces(sal_Int32& io_rPos,
|
void skipSpaces(sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen);
|
const sal_Int32 nLen);
|
||||||
|
|
||||||
void lcl_skipSpacesAndCommas(sal_Int32& io_rPos,
|
void skipSpacesAndCommas(sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen);
|
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)
|
const bool bPredicate( (sal_Unicode('0') <= aChar && sal_Unicode('9') >= aChar)
|
||||||
|| (bSignAllowed && sal_Unicode('+') == aChar)
|
|| (bSignAllowed && sal_Unicode('+') == aChar)
|
||||||
@@ -45,38 +47,41 @@ namespace basegfx
|
|||||||
return bPredicate;
|
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,
|
bool getDoubleChar(double& o_fRetval,
|
||||||
sal_Int32& io_rPos,
|
sal_Int32& io_rPos,
|
||||||
const OUString& rStr);
|
const OUString& rStr);
|
||||||
|
|
||||||
bool lcl_importDoubleAndSpaces( double& o_fRetval,
|
bool importDoubleAndSpaces(double& o_fRetval,
|
||||||
sal_Int32& io_rPos,
|
sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen );
|
const sal_Int32 nLen );
|
||||||
|
|
||||||
bool lcl_importFlagAndSpaces(sal_Int32& o_nRetval,
|
bool importFlagAndSpaces(sal_Int32& o_nRetval,
|
||||||
sal_Int32& io_rPos,
|
sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen);
|
const sal_Int32 nLen);
|
||||||
|
|
||||||
void lcl_skipNumber(sal_Int32& io_rPos,
|
void skipNumber(sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen);
|
const sal_Int32 nLen);
|
||||||
|
|
||||||
void lcl_skipDouble(sal_Int32& io_rPos,
|
void skipDouble(sal_Int32& io_rPos,
|
||||||
const OUString& rStr);
|
const OUString& rStr);
|
||||||
|
|
||||||
void lcl_putNumberCharWithSpace( OUStringBuffer& rStr,
|
void putNumberCharWithSpace(OUStringBuffer& rStr,
|
||||||
double fValue,
|
double fValue,
|
||||||
double fOldValue,
|
double fOldValue,
|
||||||
bool bUseRelativeCoordinates);
|
bool bUseRelativeCoordinates);
|
||||||
|
|
||||||
inline sal_Unicode lcl_getCommand( sal_Char cUpperCaseCommand,
|
inline sal_Unicode getCommand(sal_Char cUpperCaseCommand,
|
||||||
sal_Char cLowerCaseCommand,
|
sal_Char cLowerCaseCommand,
|
||||||
bool bUseRelativeCoordinates)
|
bool bUseRelativeCoordinates)
|
||||||
{
|
{
|
||||||
|
@@ -56,7 +56,7 @@ namespace basegfx
|
|||||||
B2DPolygon aCurrPoly;
|
B2DPolygon aCurrPoly;
|
||||||
|
|
||||||
// skip initial whitespace
|
// skip initial whitespace
|
||||||
::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen);
|
basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen);
|
||||||
|
|
||||||
while(nPos < nLen)
|
while(nPos < nLen)
|
||||||
{
|
{
|
||||||
@@ -78,7 +78,7 @@ namespace basegfx
|
|||||||
{
|
{
|
||||||
// consume CurrChar and whitespace
|
// consume CurrChar and whitespace
|
||||||
nPos++;
|
nPos++;
|
||||||
::basegfx::internal::lcl_skipSpaces(nPos, rSvgDStatement, nLen);
|
basegfx::internal::skipSpaces(nPos, rSvgDStatement, nLen);
|
||||||
|
|
||||||
// create closed polygon and reset import values
|
// create closed polygon and reset import values
|
||||||
if(aCurrPoly.count())
|
if(aCurrPoly.count())
|
||||||
@@ -122,14 +122,14 @@ namespace basegfx
|
|||||||
|
|
||||||
// consume CurrChar and whitespace
|
// consume CurrChar and whitespace
|
||||||
nPos++;
|
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 nX, nY;
|
||||||
|
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
|
|
||||||
if(bRelative)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -155,13 +155,13 @@ namespace basegfx
|
|||||||
case 'H' :
|
case 'H' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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);
|
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)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -185,13 +185,13 @@ namespace basegfx
|
|||||||
case 'V' :
|
case 'V' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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;
|
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)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -215,17 +215,17 @@ namespace basegfx
|
|||||||
case 'S' :
|
case 'S' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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 nX, nY;
|
||||||
double nX2, nY2;
|
double nX2, nY2;
|
||||||
|
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
|
|
||||||
if(bRelative)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -274,20 +274,20 @@ namespace basegfx
|
|||||||
case 'C' :
|
case 'C' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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 nX, nY;
|
||||||
double nX1, nY1;
|
double nX1, nY1;
|
||||||
double nX2, nY2;
|
double nX2, nY2;
|
||||||
|
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX2, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY2, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
|
|
||||||
if(bRelative)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -324,17 +324,17 @@ namespace basegfx
|
|||||||
case 'Q' :
|
case 'Q' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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 nX, nY;
|
||||||
double nX1, nY1;
|
double nX1, nY1;
|
||||||
|
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX1, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY1, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
|
|
||||||
if(bRelative)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -375,14 +375,14 @@ namespace basegfx
|
|||||||
case 'T' :
|
case 'T' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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 nX, nY;
|
||||||
|
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
|
|
||||||
if(bRelative)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -449,21 +449,21 @@ namespace basegfx
|
|||||||
case 'A' :
|
case 'A' :
|
||||||
{
|
{
|
||||||
nPos++;
|
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 nX, nY;
|
||||||
double fRX, fRY, fPhi;
|
double fRX, fRY, fPhi;
|
||||||
sal_Int32 bLargeArcFlag, bSweepFlag;
|
sal_Int32 bLargeArcFlag, bSweepFlag;
|
||||||
|
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(fRX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(fRX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(fRY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(fRY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(fPhi, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(fPhi, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importFlagAndSpaces(bLargeArcFlag, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importFlagAndSpaces(bLargeArcFlag, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importFlagAndSpaces(bSweepFlag, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importFlagAndSpaces(bSweepFlag, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgDStatement, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgDStatement, nLen)) return false;
|
||||||
|
|
||||||
if(bRelative)
|
if(bRelative)
|
||||||
{
|
{
|
||||||
@@ -647,18 +647,18 @@ namespace basegfx
|
|||||||
double nX, nY;
|
double nX, nY;
|
||||||
|
|
||||||
// skip initial whitespace
|
// skip initial whitespace
|
||||||
::basegfx::internal::lcl_skipSpaces(nPos, rSvgPointsAttribute, nLen);
|
basegfx::internal::skipSpaces(nPos, rSvgPointsAttribute, nLen);
|
||||||
|
|
||||||
while(nPos < nLen)
|
while(nPos < nLen)
|
||||||
{
|
{
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nX, nPos, rSvgPointsAttribute, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nX, nPos, rSvgPointsAttribute, nLen)) return false;
|
||||||
if(!::basegfx::internal::lcl_importDoubleAndSpaces(nY, nPos, rSvgPointsAttribute, nLen)) return false;
|
if(!basegfx::internal::importDoubleAndSpaces(nY, nPos, rSvgPointsAttribute, nLen)) return false;
|
||||||
|
|
||||||
// add point
|
// add point
|
||||||
o_rPoly.append(B2DPoint(nX, nY));
|
o_rPoly.append(B2DPoint(nX, nY));
|
||||||
|
|
||||||
// skip to next number, or finish
|
// skip to next number, or finish
|
||||||
::basegfx::internal::lcl_skipSpaces(nPos, rSvgPointsAttribute, nLen);
|
basegfx::internal::skipSpaces(nPos, rSvgPointsAttribute, nLen);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -722,10 +722,10 @@ namespace basegfx
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Write 'moveto' and the 1st coordinates, set aLastSVGCommand to 'lineto'
|
// Write 'moveto' and the 1st coordinates, set aLastSVGCommand to 'lineto'
|
||||||
aResult.append(::basegfx::internal::lcl_getCommand('M', 'm', bUseRelativeCoordinatesForFirstPoint));
|
aResult.append(basegfx::internal::getCommand('M', 'm', bUseRelativeCoordinatesForFirstPoint));
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinatesForFirstPoint);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinatesForFirstPoint);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinatesForFirstPoint);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinatesForFirstPoint);
|
||||||
aLastSVGCommand = ::basegfx::internal::lcl_getCommand('L', 'l', bUseRelativeCoordinatesForFirstPoint);
|
aLastSVGCommand = basegfx::internal::getCommand('L', 'l', bUseRelativeCoordinatesForFirstPoint);
|
||||||
aCurrentSVGPosition = aEdgeStart;
|
aCurrentSVGPosition = aEdgeStart;
|
||||||
|
|
||||||
for(sal_uInt32 nIndex(0); nIndex < nEdgeCount; nIndex++)
|
for(sal_uInt32 nIndex(0); nIndex < nEdgeCount; nIndex++)
|
||||||
@@ -779,7 +779,7 @@ namespace basegfx
|
|||||||
// approximately equal, export as quadratic bezier
|
// approximately equal, export as quadratic bezier
|
||||||
if(bSymmetricAtEdgeStart)
|
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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -787,14 +787,14 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
aCurrentSVGPosition = aEdgeEnd;
|
||||||
}
|
}
|
||||||
else
|
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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -802,10 +802,10 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aLeft.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aLeft.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aLeft.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aLeft.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
aCurrentSVGPosition = aEdgeEnd;
|
||||||
}
|
}
|
||||||
@@ -815,7 +815,7 @@ namespace basegfx
|
|||||||
// export as cubic bezier
|
// export as cubic bezier
|
||||||
if(bSymmetricAtEdgeStart)
|
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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -823,16 +823,16 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
aCurrentSVGPosition = aEdgeEnd;
|
||||||
}
|
}
|
||||||
else
|
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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -840,12 +840,12 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeStart.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeStart.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aControlEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
aCurrentSVGPosition = aEdgeEnd;
|
||||||
}
|
}
|
||||||
@@ -871,7 +871,7 @@ namespace basegfx
|
|||||||
else if(bXEqual)
|
else if(bXEqual)
|
||||||
{
|
{
|
||||||
// export as vertical line
|
// 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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -879,13 +879,13 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
aCurrentSVGPosition = aEdgeEnd;
|
||||||
}
|
}
|
||||||
else if(bYEqual)
|
else if(bYEqual)
|
||||||
{
|
{
|
||||||
// export as horizontal line
|
// 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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -893,13 +893,13 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
aCurrentSVGPosition = aEdgeEnd;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// export as line
|
// 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)
|
if(aLastSVGCommand != aCommand)
|
||||||
{
|
{
|
||||||
@@ -907,8 +907,8 @@ namespace basegfx
|
|||||||
aLastSVGCommand = aCommand;
|
aLastSVGCommand = aCommand;
|
||||||
}
|
}
|
||||||
|
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getX(), aCurrentSVGPosition.getX(), bUseRelativeCoordinates);
|
||||||
::basegfx::internal::lcl_putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
basegfx::internal::putNumberCharWithSpace(aResult, aEdgeEnd.getY(), aCurrentSVGPosition.getY(), bUseRelativeCoordinates);
|
||||||
aCurrentSVGPosition = aEdgeEnd;
|
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)
|
// close path if closed poly (Z and z are equivalent here, but looks nicer when case is matched)
|
||||||
if(aPolygon.isClosed())
|
if(aPolygon.isClosed())
|
||||||
{
|
{
|
||||||
aResult.append(::basegfx::internal::lcl_getCommand('Z', 'z', bUseRelativeCoordinates));
|
aResult.append(basegfx::internal::getCommand('Z', 'z', bUseRelativeCoordinates));
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!bHandleRelativeNextPointCompatible)
|
if(!bHandleRelativeNextPointCompatible)
|
||||||
|
@@ -24,7 +24,7 @@ namespace basegfx
|
|||||||
{
|
{
|
||||||
namespace internal
|
namespace internal
|
||||||
{
|
{
|
||||||
void lcl_skipSpaces(sal_Int32& io_rPos,
|
void skipSpaces(sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen)
|
const sal_Int32 nLen)
|
||||||
{
|
{
|
||||||
@@ -35,7 +35,7 @@ namespace basegfx
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcl_skipSpacesAndCommas(sal_Int32& io_rPos,
|
void skipSpacesAndCommas(sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen)
|
const sal_Int32 nLen)
|
||||||
{
|
{
|
||||||
@@ -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] );
|
sal_Unicode aChar( rStr[io_rPos] );
|
||||||
OUStringBuffer sNumberString;
|
OUStringBuffer sNumberString;
|
||||||
@@ -120,20 +122,20 @@ namespace basegfx
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcl_importDoubleAndSpaces( double& o_fRetval,
|
bool importDoubleAndSpaces(double& o_fRetval,
|
||||||
sal_Int32& io_rPos,
|
sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen )
|
const sal_Int32 nLen )
|
||||||
{
|
{
|
||||||
if( !lcl_getDoubleChar(o_fRetval, io_rPos, rStr) )
|
if( !getDoubleChar(o_fRetval, io_rPos, rStr) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lcl_skipSpacesAndCommas(io_rPos, rStr, nLen);
|
skipSpacesAndCommas(io_rPos, rStr, nLen);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool lcl_importFlagAndSpaces(sal_Int32& o_nRetval,
|
bool importFlagAndSpaces(sal_Int32& o_nRetval,
|
||||||
sal_Int32& io_rPos,
|
sal_Int32& io_rPos,
|
||||||
const OUString& rStr,
|
const OUString& rStr,
|
||||||
const sal_Int32 nLen)
|
const sal_Int32 nLen)
|
||||||
@@ -153,12 +155,12 @@ namespace basegfx
|
|||||||
else
|
else
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
lcl_skipSpacesAndCommas(io_rPos, rStr, nLen);
|
skipSpacesAndCommas(io_rPos, rStr, nLen);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void lcl_putNumberCharWithSpace( OUStringBuffer& rStr,
|
void putNumberCharWithSpace(OUStringBuffer& rStr,
|
||||||
double fValue,
|
double fValue,
|
||||||
double fOldValue,
|
double fOldValue,
|
||||||
bool bUseRelativeCoordinates )
|
bool bUseRelativeCoordinates )
|
||||||
@@ -169,7 +171,7 @@ namespace basegfx
|
|||||||
const sal_Int32 aLen( rStr.getLength() );
|
const sal_Int32 aLen( rStr.getLength() );
|
||||||
if(aLen)
|
if(aLen)
|
||||||
{
|
{
|
||||||
if( lcl_isOnNumberChar(rStr[aLen - 1], false, true) &&
|
if( isOnNumberChar(rStr[aLen - 1], false, true) &&
|
||||||
fValue >= 0.0 )
|
fValue >= 0.0 )
|
||||||
{
|
{
|
||||||
rStr.append( ' ' );
|
rStr.append( ' ' );
|
||||||
@@ -178,7 +180,6 @@ namespace basegfx
|
|||||||
|
|
||||||
rStr.append(fValue);
|
rStr.append(fValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace internal
|
} // namespace internal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user