summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2011-01-25 14:45:21 +0100
committerDavid Tardon <dtardon@redhat.com>2011-01-25 14:45:50 +0100
commitf5174d58eee92a678d56a4b360ba6e57b098eabd (patch)
tree55652cae399f236ff6d4b49776ae38abcfbbf599
parent7bf43f57e8834314a5678f78f680e69fc780c592 (diff)
make the test for "-" more robust
-rw-r--r--xmloff/source/draw/ximpcustomshape.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/xmloff/source/draw/ximpcustomshape.cxx b/xmloff/source/draw/ximpcustomshape.cxx
index d85cb49545..d9d55cec26 100644
--- a/xmloff/source/draw/ximpcustomshape.cxx
+++ b/xmloff/source/draw/ximpcustomshape.cxx
@@ -320,6 +320,7 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter
sal_Int32 nEIndex = 0; // index of "E" in double
sal_Bool bE = sal_False; // set if a double is including a "E" statement
+ sal_Bool bENum = sal_False; // there is at least one number after "E"
sal_Bool bDot = sal_False; // set if there is a dot included
sal_Bool bEnd = sal_False; // set for each value that can not be part of a double/integer
@@ -345,7 +346,19 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter
if ( bMustBePositiveWholeNumbered )
bValid = sal_False;
else
- bValid = ( nStartIndex == nIndex ) || ( bE && ( nEIndex + 1 == nIndex ) );
+ {
+ if ( nStartIndex == nIndex )
+ bValid = sal_True;
+ else if ( bE )
+ {
+ if ( nEIndex + 1 == nIndex )
+ bValid = sal_True;
+ else if ( bENum )
+ bEnd = sal_True;
+ else
+ bValid = sal_False;
+ }
+ }
}
break;
@@ -376,6 +389,10 @@ sal_Bool GetNextParameter( com::sun::star::drawing::EnhancedCustomShapeParameter
case '7' :
case '8' :
case '9' :
+ {
+ if ( bE && ! bENum )
+ bENum = sal_True;
+ }
break;
default:
bEnd = sal_True;