[Libreoffice-commits] core.git: l10ntools/source

Zolnai Tamás zolnaitamas2000 at gmail.com
Sat Mar 9 05:20:32 PST 2013


 l10ntools/source/po.cxx |   14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

New commits:
commit a18d1a107e49525efd1561f396f6b2be28ab5224
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date:   Sat Mar 9 13:47:09 2013 +0100

    Use simpler keyid with 5 digits
    
    Change-Id: Iac743d4f298b43067fe5db9199eb39c3301f827e

diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 99e113b..cdb5fb4 100755
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -264,16 +264,16 @@ namespace
         boost::crc_32_type aCRC32;
         aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength());
         sal_uInt32 nCRC = aCRC32.checksum();
-        //Use all readable ASCII character exclude xml special tags: ",',&,<,>
+        ///Use simple ASCII characters, exclude I, l, 1 and O, 0 to avoid confusing IDs
         static const OString sSymbols =
-            "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~";
-        char sKeyId[5];
-        for( short nKeyInd = 0; nKeyInd < 4; ++nKeyInd )
+            "ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz23456789";
+        char sKeyId[6];
+        for( short nKeyInd = 0; nKeyInd < 5; ++nKeyInd )
         {
-            sKeyId[nKeyInd] = sSymbols[(nCRC & 255) % 89];
-            nCRC >>= 8;
+            sKeyId[nKeyInd] = sSymbols[(nCRC & 63) % sSymbols.getLength()];
+            nCRC >>= 6;
         }
-        sKeyId[4] = '\0';
+        sKeyId[5] = '\0';
         return OString(sKeyId);
     }
 


More information about the Libreoffice-commits mailing list