summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZolnai Tamás <zolnaitamas2000@gmail.com>2013-03-31 22:10:05 +0200
committerZolnai Tamás <zolnaitamas2000@gmail.com>2013-03-31 22:10:55 +0200
commitc4745302f3bf6e9d4f94033391979deb8437c788 (patch)
tree75e0092795d16f5402dc1cb636f16b70c725d83e
parentd7a301476dfbec6a70e45808602838078bad780a (diff)
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
-rw-r--r--l10ntools/source/cfgmerge.cxx59
-rw-r--r--l10ntools/source/helper.cxx3
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("&lt;");
- break;
-
- case '>':
- sReturn.append("&gt;");
- break;
-
- case '\"':
- sReturn.append("&quot;");
- break;
-
- case '\'':
- sReturn.append("&apos;");
- break;
-
- case '&':
- if ((( i + 4 ) < rString.getLength()) &&
- ( rString.copy( i, 5 ) == "&amp;" ))
- sReturn.append(rString[i]);
- else
- sReturn.append("&amp;");
- 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("&quot;");
break;
+ case '\'':
+ sReturn.append("&apos;");
+ break;
case '&':
if (rString.match("&amp;", i))
sReturn.append('&');