summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorjan iversen <jani@documentfoundation.org>2016-04-04 19:37:01 +0200
committerjan iversen <jani@documentfoundation.org>2016-04-04 19:37:01 +0200
commit2ef9d5de7df7b38e091af7bd7276e68812493cc0 (patch)
tree2e87eee8dde58034985a96ff2004fed934ec8e01 /l10ntools
parent3ada44f631490f8910ce0bcf55353f70d7d0df6d (diff)
genlang, update to satisfy clang.
changes due a log from clang tinderbox. minor changes to interpret more files Change-Id: I3821aab91dc21e74c870628a4f2265ab61d37cca
Diffstat (limited to 'l10ntools')
-rw-r--r--l10ntools/inc/gConv.hxx2
-rw-r--r--l10ntools/inc/gConvPo.hxx1
-rw-r--r--l10ntools/inc/gConvSrc.hxx3
-rw-r--r--l10ntools/inc/gL10nMem.hxx7
-rw-r--r--l10ntools/source/export.cxx4
-rw-r--r--l10ntools/source/gConv.cxx2
-rw-r--r--l10ntools/source/gConvPo.cxx17
-rw-r--r--l10ntools/source/gConvSrc.cxx21
-rw-r--r--l10ntools/source/gConvTree.cxx6
-rw-r--r--l10ntools/source/gConvUlf.cxx2
-rw-r--r--l10ntools/source/gConvXcs.cxx2
-rw-r--r--l10ntools/source/gConvXcu.cxx6
-rw-r--r--l10ntools/source/gConvXhp.cxx4
-rw-r--r--l10ntools/source/gConvXrm.cxx2
-rwxr-xr-xl10ntools/source/gDiff.sh9
-rw-r--r--l10ntools/source/gL10nMem.cxx26
-rw-r--r--l10ntools/source/gLang.cxx22
-rw-r--r--l10ntools/source/gTest.sh6
-rw-r--r--l10ntools/source/lngmerge.cxx2
-rw-r--r--l10ntools/source/merge.cxx4
-rw-r--r--l10ntools/source/po.cxx8
-rw-r--r--l10ntools/source/treemerge.cxx6
-rw-r--r--l10ntools/source/xmlparse.cxx6
23 files changed, 104 insertions, 64 deletions
diff --git a/l10ntools/inc/gConv.hxx b/l10ntools/inc/gConv.hxx
index 3b5c1d12a120..a32291272278 100644
--- a/l10ntools/inc/gConv.hxx
+++ b/l10ntools/inc/gConv.hxx
@@ -63,7 +63,7 @@ class convert_gen
// utility functions for converters
void writeSourceFile(const string& line);
- bool createDir(const string& sDir, const string& sFile);
+ static bool createDir(const string& sDir, const string& sFile);
private:
ofstream mcOutputFile;
static bool checkAccess(string& sFile);
diff --git a/l10ntools/inc/gConvPo.hxx b/l10ntools/inc/gConvPo.hxx
index 53257c2393e0..ebf1ee3f29ea 100644
--- a/l10ntools/inc/gConvPo.hxx
+++ b/l10ntools/inc/gConvPo.hxx
@@ -54,6 +54,7 @@ class convert_po : public convert_gen
const string& sText,
const string& sComment,
const string& sResource,
+ const string& sGroup,
bool bFuzzy);
void endSave();
diff --git a/l10ntools/inc/gConvSrc.hxx b/l10ntools/inc/gConvSrc.hxx
index 4aaa8bf55b29..3f3f9a242019 100644
--- a/l10ntools/inc/gConvSrc.hxx
+++ b/l10ntools/inc/gConvSrc.hxx
@@ -52,6 +52,7 @@ class convert_src : public convert_gen
string msName;
string msTextName;
string msCmd;
+ string msGroup;
bool mbEnUs;
bool mbExpectName;
bool mbExpectMacro;
@@ -62,7 +63,7 @@ class convert_src : public convert_gen
int miListCount;
int miMacroLevel;
void doExecute() override;
- void trim(string& sText);
+ static void trim(string& sText);
void buildKey(string& sKey);
void insertLanguagePart(string& sKey, string& sTextType);
};
diff --git a/l10ntools/inc/gL10nMem.hxx b/l10ntools/inc/gL10nMem.hxx
index f2c116c36150..c657c8225b2c 100644
--- a/l10ntools/inc/gL10nMem.hxx
+++ b/l10ntools/inc/gL10nMem.hxx
@@ -57,6 +57,7 @@ class l10nMem
const string& sText,
const string& sComment,
const string& sResource,
+ const string& sGroup,
bool bIsFuzzy);
void setSourceKey(int iLineNo,
const string& sFilename,
@@ -64,6 +65,7 @@ class l10nMem
const string& sText,
const string& sComment,
const string& sResource,
+ const string& sGroup,
bool bMustExist);
void saveTemplates(const string& sTargetDir,
@@ -88,7 +90,6 @@ class l10nMem
int miCurFileInx;
int miCurLangInx;
int miCurENUSinx;
- bool mbNeedWrite;
bool mbConvertMode;
bool mbStrictMode;
vector<l10nMem_enus_entry> mcENUSlist;
@@ -111,7 +112,8 @@ class l10nMem
const string& sKey,
const string& sMsgId,
const string& sComment,
- const string& sResource);
+ const string& sResource,
+ const string& sGroup);
void loadLangKey(int iLineNo,
const string& sSourceFile,
const string& sKey,
@@ -130,6 +132,7 @@ class l10nMem
const string& sMsgId,
const string& sComment,
const string& sResource,
+ const string& sGroup,
l10nMem::ENTRY_STATE eStat);
bool findFileName(const string& sSourceFile);
};
diff --git a/l10ntools/source/export.cxx b/l10ntools/source/export.cxx
index d8dbaaea2e8d..26b3fe511cef 100644
--- a/l10ntools/source/export.cxx
+++ b/l10ntools/source/export.cxx
@@ -48,7 +48,7 @@ std::unique_ptr< Export > exporter;
}
-OString lcl_GetListTyp( const sal_uInt16 nTyp, const bool bUpperCamelCase )
+static OString lcl_GetListTyp( const sal_uInt16 nTyp, const bool bUpperCamelCase )
{
OString sType;
switch (nTyp)
@@ -176,7 +176,7 @@ bool ResData::SetId( const OString& rId, sal_uInt16 nLevel )
namespace
{
-sal_Int32 lcl_countOccurrences(const OString& text, char c)
+static sal_Int32 lcl_countOccurrences(const OString& text, char c)
{
sal_Int32 n = 0;
for (sal_Int32 i = 0;; ++i) {
diff --git a/l10ntools/source/gConv.cxx b/l10ntools/source/gConv.cxx
index 39f08259ad87..41870a225bc5 100644
--- a/l10ntools/source/gConv.cxx
+++ b/l10ntools/source/gConv.cxx
@@ -178,7 +178,7 @@ bool convert_gen::prepareFile()
if (mcOutputFile.is_open())
return true;
- if (convert_gen::createDir(msTargetPath, msSourceFile)) {
+ if (createDir(msTargetPath, msSourceFile)) {
mcOutputFile.open((msTargetPath+msSourceFile).c_str(), ios::binary);
if (mcOutputFile.is_open())
return true;
diff --git a/l10ntools/source/gConvPo.cxx b/l10ntools/source/gConvPo.cxx
index 1483d099aae4..29cb2fe4acfc 100644
--- a/l10ntools/source/gConvPo.cxx
+++ b/l10ntools/source/gConvPo.cxx
@@ -67,7 +67,7 @@ void convert_po::startLook()
// load in db
if (msId.size())
- mcMemory.loadEntryKey(miLineNo, sFileName, sNewKey, msId, msStr, "", "", mbFuzzy);
+ mcMemory.loadEntryKey(miLineNo, sFileName, sNewKey, msId, msStr, "", "", "", mbFuzzy);
// and prepare for new entry
msKey.clear();
@@ -178,9 +178,9 @@ void convert_po::startSave(const string& sName,
<< "msgstr \"\"" << endl
<< "\"Project-Id-Version: PACKAGE VERSION\\n\"" << endl
<< "\"Report-Msgid-Bugs-To: "
- << "https://bugs.libreoffice.org/enter_bug.cgi?"
- << "product=LibreOffice&bug_status=UNCONFIRMED"
- << "&component=UI\\n\"" << endl
+ "https://bugs.libreoffice.org/enter_bug.cgi?"
+ "product=LibreOffice&bug_status=UNCONFIRMED"
+ "&component=UI\\n\"" << endl
<< "\"POT-Creation-Date: "
<< std::put_time(&tm, "%Y-%m-%d %H:%M%z") << "\\n\"" << endl
<< "\"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\\n\"" << endl
@@ -201,6 +201,7 @@ void convert_po::save(const string& sFileName,
const string& sText,
const string& sComment,
const string& sResource,
+ const string& sGroup,
bool bFuzzy)
{
string sName;
@@ -211,14 +212,16 @@ void convert_po::save(const string& sFileName,
newPos = sFileName.find_last_of("/\\", sFileName.length());
sName = sFileName.substr(newPos + 1, sFileName.length());
- outFile << endl << "#. " << genKeyId(sName + sKey + sResource + sENUStext) << endl;
+ outFile << endl << "#. " << genKeyId(sName + sKey + sGroup + sResource + sENUStext) << endl;
if (sComment.length())
outFile << "#. " << sComment << endl;
outFile << "#: " << sName << endl
<< "msgctxt \"\"" << endl
<< "\"" << sName << "\\n\"" << endl
- << "\"" << sKey << "\\n\"" << endl
- << "\"" << sResource << ".text\"" << endl;
+ << "\"" << sKey << "\\n\"" << endl;
+ if (sGroup.length())
+ outFile << "\"" << sGroup << "\\n\"" << endl;
+ outFile << "\"" << sResource << ".text\"" << endl;
if (bFuzzy)
outFile << "#, fuzzy" << endl;
outFile << "msgid \"" << sENUStext << "\"" << endl
diff --git a/l10ntools/source/gConvSrc.cxx b/l10ntools/source/gConvSrc.cxx
index cc53ea8ea046..1ce32ad57d24 100644
--- a/l10ntools/source/gConvSrc.cxx
+++ b/l10ntools/source/gConvSrc.cxx
@@ -59,6 +59,8 @@ void convert_src::setValue(char *syyText, char *sbuildValue)
setListItem("", false);
}
msValue = sbuildValue;
+ if (mbInListItem)
+ msGroup = msValue;
mbValuePresent = true;
mbExpectValue = false;
}
@@ -102,8 +104,12 @@ void convert_src::setName(char *syyText)
trim(useText);
if (mbExpectName) {
mbExpectName = false;
- if (!mbAutoPush)
- msName = useText;
+ if (!mbAutoPush) {
+ if (msName.length())
+ msGroup = useText;
+ else
+ msName = useText;
+ }
else {
mbAutoPush = false;
if (mcStack.size())
@@ -145,6 +151,7 @@ void convert_src::setList(char *syyText)
miListCount = 0;
mbInList = true;
trim(msCmd);
+ l10nMem::keyToLower(msCmd);
}
@@ -158,7 +165,7 @@ void convert_src::setNL(char *syyText, bool bMacro)
if (msTextName.size() && mbValuePresent && mbEnUs) {
// locate key and extract it
- buildKey(x);
+ buildKey(sKey);
for (nL = -1;;) {
nL = msValue.find("\\\"", nL+1);
@@ -175,10 +182,11 @@ void convert_src::setNL(char *syyText, bool bMacro)
//FIX sKey += "." + msCmd + "." + msTextName;
if (msValue.size() && msValue != "-") {
- mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, msValue, "", msCmd, mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, msValue, "", msCmd, msGroup, mbMergeMode);
if (mbMergeMode)
insertLanguagePart(sKey, msTextName);
}
+ msGroup.clear();
}
if (!bMacro && mbExpectMacro) {
@@ -202,7 +210,6 @@ void convert_src::startBlock(char *syyText)
copySource(syyText);
mcStack.push_back(msName);
- msName.clear();
}
@@ -217,6 +224,7 @@ void convert_src::stopBlock(char *syyText)
mbInList =
mbEnUs = false;
+ msName.clear();
}
@@ -285,6 +293,9 @@ void convert_src::buildKey(string& sKey)
for (nL = 0; nL < (int)mcStack.size(); ++nL)
if (mcStack[nL].size())
sKey += (sKey.size() ? "." : "") + mcStack[nL];
+
+ // FIX jan
+ sKey = mcStack[0];
}
diff --git a/l10ntools/source/gConvTree.cxx b/l10ntools/source/gConvTree.cxx
index b15d4b022f94..f13d2e7a5aef 100644
--- a/l10ntools/source/gConvTree.cxx
+++ b/l10ntools/source/gConvTree.cxx
@@ -67,7 +67,7 @@ void convert_tree::doExecute()
sFile = msTargetPath + sFile2;
mcOutputFiles[i].open(sFile.c_str(), ios::binary);
if (!mcOutputFiles[i].is_open()) {
- if (!convert_gen::createDir(msTargetPath, sFile2))
+ if (!createDir(msTargetPath, sFile2))
throw l10nMem::showError("Cannot create missing directories (" + sFile + ") for writing");
mcOutputFiles[i].open(sFile.c_str(), ios::binary);
@@ -105,7 +105,7 @@ void convert_tree::setString(char *yytext)
case STATE_VAL_TITLE:
string sText = copySourceSpecial(yytext, 1);
sText.erase(sText.size()-1);
- mcMemory.setSourceKey(miLineNo, msSourceFile, msId, sText, "", "", mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msId, sText, "", "", "", mbMergeMode);
break;
}
meStateVal = STATE_VAL_NONE;
@@ -127,7 +127,7 @@ void convert_tree::setState(char *yytext, STATE_TAG eNewStateTag, STATE_VAL eNew
void convert_tree::setValue(char *yytext)
{
- mcMemory.setSourceKey(miLineNo, msSourceFile, msId, msCollector, "", msModule, mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msId, msCollector, "", msModule, "", mbMergeMode);
copySourceSpecial(yytext, 2);
meStateTag = STATE_TAG_NONE;
diff --git a/l10ntools/source/gConvUlf.cxx b/l10ntools/source/gConvUlf.cxx
index 3cd675a879e6..5b71c77c30b7 100644
--- a/l10ntools/source/gConvUlf.cxx
+++ b/l10ntools/source/gConvUlf.cxx
@@ -62,7 +62,7 @@ void convert_ulf::setValue(char *syyText)
nL = sText.rfind("\"");
sText.erase(nL);
- mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText, "", "", mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText, "", "", "", mbMergeMode);
if (mbMergeMode) {
// prepare to read all languages
diff --git a/l10ntools/source/gConvXcs.cxx b/l10ntools/source/gConvXcs.cxx
index c00f23f9fde9..f82c35416479 100644
--- a/l10ntools/source/gConvXcs.cxx
+++ b/l10ntools/source/gConvXcs.cxx
@@ -123,6 +123,6 @@ void convert_xcs::stopCollectData(char *syyText)
#endif
}
- mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, sText, "", "", mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, sKey, sText, "", "", "", mbMergeMode);
mbCollectingData = false;
}
diff --git a/l10ntools/source/gConvXcu.cxx b/l10ntools/source/gConvXcu.cxx
index 3bc2cd074bde..0352e988a470 100644
--- a/l10ntools/source/gConvXcu.cxx
+++ b/l10ntools/source/gConvXcu.cxx
@@ -125,9 +125,9 @@ void convert_xcu::stopCollectData(char *syyText)
if (useText.size()) {
// locate key and extract it
- for (nL = 0; nL < (int)mcStack.size(); ++nL)
- useKey += (useKey.size() ? "." : "" ) + mcStack[nL];
- mcMemory.setSourceKey(miLineNo, msSourceFile, useKey, useText, "", "", mbMergeMode);
+ for (nL = 0; nL < (int)mcStack.size() -1; ++nL)
+ useKey += "." + mcStack[nL];
+ mcMemory.setSourceKey(miLineNo, msSourceFile, useKey, useText, "", "value", mcStack[nL], mbMergeMode);
}
if (mbMergeMode) {
diff --git a/l10ntools/source/gConvXhp.cxx b/l10ntools/source/gConvXhp.cxx
index 9c07772f0b38..6f7cdb7f2a20 100644
--- a/l10ntools/source/gConvXhp.cxx
+++ b/l10ntools/source/gConvXhp.cxx
@@ -67,7 +67,7 @@ void convert_xhp::doExecute()
sFile = msTargetPath + sFile2;
mcOutputFiles[i].open(sFile.c_str(), ios::binary);
if (!mcOutputFiles[i].is_open()) {
- if (!convert_gen::createDir(msTargetPath, sFile2))
+ if (!createDir(msTargetPath, sFile2))
throw l10nMem::showError("Cannot create missing directories (" + sFile + ") for writing");
mcOutputFiles[i].open(sFile.c_str(), ios::binary);
@@ -251,7 +251,7 @@ void convert_xhp::closeTransTag(char *yytext)
string newString(msCollector);
if (newString[newString.length() - 1] == ' ')
newString = newString.substr(0, newString.length() - 1);
- mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, newString, "", "help", mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, newString, "", "help", "", mbMergeMode);
}
msKey.clear();
iType = 2;
diff --git a/l10ntools/source/gConvXrm.cxx b/l10ntools/source/gConvXrm.cxx
index c1ff12811862..1dcc558198f3 100644
--- a/l10ntools/source/gConvXrm.cxx
+++ b/l10ntools/source/gConvXrm.cxx
@@ -116,7 +116,7 @@ void convert_xrm::stopCollectData(char *yytext)
copySource(yytext);
if (!mbNoCollectingData) {
- mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText, "", "readmeitem", mbMergeMode);
+ mcMemory.setSourceKey(miLineNo, msSourceFile, msKey, sText, "", "readmeitem", "", mbMergeMode);
mbNoCollectingData = true;
if (mbMergeMode) {
sTagEnd = "</" + msTag.substr(1,msTag.size()-2) + ">\n";
diff --git a/l10ntools/source/gDiff.sh b/l10ntools/source/gDiff.sh
new file mode 100755
index 000000000000..56c0dbd4e0e2
--- /dev/null
+++ b/l10ntools/source/gDiff.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+cd workdir/jan
+for i in `find . -name \*.pot`
+do
+ echo ">>>>>>>> " $i
+ diff ../pot/$i $i | sed '/^6c6$/,/^16c16$/d'
+done
+
diff --git a/l10ntools/source/gL10nMem.cxx b/l10ntools/source/gL10nMem.cxx
index 1be3dcf49e55..e9af2b0054c5 100644
--- a/l10ntools/source/gL10nMem.cxx
+++ b/l10ntools/source/gL10nMem.cxx
@@ -93,6 +93,7 @@ class l10nMem_enus_entry
const string& sMsgId,
const string& sComment,
const string& sResource,
+ const string& sGroup,
int iLineNo,
int iFileInx,
int iLangSize,
@@ -100,6 +101,7 @@ class l10nMem_enus_entry
: msMsgId(sMsgId),
msComment(sComment),
msResource(sResource),
+ msGroup(sGroup),
meState(eState),
miFileInx(iFileInx),
miLineNo(iLineNo)
@@ -121,6 +123,7 @@ class l10nMem_enus_entry
string msMsgId; // en-US text from source file
string msComment; // Comment (to be used in msgcstr)
string msResource; // Resource Id (to be used in msgcstr)
+ string msGroup; // Group Id (to be used in msgcstr)
l10nMem::ENTRY_STATE meState; // status information
int miFileInx; // index of file name
int miLineNo; // line number
@@ -136,7 +139,6 @@ l10nMem::l10nMem()
miCurFileInx(0),
miCurLangInx(0),
miCurENUSinx(0),
- mbNeedWrite(false),
mbConvertMode(false),
mbStrictMode(false)
{
@@ -144,7 +146,7 @@ l10nMem::l10nMem()
msModuleName = "default";
mcFileList.push_back(l10nMem_file_entry("-genLang-", 0));
mcLangList.push_back(l10nMem_lang_list_entry("-genLang-"));
- mcENUSlist.push_back(l10nMem_enus_entry("-genLang-", "-genLang-", "", "", 0, 0, 0, l10nMem::ENTRY_DELETED));
+ mcENUSlist.push_back(l10nMem_enus_entry("-genLang-", "-genLang-", "", "", "", 0, 0, 0, l10nMem::ENTRY_DELETED));
}
@@ -281,12 +283,13 @@ void l10nMem::loadEntryKey(int iLineNo,
const string& sMsgStr,
const string& sComment,
const string& sResource,
+ const string& sGroup,
bool bIsFuzzy)
{
if (mbConvertMode)
convEntryKey(iLineNo, sSourceFile, sKey, sMsgId, sMsgStr, bIsFuzzy);
else if (!miCurLangInx)
- loadENUSkey(iLineNo, sSourceFile, sKey, sMsgId, sComment, sResource);
+ loadENUSkey(iLineNo, sSourceFile, sKey, sMsgId, sComment, sResource, sGroup);
else
loadLangKey(iLineNo, sSourceFile, sKey, sMsgId, sMsgStr, bIsFuzzy);
}
@@ -299,6 +302,7 @@ void l10nMem::setSourceKey(int iLineNo,
const string& sMsgId,
const string& sComment,
const string& sResource,
+ const string& sGroup,
bool bMustExist)
{
string newText(sMsgId);
@@ -330,7 +334,7 @@ void l10nMem::setSourceKey(int iLineNo,
throw showError("key " + sKey + " does not exist");
// add key, if changed text, this is wrong but handled in reorganize
- addKey(iLineNo, sSourceFile, sKey, newText, sComment, sResource, ENTRY_ADDED);
+ addKey(iLineNo, sSourceFile, sKey, newText, sComment, sResource, sGroup, ENTRY_ADDED);
}
}
@@ -360,7 +364,7 @@ void l10nMem::saveTemplates(const string& sTargetDir, bool bForce)
if (cE.meState == ENTRY_DELETED)
continue;
- savePo.save(mcFileList[cE.miFileInx].msFileName, cE.msKey, cE.msMsgId, "", cE.msComment, cE.msResource, false);
+ savePo.save(mcFileList[cE.miFileInx].msFileName, cE.msKey, cE.msMsgId, "", cE.msComment, cE.msResource, cE.msGroup, false);
}
savePo.endSave();
}
@@ -607,7 +611,7 @@ bool l10nMem::convFilterWarning(const string& sSourceFile,
(sSourceFile == "registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu" &&
sKey == "ImpressWindowState.UIElements.States.private:resource/toolpanel/DrawingFramework/Layouts.UIName") ||
(sSourceFile == "registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu" &&
- sKey == "ImpressWindowState.UIElements.States.private:resource/toolpanel/DrawingFramework/TableDesign.UIName") ||
+ sKey == "ImpressWindowState.UIElements.States.private:resource/toolpanel/DrawingFramework/TableDesign.UIName") )
return true;
}
if (msModuleName == "readlicense_oo") {
@@ -768,10 +772,11 @@ void l10nMem::loadENUSkey(int iLineNo,
const string& sKey,
const string& sMsgId,
const string& sComment,
- const string& sResource)
+ const string& sResource,
+ const string& sGroup)
{
// add it to vector and update file pointer
- addKey(iLineNo, sSourceFile, sKey, sMsgId, sComment, sResource, ENTRY_DELETED);
+ addKey(iLineNo, sSourceFile, sKey, sMsgId, sComment, sResource, sGroup, ENTRY_DELETED);
}
@@ -898,6 +903,7 @@ void l10nMem::addKey(int iLineNo,
const string& sMsgId,
const string& sComment,
const string& sResource,
+ const string& sGroup,
l10nMem::ENTRY_STATE eStat)
{
// check file
@@ -910,7 +916,7 @@ void l10nMem::addKey(int iLineNo,
mcFileList.push_back(l10nMem_file_entry(sSourceFile, miCurENUSinx));
// and add entry at the back (no problem since it is a new file)
- mcENUSlist.push_back(l10nMem_enus_entry(sKey, sMsgId, sComment, sResource, iLineNo, miCurFileInx,
+ mcENUSlist.push_back(l10nMem_enus_entry(sKey, sMsgId, sComment, sResource, sGroup, iLineNo, miCurFileInx,
mcLangList.size(), eStat));
mcFileList[miCurFileInx].miEnd = miCurENUSinx;
}
@@ -923,7 +929,7 @@ void l10nMem::addKey(int iLineNo,
curF.miEnd++;
miCurENUSinx = curF.miEnd;
mcENUSlist.insert(it + curF.miEnd,
- l10nMem_enus_entry(sKey, sMsgId, sComment, sResource, iLineNo, miCurFileInx,
+ l10nMem_enus_entry(sKey, sMsgId, sComment, sResource, sGroup, iLineNo, miCurFileInx,
mcLangList.size(), eStat));
for (int i = miCurFileInx + 1; i < iFsize; ++i) {
l10nMem_file_entry& curF2 = mcFileList[i];
diff --git a/l10ntools/source/gLang.cxx b/l10ntools/source/gLang.cxx
index fff5928d82f4..bc0776b4e73f 100644
--- a/l10ntools/source/gLang.cxx
+++ b/l10ntools/source/gLang.cxx
@@ -45,7 +45,7 @@ class handler
vector<string> mvSourceFiles;
l10nMem mcMemory;
- void showManual();
+ static void showManual();
void loadL10MEM(bool onlyTemplates);
void runConvert();
void runExtract();
@@ -392,13 +392,13 @@ int main(int argc, char *argv[])
try {
cHandler.checkCommandLine(argc, argv);
}
- catch(const char *pErr) {
- string myErr(pErr);
- cHandler.showUsage(myErr);
+ catch(const char *sErr) {
+ string myErr(sErr);
+ handler::showUsage(myErr);
exit(-1);
}
- catch(const string& rErr) {
- cHandler.showUsage(rErr);
+ catch(string sErr) {
+ handler::showUsage(sErr);
exit(-1);
}
@@ -406,13 +406,13 @@ int main(int argc, char *argv[])
try {
cHandler.run();
}
- catch(const char *pErr) {
- string myErr(pErr);
- cHandler.showRunTimeError(myErr);
+ catch(const char *sErr) {
+ string myErr(sErr);
+ handler::showRunTimeError(myErr);
exit(-1);
}
- catch(const string& rErr) {
- cHandler.showRunTimeError(rErr);
+ catch(string sErr) {
+ handler::showRunTimeError(sErr);
exit(-1);
}
}
diff --git a/l10ntools/source/gTest.sh b/l10ntools/source/gTest.sh
new file mode 100644
index 000000000000..e9b1fe6594e0
--- /dev/null
+++ b/l10ntools/source/gTest.sh
@@ -0,0 +1,6 @@
+#!/bin/bash
+S=C:/Users/jani/opensource/libreoffice/lode/dev/work
+I=$S/instdir
+W=$S/workdir
+PATH="C:\Users\jani\opensource\libreoffice\lode\dev\work\instdir\program;C:\Users\jani\opensource\libreoffice\lode\dev\work\instdir\program;$PATH"
+./workdir/LinkTarget/Executable/xrmex.exe -i readlicense_oo/docs/readme.xrm -o workdir/jan2/docs
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 1d33c929278a..da26398d710d 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -33,7 +33,7 @@ OString getBracketedContent(const OString& text) {
return text.getToken(1, '[').getToken(0, ']');
}
-void lcl_RemoveUTF8ByteOrderMarker( OString &rString )
+static void lcl_RemoveUTF8ByteOrderMarker( OString &rString )
{
if( rString.getLength() >= 3 && rString[0] == '\xEF' &&
rString[1] == '\xBB' && rString[2] == '\xBF' )
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index 7ee23603c6bf..7789e3bad730 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -29,7 +29,7 @@
namespace
{
- OString lcl_NormalizeFilename(const OString& rFilename)
+ static OString lcl_NormalizeFilename(const OString& rFilename)
{
return rFilename.copy(
std::max(
@@ -37,7 +37,7 @@ namespace
rFilename.lastIndexOf( '/' ))+1);
};
- bool lcl_ReadPoChecked(
+ static bool lcl_ReadPoChecked(
PoEntry& o_rPoEntry, PoIfstream& rPoFile,
const OString& rFileName)
{
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 1d8223e869f7..6aa7c1d6f48c 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -87,7 +87,7 @@ public:
namespace
{
// Convert a normal string to msg/po output string
- OString lcl_GenMsgString(const OString& rString)
+ static OString lcl_GenMsgString(const OString& rString)
{
if ( rString.isEmpty() )
return "\"\"";
@@ -114,7 +114,7 @@ namespace
}
// Convert msg string to normal form
- OString lcl_GenNormString(const OString& rString)
+ static OString lcl_GenNormString(const OString& rString)
{
return
helper::unEscapeAll(
@@ -406,7 +406,7 @@ OString PoEntry::genKeyId(const OString& rGenerator)
namespace
{
// Get actual time in "YEAR-MO-DA HO:MI+ZONE" form
- OString lcl_GetTime()
+ static OString lcl_GetTime()
{
time_t aNow = time(nullptr);
struct tm* pNow = localtime(&aNow);
@@ -511,7 +511,7 @@ namespace
{
// Check the validity of read entry
-bool lcl_CheckInputEntry(const GenPoEntry& rEntry)
+static bool lcl_CheckInputEntry(const GenPoEntry& rEntry)
{
const OString sMsgCtxt = rEntry.getMsgCtxt();
const sal_Int32 nFirstEndLine = sMsgCtxt.indexOf('\n');
diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx
index 978d393854c0..b98b0621e952 100644
--- a/l10ntools/source/treemerge.cxx
+++ b/l10ntools/source/treemerge.cxx
@@ -27,7 +27,7 @@
namespace
{
// Extract strings from nodes on all level recursively
- void lcl_ExtractLevel(
+ static void lcl_ExtractLevel(
const xmlDocPtr pSource, const xmlNodePtr pRoot,
const xmlChar* pNodeName, PoOfstream& rPOStream )
{
@@ -59,7 +59,7 @@ namespace
}
// Update id and content of the topic
- xmlNodePtr lcl_UpdateTopic(
+ static xmlNodePtr lcl_UpdateTopic(
const xmlNodePtr pCurrent, const OString& rXhpRoot )
{
xmlNodePtr pReturn = pCurrent;
@@ -139,7 +139,7 @@ namespace
return pReturn;
}
// Localize title attribute of help_section and node tags
- void lcl_MergeLevel(
+ static void lcl_MergeLevel(
xmlDocPtr io_pSource, const xmlNodePtr pRoot,
const xmlChar * pNodeName, MergeDataFile* pMergeDataFile,
const OString& rLang, const OString& rXhpRoot )
diff --git a/l10ntools/source/xmlparse.cxx b/l10ntools/source/xmlparse.cxx
index 3f23923216fb..97d6012d812f 100644
--- a/l10ntools/source/xmlparse.cxx
+++ b/l10ntools/source/xmlparse.cxx
@@ -764,7 +764,7 @@ void XMLElement::Print(XMLNode *pCur, OStringBuffer& rBuffer, bool bRootelement
namespace
{
-OUString lcl_pathnameToAbsoluteUrl(const OString& rPathname)
+static OUString lcl_pathnameToAbsoluteUrl(const OString& rPathname)
{
OUString sPath = OStringToOUString(rPathname, RTL_TEXTENCODING_UTF8 );
OUString sUrl;
@@ -1034,7 +1034,7 @@ XMLFile *SimpleXMLParser::Execute( const OString &rFileName, XMLFile* pXMLFileIn
namespace
{
-icu::UnicodeString lcl_QuotRange(
+static icu::UnicodeString lcl_QuotRange(
const icu::UnicodeString& rString, const sal_Int32 nStart,
const sal_Int32 nEnd, bool bInsideTag = false )
{
@@ -1072,7 +1072,7 @@ icu::UnicodeString lcl_QuotRange(
return sReturn;
}
-bool lcl_isTag( const icu::UnicodeString& rString )
+static bool lcl_isTag( const icu::UnicodeString& rString )
{
static const int nSize = 13;
static const icu::UnicodeString vTags[nSize] = {