summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--comphelper/inc/comphelper/mediadescriptor.hxx2
-rw-r--r--comphelper/source/misc/mediadescriptor.cxx9
-rw-r--r--filter/source/config/cache/typedetection.cxx2
-rw-r--r--sc/source/ui/unoobj/scdetect.cxx12
-rw-r--r--sd/source/ui/unoidl/sddetect.cxx7
-rw-r--r--sw/source/ui/uno/swdetect.cxx7
6 files changed, 33 insertions, 6 deletions
diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx
index 55b89a25fdf8..b8278a8f309b 100644
--- a/comphelper/inc/comphelper/mediadescriptor.hxx
+++ b/comphelper/inc/comphelper/mediadescriptor.hxx
@@ -113,6 +113,8 @@ class COMPHELPER_DLLPUBLIC MediaDescriptor : public SequenceAsHashMap
static const ::rtl::OUString& PROP_VIEWONLY();
static const ::rtl::OUString& PROP_DOCUMENTBASEURL();
+ static const rtl::OUString& PROP_DEEPDETECTION();
+
//-------------------------------------------
// interface
public:
diff --git a/comphelper/source/misc/mediadescriptor.cxx b/comphelper/source/misc/mediadescriptor.cxx
index 544d4e5c955e..e87a4e3f1957 100644
--- a/comphelper/source/misc/mediadescriptor.cxx
+++ b/comphelper/source/misc/mediadescriptor.cxx
@@ -306,9 +306,12 @@ const ::rtl::OUString& MediaDescriptor::PROP_DOCUMENTBASEURL()
return sProp;
}
-/*-----------------------------------------------
- 10.03.2004 08:09
------------------------------------------------*/
+const rtl::OUString& MediaDescriptor::PROP_DEEPDETECTION()
+{
+ static const rtl::OUString aProp("DeepDetection");
+ return aProp;
+}
+
MediaDescriptor::MediaDescriptor()
: SequenceAsHashMap()
{
diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
index 49e5e24b9f9d..f76965b43a04 100644
--- a/filter/source/config/cache/typedetection.cxx
+++ b/filter/source/config/cache/typedetection.cxx
@@ -318,6 +318,8 @@ struct EqualByName : public std::binary_function<FlatDetectionInfo, FlatDetectio
(bAllowDeep )
)
{
+ // Let's the detection service know we are in a deep detection phase.
+ stlDescriptor[comphelper::MediaDescriptor::PROP_DEEPDETECTION()] <<= sal_True;
sType = impl_detectTypeDeepOnly(stlDescriptor, lUsedDetectors);
}
diff --git a/sc/source/ui/unoobj/scdetect.cxx b/sc/source/ui/unoobj/scdetect.cxx
index 43d0bb5f84c8..d07735f64360 100644
--- a/sc/source/ui/unoobj/scdetect.cxx
+++ b/sc/source/ui/unoobj/scdetect.cxx
@@ -254,6 +254,7 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
sal_Bool bRepairPackage = false;
sal_Bool bRepairAllowed = false;
+ bool bDeepDetection = false;
// 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
@@ -310,6 +311,8 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
lDescriptor[nProperty].Value >>= bRepairPackage;
else if ( lDescriptor[nProperty].Name == "DocumentTitle" )
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
@@ -392,6 +395,10 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
}
catch( const lang::WrappedTargetException& aWrap )
{
+ if (!bDeepDetection)
+ // Bail out early unless it's a deep detection.
+ return OUString();
+
packages::zip::ZipIOException aZipException;
// repairing is done only if this type is requested from outside
@@ -434,9 +441,8 @@ static sal_Bool lcl_MayBeDBase( SvStream& rStream )
aTypeName.Erase();
}
- if ( aTypeName.Len() )
- pFilter = SfxFilterMatcher( String::CreateFromAscii("scalc") ).GetFilter4EA( aTypeName );
-
+ if ( aTypeName.Len() )
+ pFilter = SfxFilterMatcher( rtl::OUString("scalc") ).GetFilter4EA( aTypeName );
}
}
else
diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
index ba0fd114ec21..1a5da08b3d6f 100644
--- a/sd/source/ui/unoidl/sddetect.cxx
+++ b/sd/source/ui/unoidl/sddetect.cxx
@@ -112,6 +112,7 @@ SdFilterDetect::~SdFilterDetect()
sal_Bool bRepairPackage = 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
// remember their indices in the case new values must be added to the array
@@ -162,6 +163,8 @@ SdFilterDetect::~SdFilterDetect()
lDescriptor[nProperty].Value >>= bRepairPackage;
else if ( lDescriptor[nProperty].Name == "DocumentTitle" )
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
@@ -268,6 +271,10 @@ SdFilterDetect::~SdFilterDetect()
}
catch( const lang::WrappedTargetException& aWrap )
{
+ if (!bDeepDetection)
+ // Bail out early unless it's a deep detection.
+ return OUString();
+
packages::zip::ZipIOException aZipException;
if ( ( aWrap.TargetException >>= aZipException ) && aTypeName.Len() )
{
diff --git a/sw/source/ui/uno/swdetect.cxx b/sw/source/ui/uno/swdetect.cxx
index 7fec1f55a986..caac2d5bd726 100644
--- a/sw/source/ui/uno/swdetect.cxx
+++ b/sw/source/ui/uno/swdetect.cxx
@@ -107,6 +107,7 @@ SwFilterDetect::~SwFilterDetect()
sal_Bool bRepairPackage = 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
// remember their indices in the case new values must be added to the array
@@ -161,6 +162,8 @@ SwFilterDetect::~SwFilterDetect()
lDescriptor[nProperty].Value >>= bRepairPackage;
else if ( lDescriptor[nProperty].Name == "DocumentTitle" )
nIndexOfDocumentTitle = nProperty;
+ else if (lDescriptor[nProperty].Name == "DeepDetection")
+ bDeepDetection = lDescriptor[nProperty].Value.get<sal_Bool>();
}
SolarMutexGuard aGuard;
@@ -249,6 +252,10 @@ SwFilterDetect::~SwFilterDetect()
}
catch (const lang::WrappedTargetException& aWrap)
{
+ if (!bDeepDetection)
+ // Bail out early unless it's a deep detection.
+ return OUString();
+
packages::zip::ZipIOException aZipException;
// repairing is done only if this type is requested from outside