summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTamás Zolnai <tamas.zolnai@collabora.com>2017-03-10 13:13:32 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2017-03-13 14:42:59 +0000
commit78c095f991629da487a9571f736f15c44648a85d (patch)
treec081a5f78e315416f74ed58e8656091e2950d9a9
parent2dd2ef0a09cc1deb991abc55e3fd87cf9c73002e (diff)
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. Reviewed-on: https://gerrit.libreoffice.org/34961 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 145accd9a5b55070959d40c9314d870dffa5e4bc) Change-Id: I4105ba559a64ce96bfe5a390660ad7f349ba894c Reviewed-on: https://gerrit.libreoffice.org/35041 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--configmgr/source/winreg.cxx22
1 files changed, 22 insertions, 0 deletions
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx
index cd36b23454a3..7e47d42b3418 100644
--- a/configmgr/source/winreg.cxx
+++ b/configmgr/source/winreg.cxx
@@ -66,6 +66,18 @@ namespace {
// </node>
// </node>
// </item>
+//
+// 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:
+// <item oor:path="/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments">
+// <prop oor:name="AutoCheckEnabled" oor:type="xs::boolean" oor:finalized="true">
+// <value>false</value>
+// </prop>
+// </item>
void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, TempFile &aFileHandle)
{
@@ -108,6 +120,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, TempFile &aFileHandle)
bool bFinal = false;
OUString aValue;
+ OUString aType;
for(DWORD i = 0; i < nValues; ++i)
{
@@ -117,9 +130,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, TempFile &aFileHandle)
RegEnumValueW(hCurKey, i, pValueName, &nValueNameLen, NULL, NULL, (LPBYTE)pValue, &nValueLen);
const wchar_t wsValue[] = L"Value";
const wchar_t wsFinal[] = L"Final";
+ const wchar_t wsType[] = L"Type";
if(!wcscmp(pValueName, wsValue))
aValue = OUString(pValue);
+ if(!wcscmp(pValueName, wsType))
+ aType = OUString(pValue);
if(!wcscmp(pValueName, wsFinal) && *(DWORD*)pValue == 1)
bFinal = true;
}
@@ -169,6 +185,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, TempFile &aFileHandle)
writeData(aFileHandle, "<prop oor:name=\"");
writeAttributeValue(aFileHandle, aProp);
writeData(aFileHandle, "\"");
+ if(!aType.isEmpty())
+ {
+ writeData(aFileHandle, " oor:type=\"");
+ writeAttributeValue(aFileHandle, aType);
+ writeData(aFileHandle, "\"");
+ }
if(bFinal)
writeData(aFileHandle, " oor:finalized=\"true\"");
writeData(aFileHandle, "><value>");