summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-21 09:25:19 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-21 09:26:42 +0000
commit4be8eae04eaeaa943cdcfe7443813d47bf995123 (patch)
tree8a951bc7de7366269d731ccf8c7b02ba3ce79404
parent7fe28b2c7b9a1fd5718e1f5b6562cf93902d6be0 (diff)
Resolves: fdo#88594 crash on F1 with local help
regression from commit 1049511c0c5d881df4ba8042744d63d37878296f Date: Tue Jan 13 21:43:27 2015 +0900 infobar: add buttons one by one with addButton Change-Id: Icf758a9671191836bbe5bc7ca7d978574cb74479
-rw-r--r--sfx2/source/view/sfxbasecontroller.cxx9
-rw-r--r--sfx2/source/view/viewfrm.cxx10
2 files changed, 12 insertions, 7 deletions
diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx
index 5ea8ebe08565..021aea48b351 100644
--- a/sfx2/source/view/sfxbasecontroller.cxx
+++ b/sfx2/source/view/sfxbasecontroller.cxx
@@ -1448,10 +1448,13 @@ void SfxBaseController::ShowInfoBars( )
{
// Get the Frame and show the InfoBar if not checked out
SfxViewFrame* pViewFrame = m_pData->m_pViewShell->GetFrame();
- PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) );
- pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) );
SfxInfoBarWindow* pInfoBar = pViewFrame->AppendInfoBar( "checkout", SfxResId( STR_NONCHECKEDOUT_DOCUMENT ) );
- pInfoBar->addButton(pBtn);
+ if (pInfoBar)
+ {
+ PushButton* pBtn = new PushButton( &pViewFrame->GetWindow(), SfxResId( BT_CHECKOUT ) );
+ pBtn->SetClickHdl( LINK( this, SfxBaseController, CheckOutHandler ) );
+ pInfoBar->addButton(pBtn);
+ }
}
}
}
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 5ba7ef13a3e2..77a15b5a5e09 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1380,10 +1380,12 @@ void SfxViewFrame::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint )
else
{
SfxInfoBarWindow* pInfoBar = AppendInfoBar("readonly", SfxResId(STR_READONLY_DOCUMENT));
-
- PushButton* pBtn = new PushButton( &GetWindow(), SfxResId(BT_READONLY_EDIT));
- pBtn->SetClickHdl(LINK(this, SfxViewFrame, SwitchReadOnlyHandler));
- pInfoBar->addButton(pBtn);
+ if (pInfoBar)
+ {
+ PushButton* pBtn = new PushButton( &GetWindow(), SfxResId(BT_READONLY_EDIT));
+ pBtn->SetClickHdl(LINK(this, SfxViewFrame, SwitchReadOnlyHandler));
+ pInfoBar->addButton(pBtn);
+ }
}
break;