Kaydet (Commit) 9a9b8f0b authored tarafından Fridrich Štrba's avatar Fridrich Štrba

Bail early the same way as in 709f6ba6

Change-Id: I8447d776ba315db5ef961818bc577d13e4f35a20
üst f8dfa3a8
...@@ -95,6 +95,7 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor ...@@ -95,6 +95,7 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor
sal_Bool bRepairPackage = sal_False; sal_Bool bRepairPackage = sal_False;
sal_Bool bRepairAllowed = sal_False; sal_Bool bRepairAllowed = sal_False;
bool bDeepDetection = false;
// now some parameters that can already be in the array, but may be overwritten or new inserted here // now some parameters that can already be in the array, but may be overwritten or new inserted here
// remember their indices in the case new values must be added to the array // remember their indices in the case new values must be added to the array
...@@ -145,6 +146,8 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor ...@@ -145,6 +146,8 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor
lDescriptor[nProperty].Value >>= bRepairPackage; lDescriptor[nProperty].Value >>= bRepairPackage;
else if( lDescriptor[nProperty].Name == "DocumentTitle" ) else if( lDescriptor[nProperty].Name == "DocumentTitle" )
nIndexOfDocumentTitle = nProperty; nIndexOfDocumentTitle = nProperty;
else if (lDescriptor[nProperty].Name == "DeepDetection")
bDeepDetection = lDescriptor[nProperty].Value.get<sal_Bool>();
} }
// can't check the type for external filters, so set the "dont" flag accordingly // can't check the type for external filters, so set the "dont" flag accordingly
...@@ -230,6 +233,10 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor ...@@ -230,6 +233,10 @@ OUString SAL_CALL SmFilterDetect::detect( Sequence< PropertyValue >& lDescriptor
} }
catch( const WrappedTargetException& aWrap ) catch( const WrappedTargetException& aWrap )
{ {
if (!bDeepDetection)
// Bail out early unless it's a deep detection.
return OUString();
packages::zip::ZipIOException aZipException; packages::zip::ZipIOException aZipException;
// repairing is done only if this type is requested from outside // repairing is done only if this type is requested from outside
......
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