[Libreoffice-commits] .: Branch 'feature/killsdf' - l10ntools/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Wed Oct 3 10:00:46 PDT 2012
l10ntools/source/lngmerge.cxx | 19 +++++++++++--------
1 file changed, 11 insertions(+), 8 deletions(-)
New commits:
commit 85c93d57c46d02c66b6e604feb867d3ae1abac4e
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
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;
+ }
}
}
More information about the Libreoffice-commits
mailing list