[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/treemerge.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 3f469dd69c2eb9d8f193da7f88d05719762b600c Author: Zolnai Tamás Date: Sun Nov 18 22:49:36 2012 +0100 Fix some encoding problem in treemerge Change-Id: I275ccba8f07ccaba1ead0ad83a382d3ad19c722a diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx index 8555c8f..622564c 100644 --- a/l10ntools/source/treemerge.cxx +++ b/l10ntools/source/treemerge.cxx @@ -146,7 +146,9 @@ namespace replaceAll("$[officeversion]","%PRODUCTVERSION"); xmlNodeSetContent( pReturn, -reinterpret_cast( sNewTitle.getStr() )); +xmlEncodeSpecialChars( NULL, +reinterpret_cast( +sNewTitle.getStr() ))); xmlFree( sTitle ); break; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx |3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) New commits: commit 7f81bbb1c7f090d9e962e5c2cb7b694298bfe1c8 Author: Ztamas Date: Sun Nov 18 12:07:58 2012 +0100 Correct skiping source file line of msgctxt Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660 diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index ce71207..e59db11 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -252,8 +252,7 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) m_sMsgStr = lcl_GenNormString(sLine.copy(7)); pLastMsg = &m_sMsgStr; } -else if (sLine.startsWith("\"") && pLastMsg && - (pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\"") ) +else if (sLine.startsWith("\"") && pLastMsg) { if ( pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\\n\"" ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit b0f07bbbc4f179d442ff96471669f02e82686657 Author: Ztamas Date: Sun Nov 18 12:07:58 2012 +0100 Write source file into po entries' msgctxt So (msgctxt, msgid) pair is unique in one po file Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660 diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index df9efe3..ce71207 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -255,7 +255,10 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) else if (sLine.startsWith("\"") && pLastMsg && (pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\"") ) { -*pLastMsg += lcl_GenNormString(sLine); +if ( pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\\n\"" ) +{ +*pLastMsg += lcl_GenNormString(sLine); +} } else break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 11 +-- 1 file changed, 5 insertions(+), 6 deletions(-) New commits: commit 124dc60e5519ee4d1c2454050b6f54a7b020905d Author: Andras Timar Date: Sun Nov 18 13:04:33 2012 +0100 Revert "put filename into msgctxt, because po entries must be unique" This reverts commit 889574a50c8f5bdffed9f3eb70426cedae0a589c. diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 2ccaed6..df9efe3 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -452,8 +452,7 @@ PoEntry::PoEntry(const OString& rSDFLine, const TYPE eType) copy(vParts[SOURCEFILE].lastIndexOf("\\")+1)); OString sMsgCtxt = -vParts[SOURCEFILE].copy(vParts[SOURCEFILE].lastIndexOf("\\")+1) + -"\n" + vParts[GROUPID] + "\n" + +vParts[GROUPID] + "\n" + (vParts[LOCALID].isEmpty() ? "" : vParts[LOCALID] + "\n") + vParts[RESOURCETYPE]; switch(eType){ @@ -528,7 +527,7 @@ OString PoEntry::getSourceFile() const OString PoEntry::getGroupId() const { assert( m_bIsInitialized ); -return m_pGenPo->getMsgCtxt().getToken(1,'\n'); +return m_pGenPo->getMsgCtxt().getToken(0,'\n'); } //Get localid @@ -539,7 +538,7 @@ OString PoEntry::getLocalId() const if (sMsgCtxt.indexOf('\n')==sMsgCtxt.lastIndexOf('\n')) return OString(); else -return sMsgCtxt.getToken(2,'\n'); +return sMsgCtxt.getToken(1,'\n'); } //Get the type of component from which entry is extracted @@ -548,9 +547,9 @@ OString PoEntry::getResourceType() const assert( m_bIsInitialized ); const OString sMsgCtxt = m_pGenPo->getMsgCtxt(); if (sMsgCtxt.indexOf('\n')==sMsgCtxt.lastIndexOf('\n')) -return sMsgCtxt.getToken(2,'\n').getToken(0,'.'); +return sMsgCtxt.getToken(1,'\n').getToken(0,'.'); else -return sMsgCtxt.getToken(3,'\n').getToken(0,'.'); +return sMsgCtxt.getToken(2,'\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
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) New commits: commit 889574a50c8f5bdffed9f3eb70426cedae0a589c Author: Andras Timar 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
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx |6 -- 1 file changed, 4 insertions(+), 2 deletions(-) New commits: commit 302a099e5264742204b625f1cce949892d8a84f9 Author: Ztamas Date: Sun Nov 18 12:07:58 2012 +0100 Write source file into po entries' msgctxt So (msgctxt, msgid) pair is unique in one po file Change-Id: I64635dd7a6352300ed5fb6949a1b78c2a070c660 diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 18c0ef1..df9efe3 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -198,7 +198,8 @@ void GenPoEntry::writeToFile(std::ofstream& rOFStream) const rOFStream << "#, fuzzy" << std::endl; if ( !m_sMsgCtxt.isEmpty() ) rOFStream << "msgctxt " - << lcl_GenMsgString(m_sMsgCtxt).getStr() << std::endl; + << lcl_GenMsgString(m_sReference+"\n"+m_sMsgCtxt).getStr() + << std::endl; rOFStream << "msgid " << lcl_GenMsgString(m_sMsgId).getStr() << std::endl; rOFStream << "msgstr " @@ -251,7 +252,8 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) m_sMsgStr = lcl_GenNormString(sLine.copy(7)); pLastMsg = &m_sMsgStr; } -else if (sLine.startsWith("\"") && pLastMsg) +else if (sLine.startsWith("\"") && pLastMsg && + (pLastMsg != &m_sMsgCtxt || sLine != "\"" + m_sReference + "\"") ) { *pLastMsg += lcl_GenNormString(sLine); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/helper.hxx| 46 + l10ntools/source/helpmerge.cxx |2 - l10ntools/source/xrmmerge.cxx |4 +-- 3 files changed, 49 insertions(+), 3 deletions(-) New commits: commit 6cfa7552eebf69daab1ed3acc2a9954d52f00aad Author: Andras Timar Date: Tue Nov 13 21:55:18 2012 +0100 fix XML tag check in help and readme translations Change-Id: I88a3ad382df41da96fcab38c3c06d5871228e082 diff --git a/l10ntools/source/helper.hxx b/l10ntools/source/helper.hxx index 1e28aa6..1d268dd 100644 --- a/l10ntools/source/helper.hxx +++ b/l10ntools/source/helper.hxx @@ -39,6 +39,7 @@ #include "rtl/string.hxx" #include "rtl/ustring.hxx" +#include "rtl/strbuf.hxx" #include "sal/types.h" namespace helper { @@ -102,6 +103,50 @@ inline sal_Int32 indexOfAnyAsciiL( return -1; } +rtl::OString QuotHTML(const rtl::OString &rString) +{ +rtl::OStringBuffer sReturn; +for (sal_Int32 i = 0; i < rString.getLength(); ++i) { +switch (rString[i]) { +case '\\': +if (i < rString.getLength()) { +switch (rString[i + 1]) { +case '"': +case '<': +case '>': +case '\\': +++i; +break; +} +} +// fall through +default: +sReturn.append(rString[i]); +break; + +case '<': +sReturn.append("<"); +break; + +case '>': +sReturn.append(">"); +break; + +case '"': +sReturn.append("""); +break; + +case '&': +if (rString.matchL(RTL_CONSTASCII_STRINGPARAM("&"), i)) +sReturn.append('&'); +else +sReturn.append(RTL_CONSTASCII_STRINGPARAM("&")); +break; +} +} +return sReturn.makeStringAndClear(); +} + inline bool isWellFormedXML( OString const & text ) { xmlDocPtr doc; @@ -120,6 +165,7 @@ inline bool isWellFormedXML( OString const & text ) return result; } + template< typename T > inline T abbreviate( T const & text, sal_Int32 start, sal_Int32 length) { diff --git a/l10ntools/source/helpmerge.cxx b/l10ntools/source/helpmerge.cxx index aab255f..8764935 100644 --- a/l10ntools/source/helpmerge.cxx +++ b/l10ntools/source/helpmerge.cxx @@ -380,7 +380,7 @@ void HelpParser::ProcessHelp( LangHashMap* aLangHM , const rtl::OString& sCur , nPreSpaces++; pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur , true ); OUString sNewdata; -if (helper::isWellFormedXML(sNewText)) +if (helper::isWellFormedXML(helper::QuotHTML(sNewText))) { sNewdata = sSourceText.copy(0,nPreSpaces) + rtl::OStringToOUString(sNewText, RTL_TEXTENCODING_UTF8); diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index b4868f5..5b562ea 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -609,7 +609,6 @@ void XRMResMerge::WorkOnText( sContent, STRING_TYP_TEXT, sLang )) && ( sContent != "-" ) && !sContent.isEmpty() && helper::isWellFormedXML( sContent )) - { rText = sContent; ConvertStringToXMLFormat( rText ); @@ -645,7 +644,8 @@ void XRMResMerge::EndOfText( if (!sCur.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("en-US")) && ( pEntrys->GetText( sContent, STRING_TYP_TEXT, sCur, sal_True )) && -( sContent != "-" ) && !sContent.isEmpty()) +( sContent != "-" ) && !sContent.isEmpty() && +helper::isWellFormedXML( sContent )) { rtl::OString sText( sContent ); rtl::OString sAdditionalLine( "\n" ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/lngmerge.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit 06175e8b19625cb5a43b1ae5ae63e419cee7e053 Author: Zolnai Tamás Date: Wed Oct 10 15:30:40 2012 +0200 Correct lngmerge not to work with eof Change-Id: Ibf80a31ea2c03ff2882e71a45acb71d9c9a16482 diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index b0282f5..efc6c81 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -50,10 +50,10 @@ LngParser::LngParser(const rtl::OString &rLngFile, if (aStream.is_open()) { bool bFirstLine = true; +std::string s; +std::getline(aStream, s); while (!aStream.eof()) { -std::string s; -std::getline(aStream, s); rtl::OString sLine(s.data(), s.length()); if( bFirstLine ) @@ -64,6 +64,7 @@ LngParser::LngParser(const rtl::OString &rLngFile, } pLines->push_back( new rtl::OString(sLine) ); +std::getline(aStream, s); } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit 1ef83f535f638ddfa7f2ad0533f88c37e7bcbeef Author: Zolnai Tamás Date: Tue Oct 9 22:31:23 2012 +0200 Use _t suffix for typedef Change-Id: I8501739e9fb1b184facebc406ed6e20de1f7ab0a diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index eaf83a9..0a5ae28 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -352,21 +352,21 @@ namespace //Escape special tags static OString lcl_EscapeTags( const OString& rText ) { -typedef std::vector StrVec; +typedef std::vector StrVec_t; const OString vInitializer[] = { "ahelp", "link", "item", "emph", "defaultinline", "switchinline", "caseinline", "variable", "bookmark_value", "image", "embedvar", "alt" }; -const StrVec vTagsForEscape( vInitializer, +const StrVec_t vTagsForEscape( vInitializer, vInitializer + sizeof(vInitializer) / sizeof(vInitializer[0]) ); -StrVec vFoundTags; +StrVec_t vFoundTags; lcl_FindAllTag(rText,vFoundTags); OString sResult = rText; -for(StrVec::const_iterator pFound = vFoundTags.begin(); +for(StrVec_t::const_iterator pFound = vFoundTags.begin(); pFound != vFoundTags.end(); ++pFound) { bool bEscapeThis = false; -for(StrVec::const_iterator pEscape = vTagsForEscape.begin(); +for(StrVec_t::const_iterator pEscape = vTagsForEscape.begin(); pEscape != vTagsForEscape.end(); ++pEscape) { if (pFound->startsWith("<" + *pEscape) || ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx| 427 + l10ntools/source/propmerge.cxx |8 2 files changed, 229 insertions(+), 206 deletions(-) New commits: commit 63af8783bcb418e72e59f5faf3a070701b828845 Author: Zolnai Tamás Date: Tue Oct 9 22:05:24 2012 +0200 Use static, lcl_ and anonymus namespace for local functions Change-Id: I0393c9552ca353e80ac61d258a280cbcd53e1cba diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 465e18e..eaf83a9 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -29,85 +29,91 @@ //Class GenPoEntry -//Generate KeyId -OString ImplGenKeyId(const OString& rGenerator) -{ -boost::crc_32_type aCRC32; -aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength()); -sal_uInt32 nCRC = aCRC32.checksum(); -//Use all readable ASCII charachter exclude xml special tags: ",',&,<,> -const OString sSymbols = "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; -char sKeyId[5]; -for( short nKeyInd = 0; nKeyInd < 4; ++nKeyInd ) +namespace +{ +//Generate KeyId +static OString lcl_GenKeyId(const OString& rGenerator) { -sKeyId[nKeyInd] = sSymbols[(nCRC & 255) % 89]; -nCRC >>= 8; +boost::crc_32_type aCRC32; +aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength()); +sal_uInt32 nCRC = aCRC32.checksum(); +//Use all readable ASCII charachter exclude xml special tags: ",',&,<,> +const OString sSymbols = "!#$%()*+,-./0123456789:;=?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~"; +char sKeyId[5]; +for( short nKeyInd = 0; nKeyInd < 4; ++nKeyInd ) +{ +sKeyId[nKeyInd] = sSymbols[(nCRC & 255) % 89]; +nCRC >>= 8; +} +sKeyId[4] = '\0'; +return OString(sKeyId); } -sKeyId[4] = '\0'; -return OString(sKeyId); -} -//Escape text -OString ImplEscapeText(const OString& rText, - const OString& rUnEscaped= POUNESCAPED, - const OString& rEscaped = POESCAPED) -{ -assert( rEscaped.getLength() == 2*rUnEscaped.getLength() ); -OString sResult = rText; -int nCount = 0; -for(sal_Int32 nIndex=0; nIndex& o_vParts) +namespace { -o_vParts.resize( 0 ); -sal_Int32 nActIndex = 0; -sal_Int32 nLastSplit = 0; -while( nActIndex < rSource.getLength() ) +//Split string at the delimiter char +static void lcl_SplitAt(const OString& rSource, const sal_Char nDelimiter, + std::vector& o_vParts) { -if ( rSource[nActIndex] == nDelimiter ) +o_vParts.resize( 0 ); +sal_Int32 nActIndex = 0; +sal_Int32 nLastSplit = 0; +while( nActIndex < rSource.getLength() ) { -o_vParts.push_back(rSource.copy(nLastSplit,nActIndex-nLastSplit)); -nLastSplit = nActIndex+1; +if ( rSource[nActIndex] == nDelimiter ) +{ +o_vParts.push_back( +rSource.copy(nLastSplit,nActIndex-nLastSplit)); +nLastSplit = nActIndex+1; +} +++nActIndex; } -++nActIndex; +o_vParts.push_back(rSource.copy(nLastSplit)); } -o_vParts.push_back(rSource.copy(nLastSplit)); -} -//Unescape sdf string -OString ImplUnEscapeSDFText(const OString& rText,const bool bHelpText = false) -{ -if ( bHelpText ) -return ImplUnEscapeText(rText,"\\<\\>\\\"","<>\"\\"); -else -return ImplUnEscapeText(rText,"\\n\\t\\r","\n\t\r"); -} +//Unescape sdf string +static OString lcl_UnEscapeSDFText( +const OString& rText,const bool bHelpText = false ) +{ +if ( bHelpText ) +return lcl_UnEscapeText(rText,"\\<\\>\\\"","<>\"\\"); +else +return lcl_UnEscapeText(rText,"\\n\\t\\r","\n\t\r"); +} -//Miminize the length of the regular expression result -void ImplMinimize(const OUString& rText, Regexpr& io_rRegExp, re_registers& io_rRegs) -{ -re_registers aPrevRegs; -const sal_Int32 nStart = io_rRegs.start[0]; -do +//Miminize the length of the regular expression result +static void lcl_Minimize( +const OUString& rText, Regexpr& io_rRegExp, re_registers& io_rRegs ) { -const OUString sTemp = rText.copy(0,io_rRegs.end[0]-1); -memcpy(static_cast(&aPrevRegs), static_cast(&io_rRegs), +re_registers aPrevRegs; +const sal_Int32 nStart = io_rRegs.start[0]; +do +{ +const OUString sTemp = rText.copy(0,io_rRegs.end[0]-1); +memcpy( +static_cast(&aPrevRegs), +static_cast(&io_rRegs), +sizeof(re_registers)); +memset(static_cast(&io_rRegs), 0, sizeof(re_registers)); +io_rRegExp.set_line(sTemp.getStr(),sTemp.getLength()); +
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/renewpo.cxx | 11 +++ 1 file changed, 7 insertions(+), 4 deletions(-) New commits: commit 961728d58cb80e7eff11baf8d44c0d37dd1074c9 Author: Zolnai Tamás Date: Mon Oct 8 23:03:00 2012 +0200 Make renewpo to ignore double id in xml/xrm Change-Id: I01329beded3e81040726f525cdb5886b5f3a8c63 diff --git a/l10ntools/source/renewpo.cxx b/l10ntools/source/renewpo.cxx index 83b3051..4a11c36 100644 --- a/l10ntools/source/renewpo.cxx +++ b/l10ntools/source/renewpo.cxx @@ -147,14 +147,17 @@ void HandleLanguage(struct dirent* pLangEntry, const OString& rPath, if (!sActUnTrans.getToken(vTypes[nIndex],'\t').isEmpty()) { /**Because of xrmex there are duplicated id's, - only use this if xrmex have already fixed + only use this if xrmex have already fixed*/ +const OString sSource = +sActUnTrans.getToken(PoEntry::SOURCEFILE,'\t'); +const OString sEnding = +sSource.copy(sSource.getLength()-4, 4); if (sActUnTrans.getToken(PoEntry::GROUPID,'\t')== sActUnTrans.getToken(PoEntry::LOCALID,'\t') && -sActUnTrans.getToken(PoEntry::SOURCEFILE,'\t'). -endsWith(".xrm")) +( sEnding == ".xrm" || sEnding == ".xml" )) { sActUnTrans = DelLocalId(sActUnTrans); -}*/ +} PoEntry aPE(sActUnTrans, vTypes[nIndex]); const OString sActStr = sActTrans.getToken(vTypes[nIndex],'\t'); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/xrmmerge.cxx | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) New commits: commit 247bac3266ee933716ecf85e0204b0d6b8c6da74 Author: Zolnai Tamás Date: Mon Oct 8 22:43:26 2012 +0200 Make an end of xrmex id duplication Use GroupId instead of LocalId because that is the primary id. Thus usage of LocalId becomes unneeded. Change-Id: I2770141fab47c07294ab15322848e8aef0de2cec diff --git a/l10ntools/source/xrmmerge.cxx b/l10ntools/source/xrmmerge.cxx index 4cf4d9e..a3eb0e5 100644 --- a/l10ntools/source/xrmmerge.cxx +++ b/l10ntools/source/xrmmerge.cxx @@ -192,9 +192,9 @@ int XRMResParser::Execute( int nToken, char * pToken ) switch ( nToken ) { case XRM_TEXT_START:{ -rtl::OString sNewLID = GetAttribute( rToken, "id" ); -if ( sNewLID != sLID ) { -sLID = sNewLID; +rtl::OString sNewGID = GetAttribute( rToken, "id" ); +if ( sNewGID != sGID ) { +sGID = sNewGID; } bText = sal_True; sCurrentText = ""; @@ -228,7 +228,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) case DESC_TEXT_START:{ if (bDisplayName) { -sLID = rtl::OString("dispname"); +sGID = rtl::OString("dispname"); bText = sal_True; sCurrentText = ""; sCurrentOpenTag = rToken; @@ -264,7 +264,7 @@ int XRMResParser::Execute( int nToken, char * pToken ) case DESC_EXTENSION_DESCRIPTION_SRC: { if (bExtensionDescription) { -sLID = rtl::OString("extdesc"); +sGID = rtl::OString("extdesc"); sResourceType = rtl::OString ( "description" ); sLangAttribute = rtl::OString ( "lang" ); sCurrentOpenTag = rToken; @@ -429,7 +429,6 @@ void XRMResExport::WorkOnText( { rtl::OString sPlatform( "" ); pResData = new ResData( sPlatform, GetGID() ); -pResData->sId = GetLID(); } rtl::OString sText(rText); @@ -459,12 +458,8 @@ void XRMResExport::EndOfText( sOutput += "\t0\t"; sOutput += sResourceType; sOutput += "\t"; -sOutput += pResData->sId; -// USE LID AS GID OR MERGE DON'T WORK -//sOutput += pResData->sGId; -sOutput += "\t"; -sOutput += pResData->sId; -sOutput += "\t\t\t0\t"; +sOutput += pResData->sGId; +sOutput += "\t\t\t\t0\t"; sOutput += sCur; sOutput += "\t"; @@ -601,8 +596,7 @@ void XRMResMerge::WorkOnText( if ( pMergeDataFile ) { if ( !pResData ) { rtl::OString sPlatform( "" ); -pResData = new ResData( sPlatform, GetLID() , sFilename ); -pResData->sId = GetLID(); +pResData = new ResData( sPlatform, GetGID() , sFilename ); pResData->sResTyp = sResourceType; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/cfgmerge.cxx | 10 +- l10ntools/source/export.cxx | 19 ++- 2 files changed, 15 insertions(+), 14 deletions(-) New commits: commit 73ed390a7ff6b701b89faf91385aaa63e865e441 Author: Zolnai Tamás Date: Mon Oct 8 18:23:31 2012 +0200 Correct wrong memory addressing Some global variables in export.cxx and cfgmerge.cxx pointed to OString databuffer and after these strings are destroyed the pointers refered to invalid address. Use OString instead of const char* Change-Id: I4ea43f4b3772ef3370d79336559d39a67400fe2b diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index 3eb442f..1d0a819 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -38,7 +38,7 @@ namespace { namespace global { -char const * inputPathname = 0; +OString inputPathname; boost::scoped_ptr< CfgParser > parser; } @@ -55,13 +55,13 @@ FILE * init(int argc, char ** argv) { std::exit(EXIT_FAILURE); } Export::InitLanguages(); -global::inputPathname = aArgs.m_sInputFile.getStr(); +global::inputPathname = aArgs.m_sInputFile; -FILE * pFile = std::fopen(global::inputPathname, "r"); +FILE * pFile = std::fopen(global::inputPathname.getStr(), "r"); if (pFile == 0) { std::fprintf( stderr, "Error: Cannot open file \"%s\"\n", -global::inputPathname); +global::inputPathname.getStr() ); std::exit(EXIT_FAILURE); } @@ -74,7 +74,7 @@ FILE * init(int argc, char ** argv) { global::parser.reset( new CfgExport( aArgs.m_sOutputFile.getStr(), aArgs.m_sPrj.getStr(), -common::pathnameToken(global::inputPathname, +common::pathnameToken(global::inputPathname.getStr(), aArgs.m_sPrjRoot.getStr(; } diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx index d9dd5ac..13870da 100644 --- a/l10ntools/source/export.cxx +++ b/l10ntools/source/export.cxx @@ -42,9 +42,9 @@ MergeDataFile * pMergeDataFile = 0; //TODO namespace global { -char const * prj = 0; -char const * prjRoot = 0; -char const * inputPathname = 0; +OString prj; +OString prjRoot; +OString inputPathname; boost::scoped_ptr< Export > exporter; } @@ -61,15 +61,15 @@ FILE * init(int argc, char ** argv) { std::exit(EXIT_FAILURE); } Export::InitLanguages(); -global::prj = aArgs.m_sPrj.getStr(); -global::prjRoot = aArgs.m_sPrjRoot.getStr(); -global::inputPathname = aArgs.m_sInputFile.getStr(); +global::prj = aArgs.m_sPrj; +global::prjRoot = aArgs.m_sPrjRoot; +global::inputPathname = aArgs.m_sInputFile; -FILE * pFile = std::fopen(global::inputPathname, "r"); +FILE * pFile = std::fopen(global::inputPathname.getStr(), "r"); if (pFile == 0) { std::fprintf( stderr, "Error: Cannot open file \"%s\"\n", -global::inputPathname); +global::inputPathname.getStr()); std::exit(EXIT_FAILURE); } @@ -78,7 +78,8 @@ FILE * init(int argc, char ** argv) { new Export(aArgs.m_sMergeSrc.getStr(), aArgs.m_sOutputFile.getStr())); } else { sActFileName = -common::pathnameToken(global::inputPathname, global::prjRoot); +common::pathnameToken( +global::inputPathname.getStr(), global::prjRoot.getStr()); global::exporter.reset(new Export(aArgs.m_sOutputFile.getStr())); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/export2.cxx | 12 +++- l10ntools/source/helpex.cxx | 28 l10ntools/source/lngex.cxx | 15 ++- 3 files changed, 29 insertions(+), 26 deletions(-) New commits: commit f9e4d3bfe8eedd49afc2d2161f47a8825a02eec8 Author: Zolnai Tamás Date: Sun Oct 7 11:42:37 2012 +0200 Make Export::handleArguments method safer -Check wheather input and output file are given -Return with "empty" HandledArgs when input is invalid -Delete plus conditions from helpex and lngex Change-Id: I418b1ecaab5f0c78197845448ab062aa5d3ba4de diff --git a/l10ntools/source/export2.cxx b/l10ntools/source/export2.cxx index e2be3f3..64a5b1b 100644 --- a/l10ntools/source/export2.cxx +++ b/l10ntools/source/export2.cxx @@ -94,6 +94,7 @@ rtl::OString Export::sForcedLanguages; bool Export::handleArguments( int argc, char * argv[], HandledArgs& o_aHandledArgs) { +o_aHandledArgs = HandledArgs(); if ( argc <= 1 ) { return false; @@ -169,7 +170,16 @@ bool Export::handleArguments( } } } -return true; +if( !o_aHandledArgs.m_sInputFile.isEmpty() && +!o_aHandledArgs.m_sOutputFile.isEmpty() ) +{ +return true; +} +else +{ +o_aHandledArgs = HandledArgs(); +return false; +} } void Export::writeUsage(const OString& rName, const OString& rFileType) diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx index 574987e..8dca205 100644 --- a/l10ntools/source/helpex.cxx +++ b/l10ntools/source/helpex.cxx @@ -39,24 +39,20 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { //sal_uInt32 startfull = Export::startMessure(); bool hasNoError = true; -if ( !aArgs.m_sOutputFile.isEmpty() ){ -HelpParser aParser( aArgs.m_sInputFile ); - -if ( aArgs.m_bMergeMode ) -{ -//sal_uInt64 startreadloc = Export::startMessure(); -MergeDataFile aMergeDataFile( aArgs.m_sMergeSrc, aArgs.m_sInputFile, false ); - -hasNoError = aParser.Merge( aArgs.m_sMergeSrc, aArgs.m_sOutputFile , Export::sLanguages , aMergeDataFile ); -} -else -hasNoError = -aParser.CreateSDF( -aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot, -aArgs.m_sInputFile, new XMLFile( OUString('0') ), "help" ); +HelpParser aParser( aArgs.m_sInputFile ); +if ( aArgs.m_bMergeMode ) +{ +//sal_uInt64 startreadloc = Export::startMessure(); +MergeDataFile aMergeDataFile( aArgs.m_sMergeSrc, aArgs.m_sInputFile, false ); +hasNoError = aParser.Merge( aArgs.m_sMergeSrc, aArgs.m_sOutputFile , Export::sLanguages , aMergeDataFile ); } else -std::cerr << "helpex ERROR: Wrong input parameters!\n"; +{ +hasNoError = +aParser.CreateSDF( +aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot, +aArgs.m_sInputFile, new XMLFile( OUString('0') ), "help" ); +} if( hasNoError ) return 0; diff --git a/l10ntools/source/lngex.cxx b/l10ntools/source/lngex.cxx index 706ab26..eb5 100644 --- a/l10ntools/source/lngex.cxx +++ b/l10ntools/source/lngex.cxx @@ -34,15 +34,12 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) { return 1; } -if (!aArgs.m_sOutputFile.isEmpty()) -{ -LngParser aParser( aArgs.m_sInputFile, true ); -if ( aArgs.m_bMergeMode ) -aParser.Merge(aArgs.m_sMergeSrc, aArgs.m_sOutputFile); -else -aParser.CreateSDF( -aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot ); -} +LngParser aParser( aArgs.m_sInputFile, true ); +if ( aArgs.m_bMergeMode ) +aParser.Merge(aArgs.m_sMergeSrc, aArgs.m_sOutputFile); +else +aParser.CreateSDF( +aArgs.m_sOutputFile, aArgs.m_sPrj, aArgs.m_sPrjRoot ); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/lngmerge.cxx | 19 +++ 1 file changed, 11 insertions(+), 8 deletions(-) New commits: commit 85c93d57c46d02c66b6e604feb867d3ae1abac4e Author: Zolnai Tamás Date: Wed Oct 3 12:37:19 2012 +0200 Ulfex ignores comments during extraction too During string extraction this does not cause real problem but causes unnecessary operations. Plus make isNextGroup not to change sLine_in parameter. Change-Id: I3db6a94ef320c096a7519f7f83dd4080d0588459 diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index fcab696..b0282f5 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -146,12 +146,12 @@ void LngParser::WriteSDF(std::ofstream &aSDFStream, } } -bool LngParser::isNextGroup(rtl::OString &sGroup_out, rtl::OString &sLine_in) +bool LngParser::isNextGroup(rtl::OString &sGroup_out, const rtl::OString &sLine_in) { -sLine_in = sLine_in.trim(); -if ((sLine_in[0] == '[') && (sLine_in[sLine_in.getLength() - 1] == ']')) +const OString sLineTrim = sLine_in.trim(); +if ((sLineTrim[0] == '[') && (sLineTrim[sLineTrim.getLength() - 1] == ']')) { -sGroup_out = getBracketedContent(sLine_in).trim(); +sGroup_out = getBracketedContent(sLineTrim).trim(); return true; } return false; @@ -160,10 +160,13 @@ bool LngParser::isNextGroup(rtl::OString &sGroup_out, rtl::OString &sLine_in) void LngParser::ReadLine(const rtl::OString &rLine_in, OStringHashMap &rText_inout) { -rtl::OString sLang(rLine_in.getToken(0, '=').trim()); -if (!sLang.isEmpty()) { -rtl::OString sText(rLine_in.getToken(1, '"')); -rText_inout[sLang] = sText; +if (!rLine_in.match(" *") && !rLine_in.match("/*")) +{ +rtl::OString sLang(rLine_in.getToken(0, '=').trim()); +if (!sLang.isEmpty()) { +rtl::OString sText(rLine_in.getToken(1, '"')); +rText_inout[sLang] = sText; +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/merge.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit afcfb2fb26282e6e490922cca27d089b0980d071 Author: Zolnai Tamás Date: Wed Oct 3 10:31:34 2012 +0200 One little correction Change-Id: I675bd8a966b2c1654cd6547fc380a51925578835 diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 5738565..23609e0 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -196,7 +196,7 @@ MergeDataFile::MergeDataFile( } catch( PoHeader::Exception& aException ) { -if( aException = PoHeader::NOLANG ) +if( aException == PoHeader::NOLANG ) { printf( "Warning : %s' header not has language specification\n", ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/lngmerge.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e3bf6418a86cb0d9771f3a7b715e894bc02ae313 Author: Zolnai Tamás Date: Wed Oct 3 10:25:46 2012 +0200 Correct ulfex to ignore comments Change-Id: I50e41a3946ff885783006018f7b6ff2945cc7dfc diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx index 264b50c..fcab696 100644 --- a/l10ntools/source/lngmerge.cxx +++ b/l10ntools/source/lngmerge.cxx @@ -232,7 +232,7 @@ sal_Bool LngParser::Merge( { sal_Int32 n = 0; rtl::OString sLang(sLine.getToken(0, '=', n)); -if (n == -1) +if (n == -1 || static_cast(sLine.match("/*"))) { ++nPos; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) New commits: commit 9d300551b3dacd3693607e1015bea1461c173e1a Author: Zolnai Tamás Date: Sun Sep 30 18:26:15 2012 +0200 Use new startsWith() method of OString Change-Id: If8787b007767aa2701ff1b13883bcf33df12a8fc Reviewed-on: https://gerrit.libreoffice.org/737 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index b9e1c17..a922575 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -110,12 +110,6 @@ OString ImplGenNormString(const OString& rString) return ImplUnEscapeText(rString.copy(1,rString.getLength()-2)); } -//Decide whether a string starts with an other string -bool ImplStartsWith(const OString& rString,const OString& rStart) -{ -return rString.match(rStart); -} - //Default constructor GenPoEntry::GenPoEntry() : m_sWhiteSpace( OString() ) @@ -215,37 +209,37 @@ void GenPoEntry::readFromFile(std::ifstream& rIFStream) while(!rIFStream.eof()) { OString sLine = OString(sTemp.data(),sTemp.length()); -if (ImplStartsWith(sLine,"#. ")) +if (sLine.startsWith("#. ")) { if (sLine.getLength()==7) m_sKeyId = sLine.copy(3); else m_sExtractCom = sLine.copy(3); } -else if (ImplStartsWith(sLine,"#: ")) +else if (sLine.startsWith("#: ")) { m_sReference = sLine.copy(3); } -else if (ImplStartsWith(sLine,"#, fuzzy")) +else if (sLine.startsWith("#, fuzzy")) { m_bFuzzy = true; } -else if (ImplStartsWith(sLine,"msgctxt ")) +else if (sLine.startsWith("msgctxt ")) { m_sContext = ImplGenNormString(sLine.copy(8)); pLastMsg = &m_sContext; } -else if (ImplStartsWith(sLine,"msgid ")) +else if (sLine.startsWith("msgid ")) { m_sUnTransStr = ImplGenNormString(sLine.copy(6)); pLastMsg = &m_sUnTransStr; } -else if (ImplStartsWith(sLine,"msgstr ")) +else if (sLine.startsWith("msgstr ")) { m_sTransStr = ImplGenNormString(sLine.copy(7)); pLastMsg = &m_sTransStr; } -else if (ImplStartsWith(sLine,"\"") && pLastMsg) +else if (sLine.startsWith("\"") && pLastMsg) { *pLastMsg += ImplGenNormString(sLine); } @@ -359,7 +353,7 @@ OString ImplEscapeTags(const OString& rText) for(StrVec::const_iterator pEscape = vTagsForEscape.begin(); pEscape != vTagsForEscape.end(); ++pEscape) { -if (ImplStartsWith(*pFound,"<" + *pEscape) || +if (pFound->startsWith("<" + *pEscape) || *pFound == "") { bEscapeThis = true; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source solenv/gbuild
l10ntools/source/po.cxx |2 +- solenv/gbuild/ExtensionTarget.mk |8 solenv/gbuild/InstallModuleTarget.mk |2 +- 3 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 0359041aac89ef07325f6b8baa2d5ff304e833b5 Author: Zolnai Tamás Date: Sun Sep 30 17:54:37 2012 +0200 Corrections for merge -Correct po type-checking -Use new "lang" variable instead of nonexistent one -Add input parameter to ulfex Change-Id: I1dc17363179d69d40144b6a998eb1bf223bd05e9 Reviewed-on: https://gerrit.libreoffice.org/736 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index f929ce7..b9e1c17 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -481,7 +481,7 @@ OString PoEntry::getResourceType() const PoEntry::TYPE PoEntry::getType() const { const OString sContext = m_aGenPo.getContext(); -const OString sType = sContext.copy( sContext.indexOf('.') + 1 ); +const OString sType = sContext.copy( sContext.lastIndexOf('.') + 1 ); assert( m_bIsInitialized && (sType == "text" || sType == "quickhelptext" || sType == "title") ); if ( sType == "text" ) diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk index 559e0cf..4e53be5 100644 --- a/solenv/gbuild/ExtensionTarget.mk +++ b/solenv/gbuild/ExtensionTarget.mk @@ -136,9 +136,9 @@ $(call gb_ExtensionTarget_get_target,$(1)) : PRJNAME := $(firstword $(subst /, , $(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml ifneq ($(strip $(gb_WITH_LANG)),) $(call gb_ExtensionTarget_get_target,$(1)) : \ - POFILES := $(foreach lang,$(gb_ExtensionTarget_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po) + POFILES := $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po) $(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : \ - $(foreach lang,$(gb_ExtensionTarget_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po) + $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(2).po) endif $(foreach lang,$(gb_ExtensionTarget_ALL_LANGS), \ @@ -225,9 +225,9 @@ $(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(2) ifneq ($(strip $(gb_WITH_LANG)),) $(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(foreach lang,$(subst -,_,$(gb_ExtensionTarget_TRANS_LANGS)),$(subst en_US,$(lang),$(2))) $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \ - POFILES := $(foreach lang,$(gb_ExtensionTarget_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3.po) + POFILES := $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3.po) $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : \ - $(foreach lang,$(gb_ExtensionTarget_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3.po) + $(foreach lang,$(gb_ExtensionTarget_TRANS_LANGS),$(gb_POLOCATION)/$(lang)/$(patsubst /%/,%,$(subst $(SRCDIR),,$(dir $(3.po) endif $(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) \ diff --git a/solenv/gbuild/InstallModuleTarget.mk b/solenv/gbuild/InstallModuleTarget.mk index ace8ceb..242a259 100644 --- a/solenv/gbuild/InstallModuleTarget.mk +++ b/solenv/gbuild/InstallModuleTarget.mk @@ -132,7 +132,7 @@ $(dir $(call gb_ScpMergeTarget_get_target,%))%/.dir : $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) $(call gb_ScpMergeTarget_get_target,%) : $(gb_ScpMergeTarget_TARGET) - $(call gb_ScpMergeTarget__command,$@,$*) + $(call gb_ScpMergeTarget__command,$@,$*,$(SCP_SOURCE)) .PHONY : $(call gb_ScpMergeTarget_get_clean_target,%) $(call gb_ScpMergeTarget_get_clean_target,%) : ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx |4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) New commits: commit 004f4fae87fe4fe3c31948d55206291b6de64ba9 Author: Zolnai Tamás Date: Sun Sep 30 16:33:47 2012 +0200 Correct escaping tags which worked wrong with some language like Asturian Change-Id: Icd5939316ac84a3e569a9cbc04e38edda59dead1 Reviewed-on: https://gerrit.libreoffice.org/735 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index 0649efe..f929ce7 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -330,7 +330,9 @@ void ImplFindAllTag(const OString& rText,std::vector& o_vFoundTags) { ImplMinimize(sTemp,aRegExp,aRegs); o_vFoundTags.push_back( -rText.copy(aRegs.start[0],aRegs.end[0]-aRegs.start[0])); +OUStringToOString( +sTemp.copy(aRegs.start[0],aRegs.end[0]-aRegs.start[0]), +RTL_TEXTENCODING_UTF8)); nStart = aRegs.end[0]; memset(static_cast(&aRegs), 0, sizeof(re_registers)); aRegExp.re_search(&aRegs,nStart); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/merge.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit f1cbd2dc05c6765754891a909ff53f1852a878a5 Author: Zolnai Tamás Date: Sun Sep 30 13:11:54 2012 +0200 Use ascii charachters to seperate qtzi Because previous used charachters cause warnings Change-Id: I8715fc2a05df9d84b34945618184c99d54de6579 Reviewed-on: https://gerrit.libreoffice.org/731 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx index 7e6c595..b9fe90f 100644 --- a/l10ntools/source/merge.cxx +++ b/l10ntools/source/merge.cxx @@ -265,8 +265,8 @@ MergeDataFile::MergeDataFile( InsertEntry( aActPo.getResourceType(), aActPo.getGroupId(), aActPo.getLocalId(), sHACK, "qtz", -sQTZText + "â" + sExText, sQTZQHText + "â" + sExQHText, -sQTZTitle + "â" + sExTitle, sFileName, bCaseSensitive ); +sQTZText + "||" + sExText, sQTZQHText + "||" + sExQHText, +sQTZTitle + "||" + sExTitle, sFileName, bCaseSensitive ); } } aPoInput.close(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/localize.cxx |6 +- 1 file changed, 5 insertions(+), 1 deletion(-) New commits: commit 4869d45d8e6ba43f422ee3aa05b7c0baca28d1e0 Author: Zolnai Tamás Date: Sun Sep 30 12:47:56 2012 +0200 Make error message clearer in localize which is written out when one of executables writes out invalid sdf line Change-Id: I167b31bf0f550222accdda8ee5a03d8e4a742d63 Reviewed-on: https://gerrit.libreoffice.org/730 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 87ee83b..6bc92a8 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -299,7 +299,11 @@ void handleCommand( { if(aException == PoEntry::INVALIDSDFLINE) { -std::cerr << executable << "'s input is invalid\n"; +std::cerr +<< executable +<< "'s output is invalid:\n" +<< sLine.replaceAll("\t","\\t").getStr() +<< std::endl; throw false; //TODO } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) New commits: commit 0e138f246cc490df35046bba83e459164620ca77 Author: Zolnai Tamás Date: Sun Sep 30 12:08:04 2012 +0200 Move setting of po msgid to constructor because this is part of initialization Change-Id: If6ebe46cea93e378c9060f2c3ced09ab44a3d82a Reviewed-on: https://gerrit.libreoffice.org/729 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index cf0b963..0649efe 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -427,7 +427,9 @@ PoEntry::PoEntry(const OString& rSDFLine, const TYPE eType) only three element*/ } m_aGenPo.setContext(sContext); -setUnTransStr(vParts[eType]); +m_aGenPo.setUnTransStr( +ImplUnEscapeSDFText( +vParts[eType],vParts[SOURCEFILE].endsWith(".xhp"))); m_aGenPo.genKeyId(); m_bIsInitialized = true; } @@ -522,14 +524,6 @@ OString PoEntry::getTransStr() const } -//Set translation string when input is in sdf format -void PoEntry::setUnTransStr(const OString& rUnTransStr) -{ -m_aGenPo.setUnTransStr( -ImplUnEscapeSDFText( -rUnTransStr,getSourceFile().endsWith(".xhp"))); -} - //Set translated string when input is in sdf format void PoEntry::setTransStr(const OString& rTransStr) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 10 ++ l10ntools/source/renewpo.cxx |7 --- 2 files changed, 10 insertions(+), 7 deletions(-) New commits: commit 9baaced8b636e23045495c9a018d0859a9df8e76 Author: Zolnai Tamás Date: Sat Sep 29 21:01:30 2012 +0200 Not use initializer-list for vector Change-Id: I6ed72b28be3ad00224cbf7308b4f27a6fb25e24e Reviewed-on: https://gerrit.libreoffice.org/726 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index f433aab..b2082a7 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -338,10 +338,12 @@ void ImplFindAllTag(const OString& rText,std::vector& o_vFoundTags) OString ImplEscapeTags(const OString& rText) { typedef std::vector StrVec; -const StrVec vTagsForEscape = - { "ahelp", "link", "item", "emph", "defaultinline", -"switchinline", "caseinline", "variable", -"bookmark_value", "image", "embedvar", "alt" }; +const OString vInitializer[] = { +"ahelp", "link", "item", "emph", "defaultinline", +"switchinline", "caseinline", "variable", +"bookmark_value", "image", "embedvar", "alt" }; +const StrVec vTagsForEscape( vInitializer, +vInitializer + sizeof(vInitializer) / sizeof(vInitializer[0]) ); StrVec vFoundTags; ImplFindAllTag(rText,vFoundTags); OString sResult = rText; diff --git a/l10ntools/source/renewpo.cxx b/l10ntools/source/renewpo.cxx index 398b23b..39152a7 100644 --- a/l10ntools/source/renewpo.cxx +++ b/l10ntools/source/renewpo.cxx @@ -116,9 +116,10 @@ void HandleLanguage(struct dirent* pLangEntry, const OString& rPath, { sActTrans =""; } -const vector vTypes = { PoEntry::TTEXT, - PoEntry::TQUICKHELPTEXT, - PoEntry::TTITLE }; +const PoEntry::TYPE vInitializer[] = +{ PoEntry::TTEXT, PoEntry::TQUICKHELPTEXT, PoEntry::TTITLE }; +const vector vTypes( vInitializer, +vInitializer + sizeof(vInitializer) / sizeof(vInitializer[0]) ); unsigned short nDummyBit = 0; for( unsigned nIndex=0; nIndex___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/localize.cxx |1 - 1 file changed, 1 deletion(-) New commits: commit ab063326af9eeab5fcb50a52ec6d67cfc76f4f32 Author: Andras Timar Date: Fri Sep 21 22:57:08 2012 +0200 remove inclusion of deprecated header Change-Id: If30210587f0562d7e5f24fb3acbdd7ef8b13a00f diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index 598eccf..7c1ad3f 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -39,7 +39,6 @@ #include "osl/file.hxx" #include "osl/process.h" #include "osl/thread.h" -#include "rtl/oustringostreaminserter.hxx" #include "rtl/string.h" #include "rtl/string.hxx" #include "rtl/textcvt.h" ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/po.cxx | 11 ++- 1 file changed, 6 insertions(+), 5 deletions(-) New commits: commit dd83185b004e08fe0b291ede225d0e93be27c819 Author: Zolnai Tamás Date: Fri Aug 31 18:19:32 2012 +0200 Correct KeyId generator Use integer aritmetic and less cast Change-Id: I6fc0667fcbcee5f1a2dc964e2653c042338afa0c Reviewed-on: https://gerrit.libreoffice.org/523 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index a82a88b..59199c2 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -32,14 +32,15 @@ OString ImplGenKeyId(const OString& rGenerator) boost::crc_32_type aCRC32; aCRC32.process_bytes(rGenerator.getStr(), rGenerator.getLength()); sal_uInt32 nCRC = aCRC32.checksum(); -OString sKeyId = ""; -while ( sKeyId.getLength() < 4 ) +char sKeyId[5]; +for(int nIndex = 0; nIndex < 4; ++nIndex) { -//Concat a char from the [33,126] interval of ASCII -sKeyId += OString(char(int(double(nCRC & 255)/255*93)+33)); +//Get a char from the [33,126] interval of ASCII +sKeyId[nIndex] = static_cast((nCRC & 255) % 93 + 33); nCRC >>= 8; } -return sKeyId; +sKeyId[4] = 0; +return OString(sKeyId); } //Escape text ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
Re: [Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
On Thu, Aug 30, 2012 at 11:42:40AM +0200, Stephan Bergmann wrote: > >-sal_Int32 nActChar = rUnEscaped.indexOf(rText[nIndex]); > >+int nActChar = rUnEscaped.indexOf(rText[nIndex]); > > if(nActChar!=-1) > > sResult = sResult.replaceAt((nIndex)+(nCount++),1, > > rEscaped.copy(2*nActChar,2)); > > What's the reason for changes like this? The involved type is > sal_Int32, not int, and sal_Int32 is not necessarily a typedef for > int (e.g., it is a typedef for long on some platforms). I fear that > routinely using plain int instead of those sal types when > interfacing with code using those sal types leads to unnecessary > compiler warnings. It was me who suggested using int and not sal_Int* when the size does not matter. However I forgot to point out that sal_Int* types are the way to go when the variable is initialized by a method returning sal_Int* already. Sorry for the confusion. :) Miklos ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: [Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
On 08/29/2012 09:06 PM, Libreoffice Gerrit user wrote: commit ecfa813595cb577781668219d9e17a0494f92bea Author: Zolnai Tamás Date: Wed Aug 29 12:58:29 2012 +0200 Some cleanup Use normal integer types when it's unecessary to use sal_int types. Delete some hack from code. Change-Id: I93f0b1f260578d3aa9609b7e9d8a79053693971b Reviewed-on: https://gerrit.libreoffice.org/510 Reviewed-by: Andras Timar Tested-by: Andras Timar [...] diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index c488c87..472e876 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -59,10 +59,10 @@ OString ImplEscapeText(const OString& rText, { if(rEscaped.getLength()!=2*rUnEscaped.getLength()) throw; OString sResult = rText; -sal_Int32 nCount = 0; -for(sal_Int32 nIndex=0; nIndex What's the reason for changes like this? The involved type is sal_Int32, not int, and sal_Int32 is not necessarily a typedef for int (e.g., it is a typedef for long on some platforms). I fear that routinely using plain int instead of those sal types when interfacing with code using those sal types leads to unnecessary compiler warnings. Stephan ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
l10ntools/source/localize.cxx | 14 +++--- l10ntools/source/po.cxx | 22 +++--- l10ntools/source/renewpo.cxx |8 3 files changed, 22 insertions(+), 22 deletions(-) New commits: commit ecfa813595cb577781668219d9e17a0494f92bea Author: Zolnai Tamás Date: Wed Aug 29 12:58:29 2012 +0200 Some cleanup Use normal integer types when it's unecessary to use sal_int types. Delete some hack from code. Change-Id: I93f0b1f260578d3aa9609b7e9d8a79053693971b Reviewed-on: https://gerrit.libreoffice.org/510 Reviewed-by: Andras Timar Tested-by: Andras Timar diff --git a/l10ntools/source/localize.cxx b/l10ntools/source/localize.cxx index bef2444..598eccf 100644 --- a/l10ntools/source/localize.cxx +++ b/l10ntools/source/localize.cxx @@ -194,13 +194,13 @@ void handleCommand( throw false; //TODO } rtl::OUStringBuffer buf( -//getEnvironment( -//rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SOLARVER"; -//buf.append('/'); -//buf.append( -//getEnvironment( -rtl::OUString("/home/zolnai/git/libo/solver/unxlngi6.pro")); - // RTL_CONSTASCII_USTRINGPARAM("INPATH_FOR_BUILD"; +getEnvironment( +rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("SOLARVER"; +buf.append('/'); +buf.append( +getEnvironment( +rtl::OUString( +RTL_CONSTASCII_USTRINGPARAM("INPATH_FOR_BUILD"; buf.appendAscii(RTL_CONSTASCII_STRINGPARAM("/bin/")); buf.append(executable); buf.appendAscii(RTL_CONSTASCII_STRINGPARAM(" -e -p ")); diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx index c488c87..472e876 100644 --- a/l10ntools/source/po.cxx +++ b/l10ntools/source/po.cxx @@ -45,7 +45,7 @@ OString ImplGenKeyId(const OString& rGenerator) OString sKeyId = ""; while ( sKeyId.getLength() < 4 ) { -//Concat a char from the [33,126] intervallum of ASCII +//Concat a char from the [33,126] interval of ASCII sKeyId += OString(char(int(double(nCRC & 255)/255*93)+33)); nCRC >>= 8; } @@ -59,10 +59,10 @@ OString ImplEscapeText(const OString& rText, { if(rEscaped.getLength()!=2*rUnEscaped.getLength()) throw; OString sResult = rText; -sal_Int32 nCount = 0; -for(sal_Int32 nIndex=0; nIndex& o_vParts) { o_vParts.resize( 0 ); -sal_Int32 nActIndex( 0 ); -sal_Int32 nLastSplit( 0 ); +int nActIndex( 0 ); +int nLastSplit( 0 ); while( nActIndex < rSource.getLength() ) { if ( rSource[nActIndex] == nDelimiter ) diff --git a/l10ntools/source/renewpo.cxx b/l10ntools/source/renewpo.cxx index f68250e..20738b1 100644 --- a/l10ntools/source/renewpo.cxx +++ b/l10ntools/source/renewpo.cxx @@ -61,8 +61,8 @@ OString GetPath(const OString& rPath, const OString& rLine) OString DelLocalId(const OString& rLine) { -sal_uInt16 nTabIndex = 0; -for(sal_uInt16 nComponent=0; nComponent vTypes = { PoEntry::TTEXT, PoEntry::TQUICKHELPTEXT, PoEntry::TTITLE }; -sal_uInt16 nDummyBit = 0; -for( sal_uInt16 nIndex=0; nIndex___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits