summaryrefslogtreecommitdiff
authorCaolán McNamara <caolanm@redhat.com>2012-05-09 10:32:05 (GMT)
committer Caolán McNamara <caolanm@redhat.com>2012-05-09 10:35:44 (GMT)
commita1d265be484f1c70f57ab3de9b2d8c27d2fd3aa4 (patch) (side-by-side diff)
treee1806d44b6282ad9b85e5fc9f9e189fd9faa2e9f
parent107f8447818e50ba61221ca2ab0871347b7d6596 (diff)
downloadcore-a1d265be484f1c70f57ab3de9b2d8c27d2fd3aa4.zip
core-a1d265be484f1c70f57ab3de9b2d8c27d2fd3aa4.tar.gz
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
Diffstat (more/less context) (ignore whitespace changes)
-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 02a4b9a..b3792d9 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 ) );