diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2015-07-14 10:44:52 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2015-08-31 15:11:18 +0200 |
commit | 0b4c3b826ec0c32770150e1278c9ddb225e99b51 (patch) | |
tree | 5125e0dc2f5905ade4ac33ca0e2a9661a3abbb85 /configmgr | |
parent | 36cd0b37cd71675f169a2af816f5194bf162d38e (diff) |
tdf#93546 -Add HKEY_CURRENT_USER registry integration.
Back-port this to allow merging a user registry fragment.
Conflicts:
configmgr/source/components.cxx
instsetoo_native/CustomTarget_setup.mk
scp2/source/ooo/common_brand.scp
Conflicts:
scp2/source/ooo/common_brand.scp
Change-Id: Ia32ba9ff3e7878d40032bd7d10fba2c143d11757
Reviewed-on: https://gerrit.libreoffice.org/17884
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
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 7f3e41c342d2..28f422158f2b 100644 --- a/configmgr/source/components.cxx +++ b/configmgr/source/components.cxx @@ -533,7 +533,7 @@ Components::Components( parseModificationLayer(url); } #ifdef WNT - else if ( type == "winreg" ) + else if (type == "winreg" || type == "winuserreg") { if (!url.isEmpty()) { SAL_WARN( @@ -541,8 +541,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 a5723d7588ef..455c7119f329 100644 --- a/configmgr/source/winreg.cxx +++ b/configmgr/source/winreg.cxx @@ -188,10 +188,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); } |