[libreoffice/f15] Resolves: rhbz#652604 better survive exceptions in autorecovery
Caolan McNamara
caolanm at fedoraproject.org
Wed Jun 8 08:01:00 UTC 2011
commit ecc17a15319857954986c7efaa376e5e31fd970c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jun 8 09:00:47 2011 +0100
Resolves: rhbz#652604 better survive exceptions in autorecovery
...z-652604-better-survive-exceptions-thrown.patch | 127 ++++++++++++++++++++
libreoffice.spec | 5 +-
2 files changed, 131 insertions(+), 1 deletions(-)
---
diff --git a/0001-Related-rhbz-652604-better-survive-exceptions-thrown.patch b/0001-Related-rhbz-652604-better-survive-exceptions-thrown.patch
new file mode 100644
index 0000000..937184d
--- /dev/null
+++ b/0001-Related-rhbz-652604-better-survive-exceptions-thrown.patch
@@ -0,0 +1,127 @@
+From 5613954b275de8de9e6852738a7bfd215252d134 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm at redhat.com>
+Date: Tue, 7 Jun 2011 17:03:52 +0100
+Subject: [PATCH] Related: rhbz#652604 better survive exceptions thrown during
+ autorecover
+
+---
+ framework/inc/services/autorecovery.hxx | 20 ++++++++++++++
+ framework/source/services/autorecovery.cxx | 40 +++++++++++++++++++++------
+ 2 files changed, 51 insertions(+), 9 deletions(-)
+
+diff --git a/framework/inc/services/autorecovery.hxx b/framework/inc/services/autorecovery.hxx
+index 636ad98..6c4207e 100644
+--- a/framework/inc/services/autorecovery.hxx
++++ b/framework/inc/services/autorecovery.hxx
+@@ -861,6 +861,26 @@ class AutoRecovery : public css::lang::XTypeProvider
+ const ::rtl::OUString& sEventType,
+ AutoRecovery::TDocumentInfo* pInfo );
+
++
++ class ListenerInformer
++ {
++ private:
++ AutoRecovery &m_rRecovery;
++ sal_Int32 m_eJob;
++ bool m_bStopped;
++ public:
++ ListenerInformer(AutoRecovery &rRecovery, sal_Int32 eJob)
++ : m_rRecovery(rRecovery), m_eJob(eJob), m_bStopped(false)
++ {
++ }
++ void start();
++ void stop();
++ ~ListenerInformer()
++ {
++ stop();
++ }
++ };
++
+ //---------------------------------------
+
+ // TODO document me
+diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
+index efe2f17..ec60d13 100644
+--- a/framework/source/services/autorecovery.cxx
++++ b/framework/source/services/autorecovery.cxx
+@@ -576,6 +576,21 @@ void SAL_CALL AutoRecovery::dispatch(const css::util::URL&
+ implts_dispatch(aParams);
+ }
+
++void AutoRecovery::ListenerInformer::start()
++{
++ m_rRecovery.implts_informListener(m_eJob,
++ AutoRecovery::implst_createFeatureStateEvent(m_eJob, OPERATION_START, NULL));
++}
++
++void AutoRecovery::ListenerInformer::stop()
++{
++ if (m_bStopped)
++ return;
++ m_rRecovery.implts_informListener(m_eJob,
++ AutoRecovery::implst_createFeatureStateEvent(m_eJob, OPERATION_STOP, NULL));
++ m_bStopped = true;
++}
++
+ //-----------------------------------------------
+ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
+ {
+@@ -599,8 +614,8 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
+ implts_stopTimer();
+ implts_stopListening();
+
+- implts_informListener(eJob,
+- AutoRecovery::implst_createFeatureStateEvent(eJob, OPERATION_START, NULL));
++ ListenerInformer aListenerInformer(*this, eJob);
++ aListenerInformer.start();
+
+ try
+ {
+@@ -676,13 +691,14 @@ void AutoRecovery::implts_dispatch(const DispatchParams& aParams)
+ )
+ implts_cleanUpWorkingEntry(aParams);
+ }
+- catch(const css::uno::RuntimeException& exRun)
+- { throw exRun; }
++ catch(const css::uno::RuntimeException&)
++ {
++ throw;
++ }
+ catch(const css::uno::Exception&)
+ {} // TODO better error handling
+
+- implts_informListener(eJob,
+- AutoRecovery::implst_createFeatureStateEvent(eJob, OPERATION_STOP, NULL));
++ aListenerInformer.stop();
+
+ // SAFE -> ----------------------------------
+ aWriteLock.lock();
+@@ -1304,8 +1320,8 @@ void AutoRecovery::implts_flushConfigItem(const AutoRecovery::TDocumentInfo& rIn
+ xModify->insertByName(sID, css::uno::makeAny(xSet));
+ }
+ }
+- catch(const css::uno::RuntimeException& exRun)
+- { throw exRun; }
++ catch(const css::uno::RuntimeException&)
++ { throw; }
+ catch(const css::uno::Exception&)
+ {} // ??? can it happen that a full disc let these set of operations fail too ???
+
+@@ -1627,7 +1643,13 @@ IMPL_LINK(AutoRecovery, implts_asyncDispatch, void*, EMPTYARG)
+ aWriteLock.unlock();
+ // <- SAFE
+
+- implts_dispatch(aParams);
++ try
++ {
++ implts_dispatch(aParams);
++ }
++ catch (...)
++ {
++ }
+ return 0;
+ }
+
+--
+1.7.5.2
+
diff --git a/libreoffice.spec b/libreoffice.spec
index 5d5ec57..bf3ea7b 100644
--- a/libreoffice.spec
+++ b/libreoffice.spec
@@ -144,6 +144,7 @@ Patch55: 0001-fix-crash-in-fdo-36203-the-referenced-shape-didn-t-c.patch
Patch56: 0001-Resolves-rhbz-707317-avoid-crash-in-getRowSpan.patch
Patch57: 0001-Resolves-rhbz-710004-band-aid-for-immediate-crash-in.patch
Patch58: 0001-Resolves-rhbz-710556-don-t-crash-on-missing-graphics.patch
+Patch59: 0001-Related-rhbz-652604-better-survive-exceptions-thrown.patch
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%define instdir %{_libdir}
@@ -803,6 +804,7 @@ mv -f redhat.soc extras/source/palettes/standard.soc
%patch56 -p1 -b .rhbz707317-avoid-crash-in-getRowSpan.patch
%patch57 -p1 -b .rhbz710004-band-aid-for-immediate-crash-in.patch
%patch58 -p1 -b .rhbz710556-don-t-crash-on-missing-graphics.patch
+%patch59 -p1 -b .rhbz652604-better-survive-exceptions-thrown.patch
touch scripting/source/pyprov/delzip
touch scripting/util/provider/beanshell/delzip
@@ -2147,9 +2149,10 @@ update-desktop-database %{_datadir}/applications &> /dev/null || :
%{basisinstdir}/program/kde-open-url
%changelog
-* Tue Jun 07 2011 Caolán McNamara <caolanm at redhat.com> 1:3.3.2.2-10-UNBUILT
+* Wed Jun 08 2011 Caolán McNamara <caolanm at redhat.com> 1:3.3.2.2-10-UNBUILT
- Resolves: rhbz#710004 band aid for crash
- Resolves: rhbz#710556 don't crash on missing graphics on pptx export
+- Resolves: rhbz#652604 better survive exceptions in autorecovery
* Mon May 30 2011 Caolán McNamara <caolanm at redhat.com> 1:3.3.2.2-9
- Resolves: rhbz#702635 set correct page number when exporting selected
More information about the scm-commits
mailing list