diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-01-16 16:23:30 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2013-01-18 09:13:18 +0000 |
commit | 2b9edadd637ea52293473e63062d334371bc83af (patch) | |
tree | 2326ba1f413170f213d3dc0c6de8d1fd8f4bb022 /sw | |
parent | 89fb1aee1a9e80e901f9e23ef6239177645b0101 (diff) |
rhbz#818557: fix it differently: SwDocShell::_LoadStyles():
Try to prevent pushing of SfxShells from this function via EndAllAction
and SwView::AttrChangedNotify() by setting a ridiculous pre-exising
global bNoInterrupt variable.
Change-Id: I9c91ca882891c8dfcd9dc08ba197233cfefddefd
(cherry picked from commit beacee6fad46aa2c8fc813bb0150e5c7a5175b26)
Reviewed-on: https://gerrit.libreoffice.org/1722
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/app/docst.cxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/sw/source/ui/app/docst.cxx b/sw/source/ui/app/docst.cxx index ad8c702a94cd..f974fe716208 100644 --- a/sw/source/ui/app/docst.cxx +++ b/sw/source/ui/app/docst.cxx @@ -22,6 +22,8 @@ #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/container/XNameAccess.hpp> +#include <comphelper/flagguard.hxx> + #include <hintids.hxx> #include <sfx2/app.hxx> #include <svl/whiter.hxx> @@ -77,6 +79,8 @@ #include <paratr.hxx> //#outline level,add by zhaojianwei +extern bool bNoInterrupt; // in mainwn.cxx + using namespace ::com::sun::star; void SwDocShell::StateStyleSheet(SfxItemSet& rSet, SwWrtShell* pSh) @@ -1280,6 +1284,11 @@ void SwDocShell::_LoadStyles( SfxObjectShell& rSource, sal_Bool bPreserveCurrent ((SwDocShell&)rSource).pDoc->SetFixFields(false, NULL); if( pWrtShell ) { + // rhbz#818557, fdo#58893: EndAllAction will call SelectShell(), + // which pushes a bunch of SfxShells that are not cleared + // (for unknown reasons) when closing the document, causing crash; + // setting bNoInterrupt appears to avoid the problem. + ::comphelper::FlagRestorationGuard g(bNoInterrupt, true); pWrtShell->StartAllAction(); pDoc->ReplaceStyles( *((SwDocShell&)rSource).pDoc ); pWrtShell->EndAllAction(); |