From 6bc720cedbcfb5ccc3f6d8bb5abc987db8445467 Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Tue, 3 May 2016 11:07:07 +0000 Subject: genlang .xcu dot handling and level func for .src .xcu stores a '.' between keys and keys with no name count .src has commands without name (identifier used instead) Change-Id: I135c5f5594c429ebc1b278dbb7d5709b7b8ca119 --- l10ntools/inc/gConvSrc.hxx | 2 +- l10ntools/source/gConvSrc.cxx | 6 ++++-- l10ntools/source/gConvXcu.cxx | 1 - l10ntools/source/gLexSrc.l | 4 ++-- l10ntools/source/gLexXcu.l | 3 ++- 5 files changed, 9 insertions(+), 7 deletions(-) (limited to 'l10ntools') diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx index 605fffb95d4b..0710f134d69a 100644 --- a/l10ntools/inc/gConvSrc.hxx +++ b/l10ntools/inc/gConvSrc.hxx @@ -35,7 +35,7 @@ class convert_src : public convert_gen void setValue(string& syyText); bool setLang(string& syyText); - void setName(string& syyText); + void setName(string& syyText, bool revertLevel); void setCmd(string& syyText); void startBlock(); void stopBlock(); diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx index 213a3d25434c..d7b57d69d07b 100644 --- a/l10ntools/source/gConvSrc.cxx +++ b/l10ntools/source/gConvSrc.cxx @@ -60,7 +60,7 @@ void convert_src::setValue(string& syyText) { cout << "test value\n"; for (int i = 0; i < stackSize; i++) - cout << mcStack[i] << "\n"; + cout << i << ") " << mcStack[i] << "\n"; } string subid = (stackSize > 3) ? mcStack[stackSize - 1] : ""; string stringid = mcStack[stackSize - 2]; @@ -82,8 +82,10 @@ bool convert_src::setLang(string& syyText) -void convert_src::setName(string& syyText) +void convert_src::setName(string& syyText, bool revertLevel) { + if (revertLevel) + mcStack.pop_back(); mcStack.push_back(syyText); } diff --git a/l10ntools/source/gConvXcu.cxx b/l10ntools/source/gConvXcu.cxx index 10653bc379d1..0352e988a470 100644 --- a/l10ntools/source/gConvXcu.cxx +++ b/l10ntools/source/gConvXcu.cxx @@ -125,7 +125,6 @@ void convert_xcu::stopCollectData(char *syyText) if (useText.size()) { // locate key and extract it - useKey = "."; for (nL = 0; nL < (int)mcStack.size() -1; ++nL) useKey += "." + mcStack[nL]; mcMemory.setSourceKey(miLineNo, msSourceFile, useKey, useText, "", "value", mcStack[nL], mbMergeMode); diff --git a/l10ntools/source/gLexSrc.l b/l10ntools/source/gLexSrc.l index a4bf5a7a73bf..f2cedf4e70d6 100644 --- a/l10ntools/source/gLexSrc.l +++ b/l10ntools/source/gLexSrc.l @@ -98,7 +98,7 @@ f {IDENT} { - LOCptr->setName(LOCptr->copySource(yytext)); + LOCptr->setName(LOCptr->copySource(yytext), true); BEGIN(INITIAL); } @@ -178,7 +178,7 @@ f {IDENT} { - LOCptr->setName(LOCptr->copySource(yytext)); + LOCptr->setName(LOCptr->copySource(yytext),false); BEGIN(INITIAL); } diff --git a/l10ntools/source/gLexXcu.l b/l10ntools/source/gLexXcu.l index fb3e1872f319..8cc02c49028b 100644 --- a/l10ntools/source/gLexXcu.l +++ b/l10ntools/source/gLexXcu.l @@ -49,7 +49,8 @@ FIN [^/>]*">" "component-data" { LOCptr->addLevel(); - LOCptr->copySource(yytext, false); + LOCptr->pushKey(""); +// LOCptr->copySource(yytext, false); } -- cgit