diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-07-14 10:44:52 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-07-14 09:46:10 -0700 |
commit | 15511f327d36a288c229faa1b2cfb9765ed36752 (patch) | |
tree | 0aa45347a0a3e7d018241bf0501ed22dc607e19b /configmgr | |
parent | ec9e5a231e3f38e58e0dcc83f5a714037dc34b38 (diff) |
Add HKEY_CURRENT_USER registry integration.
It seems rather odd that we dump this to a file and parse again to me.
Conflicts:
configmgr/source/components.cxx
instsetoo_native/CustomTarget_setup.mk
scp2/source/ooo/common_brand.scp
Change-Id: Ia32ba9ff3e7878d40032bd7d10fba2c143d11757
Diffstat (limited to 'configmgr')
-rw-r--r-- | configmgr/source/components.cxx | 8 | ||||
-rw-r--r-- | configmgr/source/winreg.cxx | 5 | ||||
-rw-r--r-- | configmgr/source/winreg.hxx | 4 |
3 files changed, 11 insertions, 6 deletions
diff --git a/configmgr/source/components.cxx b/configmgr/source/components.cxx index 4e7259b2bbac..6f11331d40c4 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -544,7 +544,7 @@ Components::Components( parseModificationLayer(url); } #ifdef WNT - else if ( type == "winreg" ) + else if (type == "winreg" || type == "winuserreg") { if (!url.isEmpty()) { SAL_WARN( @@ -552,8 +552,10 @@ Components::Components( "winreg URL is not empty, URL handling is not implemented for winreg"); } OUString aTempFileURL; - if ( dumpWindowsRegistry(&aTempFileURL) ) - { + WinRegType eType = WinRegType::LOCAL_MACHINE; + if (type == "winuserreg") + eType = WinRegType::CURRENT_USER; + if (dumpWindowsRegistry(&aTempFileURL, eType)) { parseFileLeniently(&parseXcuFile, aTempFileURL, layer, data_, 0, 0, 0); layer++; osl::File::remove(aTempFileURL); diff --git a/configmgr/source/winreg.cxx b/configmgr/source/winreg.cxx index a47fe25b8f16..82367ee4a480 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -190,10 +190,11 @@ void dumpWindowsRegistryKey(HKEY hKey, OUString aKeyName, oslFileHandle aFileHan } } -bool dumpWindowsRegistry(OUString* pFileURL) +bool dumpWindowsRegistry(OUString* pFileURL, WinRegType eType) { HKEY hKey; - if(RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE\\Policies\\LibreOffice", 0, KEY_READ, &hKey) != ERROR_SUCCESS) + HKEY hDomain = eType == LOCAL_MACHINE ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER; + if(RegOpenKeyExW(hDomain, L"SOFTWARE\\Policies\\LibreOffice", 0, KEY_READ, &hKey) != ERROR_SUCCESS) { SAL_INFO( "configmgr", diff --git a/configmgr/source/winreg.hxx b/configmgr/source/winreg.hxx index 020977262beb..fb880ac0c564 100644 --- a/configmgr/source/winreg.hxx +++ b/configmgr/source/winreg.hxx @@ -13,7 +13,9 @@ namespace configmgr { -bool dumpWindowsRegistry(OUString* pFileURL); +enum WinRegType { LOCAL_MACHINE, CURRENT_USER }; + +bool dumpWindowsRegistry(OUString* pFileURL, WinRegType eType); } |