l10ntools/source/pocheck.cxx | 33 ++++++++++++++++++++++++++++----- 1 file changed, 28 insertions(+), 5 deletions(-)
New commits: commit baf048cd2ffe1f3afeb204b9dcc11d36999c1725 Author: Andras Timar <andras.ti...@collabora.com> AuthorDate: Sun Sep 30 12:06:49 2018 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Sun Sep 30 21:55:48 2018 +0200 pocheck: stop further processing, if input file cannot be opened Change-Id: Ida6a13e112871ab6864ae2a32a33a15a591154c2 Reviewed-on: https://gerrit.libreoffice.org/61161 Tested-by: Jenkins Reviewed-by: Andras Timar <andras.ti...@collabora.com> diff --git a/l10ntools/source/pocheck.cxx b/l10ntools/source/pocheck.cxx index e0b66877c0bc..2e4b1a4eb878 100644 --- a/l10ntools/source/pocheck.cxx +++ b/l10ntools/source/pocheck.cxx @@ -28,7 +28,10 @@ static void checkStyleNames(const OString& aLanguage) PoIfstream aPoInput; aPoInput.open(aPoPath); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPath << std::endl; + return; + } for(;;) { @@ -91,7 +94,10 @@ static void checkStyleNames(const OString& aLanguage) } aPoInput.open(aPoPath); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPath << std::endl; + return; + } PoOfstream aPoOutput; aPoOutput.open(aPoPath+".new"); PoHeader aTmp("sw/source/ui/utlui"); @@ -126,7 +132,6 @@ static void checkStyleNames(const OString& aLanguage) osl::File::move(aPoPathURL + ".new", aPoPathURL); else osl::File::remove(aPoPathURL + ".new"); - } // Translated spreadsheet function names must be unique @@ -147,7 +152,10 @@ static void checkFunctionNames(const OString& aLanguage) PoIfstream aPoInput; aPoInput.open(aPoPaths[0]); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPaths[0] << std::endl; + return; + } for(;;) { @@ -178,7 +186,10 @@ static void checkFunctionNames(const OString& aLanguage) "/scaddins/source/analysis.po"; aPoInput.open(aPoPaths[1]); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPaths[1] << std::endl; + return; + } for(;;) { @@ -210,7 +221,10 @@ static void checkFunctionNames(const OString& aLanguage) "/scaddins/source/datefunc.po"; aPoInput.open(aPoPaths[2]); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPaths[2] << std::endl; + return; + } for(;;) { @@ -241,7 +255,10 @@ static void checkFunctionNames(const OString& aLanguage) "/scaddins/source/pricing.po"; aPoInput.open(aPoPaths[3]); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPaths[3] << std::endl; + return; + } for(;;) { @@ -362,10 +379,13 @@ static void checkVerticalBar(const OString& aLanguage) "/instsetoo_native/inc_openoffice/windows/msi_languages.po"; PoIfstream aPoInput; aPoInput.open(aPoPath); - PoOfstream aPoOutput; - aPoOutput.open(aPoPath+".new"); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPath << std::endl; + return; + } + PoOfstream aPoOutput; + aPoOutput.open(aPoPath+".new"); PoHeader aTmp("instsetoo_native/inc_openoffice/windows/msi_languages"); aPoOutput.writeHeader(aTmp); bool bError = false; @@ -412,10 +432,13 @@ static void checkMathSymbolNames(const OString& aLanguage) "/starmath/source.po"; PoIfstream aPoInput; aPoInput.open(aPoPath); - PoOfstream aPoOutput; - aPoOutput.open(aPoPath+".new"); if( !aPoInput.isOpen() ) + { std::cerr << "Warning: Cannot open " << aPoPath << std::endl; + return; + } + PoOfstream aPoOutput; + aPoOutput.open(aPoPath+".new"); PoHeader aTmp("starmath/source"); aPoOutput.writeHeader(aTmp); bool bError = false; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits