summaryrefslogtreecommitdiff
path: root/configmgr
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-09-01 13:08:39 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-09-01 15:06:45 +0200
commit9da6318b4e62a0e30d15df00d564dad61a74933e (patch)
tree8ca5d81ad4c30b71aad03ddf3009046ce67ac592 /configmgr
parentf262cfcf8ebf81d2d1407cf283b5d8eaaee053fd (diff)
dconf: fix check for matching template
Change-Id: I8319bf10310d55e2f29de8103d983e34a53f87df
Diffstat (limited to 'configmgr')
-rw-r--r--configmgr/source/dconf.cxx72
1 files changed, 36 insertions, 36 deletions
diff --git a/configmgr/source/dconf.cxx b/configmgr/source/dconf.cxx
index 44e80381ac7a..4490259e0437 100644
--- a/configmgr/source/dconf.cxx
+++ b/configmgr/source/dconf.cxx
@@ -816,47 +816,47 @@ void readDir(
}
rtl::Reference<Node> member(members.findNode(layer, name));
bool insert = !member.is();
- if (!remove && (replace || insert)) {
- if (!node.is()) {
- SAL_WARN("configmgr.dconf", "bad unmatched " << path);
- continue;
- }
- switch (node->kind()) {
- case Node::KIND_LOCALIZED_PROPERTY:
- member.set(new LocalizedValueNode(layer));
- break;
- case Node::KIND_GROUP:
- if (!static_cast<GroupNode *>(node.get())->isExtensible()) {
+ if (!remove) {
+ if (replace || insert) {
+ if (!node.is()) {
SAL_WARN("configmgr.dconf", "bad unmatched " << path);
continue;
}
- member.set(
- new PropertyNode(
- layer, TYPE_ANY, true, css::uno::Any(), true));
- break;
- case Node::KIND_SET:
- assert(!templ.isEmpty());
- member = data.getTemplate(layer, templ);
- if (!member.is()) {
- SAL_WARN(
- "configmgr.dconf",
- "bad " << path << " denoting undefined template "
- << templ);
- continue;
+ switch (node->kind()) {
+ case Node::KIND_LOCALIZED_PROPERTY:
+ member.set(new LocalizedValueNode(layer));
+ break;
+ case Node::KIND_GROUP:
+ if (!static_cast<GroupNode *>(node.get())->isExtensible()) {
+ SAL_WARN("configmgr.dconf", "bad unmatched " << path);
+ continue;
+ }
+ member.set(
+ new PropertyNode(
+ layer, TYPE_ANY, true, css::uno::Any(), true));
+ break;
+ case Node::KIND_SET:
+ assert(!templ.isEmpty());
+ member = data.getTemplate(layer, templ);
+ if (!member.is()) {
+ SAL_WARN(
+ "configmgr.dconf",
+ "bad " << path << " denoting undefined template "
+ << templ);
+ continue;
+ }
+ break;
+ default:
+ assert(false); // cannot happen
}
- break;
- default:
- assert(false); // cannot happen
+ } else if (!templ.isEmpty() && templ != member->getTemplateName()) {
+ SAL_WARN(
+ "configmgr.dconf",
+ "bad " << path
+ << " denoting set element of non-matching template "
+ << member->getTemplateName());
+ continue;
}
- } else if (!(templ.isEmpty()
- || (node.is() && templ == node->getTemplateName())))
- {
- SAL_WARN(
- "configmgr.dconf",
- "bad " << path
- << " denoting set element of non-matching template "
- << node->getTemplateName());
- continue;
}
if (member.is()) {
if (member->getFinalized() < layer) {