[libreoffice] Resolves: rhbz#771108 English menu in writer despite installation of libreoffice-langpack-de

David Tardon dtardon at fedoraproject.org
Thu Jan 12 09:40:50 UTC 2012


commit cd305e9f0986e61ff8fe8db8e449192fbcafdb46
Author: David Tardon <dtardon at redhat.com>
Date:   Thu Jan 12 10:33:10 2012 +0100

    Resolves: rhbz#771108 English menu in writer despite installation of libreoffice-langpack-de

 ..._merge-fix-mis-merge-of-first-module-s-st.patch |   58 +++++++++++++
 ...-writing-of-strings-from-the-first-module.patch |   85 ++++++++++++++++++++
 libreoffice.spec                                   |    6 ++
 3 files changed, 149 insertions(+), 0 deletions(-)
---
diff --git a/0001-Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch b/0001-Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch
new file mode 100644
index 0000000..e5c33fb
--- /dev/null
+++ b/0001-Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch
@@ -0,0 +1,58 @@
+From 4ce9896c6ac42d450d2056ee8d700b9f6dce8e2d Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon at redhat.com>
+Date: Wed, 11 Jan 2012 11:42:09 +0100
+Subject: [PATCH] Revert "fast_merge: fix mis-merge of first module's strings"
+
+This is not enough, because the file is still wrong.
+
+This reverts commit 47a8454f5f76030203ce6458cf63d4348bdacffe.
+---
+ l10ntools/scripts/fast_merge.pl |   10 ++++------
+ 1 files changed, 4 insertions(+), 6 deletions(-)
+
+diff --git a/l10ntools/scripts/fast_merge.pl b/l10ntools/scripts/fast_merge.pl
+index 73b824e..5dc63cf 100644
+--- a/l10ntools/scripts/fast_merge.pl
++++ b/l10ntools/scripts/fast_merge.pl
+@@ -91,7 +91,7 @@ while( hasLines() )
+ }
+ if( $#current+1 ne 0 )
+ {
+-    ( $path , $localize_file ) = make_paths($current[ 0 ]->module);
++    ( $path , $localize_file ) = make_paths();
+     add_to_buffer();
+     write_buffer( $path , $localize_file );
+ }
+@@ -240,8 +240,7 @@ sub hasLines
+ 
+ sub make_paths
+ {
+-    my $module = shift ;
+-    my $localizeFile = $merge_dir."\\".$module."\\".$current[ 0 ]->file;
++    my $localizeFile = $merge_dir."\\".$current[ 0 ]->module."\\".$current[ 0 ]->file;
+     my $path = getDir( $localizeFile );
+     $path =~ s/\\/\//g;
+ 
+@@ -252,9 +251,8 @@ sub make_paths
+ sub write_lines
+ {
+     if( $first_run ){
+-        my $module = $current[ 0 ]->module;
+         add_to_buffer();
+-        my( $path , $localize_file ) = make_paths($module);
++        my( $path , $localize_file ) = make_paths();
+         $last_path = $path;
+         $last_localize_file = $localize_file;
+         mkpath $path;
+@@ -264,7 +262,7 @@ sub write_lines
+     else
+     {
+         return , if ( $#current+1 eq 0 );
+-        my( $path , $localize_file ) = make_paths($current[ 0 ]->module);
++        my( $path , $localize_file ) = make_paths();
+         if( $path eq $last_path )
+         {
+             add_to_buffer();
+-- 
+1.7.7.5
+
diff --git a/0001-fix-writing-of-strings-from-the-first-module.patch b/0001-fix-writing-of-strings-from-the-first-module.patch
new file mode 100644
index 0000000..383bb23
--- /dev/null
+++ b/0001-fix-writing-of-strings-from-the-first-module.patch
@@ -0,0 +1,85 @@
+From 196885980bbb51562264cb5aad9a3e01133d1d7d Mon Sep 17 00:00:00 2001
+From: David Tardon <dtardon at redhat.com>
+Date: Wed, 11 Jan 2012 14:04:54 +0100
+Subject: [PATCH] fix writing of strings from the first module
+
+---
+ l10ntools/scripts/fast_merge.pl |   21 +++++++++++++--------
+ 1 files changed, 13 insertions(+), 8 deletions(-)
+
+diff --git a/l10ntools/scripts/fast_merge.pl b/l10ntools/scripts/fast_merge.pl
+index 5dc63cf..cc632e4 100644
+--- a/l10ntools/scripts/fast_merge.pl
++++ b/l10ntools/scripts/fast_merge.pl
+@@ -89,11 +89,10 @@ while( hasLines() )
+     }
+     write_lines();
+ }
+-if( $#current+1 ne 0 )
++# write content of the last localize.sdf file
++if( $#buffer ge 0 )
+ {
+-    ( $path , $localize_file ) = make_paths();
+-    add_to_buffer();
+-    write_buffer( $path , $localize_file );
++    write_buffer( $last_path , $last_localize_file );
+ }
+ release_lock();
+ exit( 0 );
+@@ -248,15 +247,14 @@ sub make_paths
+ 
+     return ( $path , $localizeFile );
+ }
++
+ sub write_lines
+ {
+     if( $first_run ){
+-        add_to_buffer();
+         my( $path , $localize_file ) = make_paths();
+         $last_path = $path;
+         $last_localize_file = $localize_file;
+-        mkpath $path;
+-        write_buffer( $path , $localize_file );
++        add_to_buffer();
+         $first_run = '';
+     }
+     else
+@@ -269,7 +267,6 @@ sub write_lines
+         }
+         else
+         {
+-            mkpath $path;
+             write_buffer( $last_path , $last_localize_file );
+             add_to_buffer();
+             $last_path = $path;
+@@ -277,6 +274,11 @@ sub write_lines
+         }
+     }
+ }
++
++# Adds all lines that contain strings from one source file from every input file.
++# TODO: Would it not be better to add lines for all files from a directory (i.e., replace
++# "$afile eq $elem->file" by "$adir eq $elem->dir")? We could get rid of the delayed
++# writing then. But maybe there is a reason for doing it this way...
+ sub add_to_buffer
+ {
+     my $plainline;
+@@ -293,12 +295,15 @@ sub add_to_buffer
+         } while ( !$elem->endoffile && $amodule eq $elem->module && $afile eq $elem->file );
+     }
+ }
++
++# Writes the buffer to currently selected localize.sdf file.
+ sub write_buffer
+ {
+     my $path            = shift;
+     my $localize_file   = shift;
+     my $cnt             = $#buffer+1;
+     print "Write to $path $cnt lines\n";
++    mkpath $path;
+     open FILE , ">>$localize_file" or die "Can't open file '$localize_file'\n";
+     foreach ( @buffer )
+     {
+-- 
+1.7.7.5
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 6c6881b..708b4b7 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -118,6 +118,8 @@ Patch17: 0001-smath-does-not-handle-accents-in-MathML.patch
 Patch18: 0001-workaround-internal-compiler-error-with-gcc-4.7.patch
 Patch19: 0001-fix-for-gcc-4.7-C-11-these-are-not-string-literal-op.patch
 Patch20: 0001-fix-for-gcc-4.7-C-11-this-is-not-string-literal-oper.patch
+Patch21: 0001-Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch
+Patch22: 0001-fix-writing-of-strings-from-the-first-module.patch
 # TODO: this in S390 only, so it can wait .-)
 #Patch13: solenv.fix.mk.inheritance.patch
 
@@ -772,6 +774,8 @@ mv -f redhat.soc extras/source/palettes/standard.soc
 %patch18 -p1 -b .workaround-internal-compiler-error-with-gcc-4.7.patch
 %patch19 -p1 -b .fix-for-gcc-4.7-C-11-these-are-not-string-literal-op.patch
 %patch20 -p1 -b .fix-for-gcc-4.7-C-11-this-is-not-string-literal-oper.patch
+%patch21 -p1 -b .Revert-fast_merge-fix-mis-merge-of-first-module-s-st.patch
+%patch22 -p1 -b .fix-writing-of-strings-from-the-first-module.patch
 #%patch13 -p1 -b .solenv.fix.mk.inheritance.patch
 
 # TODO: check this
@@ -2050,6 +2054,8 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
 %changelog
 * Fri Jan 06 2012 Caolán McNamara <caolanm at redhat.com> - 3.4.99.2-3
 - Resolves: rhbz#533318 smath does not handle accents in MathML
+- Resolves: rhbz#771108 English menu in writer despite installation of
+  libreoffice-langpack-de
 
 * Fri Jan 06 2012 David Tardon <dtardon at redhat.com> - 3.4.99.2-2
 - rebuild with gcc 4.7


More information about the scm-commits mailing list