l10ntools/source/po.cxx |   11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

New commits:
commit 889574a50c8f5bdffed9f3eb70426cedae0a589c
Author: Andras Timar <ati...@suse.com>
Date:   Sun Nov 18 12:47:54 2012 +0100

    put filename into msgctxt, because po entries must be unique
    
    Change-Id: I700b668863c2b20cdf60fa672a994b8ae4dc613a

diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index df9efe3..2ccaed6 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -452,7 +452,8 @@ PoEntry::PoEntry(const OString& rSDFLine, const TYPE eType)
         copy(vParts[SOURCEFILE].lastIndexOf("\\")+1));
 
     OString sMsgCtxt =
-        vParts[GROUPID] + "\n" +
+        vParts[SOURCEFILE].copy(vParts[SOURCEFILE].lastIndexOf("\\")+1) +
+        "\n" + vParts[GROUPID] + "\n" +
         (vParts[LOCALID].isEmpty() ? "" : vParts[LOCALID] + "\n") +
         vParts[RESOURCETYPE];
     switch(eType){
@@ -527,7 +528,7 @@ OString PoEntry::getSourceFile() const
 OString PoEntry::getGroupId() const
 {
     assert( m_bIsInitialized );
-    return m_pGenPo->getMsgCtxt().getToken(0,'\n');
+    return m_pGenPo->getMsgCtxt().getToken(1,'\n');
 }
 
 //Get localid
@@ -538,7 +539,7 @@ OString PoEntry::getLocalId() const
     if (sMsgCtxt.indexOf('\n')==sMsgCtxt.lastIndexOf('\n'))
         return OString();
     else
-        return sMsgCtxt.getToken(1,'\n');
+        return sMsgCtxt.getToken(2,'\n');
 }
 
 //Get the type of component from which entry is extracted
@@ -547,9 +548,9 @@ OString PoEntry::getResourceType() const
     assert( m_bIsInitialized );
     const OString sMsgCtxt = m_pGenPo->getMsgCtxt();
     if (sMsgCtxt.indexOf('\n')==sMsgCtxt.lastIndexOf('\n'))
-        return sMsgCtxt.getToken(1,'\n').getToken(0,'.');
-    else
         return sMsgCtxt.getToken(2,'\n').getToken(0,'.');
+    else
+        return sMsgCtxt.getToken(3,'\n').getToken(0,'.');
 }
 
 //Get the type of entry
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to