[libreoffice/f18] Resolves: rhbz#862181 a .xlsx named as a .xls will fail to open
Caolán McNamara
caolanm at fedoraproject.org
Tue Feb 5 23:39:12 UTC 2013
commit 15ffcaf432d670950d0b1025996d6bcf895fa1d5
Author: Caolán McNamara <caolanm at redhat.com>
Date: Tue Feb 5 23:27:41 2013 +0000
Resolves: rhbz#862181 a .xlsx named as a .xls will fail to open
...on-t-try-to-repair-package-during-flat-de.patch | 158 ++++++++++++++++++++
libreoffice.spec | 3 +
2 files changed, 161 insertions(+), 0 deletions(-)
---
diff --git a/0001-fdo-59426-Don-t-try-to-repair-package-during-flat-de.patch b/0001-fdo-59426-Don-t-try-to-repair-package-during-flat-de.patch
new file mode 100644
index 0000000..7e19d22
--- /dev/null
+++ b/0001-fdo-59426-Don-t-try-to-repair-package-during-flat-de.patch
@@ -0,0 +1,158 @@
+From 709f6ba6ae5d2b5461136595a2469bf1fe32ccff Mon Sep 17 00:00:00 2001
+From: Kohei Yoshida <kohei.yoshida at gmail.com>
+Date: Mon, 4 Feb 2013 14:14:15 -0500
+Subject: [PATCH] fdo#59426: Don't try to repair package during flat detection
+ phase.
+
+Change-Id: I35968241a79db0aabe06e25c0efac2aa3d1c5b84
+---
+ comphelper/inc/comphelper/mediadescriptor.hxx | 2 ++
+ comphelper/source/misc/mediadescriptor.cxx | 6 ++++++
+ filter/source/config/cache/typedetection.cxx | 2 ++
+ sc/source/ui/unoobj/scdetect.cxx | 12 +++++++++---
+ sd/source/ui/unoidl/sddetect.cxx | 7 +++++++
+ sw/source/ui/uno/swdetect.cxx | 7 +++++++
+ 6 files changed, 33 insertions(+), 3 deletions(-)
+
+diff --git a/comphelper/inc/comphelper/mediadescriptor.hxx b/comphelper/inc/comphelper/mediadescriptor.hxx
+index 53dcffc..8c55f85 100644
+--- a/comphelper/inc/comphelper/mediadescriptor.hxx
++++ b/comphelper/inc/comphelper/mediadescriptor.hxx
+@@ -94,6 +94,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 bd73733..5a217a1 100644
+--- a/comphelper/source/misc/mediadescriptor.cxx
++++ b/comphelper/source/misc/mediadescriptor.cxx
+@@ -306,6 +306,12 @@
+ return sProp;
+ }
+
++const ::rtl::OUString& MediaDescriptor::PROP_DEEPDETECTION()
++{
++ static const ::rtl::OUString aProp(RTL_CONSTASCII_USTRINGPARAM("DeepDetection"));
++ return aProp;
++}
++
+ /*-----------------------------------------------
+ 10.03.2004 08:09
+ -----------------------------------------------*/
+diff --git a/filter/source/config/cache/typedetection.cxx b/filter/source/config/cache/typedetection.cxx
+index e7c0bc0..36b38a8 100644
+--- a/filter/source/config/cache/typedetection.cxx
++++ b/filter/source/config/cache/typedetection.cxx
+@@ -329,6 +329,8 @@ void printFlatDetectionList(const char* caption, const FlatDetection& types)
+ (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 53c69f8..94c1f7f 100644
+--- a/sc/source/ui/unoobj/scdetect.cxx
++++ b/sc/source/ui/unoobj/scdetect.cxx
+@@ -244,6 +244,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
+@@ -300,6 +301,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
+@@ -382,6 +385,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
+diff --git a/sd/source/ui/unoidl/sddetect.cxx b/sd/source/ui/unoidl/sddetect.cxx
+index eff86c5..d140345 100644
+--- a/sd/source/ui/unoidl/sddetect.cxx
++++ b/sd/source/ui/unoidl/sddetect.cxx
+@@ -102,6 +102,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
+@@ -152,6 +153,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
+@@ -258,6 +261,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 4ccf329..ba8fd2e 100644
+--- a/sw/source/ui/uno/swdetect.cxx
++++ b/sw/source/ui/uno/swdetect.cxx
+@@ -97,6 +97,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
+@@ -151,6 +152,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;
+@@ -239,6 +242,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
+--
+1.7.11.7
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 63018bd..4b3f2af 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -252,6 +252,7 @@ Patch31: libreoffice-rhel6langs.patch
Patch32: 0001-rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch
%endif
Patch33: 0001-these-ENABLE_FOOs-are-set-to-TRUE-not-YES.patch
+Patch34: 0001-fdo-59426-Don-t-try-to-repair-package-during-flat-de.patch
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%define instdir %{_libdir}
@@ -997,6 +998,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch32 -p1 -b .rhbz-891082-CMXDocument-isSupported-catch-exceptions.patch
%endif
%patch33 -p1 -b .these-ENABLE_FOOs-are-set-to-TRUE-not-YES.patch
+%patch34 -p1 -b .fdo59426-Don-t-try-to-repair-package-during-flat-de.patch
# TODO: check this
# these are horribly incomplete--empty translations and copied english
@@ -2267,6 +2269,7 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%changelog
* Tue Feb 05 2013 Caolán McNamara <caolanm at redhat.com> - 1:3.6.5.2-2
- Resolves: rhbz#907112 presentation mode does not inhibit screen saver
+- Resolves: rhbz#862181 a .xlsx named as a .xls will fail to open
* Fri Jan 25 2013 David Tardon <dtardon at redhat.com> - 1:3.6.5.2-1
- 3.6.5 rc2
More information about the scm-commits
mailing list