summaryrefslogtreecommitdiff
path: root/sc/source
diff options
context:
space:
mode:
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;