From 145accd9a5b55070959d40c9314d870dffa5e4bc Mon Sep 17 00:00:00 2001 From: Tamás Zolnai Date: Wed, 8 Mar 2017 00:08:16 +0100 Subject: tdf#106283: Registry settings are not read properly on Windows Read also a type value from registry so user can specify a type for a property of an extensible group. Change-Id: I4105ba559a64ce96bfe5a390660ad7f349ba894c Reviewed-on: https://gerrit.libreoffice.org/34961 Tested-by: Jenkins Reviewed-by: Stephan Bergmann --- configmgr/source/winreg.cxx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'configmgr') diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index 60f99f1a911f..00b6656d4047 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -68,6 +68,18 @@ namespace { // // // +// +// Third example (property of an extensible group -> needs type): +// [HKEY_LOCAL_MACHINE\SOFTWARE\Policies\LibreOffice\org.openoffice.Office.Jobs\Jobs\org.openoffice.Office.Jobs:Job['UpdateCheck']\Arguments\AutoCheckEnabled] +// "Value"="false" +// "Final"=dword:00000001 +// "Type"="xs:boolean" +// becomes the following in configuration: +// +// +// false +// +// void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFileHandle) { @@ -112,6 +124,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil bool bFinal = false; OUString aValue; + OUString aType; for(DWORD i = 0; i < nValues; ++i) { @@ -121,9 +134,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil RegEnumValueW(hCurKey, i, pValueName.get(), &nValueNameLen, nullptr, nullptr, reinterpret_cast(pValue.get()), &nValueLen); const wchar_t wsValue[] = L"Value"; const wchar_t wsFinal[] = L"Final"; + const wchar_t wsType[] = L"Type"; if(!wcscmp(pValueName.get(), wsValue)) aValue = OUString(pValue.get()); + if (!wcscmp(pValueName.get(), wsType)) + aType = OUString(pValue.get()); if(!wcscmp(pValueName.get(), wsFinal) && *reinterpret_cast(pValue.get()) == 1) bFinal = true; } @@ -173,6 +189,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil writeData(aFileHandle, ""); -- cgit