summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-03-18 11:17:44 +0100
committersb <sb@openoffice.org>2010-03-18 11:17:44 +0100
commit1881a2abb14c17030eb00157e9e910f5143ba5ef (patch)
tree5148cb820d7aa875400f10d8a5d494c02ab20ea7 /configmgr
parent953c4d7879fc9d04ef64ff68da46e2e5f0c17798 (diff)
sb121: #i110198# generally ignore unknown elements in xcu data
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/components.cxx7
-rw-r--r--configmgr/source/xcuparser.cxx58
2 files changed, 28 insertions, 37 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx
index 51cc76bef6..a6956e5a13 100644
--- a/configmgr/source/components.cxx
+++ b/configmgr/source/components.cxx
@@ -316,7 +316,6 @@ Components::Components(
context_(context)
{
OSL_ASSERT(context.is());
-/*SB*/try{
parseXcsXcuLayer(
0,
expand(
@@ -381,13 +380,11 @@ Components::Components(
":UNO_USER_PACKAGES_CACHE}/registry/"
"com.sun.star.comp.deployment.configuration."
"PackageRegistryBackend/configmgr.ini"))));
-/*SB*/}catch(css::uno::Exception&e){fprintf(stderr,"caught <%s>\n",rtl::OUStringToOString(e.Message,RTL_TEXTENCODING_UTF8).getStr());throw;}
try {
parseModificationLayer();
} catch (css::uno::Exception & e) { //TODO: more specific exception catching
- // Silently ignore unreadable parts of a corrupted
- // registrymodifications.xcu file, instead of completely preventing OOo
- // from starting:
+ // Silently ignore unreadable parts of a corrupted user modification
+ // layer, instead of completely preventing OOo from starting:
OSL_TRACE(
"configmgr error reading user modification layer: %s",
rtl::OUStringToOString(e.Message, RTL_TEXTENCODING_UTF8).getStr());
diff --git a/configmgr/source/xcuparser.cxx b/configmgr/source/xcuparser.cxx
index 220168c627..4f15b24afb 100644
--- a/configmgr/source/xcuparser.cxx
+++ b/configmgr/source/xcuparser.cxx
@@ -332,12 +332,14 @@ void XcuParser::handleComponentData(XmlReader & reader) {
Data::findNode(
valueParser_.getLayer(), data_->components, componentName_));
if (!node.is()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown component ")) +
- componentName_ +
- rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
+ OSL_TRACE(
+ "configmgr unknown component %s in %s",
+ rtl::OUStringToOString(
+ componentName_, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State()); // ignored
+ return;
}
switch (op) {
case OPERATION_MODIFY:
@@ -389,17 +391,11 @@ void XcuParser::handleItem(XmlReader & reader) {
data_->resolvePathRepresentation(
path, &modificationPath_, &finalizedLayer));
if (!node.is()) {
- //TODO: Within Components::parseModificationLayer (but only there) it
- // can rightly happen that data is read that does not match a schema
- // (that no schema exists, or that the schema specifies a different
- // type), namely if the schema was brought along by an extension that
- // has been removed or replaced; instead of taking care of that at all
- // the relevant places, as a hack, only "top-level" <item>s (that only
- // appear in modification layer data) with unknown path are filtered out
- // here.
OSL_TRACE(
- "configmgr unknown <item path=\"%s\">",
- rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr());
+ "configmgr unknown item %s in %s",
+ rtl::OUStringToOString(path, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
state_.push(State()); // ignored
return;
}
@@ -672,17 +668,10 @@ void XcuParser::handleUnknownGroupProp(
XmlReader const & reader, GroupNode * group, rtl::OUString const & name,
Type type, Operation operation, bool finalized)
{
- if (!group->isExtensible()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown prop ")) +
- name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
- }
switch (operation) {
case OPERATION_REPLACE:
case OPERATION_FUSE:
- {
+ if (group->isExtensible()) {
if (type == TYPE_ERROR) {
throw css::uno::RuntimeException(
(rtl::OUString(
@@ -705,12 +694,15 @@ void XcuParser::handleUnknownGroupProp(
modificationPath_.push_back(name);
modifications_->add(modificationPath_);
}
+ break;
}
- break;
+ // fall through
default:
OSL_TRACE(
- "ignoring modify or remove of unknown (presumably extension)"
- " property");
+ "configmgr unknown property %s in %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
state_.push(State());
break;
}
@@ -879,11 +871,13 @@ void XcuParser::handleGroupNode(
rtl::Reference< Node > child(
Data::findNode(valueParser_.getLayer(), group->getMembers(), name));
if (!child.is()) {
- throw css::uno::RuntimeException(
- (rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("unknown node ")) +
- name + rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(" in ")) +
- reader.getUrl()),
- css::uno::Reference< css::uno::XInterface >());
+ OSL_TRACE(
+ "configmgr unknown node %s in %s",
+ rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr(),
+ rtl::OUStringToOString(
+ reader.getUrl(), RTL_TEXTENCODING_UTF8).getStr());
+ state_.push(State()); // ignored
+ return;
}
if (op != OPERATION_MODIFY && op != OPERATION_FUSE) {
throw css::uno::RuntimeException(