Resolves: ofz#820 an exception is an acceptable outcome
Change-Id: Ifc5be483387202c371596fd52f1e2ce682151ca8
This commit is contained in:
@@ -118,21 +118,28 @@ HwpReader::~HwpReader()
|
|||||||
|
|
||||||
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportHWP(SvStream &rStream)
|
extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportHWP(SvStream &rStream)
|
||||||
{
|
{
|
||||||
std::unique_ptr<HStream> stream(new HStream);
|
try
|
||||||
byte aData[32768];
|
|
||||||
std::size_t nRead, nBlock = 32768;
|
|
||||||
|
|
||||||
while (true)
|
|
||||||
{
|
{
|
||||||
nRead = rStream.ReadBytes(aData, nBlock);
|
std::unique_ptr<HStream> stream(new HStream);
|
||||||
if (nRead == 0)
|
byte aData[32768];
|
||||||
break;
|
std::size_t nRead, nBlock = 32768;
|
||||||
stream->addData(aData, (int)nRead);
|
|
||||||
}
|
|
||||||
|
|
||||||
HWPFile hwpfile;
|
while (true)
|
||||||
if (hwpfile.ReadHwpFile(stream.release()))
|
{
|
||||||
return false;
|
nRead = rStream.ReadBytes(aData, nBlock);
|
||||||
|
if (nRead == 0)
|
||||||
|
break;
|
||||||
|
stream->addData(aData, (int)nRead);
|
||||||
|
}
|
||||||
|
|
||||||
|
HWPFile hwpfile;
|
||||||
|
if (hwpfile.ReadHwpFile(stream.release()))
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
catch (...)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
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.
|
//Reset all static objects,because this function may be called many times.
|
||||||
XFGlobalReset();
|
XFGlobalReset();
|
||||||
reader.Read();
|
reader.Read();
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
catch (...)
|
catch (...)
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
Reference in New Issue
Block a user