diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-08-22 16:38:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-08-22 21:52:50 +0200 |
commit | 6b68ac7d989dd34071c12ee64fe7c4cb99e37c09 (patch) | |
tree | f37f945a9b7196d67ce3bf3cb4ad342531a47fb5 /sc | |
parent | cd816c0b4e698386a482f20c975281a0f3a7d332 (diff) |
cid#1509273 Unchecked dynamic_cast
get ScDocument the way the rest of ScNavigatorDlg does
Change-Id: Ib1e66a48cc385ac1ad479e8e3b6efa04349116e6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138706
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/navipi/navipi.cxx | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx index 44ba8fee2c26..6340c1a80f33 100644 --- a/sc/source/ui/navipi/navipi.cxx +++ b/sc/source/ui/navipi/navipi.cxx @@ -126,23 +126,22 @@ namespace IMPL_LINK(ScNavigatorDlg, ParseRowInputHdl, int*, result, bool) { - SCCOL nCol; + SCCOL nCol(0); OUString aStrCol = m_xEdCol->get_text(); if (!aStrCol.isEmpty()) { - // nKeyGroup is no longer set at VCL, in cause of lack of keyinput + if (ScViewData* pData = GetViewData()) + { + ScDocument& rDoc = pData->GetDocument(); - ScTabViewShell* pViewSh = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() ); - auto& rDoc = pViewSh->GetViewData().GetDocument(); - if ( CharClass::isAsciiNumeric(aStrCol) ) - nCol = NumStrToAlpha( rDoc.GetSheetLimits(), aStrCol ); - else - nCol = AlphaToNum( rDoc, aStrCol ); + if ( CharClass::isAsciiNumeric(aStrCol) ) + nCol = NumStrToAlpha( rDoc.GetSheetLimits(), aStrCol ); + else + nCol = AlphaToNum( rDoc, aStrCol ); + } } - else - nCol = 0; *result = nCol; return true; |