Kaydet (Commit) baf048cd authored tarafından Andras Timar's avatar Andras Timar

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: 's avatarAndras Timar <andras.timar@collabora.com>
üst a906b68a
...@@ -28,7 +28,10 @@ static void checkStyleNames(const OString& aLanguage) ...@@ -28,7 +28,10 @@ static void checkStyleNames(const OString& aLanguage)
PoIfstream aPoInput; PoIfstream aPoInput;
aPoInput.open(aPoPath); aPoInput.open(aPoPath);
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPath << std::endl; std::cerr << "Warning: Cannot open " << aPoPath << std::endl;
return;
}
for(;;) for(;;)
{ {
...@@ -91,7 +94,10 @@ static void checkStyleNames(const OString& aLanguage) ...@@ -91,7 +94,10 @@ static void checkStyleNames(const OString& aLanguage)
} }
aPoInput.open(aPoPath); aPoInput.open(aPoPath);
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPath << std::endl; std::cerr << "Warning: Cannot open " << aPoPath << std::endl;
return;
}
PoOfstream aPoOutput; PoOfstream aPoOutput;
aPoOutput.open(aPoPath+".new"); aPoOutput.open(aPoPath+".new");
PoHeader aTmp("sw/source/ui/utlui"); PoHeader aTmp("sw/source/ui/utlui");
...@@ -126,7 +132,6 @@ static void checkStyleNames(const OString& aLanguage) ...@@ -126,7 +132,6 @@ static void checkStyleNames(const OString& aLanguage)
osl::File::move(aPoPathURL + ".new", aPoPathURL); osl::File::move(aPoPathURL + ".new", aPoPathURL);
else else
osl::File::remove(aPoPathURL + ".new"); osl::File::remove(aPoPathURL + ".new");
} }
// Translated spreadsheet function names must be unique // Translated spreadsheet function names must be unique
...@@ -147,7 +152,10 @@ static void checkFunctionNames(const OString& aLanguage) ...@@ -147,7 +152,10 @@ static void checkFunctionNames(const OString& aLanguage)
PoIfstream aPoInput; PoIfstream aPoInput;
aPoInput.open(aPoPaths[0]); aPoInput.open(aPoPaths[0]);
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPaths[0] << std::endl; std::cerr << "Warning: Cannot open " << aPoPaths[0] << std::endl;
return;
}
for(;;) for(;;)
{ {
...@@ -178,7 +186,10 @@ static void checkFunctionNames(const OString& aLanguage) ...@@ -178,7 +186,10 @@ static void checkFunctionNames(const OString& aLanguage)
"/scaddins/source/analysis.po"; "/scaddins/source/analysis.po";
aPoInput.open(aPoPaths[1]); aPoInput.open(aPoPaths[1]);
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPaths[1] << std::endl; std::cerr << "Warning: Cannot open " << aPoPaths[1] << std::endl;
return;
}
for(;;) for(;;)
{ {
...@@ -210,7 +221,10 @@ static void checkFunctionNames(const OString& aLanguage) ...@@ -210,7 +221,10 @@ static void checkFunctionNames(const OString& aLanguage)
"/scaddins/source/datefunc.po"; "/scaddins/source/datefunc.po";
aPoInput.open(aPoPaths[2]); aPoInput.open(aPoPaths[2]);
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPaths[2] << std::endl; std::cerr << "Warning: Cannot open " << aPoPaths[2] << std::endl;
return;
}
for(;;) for(;;)
{ {
...@@ -241,7 +255,10 @@ static void checkFunctionNames(const OString& aLanguage) ...@@ -241,7 +255,10 @@ static void checkFunctionNames(const OString& aLanguage)
"/scaddins/source/pricing.po"; "/scaddins/source/pricing.po";
aPoInput.open(aPoPaths[3]); aPoInput.open(aPoPaths[3]);
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPaths[3] << std::endl; std::cerr << "Warning: Cannot open " << aPoPaths[3] << std::endl;
return;
}
for(;;) for(;;)
{ {
...@@ -362,10 +379,13 @@ static void checkVerticalBar(const OString& aLanguage) ...@@ -362,10 +379,13 @@ static void checkVerticalBar(const OString& aLanguage)
"/instsetoo_native/inc_openoffice/windows/msi_languages.po"; "/instsetoo_native/inc_openoffice/windows/msi_languages.po";
PoIfstream aPoInput; PoIfstream aPoInput;
aPoInput.open(aPoPath); aPoInput.open(aPoPath);
PoOfstream aPoOutput;
aPoOutput.open(aPoPath+".new");
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPath << std::endl; std::cerr << "Warning: Cannot open " << aPoPath << std::endl;
return;
}
PoOfstream aPoOutput;
aPoOutput.open(aPoPath+".new");
PoHeader aTmp("instsetoo_native/inc_openoffice/windows/msi_languages"); PoHeader aTmp("instsetoo_native/inc_openoffice/windows/msi_languages");
aPoOutput.writeHeader(aTmp); aPoOutput.writeHeader(aTmp);
bool bError = false; bool bError = false;
...@@ -412,10 +432,13 @@ static void checkMathSymbolNames(const OString& aLanguage) ...@@ -412,10 +432,13 @@ static void checkMathSymbolNames(const OString& aLanguage)
"/starmath/source.po"; "/starmath/source.po";
PoIfstream aPoInput; PoIfstream aPoInput;
aPoInput.open(aPoPath); aPoInput.open(aPoPath);
PoOfstream aPoOutput;
aPoOutput.open(aPoPath+".new");
if( !aPoInput.isOpen() ) if( !aPoInput.isOpen() )
{
std::cerr << "Warning: Cannot open " << aPoPath << std::endl; std::cerr << "Warning: Cannot open " << aPoPath << std::endl;
return;
}
PoOfstream aPoOutput;
aPoOutput.open(aPoPath+".new");
PoHeader aTmp("starmath/source"); PoHeader aTmp("starmath/source");
aPoOutput.writeHeader(aTmp); aPoOutput.writeHeader(aTmp);
bool bError = false; bool bError = false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment