summaryrefslogtreecommitdiff
path: root/l10ntools
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2018-09-30 12:06:49 +0200
committerAndras Timar <andras.timar@collabora.com>2018-09-30 21:55:48 +0200
commitbaf048cd2ffe1f3afeb204b9dcc11d36999c1725 (patch)
treeb1038fcc2310eb1827939454b631dd86d8200349 /l10ntools
parenta906b68a9fff30c2af5c03189e59c1952cd3f69f (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>
Diffstat (limited to 'l10ntools')
-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;