diff options
author | Mathias Michel <matm@gmx.fr> | 2013-01-20 02:46:13 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-01-23 11:26:08 +0000 |
commit | 95ee7d9cd3a0b0f397def8e607759c81feb8c592 (patch) | |
tree | 05a77a104c510ebb2faebf94e230a9a1be1ce16e /setup_native/source/win32/customactions/sellang/sellang.cxx | |
parent | e1669188e2832cf0cc1caf111f70aff7ba17757a (diff) |
fix for fdo#39632 : Consolidate GetMsiProperty()
And did it also for GetMsiProp() and *MsiProperty()
Reworked some conditions related to that.
Change-Id: I1cd082361126db3d9aced3a878b19e7052514864
Reviewed-on: https://gerrit.libreoffice.org/1816
Reviewed-by: Andras Timar <atimar@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'setup_native/source/win32/customactions/sellang/sellang.cxx')
-rw-r--r-- | setup_native/source/win32/customactions/sellang/sellang.cxx | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index b6f7ec559ea0..893a04f386a4 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -28,7 +28,7 @@ #define WINVER 0x0500 #include <windows.h> -#include <msiquery.h> +#include <../tools/msiprop.hxx> #include <malloc.h> #include <stdio.h> @@ -40,21 +40,6 @@ #include "spellchecker_selection.hxx" -BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) -{ - DWORD sz = 0; - if ( MsiGetProperty( hMSI, pPropName, "", &sz ) == ERROR_MORE_DATA ) { - sz++; - DWORD nbytes = sz * sizeof( char ); - char* buff = reinterpret_cast<char*>( malloc( nbytes ) ); - ZeroMemory( buff, nbytes ); - MsiGetProperty( hMSI, pPropName, buff, &sz ); - *ppValue = buff; - return ( strlen(buff) > 0 ); - } - return FALSE; -} - static const char * langid_to_string( LANGID langid ) { @@ -314,8 +299,8 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) /* Keep track of what UI languages are relevant, either the ones explicitly * requested with the UI_LANGS property, or all available on the system: */ - char* pVal = NULL; - if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) && pVal ) { + LPTSTR pVal = NULL; + if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) ) { char *str_ptr; str_ptr = strtok(pVal, ","); for(; str_ptr != NULL ;) { |