summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2018-09-30 12:06:49 +0200
committerCaolán McNamara <caolanm@redhat.com>2018-11-21 13:36:43 +0100
commitc7da2fde04464da7372565d3cfb729ec46247412 (patch)
tree78c7b3e551d5cb69dc2b21d8fbf9333abd72f3bf
parent8c27cd8913035dc781295452946bf600a2848512 (diff)
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.timar@collabora.com> (cherry picked from commit baf048cd2ffe1f3afeb204b9dcc11d36999c1725) Reviewed-on: https://gerrit.libreoffice.org/63594 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--l10ntools/source/pocheck.cxx33
1 files changed, 28 insertions, 5 deletions
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;