Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


This is about backporting to libreoffice-3-6 the fix for part 1 of <https://bugs.freedesktop.org/show_bug.cgi?id=53009> "Large UserInstallation's user/extensions/bundled/ tree," namely default-selecting only a reasonable subset of the 40+ dictionaries that come included with LO's msi installer (see <https://bugs.freedesktop.org/show_bug.cgi?id=53009#c10>).

I'm switching back to the good old way of using the ML rather than gerrit to propose this backport, for various reasons:

* The fix spans multiple commits, for multiple issues and multiple repositories. 0001-Fix-for-fdo-53520-Portuguese-spelling-files.patch is for the dictionaries repo, the other 0001...0006 are for the core repo.

* There was a naming inconsistency for the pt-BR and pt-PT dictionaries that caused the data in setup_native/source/packinfo/spellchecker_selection.txt (which is used in the fix) to not match reality, and <https://bugs.freedesktop.org/show_bug.cgi?id=53520> "[PACKAGING] Brazilian spell-check pt-BR named as pt-PT" fixes that, so the easiest (though somewhat further-reaching) solution is to backport that fix as well. (Hence the many commits split across two repos.)

* The benefit of this fix for somebody doing an upgrade from a previous LO installation is not evident: As LO's msi installer keeps selected those features that were selected for the previous installation, this fix's pruning of the list of default-selected dictionaries would not kick in, and instead the default-selected list would cover exactly those dictionaries that were already installed before (which typically is all). It only effectively affects brand-new installations.

Stephan
From c07ed40b4c74257c91dbf4d1bc4e1f4b52832c6f Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Tue, 11 Sep 2012 07:31:43 +0200
Subject: [PATCH 1/6] fdo#53520 rename portuguese dicts

Change-Id: I70cb4856f1db4722e886407d1c2fdf6a73b9a7f3
(cherry picked from commit d9412fb4755377b8358a46a249cfe29a22ea9451)
---
 scp2/source/ooo/common_brand.scp | 6 +++---
 scp2/source/ooo/file_ooo.scp     | 8 ++++----
 scp2/source/ooo/module_ooo.scp   | 6 +++---
 scp2/source/ooo/module_ooo.ulf   | 4 ++--
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/scp2/source/ooo/common_brand.scp b/scp2/source/ooo/common_brand.scp
index 2736936..c2ce2c2 100644
--- a/scp2/source/ooo/common_brand.scp
+++ b/scp2/source/ooo/common_brand.scp
@@ -336,14 +336,14 @@ Directory gid_Brand_Dir_Share_Extensions_Dict_Pl
     DosName = "dict-pl";
 End
 
-Directory gid_Brand_Dir_Share_Extensions_Dict_Pt
+Directory gid_Brand_Dir_Share_Extensions_Dict_Pt_Br
     ParentID = gid_Brand_Dir_Share_Extensions;
-    DosName = "dict-pt";
+    DosName = "dict-pt-BR";
 End
 
 Directory gid_Brand_Dir_Share_Extensions_Dict_Pt_Pt
     ParentID = gid_Brand_Dir_Share_Extensions;
-    DosName = "dict-pt-pt";
+    DosName = "dict-pt-PT";
 End
 
 Directory gid_Brand_Dir_Share_Extensions_Dict_Ro
diff --git a/scp2/source/ooo/file_ooo.scp b/scp2/source/ooo/file_ooo.scp
index 781cbf7..ebdcf25 100644
--- a/scp2/source/ooo/file_ooo.scp
+++ b/scp2/source/ooo/file_ooo.scp
@@ -1604,9 +1604,9 @@ End
 #endif
 
 #ifndef WITHOUT_MYSPELL_DICTS
-File gid_File_Extension_Dictionary_Pt
-       Dir = gid_Brand_Dir_Share_Extensions_Dict_Pt;
-       Name = "dict-pt.oxt";
+File gid_File_Extension_Dictionary_Pt_Br
+       Dir = gid_Brand_Dir_Share_Extensions_Dict_Pt_Br;
+       Name = "dict-pt-BR.oxt";
        Styles = (PACKED, FORCELANGUAGEPACK, ARCHIVE);
        UnixRights = 444;
 End
@@ -1615,7 +1615,7 @@ End
 #ifndef WITHOUT_MYSPELL_DICTS
 File gid_File_Extension_Dictionary_Pt_Pt
        Dir = gid_Brand_Dir_Share_Extensions_Dict_Pt_Pt;
