From 8d4e12a4153868c9d98937d49c4ac6064013a8dd Mon Sep 17 00:00:00 2001 From: Andras Timar Date: Sun, 30 Sep 2018 12:53:48 +0200 Subject: pocheck: do not change msgctxt when po is regenerated Change-Id: I220fce194813f783c807c23eeffd2421cadd7636 Reviewed-on: https://gerrit.libreoffice.org/61163 Tested-by: Jenkins Reviewed-by: Andras Timar --- l10ntools/source/po.cxx | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index c80249ad9e83..ea52d8d8a66f 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -141,7 +141,7 @@ void GenPoEntry::writeToFile(std::ofstream& rOFStream) const rOFStream << "#, c-format" << std::endl; if ( !m_sMsgCtxt.isEmpty() ) rOFStream << "msgctxt " - << lcl_GenMsgString(m_sReference+"\n"+m_sMsgCtxt) + << lcl_GenMsgString(m_sMsgCtxt) << std::endl; rOFStream << "msgid " << lcl_GenMsgString(m_sMsgId) << std::endl; @@ -200,10 +200,7 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) } else if (sLine.startsWith("\"") && pLastMsg) { - if (pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\\n\"") - { - *pLastMsg += lcl_GenNormString(sLine); - } + *pLastMsg += lcl_GenNormString(sLine); } else break; @@ -234,9 +231,11 @@ PoEntry::PoEntry( throw WRONGHELPTEXT; m_pGenPo.reset( new GenPoEntry() ); - m_pGenPo->setReference(rSourceFile.copy(rSourceFile.lastIndexOf('/')+1)); + OString sReference = rSourceFile.copy(rSourceFile.lastIndexOf('/')+1); + m_pGenPo->setReference(sReference); OString sMsgCtxt = + sReference + "\n" + rGroupId + "\n" + (rLocalId.isEmpty() ? OString() : rLocalId + "\n") + rResType; -- cgit