diff options
Diffstat (limited to 'sd/source/ui/view/drviews3.cxx')
-rw-r--r-- | sd/source/ui/view/drviews3.cxx | 29 |
1 files changed, 23 insertions, 6 deletions
diff --git a/sd/source/ui/view/drviews3.cxx b/sd/source/ui/view/drviews3.cxx index 31e89a4b8e36..f2929425c49d 100644 --- a/sd/source/ui/view/drviews3.cxx +++ b/sd/source/ui/view/drviews3.cxx @@ -199,17 +199,34 @@ void DrawViewShell::ExecCtrl(SfxRequest& rReq) case SID_SWITCHLAYER: // BASIC { const SfxItemSet *pArgs = rReq.GetArgs (); - sal_uInt16 nCurPage = GetLayerTabControl()->GetCurPageId (); - if( pArgs && pArgs->Count () == 1) + // #i87182# + bool bCurPageValid(false); + sal_uInt16 nCurPage(0); + + if(GetLayerTabControl()) + { + nCurPage = GetLayerTabControl()->GetCurPageId(); + bCurPageValid = true; + } + + if(pArgs && 1 == pArgs->Count()) { SFX_REQUEST_ARG (rReq, pWhatLayer, SfxUInt32Item, ID_VAL_WHATLAYER, sal_False); - if( pWhatLayer ) - nCurPage = (short) pWhatLayer->GetValue (); + + if(pWhatLayer) + { + nCurPage = (short)pWhatLayer->GetValue(); + bCurPageValid = true; + } + } + + if(bCurPageValid) + { + mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) ); + Invalidate(); } - mpDrawView->SetActiveLayer( GetLayerTabControl()->GetPageText(nCurPage) ); - Invalidate(); rReq.Done (); break; |