diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-03-31 22:10:05 +0200 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-03-31 22:10:55 +0200 |
commit | c4745302f3bf6e9d4f94033391979deb8437c788 (patch) | |
tree | 75e0092795d16f5402dc1cb636f16b70c725d83e /l10ntools | |
parent | Remove commented code in odk/examples (diff) | |
download | core-c4745302f3bf6e9d4f94033391979deb8437c788.tar.gz core-c4745302f3bf6e9d4f94033391979deb8437c788.zip |
There is no <Arg> tag in xcu localizable strings
So no reason to work with it.
So can use helper function after
make it to handle single quote.
Change-Id: Ic2eb901148c3ae31316607b41350bbad79a639db
Diffstat (limited to 'l10ntools')
-rw-r--r-- | l10ntools/source/cfgmerge.cxx | 59 | ||||
-rw-r--r-- | l10ntools/source/helper.cxx | 3 |
2 files changed, 5 insertions, 57 deletions
diff --git a/l10ntools/source/cfgmerge.cxx b/l10ntools/source/cfgmerge.cxx index fd9474a184ce..0aa53f875c25 100644 --- a/l10ntools/source/cfgmerge.cxx +++ b/l10ntools/source/cfgmerge.cxx @@ -84,61 +84,6 @@ void workOnTokenSet(int nTyp, char * pTokenText) { } -namespace -{ - -static OString lcl_QuoteHTML( const OString& rString ) -{ - rtl::OStringBuffer sReturn; - for ( sal_Int32 i = 0; i < rString.getLength(); i++ ) { - rtl::OString sTemp = rString.copy( i ); - if ( sTemp.match( "<Arg n=" ) ) { - while ( i < rString.getLength() && rString[i] != '>' ) { - sReturn.append(rString[i]); - i++; - } - if ( rString[i] == '>' ) { - sReturn.append('>'); - i++; - } - } - if ( i < rString.getLength()) { - switch ( rString[i]) { - case '<': - sReturn.append("<"); - break; - - case '>': - sReturn.append(">"); - break; - - case '\"': - sReturn.append("""); - break; - - case '\'': - sReturn.append("'"); - break; - - case '&': - if ((( i + 4 ) < rString.getLength()) && - ( rString.copy( i, 5 ) == "&" )) - sReturn.append(rString[i]); - else - sReturn.append("&"); - break; - - default: - sReturn.append(rString[i]); - break; - } - } - } - return sReturn.makeStringAndClear(); -} - -} // anonymous namespace - // // class CfgStackData // @@ -558,7 +503,7 @@ void CfgMerge::WorkOnText(rtl::OString &rText, const rtl::OString& rLangIndex) if ( !rLangIndex.equalsIgnoreAsciiCase("en-US") && ( sContent != "-" ) && !sContent.isEmpty()) { - rText = lcl_QuoteHTML( rText ); + rText = helper::QuotHTML( rText ); } } } @@ -590,7 +535,7 @@ void CfgMerge::WorkOnResourceEnd() ( sContent != "-" ) && !sContent.isEmpty()) { - rtl::OString sText = lcl_QuoteHTML( sContent); + rtl::OString sText = helper::QuotHTML( sContent); rtl::OString sAdditionalLine( "\t" ); diff --git a/l10ntools/source/helper.cxx b/l10ntools/source/helper.cxx index 08a256013bcd..69163d0e38ae 100644 --- a/l10ntools/source/helper.cxx +++ b/l10ntools/source/helper.cxx @@ -27,6 +27,9 @@ OString QuotHTML(const OString &rString) case '"': sReturn.append("""); break; + case '\'': + sReturn.append("'"); + break; case '&': if (rString.match("&", i)) sReturn.append('&'); |