configmgr/source/access.cxx | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
New commits: commit a26adf6679aa13dc5821047f6aa1f05e7d0d00fd Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Feb 8 09:07:32 2018 +0100 Better return nil than an arbitrary xml:lang="..." value ...for a localized property that doesn't have a suitable value, but is nillable. E.g., /org.openoffice.Office.Writer/Insert/Caption/CaptionOrderNumberingFirst (once fixed to indeed be a localized property as apparently intended, with a follow-up commit to this) only has an explicit value (true) for xml:lang="hu", but shouldn't return that for any other locale (where the implicit default for a nil value should instead be false, cf. the else branch at the end of SwInsertConfig::Load, sw/source/uibase/config/modcfg.cxx). Change-Id: I7b991c1bc4df22bf2359175b0734e85e0844ce99 Reviewed-on: https://gerrit.libreoffice.org/49409 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx index 0d19af353b49..718f6339967b 100644 --- a/configmgr/source/access.cxx +++ b/configmgr/source/access.cxx @@ -1430,9 +1430,8 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) { } } } - // Defaults are the "en-US" locale, the "en" locale, the empty string - // locale, the first child (if any), or a null ChildAccess, in that - // order: + // Defaults are the "en-US" locale, the "en" locale, the empty string locale, the first child (if + // any, and if the property is non-nillable), or a null ChildAccess, in that order: rtl::Reference< ChildAccess > child(getChild("en-US")); if (child.is()) { return child; @@ -1445,9 +1444,11 @@ rtl::Reference< ChildAccess > Access::getChild(OUString const & name) { if (child.is()) { return child; } - std::vector< rtl::Reference< ChildAccess > > children(getAllChildren()); - if (!children.empty()) { - return children.front(); + if (!static_cast<LocalizedPropertyNode *>(getNode().get())->isNillable()) { + std::vector< rtl::Reference< ChildAccess > > children(getAllChildren()); + if (!children.empty()) { + return children.front(); + } } return rtl::Reference< ChildAccess >(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits