Author: jani
Date: Sun Mar 17 12:15:11 2013
New Revision: 1457433
URL: http://svn.apache.org/r1457433
Log:
corrected convert problem and build problem
Modified:
openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gConPolex.l
openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx
Modified: openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx?rev=1457433&r1=1457432&r2=1457433&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConPoWrap.cxx Sun Mar 17
12:15:11 2013
@@ -223,25 +223,12 @@ void convert_po::save(const std::string&
bool bFuzzy)
{
std::ostream outFile(&outBuffer);
- std::string newText(sText), newENUStext(sENUStext);
- int i;
- for (i = 0; (i = newText.find("\"", i)) != (int)std::string::npos;)
- {
- newText.insert(i, "\\");
- i += 2;
- }
- for (i = 0; (i = newENUStext.find("\"", i)) != (int)std::string::npos;)
- {
- newENUStext.insert(i, "\\");
- i += 2;
- }
-
outFile << std::endl << "#: " << sFileName << "#" << sKey << std::endl;
if (bFuzzy)
outFile << "#, fuzzy" << std::endl;
- outFile << "msgid \"" << newENUStext << "\"" << std::endl
- << "msgstr \"" << newText << "\"" << std::endl;
+ outFile << "msgid \"" << sENUStext << "\"" << std::endl
+ << "msgstr \"" << sText << "\"" << std::endl;
}
Modified: openoffice/branches/l10n/main/l10ntools/source/gConPolex.l
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConPolex.l?rev=1457433&r1=1457432&r2=1457433&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConPolex.l (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConPolex.l Sun Mar 17
12:15:11 2013
@@ -85,11 +85,7 @@ SPACE [ \t]*
// build current "..."
for (; (buildValue[++j] = yytext[++i] = yyinput()) != '\"';)
if (yytext[i] == '\\')
- {
- if ( (yytext[++i] = yyinput()) != '\"')
- ++j;
- buildValue[j] = yytext[i];
- }
+ buildValue[++j] = yytext[++i] = yyinput();
--j;
if (!LOCptr->mbExpectId && !LOCptr->mbExpectStr)
Modified: openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx?rev=1457433&r1=1457432&r2=1457433&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gConXcuWrap.cxx Sun Mar 17
12:15:11 2013
@@ -150,7 +150,6 @@ void convert_xcu::stopCollectData(char *
// locate key and extract it
for (nL = 0; nL < (int)mcStack.size(); ++nL)
useKey += (useKey.size() ? "." : "" ) + mcStack[nL];
- useKey.insert(0, miLevel, '.');
if (mbMergeMode)
{
Modified: openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx
URL:
http://svn.apache.org/viewvc/openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx?rev=1457433&r1=1457432&r2=1457433&view=diff
==============================================================================
--- openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx (original)
+++ openoffice/branches/l10n/main/l10ntools/source/gL10nMem.cxx Sun Mar 17
12:15:11 2013
@@ -185,15 +185,27 @@ void l10nMem_impl::setSourceKey(int
const std::string& sKey,
const std::string& sText)
{
+ std::string newText(sText);
+ int i;
+
+
+ // time to escape " if contained in text or key
+ for (i = 0; (i = newText.find("\"", i)) != (int)std::string::npos;)
+ {
+ if (!i || newText[i-1] != '\\' || (newText[i-1] == '\\' && newText[i-2]
== '\\'))
+ newText.insert(i++, "\\");
+ i++;
+ }
+
// if key exist update state
- if (mcDb.locateKey(iLineNo, sSourceFile, sKey, sText, false))
+ if (mcDb.locateKey(iLineNo, sSourceFile, sKey, newText, false))
{
mcDb.mcENUSlist[mcDb.miCurENUSinx].meState = l10nMem::ENTRY_NORMAL;
}
else
{
// add key, if changed text, this is wrong but handled in reorganize
- mcDb.addKey(iLineNo, sSourceFile, sKey, sText, l10nMem::ENTRY_ADDED);
+ mcDb.addKey(iLineNo, sSourceFile, sKey, newText, l10nMem::ENTRY_ADDED);
}
}
@@ -244,7 +256,7 @@ void l10nMem_impl::save(l10nMem& cMem, c
{
l10nMem_enus_entry& cE = mcDb.mcENUSlist[iE];
l10nMem_lang_entry& cL = cE.mcLangList[iL];
- bool bF = cL.mbFuzzy || (cE.meState ==
l10nMem::ENTRY_CHANGED);
+ bool bF = cL.mbFuzzy;
// remove deleted entries
if (cE.meState == l10nMem::ENTRY_DELETED)