summaryrefslogtreecommitdiff
path: root/configmgr/source/xmldata.cxx
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2009-11-10 10:30:50 +0100
committersb <sb@openoffice.org>2009-11-10 10:30:50 +0100
commitefa6cd05d30bc5c660c289d9252e07c619eefa6b (patch)
treee1a9e4872448be662036c31780353414aa57e837 /configmgr/source/xmldata.cxx
parent4f61c8f406d95f895bb4e74c8538e3129c017805 (diff)
sb111: #i101955# the span returned by XmlReader::getAttributeValue is only valid until the next call to nextItem or getAttributeValue
Diffstat (limited to 'configmgr/source/xmldata.cxx')
-rw-r--r--configmgr/source/xmldata.cxx21
1 files changed, 7 insertions, 14 deletions
diff --git a/configmgr/source/xmldata.cxx b/configmgr/source/xmldata.cxx
index 151627725aaf..710bb6db4e15 100644
--- a/configmgr/source/xmldata.cxx
+++ b/configmgr/source/xmldata.cxx
@@ -91,9 +91,7 @@ rtl::OUString convertFromUtf8(Span const & text) {
}
Type parseType(XmlReader const & reader, Span const & text) {
- if (!text.is()) {
- return TYPE_ERROR;
- }
+ OSL_ASSERT(text.is());
sal_Int32 i = rtl_str_indexOfChar_WithLength(text.begin, text.length, ':');
if (i >= 0) {
switch (reader.getNamespace(Span(text.begin, i))) {
@@ -173,10 +171,8 @@ Type parseType(XmlReader const & reader, Span const & text) {
css::uno::Reference< css::uno::XInterface >());
}
-bool parseBoolean(Span const & text, bool deflt) {
- if (!text.is()) {
- return deflt;
- }
+bool parseBoolean(Span const & text) {
+ OSL_ASSERT(text.is());
if (text.equals(RTL_CONSTASCII_STRINGPARAM("true"))) {
return true;
}
@@ -190,11 +186,10 @@ bool parseBoolean(Span const & text, bool deflt) {
}
rtl::OUString parseTemplateReference(
- Span const & component, Span const & nodeType,
- rtl::OUString const & componentName,
- rtl::OUString const * defaultTemplateName)
+ rtl::OUString const & component, bool hasNodeType,
+ rtl::OUString const & nodeType, rtl::OUString const * defaultTemplateName)
{
- if (!nodeType.is()) {
+ if (!hasNodeType) {
if (defaultTemplateName != 0) {
return *defaultTemplateName;
}
@@ -203,9 +198,7 @@ rtl::OUString parseTemplateReference(
RTL_CONSTASCII_USTRINGPARAM("missing node-type attribute")),
css::uno::Reference< css::uno::XInterface >());
}
- return Data::fullTemplateName(
- component.is() ? convertFromUtf8(component) : componentName,
- convertFromUtf8(nodeType));
+ return Data::fullTemplateName(component, nodeType);
}
}