summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-04-24 16:01:56 +0100
committerAndras Timar <andras.timar@collabora.com>2018-04-27 11:16:09 +0200
commitca5a44a9f765ca8f968e283b068be6e92f2ab394 (patch)
treea353bbe2b73cc0c148c9d25a32d061556bce8b79
parented002d7b8de39de81ccd016bc40841b8d2a132dc (diff)
Winreg config layer: Allow to define external backend separately
Defining backend separately allows e.g. creating ADMX templates with easy-to-use UI, where user defines only LDAP names for the setting, and doesn't need to type the LO configuration backend name. Change-Id: I64f23043c94a5a4e0ba7281d0f711a427d694126 Reviewed-on: https://gerrit.libreoffice.org/53413 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (cherry picked from commit 8776a895d41f174bf5d86332093ed5795c73bdd6) Reviewed-on: https://gerrit.libreoffice.org/53436 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--configmgr/source/winreg.cxx17
1 files changed, 14 insertions, 3 deletions
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index be625eb99283..b4c2cf0fb06c 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -37,7 +37,7 @@ namespace {
// Last element of Key becomes prop, first part is the path and optionally nodes,
// when the node has oor:op attribute.
// Values can be the following: Value (string), Type (string, optional),
-// Final (dword, optional), External (dword, optional)
+// Final (dword, optional), External (dword, optional), ExternalBackend (string, optional)
//
// For example the following registry setting:
// [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
@@ -82,9 +82,10 @@ namespace {
//
// External (component data) example:
// [HKEY_CURRENT_USER\Software\Policies\LibreOffice\org.openoffice.UserProfile\Data\o]
-// "Value"="com.sun.star.configuration.backend.LdapUserProfileBe company"
+// "Value"="company"
// "Final"=dword:00000001
// "External"=dword:00000001
+// "ExternalBackend"="com.sun.star.configuration.backend.LdapUserProfileBe"
// becomes the following in configuration:
// <item oor:path="/org.openoffice.UserProfile/Data">
// <prop oor:name="o" oor:finalized="true">
@@ -135,6 +136,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil
bool bExternal = false;
OUString aValue;
OUString aType;
+ OUString aExternalBackend;
for(DWORD i = 0; i < nValues; ++i)
{
@@ -157,11 +159,20 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil
if (*reinterpret_cast<DWORD*>(pValue) == 1)
bExternal = true;
}
+ else if (!wcscmp(pValueName, L"ExternalBackend"))
+ aExternalBackend = OUString(pValue);
}
- // type and external are mutually exclusive
if (bExternal)
+ {
+ // type and external are mutually exclusive
aType.clear();
+ // Prepend backend, like in
+ // "com.sun.star.configuration.backend.LdapUserProfileBe company"
+ if (!aExternalBackend.isEmpty())
+ aValue = aExternalBackend + " " + aValue;
+ }
+
sal_Int32 aLastSeparator = aKeyName.lastIndexOf('\\');
OUString aPathAndNodes = aKeyName.copy(0, aLastSeparator);
OUString aProp = aKeyName.copy(aLastSeparator + 1);