diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2012-02-15 07:25:29 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2012-02-15 07:25:29 +0000 |
| commit | 8edcffdc305b2c09a4f9b886fee12ecfc48a0e24 (patch) | |
| tree | 2365a85f9cae27fb1f8053ff69f445b02304c12e /src/dom/xpathparser.cpp | |
| parent | Snap to grid/guide lines perpendicularly (diff) | |
| download | inkscape-8edcffdc305b2c09a4f9b886fee12ecfc48a0e24.tar.gz inkscape-8edcffdc305b2c09a4f9b886fee12ecfc48a0e24.zip | |
cppcheck
(bzr r10977)
Diffstat (limited to 'src/dom/xpathparser.cpp')
| -rw-r--r-- | src/dom/xpathparser.cpp | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/dom/xpathparser.cpp b/src/dom/xpathparser.cpp index f0e929687..393c12cda 100644 --- a/src/dom/xpathparser.cpp +++ b/src/dom/xpathparser.cpp @@ -228,16 +228,16 @@ int XPathParser::getNumber(int p0, double &dresult) { int p = p0; if (p >= parselen) + { return p0;/*need at least x*/ - + } + bool isdouble = false; - bool negative = false; int ch = parsebuf[p]; if (ch=='-') { p++; - negative = true; if (p >= parselen) return p0; } @@ -1189,18 +1189,20 @@ int XPathParser::getFunctionCall(int p0, int depth) int p = p0; if (lexTokType(p) != FUNCTION_NAME) + { return p0; - + } + DOMString name = lexTok(p).getStringValue(); p++; if (lexTokType(p) != LPAREN) //this makes a function + { return p0; + } p++; - int argCount = 0; - int p2 = getArgument(p, depth+1); if (p2 < 0) { @@ -1209,7 +1211,7 @@ int XPathParser::getFunctionCall(int p0, int depth) } if (p2 > p) { - argCount++; + int argCount = 1; p = p2; while (lexTokType(p) == COMMA) { |
