diff options
Diffstat (limited to 'sc/source/ui/app/inputwin.cxx')
-rw-r--r-- | sc/source/ui/app/inputwin.cxx | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 7f0cf742b0..2b2dcb7ebd 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -799,9 +799,11 @@ void ScInputWindow::MouseButtonDown( const MouseEvent& rMEvt ) // I'd prefer to leave at least a single column header and a // row but I don't know how to get that value in pixels. // Use TOOLBOX_WINDOW_HEIGHT for the moment - ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); - mnMaxY = GetOutputSizePixel().Height() + (pViewSh->GetGridHeight(SC_SPLIT_TOP) - + pViewSh->GetGridHeight(SC_SPLIT_BOTTOM)) - TOOLBOX_WINDOW_HEIGHT; + if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell()) + { + mnMaxY = GetOutputSizePixel().Height() + (pViewSh->GetGridHeight(SC_SPLIT_TOP) + + pViewSh->GetGridHeight(SC_SPLIT_BOTTOM)) - TOOLBOX_WINDOW_HEIGHT; + } } } @@ -2663,11 +2665,12 @@ void ScPosWnd::DoEnter() if (bOpenManageNamesDialog) { const sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId(); - ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell(); - assert(pViewSh); - SfxViewFrame& rViewFrm = pViewSh->GetViewFrame(); - SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); - SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); + if (ScTabViewShell* pViewSh = ScTabViewShell::GetActiveViewShell()) + { + SfxViewFrame& rViewFrm = pViewSh->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); + SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); + } } } |