Kaydet (Commit) d885a85a authored tarafından Zolnai Tamás's avatar Zolnai Tamás

Make l10ntools executables escape clear

Steps of escaping process:
1. Executables unescape the string for export(if necessary)
2. Po class work with unescaped string
3. Escape strings to PO format and write out
4. Read from PO and unescape strings
5. Executables make own transformation on string and merge

Use general functions for escaping (helper)
Delete unneeded escaping methods(xrmmerge, merge)
Delete some unused method from PoEntry class

Change-Id: I7f9414581aae9e6de7d1573862a32cdbd68c9545
üst edc3bfd5
...@@ -45,6 +45,7 @@ $(eval $(call gb_Executable_add_exception_objects,localize,\ ...@@ -45,6 +45,7 @@ $(eval $(call gb_Executable_add_exception_objects,localize,\
$(eval $(call gb_Executable_use_externals,localize,\ $(eval $(call gb_Executable_use_externals,localize,\
boost_headers \ boost_headers \
libxml2 \
)) ))
# vim:set noet sw=4 ts=4: # vim:set noet sw=4 ts=4:
...@@ -30,6 +30,7 @@ $(eval $(call gb_Executable_add_exception_objects,propex,\ ...@@ -30,6 +30,7 @@ $(eval $(call gb_Executable_add_exception_objects,propex,\
$(eval $(call gb_Executable_use_externals,propex,\ $(eval $(call gb_Executable_use_externals,propex,\
boost_headers \ boost_headers \
libxml2 \
)) ))
# vim: set noet sw=4 ts=4: # vim: set noet sw=4 ts=4:
...@@ -46,6 +46,7 @@ $(eval $(call gb_Executable_add_exception_objects,ulfex,\ ...@@ -46,6 +46,7 @@ $(eval $(call gb_Executable_add_exception_objects,ulfex,\
$(eval $(call gb_Executable_use_externals,ulfex,\ $(eval $(call gb_Executable_use_externals,ulfex,\
boost_headers \ boost_headers \
libxml2 \
)) ))
# vim:set noet sw=4 ts=4: # vim:set noet sw=4 ts=4:
...@@ -240,6 +240,7 @@ private: ...@@ -240,6 +240,7 @@ private:
void ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OString& rTextType ); void ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OString& rTextType );
void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL ); void MergeRest( ResData *pResData, sal_uInt16 nMode = MERGE_MODE_NORMAL );
void ConvertMergeContent( OString &rText ); void ConvertMergeContent( OString &rText );
void ConvertExportContent( OString &rText );
void WriteToMerged(const OString &rText , bool bSDFContent); void WriteToMerged(const OString &rText , bool bSDFContent);
void SetChildWithText(); void SetChildWithText();
...@@ -296,7 +297,6 @@ public: ...@@ -296,7 +297,6 @@ public:
bTitleFirst[ rId ] = true; bTitleFirst[ rId ] = true;
} }
sal_Bool GetText( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel = sal_False ); sal_Bool GetText( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel = sal_False );
sal_Bool GetTransex3Text( OString &rReturn, sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel = sal_False );
}; };
......
...@@ -25,6 +25,11 @@ ...@@ -25,6 +25,11 @@
namespace helper { namespace helper {
OString escapeAll(
const OString& rText, const OString& rUnEscaped, const OString& rEscaped );
OString unEscapeAll(
const OString& rText, const OString& rEscaped, const OString& rUnEscaped );
OString QuotHTML( const OString &rString ); OString QuotHTML( const OString &rString );
OString UnQuotHTML( const OString& rString ); OString UnQuotHTML( const OString& rString );
......
...@@ -61,9 +61,6 @@ public: ...@@ -61,9 +61,6 @@ public:
OString getMsgStr() const; OString getMsgStr() const;
bool isFuzzy() const; bool isFuzzy() const;
OString getKeyId() const; OString getKeyId() const;
void setMsgId(const OString& rMsgId);
void setMsgStr(const OString& rMsgStr);
void setFuzzy(const bool bFuzzy);
static bool IsInSameComp(const PoEntry& rPo1,const PoEntry& rPo2); static bool IsInSameComp(const PoEntry& rPo1,const PoEntry& rPo2);
......
...@@ -59,9 +59,6 @@ protected: ...@@ -59,9 +59,6 @@ protected:
OString GetGID() { return sGID; } OString GetGID() { return sGID; }
OString GetLID() { return sLID; } OString GetLID() { return sLID; }
void ConvertStringToDBFormat( OString &rString );
void ConvertStringToXMLFormat( OString &rString );
public: public:
XRMResParser(); XRMResParser();
virtual ~XRMResParser(); virtual ~XRMResParser();
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <cstddef> #include <cstddef>
#include <cstring> #include <cstring>
#include "helper.hxx"
#include "boost/scoped_ptr.hpp" #include "boost/scoped_ptr.hpp"
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
...@@ -954,6 +955,11 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew ) ...@@ -954,6 +955,11 @@ sal_Bool Export::WriteData( ResData *pResData, sal_Bool bCreateNew )
if (sXText.isEmpty()) if (sXText.isEmpty())
sXText = "-"; sXText = "-";
ConvertExportContent(sXText);
ConvertExportContent(sXHText);
ConvertExportContent(sXQHText);
ConvertExportContent(sXTitle);
common::writePoEntry( common::writePoEntry(
"Transex3", *aOutput.mPo, global::inputPathname, "Transex3", *aOutput.mPo, global::inputPathname,
pResData->sResTyp, sGID, sLID, sXHText, sXText); pResData->sResTyp, sGID, sLID, sXHText, sXText);
...@@ -1070,6 +1076,7 @@ sal_Bool Export::WriteExportList(ResData *pResData, ExportList *pExportList, ...@@ -1070,6 +1076,7 @@ sal_Bool Export::WriteExportList(ResData *pResData, ExportList *pExportList,
if( sText == "\\\"" ) if( sText == "\\\"" )
sText = "\""; sText = "\"";
} }
ConvertExportContent(sText);
common::writePoEntry( common::writePoEntry(
"Transex3", *aOutput.mPo, global::inputPathname, "Transex3", *aOutput.mPo, global::inputPathname,
rTyp, sGID, sLID, OString(), sText); rTyp, sGID, sLID, OString(), sText);
...@@ -1316,68 +1323,28 @@ void Export::ConvertMergeContent( OString &rText ) ...@@ -1316,68 +1323,28 @@ void Export::ConvertMergeContent( OString &rText )
/*****************************************************************************/ /*****************************************************************************/
{ {
sal_Bool bNoOpen = ( rText.indexOf( "\\\"" ) != 0 ); sal_Bool bNoOpen = ( rText.indexOf( "\\\"" ) != 0 );
sal_Bool bNoClose = !rText.endsWithL(RTL_CONSTASCII_STRINGPARAM("\\\"")); sal_Bool bNoClose = !rText.endsWith("\\\"");
OStringBuffer sNew;
for ( sal_Int32 i = 0; i < rText.getLength(); i++ )
{
OString sChar( rText[i]);
if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM("\\")))
{
if (( i + 1 ) < rText.getLength())
{
sal_Char cNext = rText[i + 1];
if ( cNext == '\"' )
{
sChar = OString('\"');
i++;
}
else if ( cNext == 'n' )
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\n"));
i++;
}
else if ( cNext == 't' )
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\t"));
i++;
}
else if ( cNext == '\'' )
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\'"));
i++;
}
else
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\\"));
}
}
else
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\\"));
}
}
else if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM("\"")))
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\\""));
}
else if (sChar.equalsL(RTL_CONSTASCII_STRINGPARAM("")))
{
sChar = OString(RTL_CONSTASCII_STRINGPARAM("\\0x7F"));
}
sNew.append(sChar);
}
rText = sNew.makeStringAndClear();
if ( bNoOpen ) { rText = rText.replaceAll("\\\"'","\'"); /// Temporary: until PO files contain escaped single quotes
OString sTmp( rText ); /// (Maybe next PO update solve this)
rText = "\""; rText =
rText += sTmp; helper::escapeAll(
} rText.replaceAll("","\\0x7F"),
"\n""\t""\\""\"","\\n""\\t""\\\\""\\\"");
if ( bNoOpen )
rText = "\"" + rText;
if ( bNoClose ) if ( bNoClose )
rText += "\""; rText += "\"";
} }
void Export::ConvertExportContent( OString& rText )
{
rText = helper::unEscapeAll(rText,"\\n""\\t""\\\\""\\\"","\n""\t""\\""\"");
}
sal_Bool Export::PrepareTextToMerge(OString &rText, sal_uInt16 nTyp, sal_Bool Export::PrepareTextToMerge(OString &rText, sal_uInt16 nTyp,
OString &rLangIndex, ResData *pResData) OString &rLangIndex, ResData *pResData)
{ {
...@@ -1539,7 +1506,7 @@ sal_Bool Export::PrepareTextToMerge(OString &rText, sal_uInt16 nTyp, ...@@ -1539,7 +1506,7 @@ sal_Bool Export::PrepareTextToMerge(OString &rText, sal_uInt16 nTyp,
} }
OString sContent; OString sContent;
pEntrys->GetTransex3Text(sContent, nTyp, rLangIndex); pEntrys->GetText(sContent, nTyp, rLangIndex);
if (sContent.isEmpty() && !rLangIndex.equalsIgnoreAsciiCase("en-US")) if (sContent.isEmpty() && !rLangIndex.equalsIgnoreAsciiCase("en-US"))
{ {
rText = sOrigText; rText = sOrigText;
...@@ -1573,7 +1540,7 @@ void Export::ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OStrin ...@@ -1573,7 +1540,7 @@ void Export::ResData2Output( PFormEntrys *pEntry, sal_uInt16 nType, const OStrin
sCur = aLanguages[ n ]; sCur = aLanguages[ n ];
OString sText; OString sText;
sal_Bool bText = pEntry->GetTransex3Text( sText, nType, sCur , sal_True ); sal_Bool bText = pEntry->GetText( sText, nType, sCur , sal_True );
if ( bText && !sText.isEmpty() && sText != "-" ) { if ( bText && !sText.isEmpty() && sText != "-" ) {
OString sOutput; OString sOutput;
if ( bNextMustBeDefineEOL) { if ( bNextMustBeDefineEOL) {
...@@ -1772,7 +1739,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode ) ...@@ -1772,7 +1739,7 @@ void Export::MergeRest( ResData *pResData, sal_uInt16 nMode )
OString sText; OString sText;
sal_Bool bText = false; sal_Bool bText = false;
if ( pEntrys ) if ( pEntrys )
bText = pEntrys->GetTransex3Text( sText, STRING_TYP_TEXT, sCur, sal_True ); bText = pEntrys->GetText( sText, STRING_TYP_TEXT, sCur, sal_True );
if ( bText && !sText.isEmpty() ) if ( bText && !sText.isEmpty() )
{ {
sal_Int32 nStart, nEnd; sal_Int32 nStart, nEnd;
......
...@@ -11,6 +11,49 @@ ...@@ -11,6 +11,49 @@
namespace helper { namespace helper {
OString escapeAll(
const OString& rText, const OString& rUnEscaped, const OString& rEscaped )
{
assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
OStringBuffer sReturn;
for ( sal_Int32 nIndex = 0; nIndex < rText.getLength(); ++nIndex )
{
sal_Int32 nUnEscapedOne = rUnEscaped.indexOf(rText[nIndex]);
if( nUnEscapedOne != -1 )
{
sReturn.append(rEscaped.copy(nUnEscapedOne*2,2));
}
else
sReturn.append(rText[nIndex]);
}
return sReturn.makeStringAndClear();
}
OString unEscapeAll(
const OString& rText, const OString& rEscaped, const OString& rUnEscaped)
{
assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
OStringBuffer sReturn;
const sal_Int32 nLength = rText.getLength();
for ( sal_Int32 nIndex = 0; nIndex < nLength; ++nIndex )
{
if( rText[nIndex] == '\\' && nIndex+1 < nLength )
{
sal_Int32 nEscapedOne = rEscaped.indexOf(rText.copy(nIndex,2));
if( nEscapedOne != -1 )
{
sReturn.append(rUnEscaped[nEscapedOne/2]);
++nIndex;
}
}
else
sReturn.append(rText[nIndex]);
}
return sReturn.makeStringAndClear();
}
OString QuotHTML(const OString &rString) OString QuotHTML(const OString &rString)
{ {
OStringBuffer sReturn; OStringBuffer sReturn;
......
...@@ -165,20 +165,6 @@ ResData::~ResData() ...@@ -165,20 +165,6 @@ ResData::~ResData()
// class PFormEntrys // class PFormEntrys
// //
sal_Bool PFormEntrys::GetTransex3Text( OString &rReturn,
sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel )
{
sal_Bool rc = GetText( rReturn , nTyp , nLangIndex , bDel );
for( sal_Int32 idx = 0; idx < rReturn.getLength(); idx++ )
{
if( rReturn[idx] == '\"' && ( idx >= 1 ) && rReturn[idx-1] == '\\' )
{
rReturn = rReturn.replaceAt( idx-1, 1, OString() );
}
}
return rc;
}
/*****************************************************************************/
sal_Bool PFormEntrys::GetText( OString &rReturn, sal_Bool PFormEntrys::GetText( OString &rReturn,
sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel ) sal_uInt16 nTyp, const OString &nLangIndex, sal_Bool bDel )
{ {
......
...@@ -19,9 +19,7 @@ ...@@ -19,9 +19,7 @@
#include <boost/crc.hpp> #include <boost/crc.hpp>
#include "po.hxx" #include "po.hxx"
#include "helper.hxx"
#define POESCAPED OString("\\n\\t\\r\\\\\\\"")
#define POUNESCAPED OString("\n\t\r\\\"")
/** Container of po entry /** Container of po entry
...@@ -85,49 +83,16 @@ public: ...@@ -85,49 +83,16 @@ public:
namespace namespace
{ {
//Escape text
static OString lcl_EscapeText(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<rText.getLength(); ++nIndex)
{
sal_Int32 nActChar = rUnEscaped.indexOf(rText[nIndex]);
if(nActChar!=-1)
sResult = sResult.replaceAt((nIndex)+(nCount++),1,
rEscaped.copy(2*nActChar,2));
}
return sResult;
}
//Unescape text
static OString lcl_UnEscapeText(const OString& rText,
const OString& rEscaped = POESCAPED,
const OString& rUnEscaped = POUNESCAPED)
{
assert( rEscaped.getLength() == 2*rUnEscaped.getLength() );
OString sResult = rText;
int nCount = 0;
for(sal_Int32 nIndex=0; nIndex<rText.getLength()-1; ++nIndex)
{
sal_Int32 nActChar = rEscaped.indexOf(rText.copy(nIndex,2));
if(nActChar % 2 == 0)
sResult = sResult.replaceAt((nIndex++)-(nCount++),2,
rUnEscaped.copy(nActChar/2,1));
}
return sResult;
}
//Convert a normal string to msg/po output string //Convert a normal string to msg/po output string
static OString lcl_GenMsgString(const OString& rString) static OString lcl_GenMsgString(const OString& rString)
{ {
if ( rString.isEmpty() ) if ( rString.isEmpty() )
return "\"\""; return "\"\"";
OString sResult = "\"" + lcl_EscapeText(rString) + "\""; OString sResult =
"\"" +
helper::escapeAll(rString,"\n""\t""\r""\\""\"","\\n""\\t""\\r""\\\\""\\\"") +
"\"";
sal_Int32 nIndex = 0; sal_Int32 nIndex = 0;
while((nIndex=sResult.indexOf("\\n",nIndex))!=-1) while((nIndex=sResult.indexOf("\\n",nIndex))!=-1)
{ {
...@@ -148,7 +113,11 @@ namespace ...@@ -148,7 +113,11 @@ namespace
//Convert msg string to normal form //Convert msg string to normal form
static OString lcl_GenNormString(const OString& rString) static OString lcl_GenNormString(const OString& rString)
{ {
return lcl_UnEscapeText(rString.copy(1,rString.getLength()-2)); return
helper::unEscapeAll(
rString.copy(1,rString.getLength()-2),
"\\n""\\t""\\r""\\\\""\\\"",
"\n""\t""\r""\\""\"");
} }
} }
...@@ -273,26 +242,6 @@ namespace ...@@ -273,26 +242,6 @@ namespace
sKeyId[5] = '\0'; sKeyId[5] = '\0';
return OString(sKeyId); return OString(sKeyId);
} }
//Unescape merge string
static OString lcl_UnEscapeMergeText(
const OString& rText,const bool bHelpText = false )
{
if ( bHelpText )
return rText;
else
return lcl_UnEscapeText(rText,"\\n\\t\\r","\n\t\r");
}
//Escape to get merge string
static OString lcl_EscapeMergeText(
const OString& rText,const bool bHelpText = false )
{
if ( bHelpText )
return rText;
else
return lcl_EscapeText(rText,"\n\t\r","\\n\\t\\r");
}
} }
//Default constructor //Default constructor
...@@ -338,15 +287,12 @@ PoEntry::PoEntry( ...@@ -338,15 +287,12 @@ PoEntry::PoEntry(
only three element*/ only three element*/
} }
m_pGenPo->setMsgCtxt(sMsgCtxt); m_pGenPo->setMsgCtxt(sMsgCtxt);
m_pGenPo->setMsgId( m_pGenPo->setMsgId(rText);
lcl_UnEscapeMergeText(
rText,rSourceFile.endsWith(".xhp")));
m_pGenPo->setExtractCom( m_pGenPo->setExtractCom(
( !rHelpText.isEmpty() ? rHelpText + "\n" : OString( "" )) + ( !rHelpText.isEmpty() ? rHelpText + "\n" : OString( "" )) +
lcl_GenKeyId( lcl_GenKeyId(
m_pGenPo->getReference() + sMsgCtxt + m_pGenPo->getMsgId() ) ); m_pGenPo->getReference() + sMsgCtxt + m_pGenPo->getMsgId() ) );
m_bIsInitialized = true; m_bIsInitialized = true;
} }
//Destructor //Destructor
...@@ -468,35 +414,15 @@ OString PoEntry::getKeyId() const ...@@ -468,35 +414,15 @@ OString PoEntry::getKeyId() const
OString PoEntry::getMsgId() const OString PoEntry::getMsgId() const
{ {
assert( m_bIsInitialized ); assert( m_bIsInitialized );
return return m_pGenPo->getMsgId();
lcl_EscapeMergeText(
m_pGenPo->getMsgId(), getSourceFile().endsWith(".xhp") );
} }
//Get translated string in merge format //Get translated string in merge format
OString PoEntry::getMsgStr() const OString PoEntry::getMsgStr() const
{ {
assert( m_bIsInitialized ); assert( m_bIsInitialized );
return return m_pGenPo->getMsgStr();
lcl_EscapeMergeText(
m_pGenPo->getMsgStr(), getSourceFile().endsWith(".xhp") );
}
//Set translated string when input is in merge format
void PoEntry::setMsgStr(const OString& rMsgStr)
{
assert( m_bIsInitialized );
m_pGenPo->setMsgStr(
lcl_UnEscapeMergeText(
rMsgStr,getSourceFile().endsWith(".xhp")));
}
//Set fuzzy flag
void PoEntry::setFuzzy(const bool bFuzzy)
{
assert( m_bIsInitialized );
m_pGenPo->setFuzzy(bFuzzy);
} }
//Check whether po-s belong to the same localization component //Check whether po-s belong to the same localization component
......
...@@ -70,11 +70,12 @@ void StringParser::Extract( const OString& rPOFile ) ...@@ -70,11 +70,12 @@ void StringParser::Extract( const OString& rPOFile )
{ {
xmlChar* pID = xmlGetProp(pCurrent, (const xmlChar*)("name")); xmlChar* pID = xmlGetProp(pCurrent, (const xmlChar*)("name"));
xmlChar* pText = xmlNodeGetContent(pCurrent); xmlChar* pText = xmlNodeGetContent(pCurrent);
const OString sTemp =
helper::unEscapeAll(helper::xmlStrToOString( pText ),"\\n""\\t","\n""\t");
common::writePoEntry( common::writePoEntry(
"Stringex", aPOStream, m_pSource->name, "string", "Stringex", aPOStream, m_pSource->name, "string",
helper::xmlStrToOString( pID ), OString(), OString(), helper::xmlStrToOString( pID ), OString(), OString(),
helper::xmlStrToOString( pText )); sTemp);
xmlFree( pID ); xmlFree( pID );
xmlFree( pText ); xmlFree( pText );
...@@ -131,7 +132,7 @@ void StringParser::Merge( ...@@ -131,7 +132,7 @@ void StringParser::Merge(
{ {
OString sNewText; OString sNewText;
pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang ); pEntrys->GetText( sNewText, STRING_TYP_TEXT, m_sLang );
sNewText = sNewText.replaceAll("\'","\\\'").replaceAll("\"","\\\""); sNewText = helper::escapeAll(sNewText, "\n""\t""\'""\"","\\n""\\t""\\\'""\\\"");
xmlNodeSetContent( xmlNodeSetContent(
pCurrent, pCurrent,
xmlEncodeSpecialChars( NULL, xmlEncodeSpecialChars( NULL,
......
...@@ -313,20 +313,6 @@ void XRMResParser::Error( const OString &rError ) ...@@ -313,20 +313,6 @@ void XRMResParser::Error( const OString &rError )
yyerror(( char * ) rError.getStr()); yyerror(( char * ) rError.getStr());
} }
/*****************************************************************************/
void XRMResParser::ConvertStringToDBFormat( OString &rString )
/*****************************************************************************/
{
rString = rString.trim().replaceAll("\t", "\\t");
}
/*****************************************************************************/
void XRMResParser::ConvertStringToXMLFormat( OString &rString )
/*****************************************************************************/
{
rString = rString.replaceAll("\\t", "\t");
}
// //
// class XMLResExport // class XMLResExport
// //
...@@ -377,7 +363,7 @@ void XRMResExport::WorkOnDesc( ...@@ -377,7 +363,7 @@ void XRMResExport::WorkOnDesc(
file.read (memblock, size); file.read (memblock, size);
file.close(); file.close();
memblock[size] = '\0'; memblock[size] = '\0';
rText = OString(memblock).replaceAll("\n", "\\n"); rText = OString(memblock);
delete[] memblock; delete[] memblock;
} }
WorkOnText( rOpenTag, rText ); WorkOnText( rOpenTag, rText );
...@@ -395,13 +381,9 @@ void XRMResExport::WorkOnText( ...@@ -395,13 +381,9 @@ void XRMResExport::WorkOnText(
if ( !pResData ) if ( !pResData )
{ {
OString sPlatform( "" ); pResData = new ResData( OString(), GetGID() );
pResData = new ResData( sPlatform, GetGID() );
} }
pResData->sText[sLang] = rText;
OString sText(rText);
ConvertStringToDBFormat(sText);
pResData->sText[sLang] = sText;
} }
/*****************************************************************************/ /*****************************************************************************/
...@@ -418,8 +400,7 @@ void XRMResExport::EndOfText( ...@@ -418,8 +400,7 @@ void XRMResExport::EndOfText(
{ {
sCur = aLanguages[ n ]; sCur = aLanguages[ n ];
OString sAct( OString sAct = pResData->sText[sCur];
pResData->sText[sCur].replaceAll("\x0A", OString()));
if( !sAct.isEmpty() ) if( !sAct.isEmpty() )
common::writePoEntry( common::writePoEntry(
...@@ -528,7 +509,6 @@ void XRMResMerge::WorkOnDesc( ...@@ -528,7 +509,6 @@ void XRMResMerge::WorkOnDesc(
} }
OString sOutputDescFile( OString sOutputDescFile(
sOutputFile.copy(0, i + 1) + sLocDescFilename); sOutputFile.copy(0, i + 1) + sLocDescFilename);
sText = sText.replaceAll("\\n", "\n");
ofstream file(sOutputDescFile.getStr()); ofstream file(sOutputDescFile.getStr());
if (file.is_open()) { if (file.is_open()) {
file << sText.getStr(); file << sText.getStr();
...@@ -573,7 +553,6 @@ void XRMResMerge::WorkOnText( ...@@ -573,7 +553,6 @@ void XRMResMerge::WorkOnText(
helper::isWellFormedXML( sContent )) helper::isWellFormedXML( sContent ))
{ {
rText = sContent; rText = sContent;
ConvertStringToXMLFormat( rText );
} }
} }
} }
......
...@@ -2,9 +2,6 @@ Application::PostZoomEvent(unsigned long, Window*, ZoomEvent*) ...@@ -2,9 +2,6 @@ Application::PostZoomEvent(unsigned long, Window*, ZoomEvent*)
EditTextObjectImpl::SetParaAttribs(unsigned long, SfxItemSet const&) EditTextObjectImpl::SetParaAttribs(unsigned long, SfxItemSet const&)
FontSelectPatternAttributes::FontSelectPatternAttributes(PhysicalFontFace const&, Size const&, float, int, bool) FontSelectPatternAttributes::FontSelectPatternAttributes(PhysicalFontFace const&, Size const&, float, int, bool)
LanguageTag::reset(_rtl_Locale const&) LanguageTag::reset(_rtl_Locale const&)
PoEntry::setFuzzy(bool)
PoEntry::setMsgStr(rtl::OString const&)
PoHeader::PoHeader(std::basic_ifstream<char, std::char_traits<char> >&)
ScConditionalFormat::dumpInfo(rtl::OUStringBuffer&) const ScConditionalFormat::dumpInfo(rtl::OUStringBuffer&) const
ScDocument::GetEditText(ScAddress const&) const ScDocument::GetEditText(ScAddress const&) const
ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent() ScVbaFormat<ooo::vba::excel::XStyle>::getAddIndent()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment