Running astyle [ci skip].

This commit is contained in:
orbitcowboy 2020-06-12 16:08:40 +02:00
parent 9f445fc735
commit 258d0a6ade
2 changed files with 6 additions and 12 deletions

View File

@ -712,8 +712,7 @@ Library::Error Library::loadFunction(const tinyxml2::XMLElement * const node, co
return Error(BAD_ATTRIBUTE_VALUE, (!p ? "\"\"" : argnode->GetText())); return Error(BAD_ATTRIBUTE_VALUE, (!p ? "\"\"" : argnode->GetText()));
// Set validation expression // Set validation expression
ac.valid = argnode->GetText(); ac.valid = argnode->GetText();
} } else if (argnodename == "minsize") {
else if (argnodename == "minsize") {
const char *typeattr = argnode->Attribute("type"); const char *typeattr = argnode->Attribute("type");
if (!typeattr) if (!typeattr)
return Error(MISSING_ATTRIBUTE, "type"); return Error(MISSING_ATTRIBUTE, "type");
@ -1226,24 +1225,20 @@ bool Library::isCompliantValidationExpression(const char* p)
range = true; range = true;
has_dot = false; has_dot = false;
has_E = false; has_E = false;
} } else if ((*p == '-')|| (*p == '+'))
else if ((*p == '-')|| (*p == '+'))
error |= (!std::isdigit(*(p + 1))); error |= (!std::isdigit(*(p + 1)));
else if (*p == ',') { else if (*p == ',') {
range = false; range = false;
error |= *(p + 1) == '.'; error |= *(p + 1) == '.';
has_dot = false; has_dot = false;
has_E = false; has_E = false;
} } else if (*p == '.') {
else if (*p == '.') {
error |= has_dot | (!std::isdigit(*(p + 1))); error |= has_dot | (!std::isdigit(*(p + 1)));
has_dot = true; has_dot = true;
} } else if (*p == 'E' || *p == 'e') {
else if (*p == 'E' || *p == 'e') {
error |= has_E; error |= has_E;
has_E = true; has_E = true;
} } else
else
return false; return false;
} }
return !error; return !error;

View File

@ -73,8 +73,7 @@ private:
return library.load(doc); return library.load(doc);
} }
void isCompliantValidationExpression() void isCompliantValidationExpression() {
{
ASSERT_EQUALS(true, Library::isCompliantValidationExpression("-1")); ASSERT_EQUALS(true, Library::isCompliantValidationExpression("-1"));
ASSERT_EQUALS(true, Library::isCompliantValidationExpression("1")); ASSERT_EQUALS(true, Library::isCompliantValidationExpression("1"));
ASSERT_EQUALS(true, Library::isCompliantValidationExpression("1:")); ASSERT_EQUALS(true, Library::isCompliantValidationExpression("1:"));