diff options
author | Petr Mladek <pmladek@suse.cz> | 2012-11-05 14:34:27 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-11-05 14:34:27 +0100 |
commit | ef15a5a4acd3174752484c6aeb570d4d6444b645 (patch) | |
tree | 3d1d5b58f85737aa46241aea4c4dabea520cecc2 /setup_native | |
parent | a1b0ce05e851e9724c046888a01869eddf9e9db2 (diff) | |
parent | c309ce0227a14330094191c1ef15fa00899defcb (diff) |
Merge remote-tracking branch 'origin/libreoffice-3-6-3' into suse-3.6
Conflicts:
desktop/source/app/sofficemain.cxx
instsetoo_native/util/openoffice.lst
solenv/inc/minor.mk
Change-Id: I3e9510067c7173f6c71368e70ba6dfe168c5318e
Diffstat (limited to 'setup_native')
-rw-r--r-- | setup_native/prj/build.lst | 3 | ||||
-rw-r--r-- | setup_native/source/packinfo/makefile.mk | 24 | ||||
-rw-r--r-- | setup_native/source/packinfo/packinfo_office.txt | 12 | ||||
-rw-r--r-- | setup_native/source/packinfo/spellchecker_selection.pl | 68 | ||||
-rw-r--r-- | setup_native/source/packinfo/spellchecker_selection.txt | 2 | ||||
-rw-r--r-- | setup_native/source/win32/customactions/sellang/sellang.cxx | 234 | ||||
-rw-r--r-- | setup_native/source/win32/msi-encodinglist.txt | 2 |
7 files changed, 247 insertions, 98 deletions
diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst index 8898e8ad4e17..9b9914c8f86a 100644 --- a/setup_native/prj/build.lst +++ b/setup_native/prj/build.lst @@ -3,12 +3,13 @@ pk setup_native usr1 - all sn_mkou pk setup_native\scripts\source nmake - u sn_source NULL pk setup_native\scripts nmake - u sn_scripts sn_source.u NULL pk setup_native\source\mac nmake - u sn_mac NULL +pk setup_native\source\packinfo nmake - w sn_packinfo NULL pk setup_native\source\win32\customactions\tools nmake - w sn_tools NULL pk setup_native\source\win32\customactions\rebase nmake - w sn_rebase NULL pk setup_native\source\win32\customactions\regactivex nmake - w sn_regactivex NULL pk setup_native\source\win32\customactions\regpatchactivex nmake - w sn_regpatchactivex NULL pk setup_native\source\win32\customactions\reg4allmsdoc nmake - w sn_reg4allmsdoc NULL -pk setup_native\source\win32\customactions\sellang nmake - w sn_sellang NULL +pk setup_native\source\win32\customactions\sellang nmake - w sn_sellang sn_packinfo.w NULL pk setup_native\source\win32\customactions\thesaurus nmake - w sn_thesaurus NULL pk setup_native\source\win32\customactions\javafilter nmake - w sn_javafilter NULL pk setup_native\source\win32\customactions\quickstarter nmake - w sn_quickstarter NULL diff --git a/setup_native/source/packinfo/makefile.mk b/setup_native/source/packinfo/makefile.mk new file mode 100644 index 000000000000..a2c647886cf2 --- /dev/null +++ b/setup_native/source/packinfo/makefile.mk @@ -0,0 +1,24 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +PRJ = ../.. +PRJNAME = setup_native +TARGET = packinfo + +.INCLUDE: settings.mk + +ALLTAR: $(OUT)/inc/spellchecker_selection.hxx + +.INCLUDE: target.mk + +$(OUT)/inc/spellchecker_selection.hxx .ERRREMOVE : spellchecker_selection.pl \ + spellchecker_selection.txt + $(PERL) -w spellchecker_selection.pl <spellchecker_selection.txt >$@ + +# vim: set noet sw=4 ts=4: diff --git a/setup_native/source/packinfo/packinfo_office.txt b/setup_native/source/packinfo/packinfo_office.txt index bc7605bfd1ce..3a17e73573a8 100644 --- a/setup_native/source/packinfo/packinfo_office.txt +++ b/setup_native/source/packinfo/packinfo_office.txt @@ -941,25 +941,25 @@ packageversion = "%PACKAGEVERSION" End Start -module = "gid_Module_Root_Extension_Dictionary_Pt" -solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt" +module = "gid_Module_Root_Extension_Dictionary_Pt_Br" +solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-BR" solarisrequires = "%SOLSUREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07, %PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" -packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt" +packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-BR" requires = "%UREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure,%BASISPACKAGEPREFIX%PRODUCTVERSION-core01,%BASISPACKAGEPREFIX%PRODUCTVERSION-core02,%BASISPACKAGEPREFIX%PRODUCTVERSION-core03,%BASISPACKAGEPREFIX%PRODUCTVERSION-core04,%BASISPACKAGEPREFIX%PRODUCTVERSION-core05,%BASISPACKAGEPREFIX%PRODUCTVERSION-core06,%BASISPACKAGEPREFIX%PRODUCTVERSION-core07,%UNIXPACKAGENAME%BRANDPACKAGEVERSION" linuxpatchrequires = "" copyright = "1999-2010 by Oracle" solariscopyright = "solariscopyrightfile" vendor = "Oracle" -description = "Pt dictionary for %PRODUCTNAME %PRODUCTVERSION" +description = "Pt-BR dictionary for %PRODUCTNAME %PRODUCTVERSION" destpath = "/opt" packageversion = "%PACKAGEVERSION" End Start module = "gid_Module_Root_Extension_Dictionary_Pt_Pt" -solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-pt" +solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-PT" solarisrequires = "%SOLSUREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core01, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core02, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core03, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core04, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core05, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core06, %BASISPACKAGEPREFIX%WITHOUTDOTPRODUCTVERSION-core07, %PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION" -packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-pt" +packagename = "%UNIXPACKAGENAME%BRANDPACKAGEVERSION-dict-pt-PT" requires = "%UREPACKAGEPREFIX%BRANDPACKAGEVERSION-ure,%BASISPACKAGEPREFIX%PRODUCTVERSION-core01,%BASISPACKAGEPREFIX%PRODUCTVERSION-core02,%BASISPACKAGEPREFIX%PRODUCTVERSION-core03,%BASISPACKAGEPREFIX%PRODUCTVERSION-core04,%BASISPACKAGEPREFIX%PRODUCTVERSION-core05,%BASISPACKAGEPREFIX%PRODUCTVERSION-core06,%BASISPACKAGEPREFIX%PRODUCTVERSION-core07,%UNIXPACKAGENAME%BRANDPACKAGEVERSION" linuxpatchrequires = "" copyright = "1999-2010 by Oracle" diff --git a/setup_native/source/packinfo/spellchecker_selection.pl b/setup_native/source/packinfo/spellchecker_selection.pl new file mode 100644 index 000000000000..b30a843e4acd --- /dev/null +++ b/setup_native/source/packinfo/spellchecker_selection.pl @@ -0,0 +1,68 @@ +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# + +use List::Util qw[max]; + +@ARGV == 0 or die 'Usage: translates from stdin to stdout'; + +my %map = (); +my $max = 0; + +while (<>) { + next if /^\s*(#.*)?$/; + /^ \s* ([a-z]{2}(?:-[A-Z]{2})?) \s* = \s* + \"(EMPTY|[a-z]{2}(?:-[A-Z]{2})?(?:,[a-z]{2}(?:-[A-Z]{2})?)*)\" \s* $/x + or die "bad input line \"$_\""; + my $lang = $1; + $lang =~ tr/-/_/; + my $dicts = $2; + $dicts =~ tr/-/_/; + !exists($map{$lang}) or die "duplicate values for $lang"; + if ($dicts eq 'EMPTY') { + @{$map{$lang}} = (); + } else { + @{$map{$lang}} = split(/,/, $dicts); + $max = max($max, scalar(@{$map{$lang}})); + } +} + +++$max; + +print <<EOF; +// generated by setup_native/source/packinfo/spellchecker_selection.pl + +#ifndef INCLUDED_SETUP_NATIVE_SOURCE_PACKINFO_SPELLCHECKER_SELECTION_HXX +#define INCLUDED_SETUP_NATIVE_SOURCE_PACKINFO_SPELLCHECKER_SELECTION_HXX + +#include "sal/config.h" + +namespace setup_native { + +struct LanguageDictionaries { + char const * language; + char const * dictionaries[$max]; +}; + +LanguageDictionaries const languageDictionaries[] = { +EOF + +foreach $i (sort(keys(%map))) { + print(" { \"$i\", {"); + foreach $j (sort(@{$map{$i}})) { + print(" \"$j\","); + } + print(" 0 } },\n"); +} + +print <<EOF; +}; + +} + +#endif +EOF diff --git a/setup_native/source/packinfo/spellchecker_selection.txt b/setup_native/source/packinfo/spellchecker_selection.txt index a2e10bbac94b..f80e5d584716 100644 --- a/setup_native/source/packinfo/spellchecker_selection.txt +++ b/setup_native/source/packinfo/spellchecker_selection.txt @@ -22,7 +22,7 @@ el = "el" en-US = "en,es,fr" en-GB = "en,es,fr" en-ZA = "en,es,fr" -es = "an,es,fr,pt" +es = "an,es,fr,pt-PT" et = "et" fr = "fr,es" gd = "gd" diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx b/setup_native/source/win32/customactions/sellang/sellang.cxx index d88bbf767e5a..cda413c9d1b0 100644 --- a/setup_native/source/win32/customactions/sellang/sellang.cxx +++ b/setup_native/source/win32/customactions/sellang/sellang.cxx @@ -49,6 +49,8 @@ #include <sal/macros.h> #include <systools/win32/uwinapi.h> +#include "spellchecker_selection.hxx" + BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) { DWORD sz = 0; @@ -65,7 +67,7 @@ BOOL GetMsiProp( MSIHANDLE hMSI, const char* pPropName, char** ppValue ) } static const char * -langid_to_string( LANGID langid, int *have_default_lang ) +langid_to_string( LANGID langid ) { /* Map from LANGID to string. The languages below are now in * alphabetical order of codes as in @@ -73,11 +75,6 @@ langid_to_string( LANGID langid, int *have_default_lang ) * language part is returned in the string. */ switch (PRIMARYLANGID (langid)) { - case LANG_ENGLISH: - if (have_default_lang != NULL && - langid == MAKELANGID(LANG_ENGLISH, SUBLANG_DEFAULT)) - *have_default_lang = 1; - return "en"; #define CASE(name, primary) \ case LANG_##primary: return #name CASE(af, AFRIKAANS); @@ -94,6 +91,7 @@ langid_to_string( LANGID langid, int *have_default_lang ) CASE(da, DANISH); CASE(de, GERMAN); CASE(el, GREEK); + CASE(en, ENGLISH); CASE(es, SPANISH); CASE(et, ESTONIAN); CASE(eu, BASQUE); @@ -174,7 +172,7 @@ langid_to_string( LANGID langid, int *have_default_lang ) CASE(sh, SERBIAN, SERBIAN_LATIN); CASE(sr, SERBIAN, SERBIAN_CYRILLIC); #undef CASE - default: return ""; + default: return 0; } } } @@ -185,14 +183,20 @@ langid_to_string( LANGID langid, int *have_default_lang ) static const char *ui_langs[MAX_LANGUAGES]; static int num_ui_langs = 0; +void add_ui_lang(char const * lang) +{ + if (lang != 0 && num_ui_langs != SAL_N_ELEMENTS(ui_langs)) { + ui_langs[num_ui_langs++] = lang; + } +} + BOOL CALLBACK enum_ui_lang_proc (LPTSTR language, LONG_PTR /* unused_lParam */) { long langid = strtol(language, NULL, 16); if (langid > 0xFFFF) return TRUE; - ui_langs[num_ui_langs] = langid_to_string((LANGID) langid, NULL); - num_ui_langs++; + add_ui_lang(langid_to_string((LANGID) langid)); if (num_ui_langs == SAL_N_ELEMENTS(ui_langs) ) return FALSE; return TRUE; @@ -207,13 +211,47 @@ present_in_ui_langs(const char *lang) return FALSE; } +namespace { + +struct InstallLocalized { + char lang[sizeof("xx_XX")]; + bool install; +}; + +void addMatchingDictionaries( + char const * lang, InstallLocalized * dicts, int ndicts) +{ + for (int i = 0; i != SAL_N_ELEMENTS(setup_native::languageDictionaries); + ++i) + { + if (strcmp(lang, setup_native::languageDictionaries[i].language) == 0) { + for (char const * const * p = setup_native::languageDictionaries[i]. + dictionaries; + *p != NULL; ++p) + { + for (int j = 0; j != ndicts; ++j) { + if (_stricmp(*p, dicts[j].lang) == 0) { + dicts[j].install = true; + break; + } + } + } + break; + } + } +} + +} + extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) { char feature[100]; MSIHANDLE database, view, record; DWORD length; int nlangs = 0; - char langs[MAX_LANGUAGES][6]; + InstallLocalized langs[MAX_LANGUAGES]; + int ndicts = 0; + InstallLocalized dicts[MAX_LANGUAGES]; database = MsiGetActiveDatabase(handle); @@ -238,100 +276,118 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle ) return ERROR_SUCCESS; } - /* Keep track of what languages are included in this installer, if - * it is a multilanguage one. + /* Keep track of what langpacks are included in this installer. */ - if (strcmp(feature, "gm_Langpack_r_en_US") != 0) - strcpy(langs[nlangs++], feature + strlen("gm_Langpack_r_")); + strcpy(langs[nlangs].lang, feature + strlen("gm_Langpack_r_")); + langs[nlangs].install = false; + ++nlangs; MsiCloseHandle(record); } MsiCloseHandle(view); - if (nlangs > 0) { - int i; - char* pVal = NULL; - if ( (GetMsiProp( handle, "UI_LANGS", &pVal )) && pVal ) { - /* user gave UI languages explicitely with UI_LANGS property */ - int sel_ui_lang = 0; - strcpy(langs[nlangs++], "en_US"); - char *str_ptr; - str_ptr = strtok(pVal, ","); - for(; str_ptr != NULL ;) { - ui_langs[num_ui_langs] = str_ptr; - num_ui_langs++; - str_ptr = strtok(NULL, ","); - } - for (i = 0; i < nlangs; i++) { - if (!present_in_ui_langs(langs[i])) { - UINT rc; - sprintf(feature, "gm_Langpack_r_%s", langs[i]); - rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); - } - else { - sel_ui_lang++; - } - } - if ( sel_ui_lang == 0 ) { - /* When UI_LANG property contains only languages that are not present - * in the installer, install at least en_US localization. - */ - MsiSetFeatureStateA(handle, "gm_Langpack_r_en_US", INSTALLSTATE_LOCAL); - } - } - else { - /* Deselect those languages that don't match any of the UI languages - * available on the system. - */ - - int have_system_default_lang = 0; - const char *system_default_lang = langid_to_string(GetSystemDefaultUILanguage(), &have_system_default_lang); - const char *user_locale_lang = langid_to_string(LANGIDFROMLCID(GetThreadLocale()), NULL); - - EnumUILanguagesA(enum_ui_lang_proc, 0, 0); - - /* If one of the alternative languages in a multi-language installer - * is the system default UI language, deselect those languages that - * aren't among the UI languages available on the system. - * (On most Windows installations, just one UI language is present, - * which obviously is the same as the default UI language. But - * we want to be generic.) - * If none of the languages in a multi-language installer is the - * system default UI language (this happens now in 2.4.0 where we - * cannot put as many UI languages into the installer as we would - * like, but only half a dozen: en-US,de,es,fr,it,pt-BR), pretend - * that English is the system default UI language, - * so that we will by default deselect everything except - * English. We don't want to by default install all half dozen - * languages for an unsuspecting user of a Finnish Windows, for - * instance. Sigh. - */ - if (system_default_lang[0]) { - for (i = 0; i < nlangs; i++) { - if (memcmp (system_default_lang, langs[i], 2) == 0) { - have_system_default_lang = 1; + /* Keep track of what dictionaries are included in this installer: + */ + if (MsiDatabaseOpenViewA( + database, + ("SELECT Feature from Feature WHERE" + " Feature_Parent = 'gm_Dictionaries'"), + &view) + == ERROR_SUCCESS) + { + if (MsiViewExecute(view, NULL) == ERROR_SUCCESS) { + while (ndicts < MAX_LANGUAGES && + MsiViewFetch(view, &record) == ERROR_SUCCESS) + { + length = sizeof(feature); + if (MsiRecordGetStringA(record, 1, feature, &length) + == ERROR_SUCCESS) + { + if (strncmp( + feature, "gm_r_ex_Dictionary_", + strlen("gm_r_ex_Dictionary_")) + == 0) + { + strcpy( + dicts[ndicts].lang, + feature + strlen("gm_r_ex_Dictionary_")); + dicts[ndicts].install = false; + ++ndicts; } } + MsiCloseHandle(record); } + } + MsiCloseHandle(view); + } - if (!have_system_default_lang) { - system_default_lang = "en"; - have_system_default_lang = 1; + /* 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 ) { + char *str_ptr; + str_ptr = strtok(pVal, ","); + for(; str_ptr != NULL ;) { + add_ui_lang(str_ptr); + str_ptr = strtok(NULL, ","); + } + } else { + add_ui_lang(langid_to_string(GetSystemDefaultUILanguage())); + add_ui_lang(langid_to_string(LANGIDFROMLCID(GetThreadLocale()))); + //TODO: are the above two explicit additions necessary, or will + // those values always be included in the below EnumUILanguages + // anyway? + EnumUILanguagesA(enum_ui_lang_proc, 0, 0); + } + + // If the set of langpacks that match any of the relevant UI languages is + // non-empty, select just those matching langpacks; otherwise, if an en_US + // langpack is included, select just that langpack (this happens if, e.g., + // a multi-language en-US,de,es,fr,it,pt-BR installation set is installed on + // a Finnish Windows); otherwise, select all langpacks (this happens if, + // e.g., a single-language de installation set is installed on a Finnish + // Windows): + bool matches = false; + for (int i = 0; i < nlangs; i++) { + if (present_in_ui_langs(langs[i].lang)) { + langs[i].install = true; + matches = true; + } + } + if (!matches) { + for (int i = 0; i < nlangs; i++) { + if (strcmp(langs[nlangs].lang, "en_US") == 0) { + langs[i].install = true; + matches = true; + break; } - if (have_system_default_lang) { - for (i = 0; i < nlangs; i++) { - if (memcmp(system_default_lang, langs[i], 2) != 0 && - memcmp(user_locale_lang, langs[i], 2) != 0 && - !present_in_ui_langs(langs[i])) { - UINT rc; - sprintf(feature, "gm_Langpack_r_%s", langs[i]); - rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); - } - } + } + if (!matches) { + for (int i = 0; i < nlangs; i++) { + langs[i].install = true; } } } + + for (int i = 0; i < nlangs; i++) { + if (langs[i].install) { + addMatchingDictionaries(langs[i].lang, dicts, ndicts); + } else { + sprintf(feature, "gm_Langpack_r_%s", langs[i].lang); + MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); + } + } + + // Select just those dictionaries that match any of the selected langpacks: + for (int i = 0; i != ndicts; ++i) { + if (!dicts[i].install) { + sprintf(feature, "gm_r_ex_Dictionary_%s", dicts[i].lang); + MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT); + } + } + MsiCloseHandle(database); return ERROR_SUCCESS; diff --git a/setup_native/source/win32/msi-encodinglist.txt b/setup_native/source/win32/msi-encodinglist.txt index 1fd3cb96e70d..84d77f7c78b4 100644 --- a/setup_native/source/win32/msi-encodinglist.txt +++ b/setup_native/source/win32/msi-encodinglist.txt @@ -104,7 +104,7 @@ pt-BR 1252 1046 pt-PT 1252 2070 qtz 1252 1033 # key id pseudo language rm 0 1047 # Raeto-Romance -ro 1250 1048 # Romanian +ro 0 1048 # Romanian ru 1251 1049 rw 0 1569 # Kinyarwanda sa-IN 0 1103 # Sanskrit |