summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-05-09 11:32:05 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-05-09 11:35:44 +0100
commita1d265be484f1c70f57ab3de9b2d8c27d2fd3aa4 (patch)
treee1806d44b6282ad9b85e5fc9f9e189fd9faa2e9f
parent107f8447818e50ba61221ca2ab0871347b7d6596 (diff)
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
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx3
1 files changed, 3 insertions, 0 deletions
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
1198 { 1198 {
1199 SfxViewFrame* pViewFrame = SfxViewFrame::Get( xController, GetObjectShell() ); 1199 SfxViewFrame* pViewFrame = SfxViewFrame::Get( xController, GetObjectShell() );
1200 ENSURE_OR_THROW( pViewFrame, "SFX document without SFX view!?" ); 1200 ENSURE_OR_THROW( pViewFrame, "SFX document without SFX view!?" );
1201 bool bOldLock = pViewFrame->GetDispatcher()->IsLocked();
1202 pViewFrame->GetDispatcher()->Lock(sal_True);
1201 pViewFrame->UpdateDocument_Impl(); 1203 pViewFrame->UpdateDocument_Impl();
1204 pViewFrame->GetDispatcher()->Lock(bOldLock);
1202 const String sDocumentURL = GetObjectShell()->GetMedium()->GetName(); 1205 const String sDocumentURL = GetObjectShell()->GetMedium()->GetName();
1203 if ( sDocumentURL.Len() ) 1206 if ( sDocumentURL.Len() )
1204 SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) ); 1207 SFX_APP()->Broadcast( SfxStringHint( SID_OPENURL, sDocumentURL ) );