Author: jani Date: Sun Sep 29 18:13:49 2013 New Revision: 1527375 URL: http://svn.apache.org/r1527375 Log: moved kid handling to generate (was merge) and corrected throw statement
Modified: openoffice/branches/l10n40/main/l10ntools/source/gConPoWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx openoffice/branches/l10n40/main/l10ntools/source/gHandler.cxx openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx Modified: openoffice/branches/l10n40/main/l10ntools/source/gConPoWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConPoWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConPoWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConPoWrap.cxx Sun Sep 29 18:13:49 2013 @@ -161,7 +161,7 @@ void convert_po::handleNL() void convert_po::execute() { if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); PoWrap::yylex(); startLook(); Modified: openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConSrcWrap.cxx Sun Sep 29 18:13:49 2013 @@ -65,7 +65,7 @@ namespace SrcWrap void convert_src::execute() { if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); SrcWrap::yylex(); } Modified: openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConTreeWrap.cxx Sun Sep 29 18:13:49 2013 @@ -75,7 +75,7 @@ void convert_tree::execute() std::string sFile, sFile2; if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); // prepare list with languages if (mbMergeMode) Modified: openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConUlfWrap.cxx Sun Sep 29 18:13:49 2013 @@ -52,9 +52,6 @@ namespace UlfWrap /********************** I M P L E M E N T A T I O N **********************/ void convert_ulf::execute() { - if (mbMergeMode) - throw "Merge not implemented"; - UlfWrap::yylex(); } Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConXcsWrap.cxx Sun Sep 29 18:13:49 2013 @@ -63,7 +63,7 @@ namespace XcsWrap void convert_xcs::execute() { if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); // currently no .xcs files generate en-US translation, so stop trying XcsWrap::yylex(); Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConXcuWrap.cxx Sun Sep 29 18:13:49 2013 @@ -64,7 +64,7 @@ namespace XcuWrap void convert_xcu::execute() { if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); XcuWrap::yylex(); } Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConXhpWrap.cxx Sun Sep 29 18:13:49 2013 @@ -75,7 +75,7 @@ void convert_xhp::execute() std::string sFile, sFile2; if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); // prepare list with languages miCntLanguages = mcMemory.prepareMerge(); Modified: openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gConXrmWrap.cxx Sun Sep 29 18:13:49 2013 @@ -60,7 +60,7 @@ namespace XrmWrap void convert_xrm::execute() { if (mbMergeMode) - throw "Merge not implemented"; + throw l10nMem::showError("Merge not implemented"); XrmWrap::yylex(); Modified: openoffice/branches/l10n40/main/l10ntools/source/gHandler.cxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gHandler.cxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gHandler.cxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gHandler.cxx Sun Sep 29 18:13:49 2013 @@ -104,8 +104,8 @@ void handler::checkCommandLine(int argc, // is it a known parameter if (sArg == "-d") {l10nMem::setShowDebug(); } else if (sArg == "-f") {eGotArg = ARG_F; } - else if (sArg == "-k") {if (meWorkMode == DO_MERGE) - meWorkMode = DO_MERGE_KID; + else if (sArg == "-k") {if (meWorkMode == DO_EXTRACT) + meWorkMode = DO_EXTRACT_KID; else throw "-k is not valid"; } else if (sArg == "-o") {eGotArg = ARG_O; mbForceSave = true; } @@ -148,10 +148,10 @@ void handler::checkCommandLine(int argc, switch (meWorkMode) { case DO_EXTRACT: + case DO_EXTRACT_KID: break; case DO_MERGE: - case DO_MERGE_KID: useSoption = 0; useLangText = 1; break; @@ -249,9 +249,10 @@ void handler::run() // use workMode to start correct control part switch (meWorkMode) { - case DO_EXTRACT: runExtract(); break; - case DO_MERGE: runMerge(false); break; - case DO_MERGE_KID: runMerge(true); break; + case DO_EXTRACT: runExtract(false); break; + case DO_EXTRACT_KID: runExtract(true); break; + case DO_MERGE: runMerge(); break; + case DO_MERGE_KID: runMerge(); break; case DO_CONVERT: runConvert(false); break; case DO_CONVERT_POT: runConvert(true); break; } @@ -265,8 +266,12 @@ void handler::run() /********************** I M P L E M E N T A T I O N **********************/ -void handler::runExtract() +void handler::runExtract(bool bKid) { + // just to satisfy compiler + if (bKid) + return; + // no convert mcMemory.setConvert(false, false); @@ -288,12 +293,8 @@ void handler::runExtract() /********************** I M P L E M E N T A T I O N **********************/ -void handler::runMerge(bool bKid) +void handler::runMerge() { - // just to satisfy compiler - if (bKid) - return; - // no convert mcMemory.setConvert(false, false); @@ -301,7 +302,7 @@ void handler::runMerge(bool bKid) for (std::vector<std::string>::iterator siSource = mvSourceFiles.begin(); siSource != mvSourceFiles.end(); ++siSource) { // tell system - l10nMem::showDebug("genLang extracting text from file " + msSourceDir + *siSource); + l10nMem::showDebug("genLang merging translated text to file " + msSourceDir + *siSource); // get converter and extract file convert_gen convertObj(mcMemory, msSourceDir, msTargetDir, *siSource); Modified: openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx URL: http://svn.apache.org/viewvc/openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx?rev=1527375&r1=1527374&r2=1527375&view=diff ============================================================================== --- openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx (original) +++ openoffice/branches/l10n40/main/l10ntools/source/gLang.hxx Sun Sep 29 18:13:49 2013 @@ -137,7 +137,7 @@ class handler void run(); private: - enum {DO_CONVERT, DO_CONVERT_POT, DO_EXTRACT, DO_MERGE, DO_MERGE_KID} meWorkMode; + enum {DO_CONVERT, DO_CONVERT_POT, DO_EXTRACT, DO_EXTRACT_KID, DO_MERGE} meWorkMode; l10nMem mcMemory; std::string msModuleName; std::string msPoOutDir; @@ -149,8 +149,8 @@ class handler std::vector<std::string> mvLanguages; void runConvert(bool bPot); - void runExtract(); - void runMerge(bool bKid); + void runExtract(bool bKid); + void runMerge(); void showUsage(std::string& sErr); void showManual();