diff options
author | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-03-25 11:57:39 +0100 |
---|---|---|
committer | Zolnai Tamás <zolnaitamas2000@gmail.com> | 2013-03-25 12:01:59 +0100 |
commit | 56a52889e65a17e324fc10cf341690385f5a9dd9 (patch) | |
tree | 00b1b49b1ea5fc63c2ab01838a55afb5d420c1ad /l10ntools/source/uimerge.cxx | |
parent | 2d8547d095897037388b27075fd7dc182a4e4912 (diff) |
Remove unneeded project and projectroot parameters
Plus avoid use of Export::sLanguages member outside
of the class.
Change-Id: I33702816fdb4980d690cfe8fcd8cc3fbd0df1dd8
Diffstat (limited to 'l10ntools/source/uimerge.cxx')
-rw-r--r-- | l10ntools/source/uimerge.cxx | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/l10ntools/source/uimerge.cxx b/l10ntools/source/uimerge.cxx index 63b08084a790..6e0ec03b33ca 100644 --- a/l10ntools/source/uimerge.cxx +++ b/l10ntools/source/uimerge.cxx @@ -28,8 +28,6 @@ #include <fstream> #include <vector> -rtl::OString sPrj; -rtl::OString sPrjRoot; rtl::OString sInputFileName; rtl::OString sOutputFile; @@ -186,9 +184,10 @@ namespace } bool Merge( - const rtl::OString &rSDFFile, - const rtl::OString &rSourceFile, - const rtl::OString &rDestinationDir) + const OString &rPOFile, + const OString &rSourceFile, + const OString &rDestinationDir, + const OString &rLanguage ) { { bool bDestinationIsDir(false); @@ -213,14 +212,12 @@ bool Merge( } } - Export::InitLanguages( true ); - - MergeDataFile aMergeDataFile( rSDFFile, rSourceFile, sal_False ); - rtl::OString sTmp( Export::sLanguages ); - if( sTmp.equalsIgnoreAsciiCaseL(RTL_CONSTASCII_STRINGPARAM("ALL")) ) - Export::SetLanguages( aMergeDataFile.GetLanguages() ); - - std::vector<rtl::OString> aLanguages = Export::GetLanguages(); + MergeDataFile aMergeDataFile( rPOFile, rSourceFile, sal_False ); + std::vector<rtl::OString> aLanguages; + if( rLanguage.equalsIgnoreAsciiCase("ALL") ) + aLanguages = aMergeDataFile.GetLanguages(); + else + aLanguages.push_back(rLanguage); const MergeDataHashMap& rMap = aMergeDataFile.getMap(); const rtl::OString aDestinationDir(rDestinationDir + "/"); @@ -246,18 +243,16 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) HandledArgs aArgs; if ( !Export::handleArguments(argc, argv, aArgs) ) { - Export::writeUsage("uiex","ui"); + Export::writeUsage("uiex","*.ui"); return 1; } - sPrj = aArgs.m_sPrj; - sPrjRoot = aArgs.m_sPrjRoot; sInputFileName = aArgs.m_sInputFile; sOutputFile = aArgs.m_sOutputFile; if (!aArgs.m_bMergeMode) { - if (Export::sLanguages != "en-US") + if (aArgs.m_sLanguage != "en-US") { fprintf(stderr, "only en-US can exist in source .ui files\n"); nRetValue = 1; @@ -267,7 +262,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) } else { - Merge(aArgs.m_sMergeSrc, sInputFileName, sOutputFile); + Merge(aArgs.m_sMergeSrc, sInputFileName, sOutputFile, aArgs.m_sLanguage); } return nRetValue; |