summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-09-16 09:41:49 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-09-18 09:44:42 +0200
commitbaf075ff005cf307dbad8bd664d43ccd556ce8fb (patch)
tree13486f2f5c1952d8b9832240edea51607ae211c4 /sc/source
parent300378fb4e99584389e1e9287febf77beaf63f75 (diff)
only handle SID_CURRENTCELL if there is a ScViewData*
which I suspect is always Change-Id: Id02afb045b25472df793480823d6f17c0d1ac620 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102958 Tested-by: Caolán McNamara <caolanm@redhat.com> Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source')
-rw-r--r--sc/source/ui/navipi/navcitem.cxx6
1 files changed, 3 insertions, 3 deletions
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<const SfxStringItem*>( 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;