From baf075ff005cf307dbad8bd664d43ccd556ce8fb Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 16 Sep 2020 09:41:49 +0100 Subject: only handle SID_CURRENTCELL if there is a ScViewData* MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit which I suspect is always Change-Id: Id02afb045b25472df793480823d6f17c0d1ac620 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102958 Tested-by: Caolán McNamara Reviewed-by: Caolán McNamara --- sc/source/ui/navipi/navcitem.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'sc/source/ui/navipi') diff --git a/sc/source/ui/navipi/navcitem.cxx b/sc/source/ui/navipi/navcitem.cxx index bac2b45e179d..8e11edfca0a8 100644 --- a/sc/source/ui/navipi/navcitem.cxx +++ b/sc/source/ui/navipi/navcitem.cxx @@ -42,16 +42,16 @@ void ScNavigatorControllerItem::StateChanged( sal_uInt16 /* nSID */, SfxItemStat case SID_CURRENTCELL: if ( pItem ) { + ScViewData* pViewData = rNavigatorDlg.GetViewData(); const SfxStringItem* pCellPosItem = dynamic_cast( pItem ); OSL_ENSURE( pCellPosItem, "SfxStringItem expected!" ); - if ( pCellPosItem ) + if (pCellPosItem && pViewData) { const OUString& aAddress( pCellPosItem->GetValue() ); ScAddress aScAddress; - ScViewData* pViewData = rNavigatorDlg.GetViewData(); - aScAddress.Parse(aAddress, pViewData ? &pViewData->GetDocument() : nullptr); + aScAddress.Parse(aAddress, &pViewData->GetDocument()); SCCOL nCol = aScAddress.Col()+1; SCROW nRow = aScAddress.Row()+1; -- cgit