diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-02-04 14:14:15 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-02-05 09:29:52 -0500 |
commit | 278b3534e3aa27b92f7d681f086cb071df75bffd (patch) | |
tree | 4d4ce1211d1887a78808935fb580ae5175d6f02a /sc | |
parent | e77c476610ee3f7ca4bbb9728b495e41372ac33a (diff) |
fdo#59426: Don't try to repair package during flat detection phase.suse-3.6-10
Conflicts:
comphelper/source/misc/mediadescriptor.cxx
sc/source/ui/unoobj/scdetect.cxx
Change-Id: I35968241a79db0aabe06e25c0efac2aa3d1c5b84
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/unoobj/scdetect.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
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 |