-       Name = "dict-pt-pt.oxt";
+       Name = "dict-pt-PT.oxt";
        Styles = (PACKED, FORCELANGUAGEPACK, ARCHIVE);
        UnixRights = 444;
 End
diff --git a/scp2/source/ooo/module_ooo.scp b/scp2/source/ooo/module_ooo.scp
index 23196e2..af6e72c 100644
--- a/scp2/source/ooo/module_ooo.scp
+++ b/scp2/source/ooo/module_ooo.scp
@@ -408,9 +408,9 @@ Module gid_Module_Root_Extension_Dictionary_Pl
     Styles = ();
 End
 
-Module gid_Module_Root_Extension_Dictionary_Pt
-    MOD_NAME_DESC ( MODULE_EXTENSION_DICTIONARY_PT );
-    Files = (gid_File_Extension_Dictionary_Pt);
+Module gid_Module_Root_Extension_Dictionary_Pt_Br
+    MOD_NAME_DESC ( MODULE_EXTENSION_DICTIONARY_PT_BR );
+    Files = (gid_File_Extension_Dictionary_Pt_Br);
     InstallOrder = "2000";
     Sortkey = "515";
     Spellcheckerlanguage = "pt-BR";
diff --git a/scp2/source/ooo/module_ooo.ulf b/scp2/source/ooo/module_ooo.ulf
index 8d0ddf6..a4927ba 100644
--- a/scp2/source/ooo/module_ooo.ulf
+++ b/scp2/source/ooo/module_ooo.ulf
@@ -241,10 +241,10 @@ en-US = "Polish"
 [STR_DESC_MODULE_EXTENSION_DICTIONARY_PL]
 en-US = "Polish spelling dictionary, hyphenation rules, and thesaurus"
 
-[STR_NAME_MODULE_EXTENSION_DICTIONARY_PT]
+[STR_NAME_MODULE_EXTENSION_DICTIONARY_PT_BR]
 en-US = "Brazilian Portuguese"
 
-[STR_DESC_MODULE_EXTENSION_DICTIONARY_PT]
+[STR_DESC_MODULE_EXTENSION_DICTIONARY_PT_BR]
 en-US = "Brazilian Portuguese spelling Dictionary (1990 Spelling Agreement), and hyphenation rules"
 
 [STR_NAME_MODULE_EXTENSION_DICTIONARY_PT_PT]
-- 
1.7.11.4

From 41bf20c442c81edf493c8bfc23983087090bcdfd Mon Sep 17 00:00:00 2001
From: Olivier Hallot <olivier.hallot@alta.org.br>
Date: Sun, 9 Sep 2012 07:43:03 -0300
Subject: [PATCH 2/6] fix bug fdo#53520, pt-PT and pt-BR better split

This patch fixes fdo#53520: Portuguese language spelling package names and split the files into the 
proper directories.

Change-Id: Iff10cfee1da2c4775e4cf9050ec154052ee18ac9
(cherry picked from commit ff9c93c0294b8350a58c648346c01d726710c402)
---
 setup_native/source/packinfo/packinfo_office.txt | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/setup_native/source/packinfo/packinfo_office.txt 
b/setup_native/source/packinfo/packinfo_office.txt
index bc7605b..9f9723a 100644
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -942,24 +942,24 @@ End
 
 Start
 module = "gid_Module_Root_Extension_Dictionary_Pt"
-solarispackagename = "%PACKAGEPREFIX%SOLARISBRANDPACKAGENAME%BRANDPACKAGEVERSION-dict-pt"
+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"
-- 
1.7.11.4

From afe069d1103f0d4feb4d1cd7e627c48fdb14e819 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Tue, 11 Sep 2012 08:58:09 +0200
Subject: [PATCH 3/6] fdo#53520: Adapt to dict-pt*.oxt renames, and more
 pt-PT/pt-BR clean up

Change-Id: Ie2262ed49ea829e1afdf97583dd633f954f64edc
(cherry picked from commit a7805f85ad7a11c187c3bdc1b85be624ccbff864)
---
 setup_native/source/packinfo/packinfo_office.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup_native/source/packinfo/packinfo_office.txt 
b/setup_native/source/packinfo/packinfo_office.txt
index 9f9723a..3a17e73 100644
--- a/setup_native/source/packinfo/packinfo_office.txt
+++ b/setup_native/source/packinfo/packinfo_office.txt
@@ -941,7 +941,7 @@ packageversion = "%PACKAGEVERSION"
 End
 
 Start
