From a1d265be484f1c70f57ab3de9b2d8c27d2fd3aa4 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 9 May 2012 11:32:05 +0100 Subject: Resolves: rhbz#818557 crash with NULL shell post template update It's all a bit baffling in a maze of Shells, but what I can see is that when we update from the template at the end of loading we end up with a different order of shells on the stack than in the usual case. Apparently from positioning the cursor at an earlier stage than usual. If I lock the dispatcher for the duration of updating the template it all works out ok. I freely admit I can't foresee the full consequences of this, but it appears to work. Change-Id: Ib7b2f511cdb5a37715a6ad839d9b1426ad9db8e0 --- sfx2/source/doc/sfxbasemodel.cxx | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sfx2') diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 02a4b9a0beff..b3792d9ca034 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -1198,7 +1198,10 @@ void SAL_CALL SfxBaseModel::connectController( const uno::Reference< frame::XCon { SfxViewFrame* pViewFrame = SfxViewFrame::Get( xController, GetObjectShell() ); ENSURE_OR_THROW( pViewFrame, "SFX document without SFX view!?" ); + bool bOldLock = pViewFrame->GetDispatcher()->IsLocked(); + pViewFrame->GetDispatcher()->Lock(sal_True); pViewFrame->UpdateDocument_Impl(); + pViewFrame->GetDispatcher()->Lock(bOldLock); const String sDocumentURL = GetObjectShell()->GetMedium()->GetName(); if ( sDocumentURL.Len() ) SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) ); -- cgit