summaryrefslogtreecommitdiffstats
path: root/configmgr/source/xcsparser.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-05-23 12:03:21 +0200
committerNoel Grandin <noel@peralex.com>2014-05-23 15:06:00 +0200
commite7bc3cab019fbf040f9fb8b53ae2cf3f977d200b (patch)
treebc507bccee9fb71134e362b72d22991561e32aa0 /configmgr/source/xcsparser.cxx
parentadd default value for Context param in uno::Exception constructors (diff)
downloadcore-e7bc3cab019fbf040f9fb8b53ae2cf3f977d200b.tar.gz
core-e7bc3cab019fbf040f9fb8b53ae2cf3f977d200b.zip
remove boilerplate in UNO Exception constructor calls
Now that we have default values for Exception constructor params, remove lots of boilerplate code. Change-Id: I620bd641eecfed38e6123873b3b94aaf47922e74
Diffstat (limited to 'configmgr/source/xcsparser.cxx')
-rw-r--r--configmgr/source/xcsparser.cxx49
1 files changed, 17 insertions, 32 deletions
diff --git a/configmgr/source/xcsparser.cxx b/configmgr/source/xcsparser.cxx
index a550240ee3d3..dd51807b0c70 100644
--- a/configmgr/source/xcsparser.cxx
+++ b/configmgr/source/xcsparser.cxx
@@ -252,8 +252,7 @@ bool XcsParser::startElement(
}
}
throw css::uno::RuntimeException(
- "bad member <" + name.convertFromUtf8() + "> in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "bad member <" + name.convertFromUtf8() + "> in " + reader.getUrl());
}
void XcsParser::endElement(xmlreader::XmlReader const & reader) {
@@ -295,16 +294,14 @@ void XcsParser::endElement(xmlreader::XmlReader const & reader) {
default:
assert(false);
throw css::uno::RuntimeException(
- "this cannot happen",
- css::uno::Reference< css::uno::XInterface >());
+ "this cannot happen");
}
} else {
if (!elements_.top().node->getMembers().insert(
NodeMap::value_type(top.name, top.node)).second)
{
throw css::uno::RuntimeException(
- "duplicate " + top.name + " in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "duplicate " + top.name + " in " + reader.getUrl());
}
}
}
@@ -320,8 +317,7 @@ void XcsParser::endElement(xmlreader::XmlReader const & reader) {
break;
case STATE_TEMPLATES_DONE:
throw css::uno::RuntimeException(
- "no component element in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no component element in " + reader.getUrl());
case STATE_COMPONENT_DONE:
break;
default:
@@ -350,9 +346,8 @@ void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
{
if (hasPackage) {
throw css::uno::RuntimeException(
- ("multiple component-schema package attributes in " +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
+ "multiple component-schema package attributes in " +
+ reader.getUrl());
}
hasPackage = true;
xmlreader::Span s(reader.getAttributeValue(false));
@@ -362,9 +357,8 @@ void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
{
if (hasName) {
throw css::uno::RuntimeException(
- ("multiple component-schema name attributes in " +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
+ "multiple component-schema name attributes in " +
+ reader.getUrl());
}
hasName = true;
xmlreader::Span s(reader.getAttributeValue(false));
@@ -373,13 +367,11 @@ void XcsParser::handleComponentSchema(xmlreader::XmlReader & reader) {
}
if (!hasPackage) {
throw css::uno::RuntimeException(
- "no component-schema package attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no component-schema package attribute in " + reader.getUrl());
}
if (!hasName) {
throw css::uno::RuntimeException(
- "no component-schema name attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no component-schema name attribute in " + reader.getUrl());
}
componentName_ = xmlreader::Span(buf.getStr(), buf.getLength()).
convertFromUtf8();
@@ -413,8 +405,7 @@ void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) {
}
if (!hasName) {
throw css::uno::RuntimeException(
- "no node-ref name attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no node-ref name attribute in " + reader.getUrl());
}
rtl::Reference< Node > tmpl(
data_.getTemplate(
@@ -425,8 +416,7 @@ void XcsParser::handleNodeRef(xmlreader::XmlReader & reader) {
//TODO: this can erroneously happen as long as import/uses attributes
// are not correctly processed
throw css::uno::RuntimeException(
- "unknown node-ref " + name + " in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "unknown node-ref " + name + " in " + reader.getUrl());
}
rtl::Reference< Node > node(tmpl->clone(false));
node->setLayer(valueParser_.getLayer());
@@ -465,13 +455,11 @@ void XcsParser::handleProp(xmlreader::XmlReader & reader) {
}
if (!hasName) {
throw css::uno::RuntimeException(
- "no prop name attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no prop name attribute in " + reader.getUrl());
}
if (valueParser_.type_ == TYPE_ERROR) {
throw css::uno::RuntimeException(
- "no prop type attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no prop type attribute in " + reader.getUrl());
}
elements_.push(
Element(
@@ -502,8 +490,7 @@ void XcsParser::handlePropValue(
attrSeparator = reader.getAttributeValue(false);
if (attrSeparator.length == 0) {
throw css::uno::RuntimeException(
- "bad oor:separator attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "bad oor:separator attribute in " + reader.getUrl());
}
}
}
@@ -533,8 +520,7 @@ void XcsParser::handleGroup(xmlreader::XmlReader & reader, bool isTemplate) {
}
if (!hasName) {
throw css::uno::RuntimeException(
- "no group name attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no group name attribute in " + reader.getUrl());
}
if (isTemplate) {
name = Data::fullTemplateName(componentName_, name);
@@ -575,8 +561,7 @@ void XcsParser::handleSet(xmlreader::XmlReader & reader, bool isTemplate) {
}
if (!hasName) {
throw css::uno::RuntimeException(
- "no set name attribute in " + reader.getUrl(),
- css::uno::Reference< css::uno::XInterface >());
+ "no set name attribute in " + reader.getUrl());
}
if (isTemplate) {
name = Data::fullTemplateName(componentName_, name);