sc/source/ui/view/hdrcont.cxx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
New commits: commit b95038cd6795eec03989c708c1d05a894043dbc8 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Aug 18 12:42:58 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Thu Aug 18 16:06:19 2022 +0200 cid#1509313 Unchecked dynamic_cast we can get the ScDocument another way Change-Id: Ie1953b911d34a647fbac1923bc9166f67f346a69 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138483 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx index f2799b6449fc..805326330ae4 100644 --- a/sc/source/ui/view/hdrcont.cxx +++ b/sc/source/ui/view/hdrcont.cxx @@ -722,8 +722,7 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& rMEvt ) SCTAB nTab = pTabView->GetViewData().GetTabNo(); if( !rMEvt.IsShift() ) pTabView->DoneRefMode( rMEvt.IsMod1() ); - ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); - ScDocument& rDoc = pViewSh->GetViewData().GetDocument(); + ScDocument& rDoc = pTabView->GetViewData().GetDocument(); if( !bVertical ) { pTabView->InitRefMode( nHitNo, 0, nTab, SC_REFTYPE_REF ); @@ -872,8 +871,7 @@ void ScHeaderControl::MouseMove( const MouseEvent& rMEvt ) bool bTmp; SCCOLROW nHitNo = GetMousePos(rMEvt.GetPosPixel(), bTmp); SCTAB nTab = pTabView->GetViewData().GetTabNo(); - ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>(SfxViewShell::Current()); - ScDocument& rDoc = pViewSh->GetViewData().GetDocument(); + ScDocument& rDoc = pTabView->GetViewData().GetDocument(); if( !bVertical ) pTabView->UpdateRef( nHitNo, rDoc.MaxRow(), nTab ); else