diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2019-10-06 08:10:55 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-10-06 17:06:53 +0200 |
commit | 0a6b9df8c8fc8e97ac627081485613e336051208 (patch) | |
tree | 1387d9751601052546c2eeb5af037429718f8aac /configmgr | |
parent | 3e5d4ecbde512efe169536544489635f7f076fd2 (diff) |
convert equals() to operator== in xmlreader::Span
Change-Id: Ic6a8eae344c06be87e2bc4bf7f242a2d18ebc8ad
Reviewed-on: https://gerrit.libreoffice.org/80312
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/valueparser.cxx | 10 | ||||
-rw-r--r-- | configmgr/source/xcdparser.cxx | 12 | ||||
-rw-r--r-- | configmgr/source/xcsparser.cxx | 60 | ||||
-rw-r--r-- | configmgr/source/xcuparser.cxx | 80 | ||||
-rw-r--r-- | configmgr/source/xmldata.cxx | 63 |
5 files changed, 99 insertions, 126 deletions
diff --git a/configmgr/source/valueparser.cxx b/configmgr/source/valueparser.cxx index ceadf689f5b1..49ddba36fc27 100644 --- a/configmgr/source/valueparser.cxx +++ b/configmgr/source/valueparser.cxx @@ -63,11 +63,11 @@ bool parseHexDigit(char c, int * value) { bool parseValue(xmlreader::Span const & text, sal_Bool * value) { assert(text.is() && value != nullptr); - if (text.equals("true") || text.equals("1")) { + if (text == "true" || text == "1") { *value = true; return true; } - if (text.equals("false") || text.equals("0")) { + if (text == "false" || text == "0") { *value = false; return true; } @@ -278,7 +278,7 @@ bool ValueParser::startElement( } switch (state_) { case State::Text: - if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name.equals("it") && + if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && name == "it" && isListType(type_) && separator_.isEmpty()) { pad_.clear(); @@ -290,7 +290,7 @@ bool ValueParser::startElement( [[fallthrough]]; case State::IT: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("unicode") && + name == "unicode" && (type_ == TYPE_STRING || type_ == TYPE_STRING_LIST)) { sal_Int32 scalar = -1; @@ -301,7 +301,7 @@ bool ValueParser::startElement( break; } if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("scalar")) + attrLn == "scalar") { if (!parseValue(reader.getAttributeValue(true), &scalar)) { scalar = -1; diff --git a/configmgr/source/xcdparser.cxx b/configmgr/source/xcdparser.cxx index a849e210b3b6..a069c6b99c6f 100644 --- a/configmgr/source/xcdparser.cxx +++ b/configmgr/source/xcdparser.cxx @@ -61,14 +61,14 @@ bool XcdParser::startElement( } switch (state_) { case STATE_START: - if (nsId == ParseManager::NAMESPACE_OOR && name.equals("data")) { + if (nsId == ParseManager::NAMESPACE_OOR && name == "data") { state_ = STATE_DEPENDENCIES; return true; } break; case STATE_DEPENDENCIES: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("dependency")) + name == "dependency") { if (dependencyFile_.isEmpty()) { dependencyOptional_ = false; @@ -81,12 +81,12 @@ bool XcdParser::startElement( } if (attrNsId == xmlreader::XmlReader::NAMESPACE_NONE && //TODO: _OOR - attrLn.equals("file")) + attrLn == "file") { attrFile = reader.getAttributeValue(false); } else if ((attrNsId == xmlreader::XmlReader::NAMESPACE_NONE) && - attrLn.equals("optional")) + attrLn == "optional") { dependencyOptional_ = xmldata::parseBoolean( reader.getAttributeValue(true)); @@ -118,7 +118,7 @@ bool XcdParser::startElement( [[fallthrough]]; case STATE_COMPONENTS: if (nsId == ParseManager::NAMESPACE_OOR && - name.equals("component-schema")) + name == "component-schema") { nestedParser_ = new XcsParser(layer_, data_); nesting_ = 1; @@ -126,7 +126,7 @@ bool XcdParser::startElement( reader, nsId, name, existingDependencies); } if (nsId == ParseManager::NAMESPACE_OOR && - (name.equals("component-data") || name.equals("items"))) + (name == "component-data" || name == "items")) { nestedParser_ = new XcuParser(layer_ + 1, data_, nullptr, nullptr, nullptr); nesting_ = 1; diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx index 2087aec55226..24e1dc008312 100644 --- a/configmgr/source/xcsparser.cxx +++ b/configmgr/source/xcsparser.cxx @@ -127,7 +127,7 @@ bool XcsParser::startElement( } if (state_ == STATE_START) { if (nsId == ParseManager::NAMESPACE_OOR && - name.equals("component-schema")) + name == "component-schema") { handleComponentSchema(reader); state_ = STATE_COMPONENT_SCHEMA; @@ -140,8 +140,8 @@ bool XcsParser::startElement( // illegal content): if (ignoring_ > 0 || (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - (name.equals("info") || name.equals("import") || - name.equals("uses") || name.equals("constraints")))) + (name == "info" || name == "import" || + name == "uses" || name == "constraints"))) { assert(ignoring_ < LONG_MAX); ++ignoring_; @@ -150,7 +150,7 @@ bool XcsParser::startElement( switch (state_) { case STATE_COMPONENT_SCHEMA: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("templates")) + name == "templates") { state_ = STATE_TEMPLATES; return true; @@ -158,7 +158,7 @@ bool XcsParser::startElement( [[fallthrough]]; case STATE_TEMPLATES_DONE: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("component")) + name == "component") { state_ = STATE_COMPONENT; assert(elements_.empty()); @@ -172,13 +172,13 @@ bool XcsParser::startElement( case STATE_TEMPLATES: if (elements_.empty()) { if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("group")) + name == "group") { handleGroup(reader, true); return true; } if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("set")) + name == "set") { handleSet(reader, true); return true; @@ -192,7 +192,7 @@ bool XcsParser::startElement( case Node::KIND_PROPERTY: case Node::KIND_LOCALIZED_PROPERTY: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("value")) + name == "value") { handlePropValue(reader, elements_.top().node); return true; @@ -200,25 +200,25 @@ bool XcsParser::startElement( break; case Node::KIND_GROUP: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("prop")) + name == "prop") { handleProp(reader); return true; } if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("node-ref")) + name == "node-ref") { handleNodeRef(reader); return true; } if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("group")) + name == "group") { handleGroup(reader, false); return true; } if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("set")) + name == "set") { handleSet(reader, false); return true; @@ -226,7 +226,7 @@ bool XcsParser::startElement( break; case Node::KIND_SET: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("item")) + name == "item") { handleSetItem( reader, @@ -331,7 +331,7 @@ void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("package")) + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "package") { if (hasPackage) { throw css::uno::RuntimeException( @@ -342,7 +342,7 @@ void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) { xmlreader::Span s(reader.getAttributeValue(false)); buf.insert(0, s.begin, s.length); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("name")) + attrLn == "name") { if (hasName) { throw css::uno::RuntimeException( @@ -378,15 +378,15 @@ void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("component")) + attrLn == "component") { component = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("node-type")) + attrLn == "node-type") { hasNodeType = true; nodeType = reader.getAttributeValue(false).convertFromUtf8(); @@ -424,20 +424,20 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("type")) + attrLn == "type") { valueParser_.type_ = xmldata::parseType( reader, reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("localized")) + attrLn == "localized") { localized = xmldata::parseBoolean(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("nillable")) + attrLn == "nillable") { nillable = xmldata::parseBoolean(reader.getAttributeValue(true)); } @@ -474,7 +474,7 @@ void XcsParser::handlePropValue( break; } if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("separator")) + attrLn == "separator") { attrSeparator = reader.getAttributeValue(false); if (attrSeparator.length == 0) { @@ -498,11 +498,11 @@ void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("extensible")) + attrLn == "extensible") { extensible = xmldata::parseBoolean(reader.getAttributeValue(true)); } @@ -534,15 +534,15 @@ void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("component")) + attrLn == "component") { component = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("node-type")) + attrLn == "node-type") { hasNodeType = true; nodeType = reader.getAttributeValue(false).convertFromUtf8(); @@ -576,11 +576,11 @@ void XcsParser::handleSetItem(xmlreader::XmlReader & reader, SetNode * set) { break; } if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("component")) + attrLn == "component") { component = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("node-type")) + attrLn == "node-type") { hasNodeType = true; nodeType = reader.getAttributeValue(false).convertFromUtf8(); diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx index 596d85b696da..89508be97992 100644 --- a/configmgr/source/xcuparser.cxx +++ b/configmgr/source/xcuparser.cxx @@ -75,10 +75,10 @@ bool XcuParser::startElement( } if (state_.empty()) { if (nsId == ParseManager::NAMESPACE_OOR && - name.equals("component-data")) + name == "component-data") { handleComponentData(reader); - } else if (nsId == ParseManager::NAMESPACE_OOR && name.equals("items")) + } else if (nsId == ParseManager::NAMESPACE_OOR && name == "items") { state_.push(State::Modify(rtl::Reference< Node >())); } else { @@ -89,7 +89,7 @@ bool XcuParser::startElement( } else if (state_.top().ignore) { state_.push(State::Ignore(false)); } else if (!state_.top().node.is()) { - if (nsId != xmlreader::XmlReader::NAMESPACE_NONE || !name.equals("item")) + if (nsId != xmlreader::XmlReader::NAMESPACE_NONE || name != "item") { throw css::uno::RuntimeException( "bad items node member <" + name.convertFromUtf8() + "> in " + @@ -100,7 +100,7 @@ bool XcuParser::startElement( switch (state_.top().node->kind()) { case Node::KIND_PROPERTY: if (nsId != xmlreader::XmlReader::NAMESPACE_NONE || - !name.equals("value")) + name != "value") { throw css::uno::RuntimeException( "bad property node member <" + name.convertFromUtf8() + @@ -112,7 +112,7 @@ bool XcuParser::startElement( break; case Node::KIND_LOCALIZED_PROPERTY: if (nsId != xmlreader::XmlReader::NAMESPACE_NONE || - !name.equals("value")) + name != "value") { throw css::uno::RuntimeException( "bad localized property node member <" + @@ -129,13 +129,13 @@ bool XcuParser::startElement( reader.getUrl()); case Node::KIND_GROUP: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("prop")) + name == "prop") { handleGroupProp( reader, static_cast< GroupNode * >(state_.top().node.get())); } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("node")) + name == "node") { handleGroupNode(reader, state_.top().node); } else { @@ -146,12 +146,12 @@ bool XcuParser::startElement( break; case Node::KIND_SET: if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("node")) + name == "node") { handleSetNode( reader, static_cast< SetNode * >(state_.top().node.get())); } else if (nsId == xmlreader::XmlReader::NAMESPACE_NONE && - name.equals("prop")) + name == "prop") { SAL_WARN( "configmgr", @@ -203,16 +203,16 @@ void XcuParser::characters(xmlreader::Span const & text) { XcuParser::Operation XcuParser::parseOperation(xmlreader::Span const & text) { assert(text.is()); - if (text.equals("modify")) { + if (text == "modify") { return OPERATION_MODIFY; } - if (text.equals("replace")) { + if (text == "replace") { return OPERATION_REPLACE; } - if (text.equals("fuse")) { + if (text == "fuse") { return OPERATION_FUSE; } - if (text.equals("remove")) { + if (text == "remove") { return OPERATION_REMOVE; } throw css::uno::RuntimeException( @@ -232,7 +232,7 @@ void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("package")) + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "package") { if (hasPackage) { throw css::uno::RuntimeException( @@ -243,7 +243,7 @@ void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { xmlreader::Span s(reader.getAttributeValue(false)); buf.insert(0, s.begin, s.length); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("name")) + attrLn == "name") { if (hasName) { throw css::uno::RuntimeException( @@ -254,11 +254,11 @@ void XcuParser::handleComponentData(xmlreader::XmlReader & reader) { xmlreader::Span s(reader.getAttributeValue(false)); buf.append(s.begin, s.length); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("op")) + attrLn == "op") { op = parseOperation(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("finalized")) + attrLn == "finalized") { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); } @@ -320,7 +320,7 @@ void XcuParser::handleItem(xmlreader::XmlReader & reader) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("path")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "path") { attrPath = reader.getAttributeValue(false); } } @@ -386,10 +386,10 @@ void XcuParser::handlePropValue( if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_XSI && attrLn.equals("nil")) { + if (attrNsId == ParseManager::NAMESPACE_XSI && attrLn == "nil") { nil = xmldata::parseBoolean(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("type")) + attrLn == "type") { Type type = xmldata::parseType( reader, reader.getAttributeValue(true)); @@ -399,7 +399,7 @@ void XcuParser::handlePropValue( } valueParser_.type_ = type; } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("separator")) + attrLn == "separator") { xmlreader::Span s(reader.getAttributeValue(false)); if (s.length == 0) { @@ -408,7 +408,7 @@ void XcuParser::handlePropValue( } separator = OString(s.begin, s.length); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("external")) + attrLn == "external") { external = reader.getAttributeValue(true).convertFromUtf8(); if (external.isEmpty()) { @@ -452,15 +452,15 @@ void XcuParser::handleLocpropValue( break; } if (attrNsId == xmlreader::XmlReader::NAMESPACE_XML && - attrLn.equals("lang")) + attrLn == "lang") { name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_XSI && - attrLn.equals("nil")) + attrLn == "nil") { nil = xmldata::parseBoolean(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("type")) + attrLn == "type") { Type type = xmldata::parseType( reader, reader.getAttributeValue(true)); @@ -470,7 +470,7 @@ void XcuParser::handleLocpropValue( } valueParser_.type_ = type; } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("separator")) + attrLn == "separator") { xmlreader::Span s(reader.getAttributeValue(false)); if (s.length == 0) { @@ -479,7 +479,7 @@ void XcuParser::handleLocpropValue( } separator = OString(s.begin, s.length); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("op")) + attrLn == "op") { op = parseOperation(reader.getAttributeValue(true)); } @@ -559,19 +559,19 @@ void XcuParser::handleGroupProp( if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("type")) + attrLn == "type") { type = xmldata::parseType(reader, reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("op")) + attrLn == "op") { op = parseOperation(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("finalized")) + attrLn == "finalized") { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); } @@ -754,15 +754,15 @@ void XcuParser::handleGroupNode( if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("op")) + attrLn == "op") { op = parseOperation(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("finalized")) + attrLn == "finalized") { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); } @@ -824,28 +824,28 @@ void XcuParser::handleSetNode(xmlreader::XmlReader & reader, SetNode * set) { if (!reader.nextAttribute(&attrNsId, &attrLn)) { break; } - if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn.equals("name")) { + if (attrNsId == ParseManager::NAMESPACE_OOR && attrLn == "name") { hasName = true; name = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("component")) + attrLn == "component") { component = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("node-type")) + attrLn == "node-type") { hasNodeType = true; nodeType = reader.getAttributeValue(false).convertFromUtf8(); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("op")) + attrLn == "op") { op = parseOperation(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("finalized")) + attrLn == "finalized") { finalized = xmldata::parseBoolean(reader.getAttributeValue(true)); } else if (attrNsId == ParseManager::NAMESPACE_OOR && - attrLn.equals("mandatory")) + attrLn == "mandatory") { mandatory = xmldata::parseBoolean(reader.getAttributeValue(true)); } diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx index 6323f5d65b86..e919d08e7824 100644 --- a/configmgr/source/xmldata.cxx +++ b/configmgr/source/xmldata.cxx @@ -43,82 +43,55 @@ Type parseType( assert(text.is()); sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':'); if (i >= 0) { + xmlreader::Span token(text.begin + i + 1, text.length - (i + 1)); switch (reader.getNamespaceId(xmlreader::Span(text.begin, i))) { case ParseManager::NAMESPACE_OOR: - if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)). - equals("any")) + if (token == "any") { return TYPE_ANY; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("boolean-list")) + } else if (token == "boolean-list") { return TYPE_BOOLEAN_LIST; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("short-list")) + } else if (token == "short-list") { return TYPE_SHORT_LIST; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("int-list")) + } else if (token == "int-list") { return TYPE_INT_LIST; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("long-list")) + } else if (token == "long-list") { return TYPE_LONG_LIST; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("double-list")) + } else if (token == "double-list") { return TYPE_DOUBLE_LIST; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("string-list")) + } else if (token == "string-list") { return TYPE_STRING_LIST; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("hexBinary-list")) + } else if (token == "hexBinary-list") { return TYPE_HEXBINARY_LIST; } break; case ParseManager::NAMESPACE_XS: - if (xmlreader::Span(text.begin + i + 1, text.length - (i + 1)). - equals("boolean")) + if (token == "boolean") { return TYPE_BOOLEAN; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("short")) + } else if (token =="short") { return TYPE_SHORT; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("int")) + } else if (token =="int") { return TYPE_INT; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("long")) + } else if (token =="long") { return TYPE_LONG; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("double")) + } else if (token =="double") { return TYPE_DOUBLE; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("string")) + } else if (token =="string") { return TYPE_STRING; - } else if (xmlreader::Span( - text.begin + i + 1, text.length - (i + 1)). - equals("hexBinary")) + } else if (token =="hexBinary") { return TYPE_HEXBINARY; } @@ -133,10 +106,10 @@ Type parseType( bool parseBoolean(xmlreader::Span const & text) { assert(text.is()); - if (text.equals("true")) { + if (text == "true") { return true; } - if (text.equals("false")) { + if (text == "false") { return false; } throw css::uno::RuntimeException( |