diff options
-rw-r--r-- | sd/source/ui/sidebar/SlideBackground.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/view/ViewShellBase.cxx | 45 |
2 files changed, 39 insertions, 21 deletions
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx index f6c7d89fe88a..fd728d6a0076 100644 --- a/sd/source/ui/sidebar/SlideBackground.cxx +++ b/sd/source/ui/sidebar/SlideBackground.cxx @@ -174,12 +174,15 @@ void SlideBackground::Initialize() mpFillGrad->SetSelectHdl(LINK(this, SlideBackground, FillColorHdl)); mpFillAttr->SetSelectHdl(LINK(this, SlideBackground, FillBackgroundHdl)); - ViewShell* pMainViewShell = mrBase.GetMainViewShell().get(); - DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell); - SdPage* mpPage = pDrawViewShell->getCurrentPage(); - OUString aLayoutName( mpPage->GetLayoutName() ); - aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR)); - mpMasterSlide->SelectEntry(aLayoutName); + if (ViewShell* pMainViewShell = mrBase.GetMainViewShell().get()) + { + DrawViewShell* pDrawViewShell = static_cast<DrawViewShell*>(pMainViewShell); + SdPage* mpPage = pDrawViewShell->getCurrentPage(); + OUString aLayoutName( mpPage->GetLayoutName() ); + aLayoutName = aLayoutName.copy(0,aLayoutName.indexOf(SD_LT_SEPARATOR)); + mpMasterSlide->SelectEntry(aLayoutName); + } + mpFillStyle->SelectEntryPos(0); mpDspMasterBackground->SetClickHdl(LINK(this, SlideBackground, DspBackground)); diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index b0db26731767..72b3f3b94532 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -1243,15 +1243,21 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) break; case SID_NORMAL_MULTI_PANE_GUI: - pFrameView = mrBase.GetMainViewShell()->GetFrameView(); - bState = pFrameView->GetViewShEditMode() == EM_PAGE - && pFrameView->GetPageKind() == PK_STANDARD; + if (ViewShell* pViewShell = mrBase.GetMainViewShell().get()) + { + pFrameView = pViewShell->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_PAGE + && pFrameView->GetPageKind() == PK_STANDARD; + } break; case SID_SLIDE_MASTER_MODE: - pFrameView = mrBase.GetMainViewShell()->GetFrameView(); - bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE - && pFrameView->GetPageKind() == PK_STANDARD; + if (ViewShell* pViewShell = mrBase.GetMainViewShell().get()) + { + pFrameView = pViewShell->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE + && pFrameView->GetPageKind() == PK_STANDARD; + } break; case SID_SLIDE_SORTER_MULTI_PANE_GUI: @@ -1272,21 +1278,30 @@ void ViewShellBase::Implementation::GetSlotState (SfxItemSet& rSet) break; case SID_HANDOUT_MASTER_MODE: - pFrameView = mrBase.GetMainViewShell()->GetFrameView(); - bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE - && pFrameView->GetPageKind() == PK_HANDOUT; + if (ViewShell* pViewShell = mrBase.GetMainViewShell().get()) + { + pFrameView = pViewShell->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE + && pFrameView->GetPageKind() == PK_HANDOUT; + } break; case SID_NOTES_MODE: - pFrameView = mrBase.GetMainViewShell()->GetFrameView(); - bState = pFrameView->GetViewShEditMode() == EM_PAGE - && pFrameView->GetPageKind() == PK_NOTES; + if (ViewShell* pViewShell = mrBase.GetMainViewShell().get()) + { + pFrameView = pViewShell->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_PAGE + && pFrameView->GetPageKind() == PK_NOTES; + } break; case SID_NOTES_MASTER_MODE: - pFrameView = mrBase.GetMainViewShell()->GetFrameView(); - bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE - && pFrameView->GetPageKind() == PK_NOTES; + if (ViewShell* pViewShell = mrBase.GetMainViewShell().get()) + { + pFrameView = pViewShell->GetFrameView(); + bState = pFrameView->GetViewShEditMode() == EM_MASTERPAGE + && pFrameView->GetPageKind() == PK_NOTES; + } break; case SID_TOGGLE_TABBAR_VISIBILITY: |