Kaydet (Commit) c10390a6 authored tarafından David Tardon's avatar David Tardon

fdo#81113 always run the actual detection

The old code only run detection if an UCBContent property was passed.
That means that any time the function got only InputStream, it claimed
that it was a Keynote presentation.

Change-Id: I377828229e7e95384257bde247612d7768307581
üst cc1bea86
...@@ -247,29 +247,29 @@ throw( com::sun::star::uno::RuntimeException, std::exception ) ...@@ -247,29 +247,29 @@ throw( com::sun::star::uno::RuntimeException, std::exception )
{ {
return OUString(); return OUString();
} }
}
libetonyek::EtonyekDocument::Type type = libetonyek::EtonyekDocument::TYPE_UNKNOWN; libetonyek::EtonyekDocument::Type type = libetonyek::EtonyekDocument::TYPE_UNKNOWN;
const libetonyek::EtonyekDocument::Confidence confidence = libetonyek::EtonyekDocument::isSupported( input.get(), &type ); const libetonyek::EtonyekDocument::Confidence confidence = libetonyek::EtonyekDocument::isSupported( input.get(), &type );
if ((libetonyek::EtonyekDocument::CONFIDENCE_NONE == confidence) || (libetonyek::EtonyekDocument::TYPE_KEYNOTE != type)) if ((libetonyek::EtonyekDocument::CONFIDENCE_NONE == confidence) || (libetonyek::EtonyekDocument::TYPE_KEYNOTE != type))
return OUString(); return OUString();
if ( confidence == libetonyek::EtonyekDocument::CONFIDENCE_SUPPORTED_PART ) if ( confidence == libetonyek::EtonyekDocument::CONFIDENCE_SUPPORTED_PART )
{ {
assert( !bIsPackage ); assert( !bIsPackage );
const Reference < container::XChild > xChild( xContent, UNO_QUERY ); const Reference < container::XChild > xChild( xContent, UNO_QUERY );
if ( xChild.is() ) if ( xChild.is() )
{
const Reference < ucb::XContent > xPackageContent( xChild->getParent(), UNO_QUERY );
if ( xPackageContent.is() )
{ {
const Reference < ucb::XContent > xPackageContent( xChild->getParent(), UNO_QUERY ); input.reset( new writerperfect::DirectoryStream( xPackageContent ) );
if ( xPackageContent.is() ) if ( libetonyek::EtonyekDocument::CONFIDENCE_EXCELLENT == libetonyek::EtonyekDocument::isSupported( input.get() ) )
{ {
input.reset( new writerperfect::DirectoryStream( xPackageContent ) ); xContent = xPackageContent;
if ( libetonyek::EtonyekDocument::CONFIDENCE_EXCELLENT == libetonyek::EtonyekDocument::isSupported( input.get() ) ) bUCBContentChanged = true;
{ bIsPackage = true;
xContent = xPackageContent;
bUCBContentChanged = true;
bIsPackage = true;
}
} }
} }
} }
......
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