Kaydet (Commit) 013e34d8 authored tarafından Caolán McNamara's avatar Caolán McNamara

Related: tdf#62702 also try various other known streams for object content

Change-Id: I5b5fa61e9930ba0eaa5ac86e4231050c9ebebf8a
üst 48270327
...@@ -704,29 +704,31 @@ namespace ...@@ -704,29 +704,31 @@ namespace
"com.sun.star.embed.OLESimpleStorage", "com.sun.star.embed.OLESimpleStorage",
aArgs ), uno::UNO_QUERY_THROW ); aArgs ), uno::UNO_QUERY_THROW );
uno::Reference< io::XStream > xCONTENTS; //various stream names that can contain the real document contents for
try //this object in a straightforward direct way
const OUStringLiteral aStreamNames[] =
{ {
xNameContainer->getByName("CONTENTS") >>= xCONTENTS; "CONTENTS",
} "Package",
catch (container::NoSuchElementException const&) "EmbeddedOdf",
"WordDocument",
"Workbook",
"PowerPoint Document"
};
bool bCopied = false;
for (size_t i = 0; i < SAL_N_ELEMENTS(aStreamNames) && !bCopied; ++i)
{ {
// ignore uno::Reference<io::XStream> xEmbeddedFile;
}
bool bCopied = xCONTENTS.is() && lcl_CopyStream(xCONTENTS->getInputStream(), xStream->getOutputStream());
if (!bCopied)
{
uno::Reference< io::XStream > xEmbeddedOdf;
try try
{ {
xNameContainer->getByName("EmbeddedOdf") >>= xEmbeddedOdf; xNameContainer->getByName(aStreamNames[i]) >>= xEmbeddedFile;
} }
catch (container::NoSuchElementException const&) catch (const container::NoSuchElementException&)
{ {
// ignore // ignore
} }
bCopied = xEmbeddedOdf.is() && lcl_CopyStream(xEmbeddedOdf->getInputStream(), xStream->getOutputStream()); bCopied = xEmbeddedFile.is() && lcl_CopyStream(xEmbeddedFile->getInputStream(), xStream->getOutputStream());
} }
if (!bCopied) if (!bCopied)
......
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