diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2023-02-15 20:04:47 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2023-02-15 21:03:19 +0000 |
commit | 847f9b446f6d87e9de0b438d07a3b2cc8a0ad88c (patch) | |
tree | 2e5a02359c1e1ebe96ae5dc894aeb79af7fc28b2 /configmgr | |
parent | c8003c409f8ea307ad66b6b3607b4864f41cfd78 (diff) |
Add a rudimentary test for localized properties
Change-Id: I9abe06e6f1f2b6b39cbbf07043dd9c5062ff0460
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147108
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/qa/unit/test.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/configmgr/qa/unit/test.cxx b/configmgr/qa/unit/test.cxx index daa2070086f7..3de93a6672df 100644 --- a/configmgr/qa/unit/test.cxx +++ b/configmgr/qa/unit/test.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/beans/XPropertyChangeListener.hpp> #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertyState.hpp> +#include <com/sun/star/configuration/ReadOnlyAccess.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> @@ -63,6 +64,7 @@ public: void testKeyReset(); void testSetSetMemberName(); void testInsertSetMember(); + void testLocalizedProperty(); void testReadCommands(); void testListener(); void testRecursive(); @@ -89,6 +91,7 @@ public: CPPUNIT_TEST(testKeyReset); CPPUNIT_TEST(testSetSetMemberName); CPPUNIT_TEST(testInsertSetMember); + CPPUNIT_TEST(testLocalizedProperty); CPPUNIT_TEST(testReadCommands); CPPUNIT_TEST(testListener); CPPUNIT_TEST(testRecursive); @@ -309,6 +312,20 @@ void Test::testInsertSetMember() { access, css::uno::UNO_QUERY_THROW)->dispose(); } +void Test::testLocalizedProperty() { + auto const access = css::configuration::ReadOnlyAccess::create( + comphelper::getProcessComponentContext(), "*"); + { + // See <https://bugs.documentfoundation.org/show_bug.cgi?id=33638> "Pagination extension + // not localized in LibreOffice", which wants to retrieve the non-canonical xml:lang="pt-PT" + // value for the passed-in "pt" locale: + OUString v; + CPPUNIT_ASSERT( + access->getByHierarchicalName("/org.libreoffice.unittest/localized/*pt") >>= v); + CPPUNIT_ASSERT_EQUAL(OUString("pt-PT"), v); + } +} + void Test::testReadCommands() { css::uno::Reference< css::container::XNameAccess > access( |