Author: jani
Date: Sat Sep 28 19:09:31 2013
New Revision: 1527216

URL: http://svn.apache.org/r1527216
Log:
deal with old system missing entries for translation
(actual case basctl)
if old system does not contain key it will not be deleted.

Modified:
    openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx
    openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx
    openoffice/branches/l10n40/main/l10ntools/source/gL10nMemDB.cxx

Modified: openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx?rev=1527216&r1=1527215&r2=1527216&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.cxx Sat Sep 28 
19:09:31 2013
@@ -247,7 +247,7 @@ void l10nMem_impl::saveTemplates(l10nMem
 
   // and reorganize db if needed
    mcDb.miCurFileInx = 0;
-   mcDb.reorganize();
+   mcDb.reorganize(false);
 
   // no save if there has been errors
   if(!needWrite(sFileName, bForce))
@@ -284,7 +284,7 @@ void l10nMem_impl::saveLanguages(l10nMem
 
   // and reorganize db if needed
    mcDb.miCurFileInx = 0;
-   mcDb.reorganize();
+   mcDb.reorganize(true);
 
   // no save if there has been errors
   if(!needWrite(sFileName, bForce))
@@ -341,7 +341,7 @@ void l10nMem_impl::showNOconvert ()
 void l10nMem_impl::dumpMem(const std::string& sFileName)
 {
   // and reorganize db if needed
-  mcDb.reorganize();
+  mcDb.reorganize(false);
 
   // no save if there has been errors
   if(!needWrite(sFileName, true))
@@ -384,7 +384,7 @@ bool l10nMem_impl::needWrite(const std::
     if (cur.meState == l10nMem::ENTRY_CHANGED)
     {
       ++iCntChanged;
-      if (mcDb.mbConvertMode)
+      if (mcDb.mbStrictMode)
         cur.meState = l10nMem::ENTRY_NORMAL;
     }
     if (cur.meState == l10nMem::ENTRY_DELETED)

Modified: openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx?rev=1527216&r1=1527215&r2=1527216&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gL10nMem.hxx Sat Sep 28 
19:09:31 2013
@@ -136,7 +136,7 @@ class l10nMem_db
                          const std::string& sKey,
                          const std::string& sMsgId,
                          bool               bThrow);
-    void reorganize     ();
+    void reorganize     (bool               bConvert);
     void addKey         (int                  iLineNo,
                          const std::string&   sSourceFile,
                          const std::string&   sKey,

Modified: openoffice/branches/l10n40/main/l10ntools/source/gL10nMemDB.cxx
URL: 
http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gL10nMemDB.cxx?rev=1527216&r1=1527215&r2=1527216&view=diff
==============================================================================
--- openoffice/branches/l10n40/main/l10ntools/source/gL10nMemDB.cxx (original)
+++ openoffice/branches/l10n40/main/l10ntools/source/gL10nMemDB.cxx Sat Sep 28 
19:09:31 2013
@@ -264,7 +264,7 @@ void l10nMem_db::loadLangKey(int        
 
 
 /**********************   I M P L E M E N T A T I O N   **********************/
-void l10nMem_db::reorganize()
+void l10nMem_db::reorganize(bool bConvert)
 {
   int iE, iEsize  = mcENUSlist.size();
   int iD, iDsize;
@@ -278,7 +278,12 @@ void l10nMem_db::reorganize()
     if (cur.meState == l10nMem::ENTRY_ADDED)
       listAdd.push_back(iE);
     if (cur.meState == l10nMem::ENTRY_DELETED)
-      listDel.push_back(iE);
+    {
+      if (bConvert)
+        cur.meState = l10nMem::ENTRY_NORMAL;
+      else
+        listDel.push_back(iE);
+    }
   }
 
   if (!listDel.size() || !listAdd.size())


Reply via email to