[Libreoffice-commits] core.git: sc/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 18 07:45:28 UTC 2020


 sc/source/ui/navipi/navcitem.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit baf075ff005cf307dbad8bd664d43ccd556ce8fb
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Wed Sep 16 09:41:49 2020 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Sep 18 09:44:42 2020 +0200

    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 at redhat.com>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

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;


More information about the Libreoffice-commits mailing list