diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-08-18 12:42:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-08-18 16:06:19 +0200 |
commit | b95038cd6795eec03989c708c1d05a894043dbc8 (patch) | |
tree | 9a2cbd819d110c14465a0921d33d8f1d2b894812 /sc | |
parent | f6e24b10c9148f1cf6a2a93359ffcc0c7ec56152 (diff) |
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 <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/hdrcont.cxx | 6 |
1 files changed, 2 insertions, 4 deletions
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 |