l10ntools/source/merge.cxx |    9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 1f91be7dddafa67cd2985e1528e1cb1951bf8edf
Author: Zolnai Tamás <zolnaitamas2...@gmail.com>
Date:   Tue Jun 11 11:37:53 2013 +0200

    fdo#65483 Invalid po lines caused missing translations
    
    L10ntools merge skipped reading po files entirely when got
    an invalid entry from one of these po files, by now just
    skip the invalid po file instead.
    
    Change-Id: I787d531e1842e53e2074690b1300a204abd928f5
    (cherry picked from commit 58a9d35b84947510f78e3ffeb6d1ef9a9adac0cb)

diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index f9dd4da..fab9e6e 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -291,6 +291,7 @@ MergeDataFile::MergeDataFile(
     bool bFirstLang = true;
     while( !aInputStream.eof() )
     {
+        bool bSkipCurrentPOFile = false;
         const OString sFileName( lcl_NormalizeFilename(rFile) );
         const bool bReadAll = sFileName.isEmpty();
         const OString sPoFileName(sPoFile.data(), sPoFile.length());
@@ -318,10 +319,11 @@ MergeDataFile::MergeDataFile(
         {
             if( !lcl_ReadPoChecked(aNextPo, aPoInput, sPoFileName) )
             {
-                return;
+                bSkipCurrentPOFile = true;
+                break;
             }
         } while( !aPoInput.eof() && aNextPo.getSourceFile() != sFileName && 
!bReadAll );
-        while( !aPoInput.eof() && (aNextPo.getSourceFile() == sFileName || 
bReadAll ))
+        while( !aPoInput.eof() && (aNextPo.getSourceFile() == sFileName || 
bReadAll ) && !bSkipCurrentPOFile )
         {
             PoEntry aActPo( aNextPo );
 
@@ -356,7 +358,8 @@ MergeDataFile::MergeDataFile(
                 }
                 if( !lcl_ReadPoChecked(aNextPo, aPoInput, sPoFileName) )
                 {
-                    return;
+                    bSkipCurrentPOFile = true;
+                    break;
                 }
             } while( !aPoInput.eof() &&
                 ( bInSameComp = PoEntry::IsInSameComp(aActPo, aNextPo) ) );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to