diff options
-rw-r--r-- | configmgr/source/winreg.cxx | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index c2e709b15686..ef7e212c9e8f 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 const & aKeyName, TempFile &aFileHandle) { @@ -108,6 +120,7 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil bool bFinal = false; OUString aValue; + OUString aType; for(DWORD i = 0; i < nValues; ++i) { @@ -117,9 +130,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil RegEnumValueW(hCurKey, i, pValueName, &nValueNameLen, nullptr, nullptr, reinterpret_cast<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) && *reinterpret_cast<DWORD*>(pValue) == 1) bFinal = true; } @@ -169,6 +185,12 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString const & aKeyName, TempFile &aFil 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>"); |