Kaydet (Commit) 2ee7ad01 authored tarafından Caolán McNamara's avatar Caolán McNamara

Resolves: ofz#820 an exception is an acceptable outcome

Change-Id: Ifc5be483387202c371596fd52f1e2ce682151ca8
üst d31cdf52
......@@ -118,21 +118,28 @@ HwpReader::~HwpReader()
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportHWP(SvStream &rStream)
{
std::unique_ptr<HStream> stream(new HStream);
byte aData[32768];
std::size_t nRead, nBlock = 32768;
try
{
std::unique_ptr<HStream> stream(new HStream);
byte aData[32768];
std::size_t nRead, nBlock = 32768;
while (true)
{
nRead = rStream.ReadBytes(aData, nBlock);
if (nRead == 0)
break;
stream->addData(aData, (int)nRead);
}
while (true)
HWPFile hwpfile;
if (hwpfile.ReadHwpFile(stream.release()))
return false;
}
catch (...)
{
nRead = rStream.ReadBytes(aData, nBlock);
if (nRead == 0)
break;
stream->addData(aData, (int)nRead);
return false;
}
HWPFile hwpfile;
if (hwpfile.ReadHwpFile(stream.release()))
return false;
return true;
}
......
......@@ -215,13 +215,12 @@ int ReadWordproFile(SvStream &rStream, uno::Reference<css::xml::sax::XDocumentHa
//Reset all static objects,because this function may be called many times.
XFGlobalReset();
reader.Read();
return 0;
}
catch (...)
{
return 1;
}
return 0;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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