-module = "gid_Module_Root_Extension_Dictionary_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-BR"
-- 
1.7.11.4

From 015d0e1e4297d5b0e69f69f76296d28d8e146bdb Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Tue, 11 Sep 2012 13:03:13 +0200
Subject: [PATCH 4/6] fdo#53520: One more dict pt vs. pt-PT inconsitency

Change-Id: Idad02284eaa033a029a2ff7d03bde83800ba738a
(cherry picked from commit 8bb4cc03cf81051aa04362f2bc3a867e4bd72bd0)
---
 setup_native/source/packinfo/spellchecker_selection.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/setup_native/source/packinfo/spellchecker_selection.txt 
b/setup_native/source/packinfo/spellchecker_selection.txt
index a2e10bb..f80e5d5 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"
-- 
1.7.11.4

From 69847cffdcce4c4f103afd453389f7710b54d10f Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Wed, 5 Sep 2012 16:37:25 +0200
Subject: [PATCH 5/6] Some code simplification

Change-Id: I01eb2bf6fe03845787e8869a2f90bb2fced4f933
(cherry picked from commit 8b3ab4b8a580bf4c4013e1baf3474a71fed44663)
---
 .../source/win32/customactions/sellang/sellang.cxx | 38 +++++++++-------------
 1 file changed, 16 insertions(+), 22 deletions(-)

diff --git a/setup_native/source/win32/customactions/sellang/sellang.cxx 
b/setup_native/source/win32/customactions/sellang/sellang.cxx
index d88bbf7..103496f 100644
--- a/setup_native/source/win32/customactions/sellang/sellang.cxx
+++ b/setup_native/source/win32/customactions/sellang/sellang.cxx
@@ -65,7 +65,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 +73,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 +89,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);
@@ -191,7 +187,7 @@ 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);
+    ui_langs[num_ui_langs] = langid_to_string((LANGID) langid);
     num_ui_langs++;
     if (num_ui_langs == SAL_N_ELEMENTS(ui_langs) )
         return FALSE;
@@ -285,9 +281,8 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
              * 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);
+            const char *system_default_lang = langid_to_string(GetSystemDefaultUILanguage());
+            const char *user_locale_lang = langid_to_string(LANGIDFROMLCID(GetThreadLocale()));
 
             EnumUILanguagesA(enum_ui_lang_proc, 0, 0);
 
@@ -307,27 +302,26 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
              * languages for an unsuspecting user of a Finnish Windows, for
              * instance. Sigh.
              */
+            bool have_system_default_lang = false;
             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;
+                        have_system_default_lang = true;
+                        break;
                     }
                 }
             }
-
             if (!have_system_default_lang) {
                 system_default_lang = "en";
-                have_system_default_lang = 1;
             }
-            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);
-                    }
+
+            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);
                 }
             }
         }
-- 
1.7.11.4

From ae47920616992459a28cd96547f420b07094270f Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Tue, 11 Sep 2012 13:05:56 +0200
Subject: [PATCH 6/6] fdo#53009: For msi installer, only default-select a
 subset of dictionaries

Change-Id: I3ee3fb5e5142ce4956776467b2ffcb19ed3b10c2
(cherry picked from commit e2fac98819c00b4fb50f9de9d0f32d20092f3191)
---
 setup_native/prj/build.lst                         |  3 +-
 setup_native/source/packinfo/makefile.mk           | 24 +++++++
 .../source/packinfo/spellchecker_selection.pl      | 68 ++++++++++++++++++
 .../source/win32/customactions/sellang/sellang.cxx | 82 ++++++++++++++++++++++
 4 files changed, 176 insertions(+), 1 deletion(-)
 create mode 100644 setup_native/source/packinfo/makefile.mk
 create mode 100644 setup_native/source/packinfo/spellchecker_selection.pl

diff --git a/setup_native/prj/build.lst b/setup_native/prj/build.lst
index 8898e8a..9b9914c 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 0000000..a2c6478
--- /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/spellchecker_selection.pl 
b/setup_native/source/packinfo/spellchecker_selection.pl
new file mode 100644
index 0000000..b30a843
--- /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/win32/customactions/sellang/sellang.cxx 
b/setup_native/source/win32/customactions/sellang/sellang.cxx
index 103496f..8d243b0 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;
@@ -203,6 +205,37 @@ present_in_ui_langs(const char *lang)
     return FALSE;
 }
 
+namespace {
+
+struct Dictionary {
+    char lang[sizeof("xx_XX")];
+    bool install;
+};
+
+void addMatchingDictionaries(char const * lang, Dictionary * 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];
@@ -210,6 +243,8 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
     DWORD length;
     int nlangs = 0;
     char langs[MAX_LANGUAGES][6];
+    int ndicts = 0;
+    Dictionary dicts[MAX_LANGUAGES];
 
     database = MsiGetActiveDatabase(handle);
 
@@ -245,6 +280,41 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
 
     MsiCloseHandle(view);
 
+    /* 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 (nlangs > 0) {
         int i;
         char* pVal = NULL;
@@ -266,6 +336,7 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
                     rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT);
                 }
                 else {
+                    addMatchingDictionaries(langs[i], dicts, ndicts);
                     sel_ui_lang++;
                 }
             }
@@ -274,6 +345,7 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
                  * in the installer, install at least en_US localization.
                  */
                 MsiSetFeatureStateA(handle, "gm_Langpack_r_en_US", INSTALLSTATE_LOCAL);
+                addMatchingDictionaries("en_US", dicts, ndicts);
             }
         }
         else {
@@ -322,10 +394,20 @@ extern "C" UINT __stdcall SelectLanguage( MSIHANDLE handle )
                     UINT rc;
                     sprintf(feature, "gm_Langpack_r_%s", langs[i]);
                     rc = MsiSetFeatureStateA(handle, feature, INSTALLSTATE_ABSENT);
+                } else {
+                    addMatchingDictionaries(langs[i], dicts, ndicts);
                 }
             }
         }
     }
+
+    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;
-- 
1.7.11.4

From 80a67e41138617990b24ece54aeaa28465ec4b8f Mon Sep 17 00:00:00 2001
From: Olivier Hallot <olivier.hallot@alta.org.br>
Date: Sun, 9 Sep 2012 07:48:00 -0300
Subject: [PATCH] Fix for fdo#53520, Portuguese spelling files

(cherry picked from commit d1f69e800560a558f9dbffc195573d32354e8efb)

Conflicts:
        dictionaries/Dictionary_pt-BR.mk
        dictionaries/Dictionary_pt-PT.mk
        dictionaries/Module_dictionaries.mk

Change-Id: I95cb422412de5f36416e6aaeb1663c39773ffb7c
---
 dictionaries/pt_BR/makefile.mk | 6 +++---
 dictionaries/pt_PT/makefile.mk | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dictionaries/pt_BR/makefile.mk b/dictionaries/pt_BR/makefile.mk
index 021981c..de6f96b 100644
--- a/dictionaries/pt_BR/makefile.mk
+++ b/dictionaries/pt_BR/makefile.mk
@@ -28,7 +28,7 @@
 PRJ=..
 
 PRJNAME=dictionaries
-TARGET=dict-pt
+TARGET=dict-pt-BR
 
 # --- Settings -----------------------------------------------------
 
@@ -40,8 +40,8 @@ TARGET=dict-pt
 # --- Files --------------------------------------------------------
 
 # name for uniq directory
-EXTENSIONNAME:=dict-pt
-EXTENSION_ZIPNAME:=dict-pt
+EXTENSIONNAME:=dict-pt-BR
+EXTENSION_ZIPNAME:=dict-pt-BR
 
 # some other targets to be done
 
diff --git a/dictionaries/pt_PT/makefile.mk b/dictionaries/pt_PT/makefile.mk
index c8cf974..4686de8 100644
--- a/dictionaries/pt_PT/makefile.mk
+++ b/dictionaries/pt_PT/makefile.mk
@@ -28,7 +28,7 @@
 PRJ=..
 
 PRJNAME=dictionaries
-TARGET=dict-pt-pt
+TARGET=dict-pt-PT
 
 # --- Settings -----------------------------------------------------
 
@@ -40,8 +40,8 @@ TARGET=dict-pt-pt
 # --- Files --------------------------------------------------------
 
 # name for uniq directory
-EXTENSIONNAME:=dict-pt-pt
-EXTENSION_ZIPNAME:=dict-pt-pt
+EXTENSIONNAME:=dict-pt-PT
+EXTENSION_ZIPNAME:=dict-pt-PT
 
 # some other targets to be done
 
-- 
1.7.11.4


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.