sc/source/ui/dbgui/dbnamdlg.cxx     |   92 +++++++++++++++++-------------------
 sc/source/ui/formdlg/formula.cxx    |   16 +++---
 sc/source/ui/inc/crnrdlg.hxx        |    4 -
 sc/source/ui/inc/dbnamdlg.hxx       |    4 -
 sc/source/ui/inc/formula.hxx        |    2 
 sc/source/ui/inc/highred.hxx        |    6 +-
 sc/source/ui/inc/namedefdlg.hxx     |    2 
 sc/source/ui/inc/namedlg.hxx        |    4 -
 sc/source/ui/miscdlgs/crnrdlg.cxx   |   36 +++++---------
 sc/source/ui/miscdlgs/highred.cxx   |   10 +--
 sc/source/ui/namedlg/namedefdlg.cxx |    8 +--
 sc/source/ui/namedlg/namedlg.cxx    |    8 +--
 sc/source/ui/view/tabvwshc.cxx      |   16 +++---
 13 files changed, 96 insertions(+), 112 deletions(-)

New commits:
commit 4abf1bdfa383a645e73563f8b0d0b1b945303360
Author:     Caolán McNamara <caol...@redhat.com>
AuthorDate: Sat Sep 26 21:32:26 2020 +0100
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Sep 27 16:23:56 2020 +0200

    never null ScViewData*
    
    and so remove some never called code
    
    Change-Id: Ia5a6501f9a5214a4069623832508a6f884cfa6ee
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103494
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/sc/source/ui/dbgui/dbnamdlg.cxx b/sc/source/ui/dbgui/dbnamdlg.cxx
index f49e6ac617fa..555b5acbacb3 100644
--- a/sc/source/ui/dbgui/dbnamdlg.cxx
+++ b/sc/source/ui/dbgui/dbnamdlg.cxx
@@ -127,11 +127,11 @@ void DBSaveData::Restore()
 
 
 ScDbNameDlg::ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
-    ScViewData* ptrViewData)
+    ScViewData& rViewData)
     : ScAnyRefDlgController(pB, pCW, pParent,
         "modules/scalc/ui/definedatabaserangedialog.ui", 
"DefineDatabaseRangeDialog")
-    , pViewData(ptrViewData)
-    , rDoc(ptrViewData->GetDocument())
+    , m_rViewData(rViewData)
+    , rDoc(rViewData.GetDocument())
     , bRefInputMode(false)
     , aAddrDetails(rDoc.GetAddressConvention(), 0, 0)
     , aLocalDbCol(*(rDoc.GetDBCollection()))
@@ -194,56 +194,53 @@ void ScDbNameDlg::Init()
 
     OUString  theAreaStr;
 
-    if ( pViewData )
-    {
-        SCCOL   nStartCol   = 0;
-        SCROW   nStartRow   = 0;
-        SCTAB   nStartTab   = 0;
-        SCCOL   nEndCol     = 0;
-        SCROW   nEndRow     = 0;
-        SCTAB   nEndTab     = 0;
+    SCCOL   nStartCol   = 0;
+    SCROW   nStartRow   = 0;
+    SCTAB   nStartTab   = 0;
+    SCCOL   nEndCol     = 0;
+    SCROW   nEndRow     = 0;
+    SCTAB   nEndTab     = 0;
 
-        ScDBCollection* pDBColl = rDoc.GetDBCollection();
-        ScDBData*       pDBData = nullptr;
+    ScDBCollection* pDBColl = rDoc.GetDBCollection();
+    ScDBData*       pDBData = nullptr;
 
-        pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
-                                  nEndCol,   nEndRow,  nEndTab );
+    m_rViewData.GetSimpleArea( nStartCol, nStartRow, nStartTab,
+                              nEndCol,   nEndRow,  nEndTab );
 
-        theCurArea = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, 
nEndRow, nEndTab);
+    theCurArea = ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, 
nEndTab);
 
-        theAreaStr = theCurArea.Format(rDoc, ScRefFlags::RANGE_ABS_3D, 
aAddrDetails);
+    theAreaStr = theCurArea.Format(rDoc, ScRefFlags::RANGE_ABS_3D, 
aAddrDetails);
 
-        if ( pDBColl )
+    if ( pDBColl )
+    {
+        // determine if the defined DB area has been marked:
+        pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, 
ScDBDataPortion::TOP_LEFT );
+        if ( pDBData )
         {
-            // determine if the defined DB area has been marked:
-            pDBData = pDBColl->GetDBAtCursor( nStartCol, nStartRow, nStartTab, 
ScDBDataPortion::TOP_LEFT );
-            if ( pDBData )
+            ScAddress&  rStart = theCurArea.aStart;
+            ScAddress&  rEnd   = theCurArea.aEnd;
+            SCCOL nCol1;
+            SCCOL  nCol2;
+            SCROW  nRow1;
+            SCROW  nRow2;
+            SCTAB  nTab;
+
+            pDBData->GetArea( nTab, nCol1, nRow1, nCol2, nRow2 );
+
+            if (   (rStart.Tab() == nTab)
+                && (rStart.Col() == nCol1) && (rStart.Row() == nRow1)
+                && (rEnd.Col()   == nCol2) && (rEnd.Row()   == nRow2 ) )
             {
-                ScAddress&  rStart = theCurArea.aStart;
-                ScAddress&  rEnd   = theCurArea.aEnd;
-                SCCOL nCol1;
-                SCCOL  nCol2;
-                SCROW  nRow1;
-                SCROW  nRow2;
-                SCTAB  nTab;
-
-                pDBData->GetArea( nTab, nCol1, nRow1, nCol2, nRow2 );
-
-                if (   (rStart.Tab() == nTab)
-                    && (rStart.Col() == nCol1) && (rStart.Row() == nRow1)
-                    && (rEnd.Col()   == nCol2) && (rEnd.Row()   == nRow2 ) )
-                {
-                    OUString aDBName = pDBData->GetName();
-                    if ( aDBName != STR_DB_LOCAL_NONAME )
-                        m_xEdName->set_entry_text(aDBName);
-
-                    m_xBtnHeader->set_active( pDBData->HasHeader() );
-                    m_xBtnTotals->set_active( pDBData->HasTotals() );
-                    m_xBtnDoSize->set_active( pDBData->IsDoSize() );
-                    m_xBtnKeepFmt->set_active( pDBData->IsKeepFmt() );
-                    m_xBtnStripData->set_active( pDBData->IsStripData() );
-                    SetInfoStrings( pDBData );
-                }
+                OUString aDBName = pDBData->GetName();
+                if ( aDBName != STR_DB_LOCAL_NONAME )
+                    m_xEdName->set_entry_text(aDBName);
+
+                m_xBtnHeader->set_active( pDBData->HasHeader() );
+                m_xBtnTotals->set_active( pDBData->HasTotals() );
+                m_xBtnDoSize->set_active( pDBData->IsDoSize() );
+                m_xBtnKeepFmt->set_active( pDBData->IsKeepFmt() );
+                m_xBtnStripData->set_active( pDBData->IsStripData() );
+                SetInfoStrings( pDBData );
             }
         }
     }
@@ -385,9 +382,8 @@ IMPL_LINK_NOARG(ScDbNameDlg, OkBtnHdl, weld::Button&, void)
     // Pass the changes and the remove list to the view: both are
     // transferred as a reference only, so that no dead memory can
     // be created at this point:
-    if ( pViewData )
     {
-        ScDBDocFunc aFunc(*pViewData->GetDocShell());
+        ScDBDocFunc aFunc(*m_rViewData.GetDocShell());
         aFunc.ModifyAllDBData(aLocalDbCol, aRemoveList);
     }
 
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index e150cfa1e9bd..4af9a35fb7a5 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -57,7 +57,7 @@ using namespace com::sun::star;
 //      init/ shared functions for dialog
 
 ScFormulaDlg::ScFormulaDlg(SfxBindings* pB, SfxChildWindow* pCW,
-                           weld::Window* pParent, const ScViewData* pViewData, 
const formula::IFunctionManager* _pFunctionMgr)
+                           weld::Window* pParent, const ScViewData& rViewData, 
const formula::IFunctionManager* _pFunctionMgr)
     : formula::FormulaDlg(pB, pCW, pParent, _pFunctionMgr, this)
     , m_aHelper(this,pB)
     , m_pViewShell( nullptr )
@@ -85,7 +85,7 @@ ScFormulaDlg::ScFormulaDlg(SfxBindings* pB, SfxChildWindow* 
pCW,
         }
     }
 
-    m_pDoc = &pViewData->GetDocument();
+    m_pDoc = &rViewData.GetDocument();
     
m_xParser.set(ScServiceProvider::MakeInstance(ScServiceProvider::Type::FORMULAPARS,
                                                   
static_cast<ScDocShell*>(m_pDoc->GetDocumentShell())),uno::UNO_QUERY);
     uno::Reference< beans::XPropertySet> xSet(m_xParser,uno::UNO_QUERY);
@@ -114,16 +114,16 @@ ScFormulaDlg::ScFormulaDlg(SfxBindings* pB, 
SfxChildWindow* pCW,
 
     pScMod->SetRefInputHdl(pInputHdl);
 
-    m_pDoc = &pViewData->GetDocument();
-    SCCOL nCol = pViewData->GetCurX();
-    SCROW nRow = pViewData->GetCurY();
-    SCTAB nTab = pViewData->GetTabNo();
+    m_pDoc = &rViewData.GetDocument();
+    SCCOL nCol = rViewData.GetCurX();
+    SCROW nRow = rViewData.GetCurY();
+    SCTAB nTab = rViewData.GetTabNo();
     m_CursorPos = ScAddress( nCol, nRow, nTab );
 
     m_pViewShell->InitFormEditData();                             // create new
     pData = m_pViewShell->GetFormEditData();
     pData->SetInputHandler(pInputHdl);
-    pData->SetDocShell(pViewData->GetDocShell());
+    pData->SetDocShell(rViewData.GetDocShell());
 
     OSL_ENSURE(pData,"FormEditData not available");
 
@@ -195,7 +195,7 @@ void ScFormulaDlg::fill()
 
     //  data exists -> restore state (after switch)
     //  don't reinitialise m_pDoc and m_CursorPos
-    //pDoc = pViewData->GetDocument();
+    //pDoc = rViewData.GetDocument();
     if(IsInputHdl(pData->GetInputHandler()))
     {
         pScMod->SetRefInputHdl(pData->GetInputHandler());
diff --git a/sc/source/ui/inc/crnrdlg.hxx b/sc/source/ui/inc/crnrdlg.hxx
index 10a577b89262..e54decd7cf41 100644
--- a/sc/source/ui/inc/crnrdlg.hxx
+++ b/sc/source/ui/inc/crnrdlg.hxx
@@ -32,7 +32,7 @@ class ScColRowNameRangesDlg : public ScAnyRefDlgController
 {
 public:
     ScColRowNameRangesDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
-                          ScViewData* ptrViewData);
+                          ScViewData& rViewData);
     virtual ~ScColRowNameRangesDlg() override;
 
     virtual void    SetReference( const ScRange& rRef, ScDocument& rDoc ) 
override;
@@ -50,7 +50,7 @@ private:
 
     typedef std::unordered_map< OUString, ScRange > NameRangeMap;
     NameRangeMap    aRangeMap;
-    ScViewData*     pViewData;
+    ScViewData&     m_rViewData;
     ScDocument&     rDoc;
     bool            bDlgLostFocus;
 
diff --git a/sc/source/ui/inc/dbnamdlg.hxx b/sc/source/ui/inc/dbnamdlg.hxx
index 27b02e2986ea..fa7cc13dad4f 100644
--- a/sc/source/ui/inc/dbnamdlg.hxx
+++ b/sc/source/ui/inc/dbnamdlg.hxx
@@ -31,7 +31,7 @@ class ScDbNameDlg : public ScAnyRefDlgController
 {
 public:
     ScDbNameDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
-                ScViewData* ptrViewData);
+                ScViewData& rViewData);
     virtual ~ScDbNameDlg() override;
 
     virtual void    SetReference( const ScRange& rRef, ScDocument& rDoc ) 
override;
@@ -50,7 +50,7 @@ private:
     OUString        aStrSource;
     OUString        aStrOperations;
 
-    ScViewData*     pViewData;
+    ScViewData&     m_rViewData;
     const ScDocument& rDoc;
     bool            bRefInputMode;
     ScAddress::Details aAddrDetails;
diff --git a/sc/source/ui/inc/formula.hxx b/sc/source/ui/inc/formula.hxx
index b404b20d6be3..d478ff008285 100644
--- a/sc/source/ui/inc/formula.hxx
+++ b/sc/source/ui/inc/formula.hxx
@@ -46,7 +46,7 @@ class ScFormulaDlg final : public formula::FormulaDlg,
 
 public:
     ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
-        weld::Window* pParent, const ScViewData* pViewData, const 
formula::IFunctionManager* _pFunctionMgr);
+        weld::Window* pParent, const ScViewData& rViewData, const 
formula::IFunctionManager* _pFunctionMgr);
     virtual ~ScFormulaDlg() COVERITY_NOEXCEPT_FALSE override;
 
     // IFormulaEditorHelper
diff --git a/sc/source/ui/inc/highred.hxx b/sc/source/ui/inc/highred.hxx
index 566811eacd22..1655c8fa9522 100644
--- a/sc/source/ui/inc/highred.hxx
+++ b/sc/source/ui/inc/highred.hxx
@@ -32,7 +32,7 @@ class ScDocument;
 class ScHighlightChgDlg : public ScAnyRefDlgController
 {
 private:
-    ScViewData*             pViewData;
+    ScViewData&             m_rViewData;
     ScDocument&             rDoc;
     ScChangeViewSettings    aChangeViewSet;
 
@@ -59,8 +59,8 @@ protected:
     virtual void    RefInputDone( bool bForced = false ) override;
 
 public:
-    ScHighlightChgDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
-               ScViewData*      ptrViewData);
+    ScHighlightChgDlg(SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
+                      ScViewData& rViewData);
 
     virtual ~ScHighlightChgDlg() override;
 
diff --git a/sc/source/ui/inc/namedefdlg.hxx b/sc/source/ui/inc/namedefdlg.hxx
index 7225f592d231..b20b0dc13336 100644
--- a/sc/source/ui/inc/namedefdlg.hxx
+++ b/sc/source/ui/inc/namedefdlg.hxx
@@ -73,7 +73,7 @@ protected:
 
 public:
     ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
-                    const ScViewData* pViewData, const std::map<OUString, 
ScRangeName*>& aRangeMap,
+                    const ScViewData& rViewData, const std::map<OUString, 
ScRangeName*>& aRangeMap,
                     const ScAddress& aCursorPos, const bool bUndo);
 
     virtual ~ScNameDefDlg() override;
diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx
index 405fe99d0328..a45b4ec4c65e 100644
--- a/sc/source/ui/inc/namedlg.hxx
+++ b/sc/source/ui/inc/namedlg.hxx
@@ -39,7 +39,7 @@ private:
     const OUString maStrMultiSelect;
     OUString maStrInfoDefault;
 
-    ScViewData*     mpViewData;
+    ScViewData&     mrViewData;
     ScDocument&     mrDoc;
     const ScAddress maCursorPos;
 
@@ -108,7 +108,7 @@ protected:
 
 public:
     ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* pParent,
-               ScViewData*      ptrViewData,
+               ScViewData&      rViewData,
                const ScAddress& aCursorPos,
                std::map<OUString, std::unique_ptr<ScRangeName>>* pRangeMap = 
nullptr);
     virtual         ~ScNameDlg() override;
diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx 
b/sc/source/ui/miscdlgs/crnrdlg.cxx
index a82d8d26762f..82f42c15be6e 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -57,11 +57,11 @@ const sal_uLong nEntryDataDelim = 2;
 ScColRowNameRangesDlg::ScColRowNameRangesDlg( SfxBindings* pB,
                                 SfxChildWindow* pCW,
                                 weld::Window* pParent,
-                                ScViewData* ptrViewData )
+                                ScViewData& rViewData )
 
     : ScAnyRefDlgController(pB, pCW, pParent, 
"modules/scalc/ui/namerangesdialog.ui", "NameRangesDialog")
-    , pViewData(ptrViewData)
-    , rDoc(ptrViewData->GetDocument())
+    , m_rViewData(rViewData)
+    , rDoc(rViewData.GetDocument())
     , bDlgLostFocus(false)
     , m_pEdActive(nullptr)
     , m_xLbRange(m_xBuilder->weld_tree_view("range"))
@@ -126,25 +126,15 @@ void ScColRowNameRangesDlg::Init()
 
     UpdateNames();
 
-    if (pViewData)
-    {
-        SCCOL nStartCol = 0;
-        SCROW nStartRow = 0;
-        SCTAB nStartTab = 0;
-        SCCOL nEndCol   = 0;
-        SCROW nEndRow   = 0;
-        SCTAB nEndTab   = 0;
-        pViewData->GetSimpleArea( nStartCol, nStartRow, nStartTab,
-                                  nEndCol,   nEndRow,  nEndTab );
-        SetColRowData( ScRange( nStartCol, nStartRow, nStartTab, nEndCol, 
nEndRow, nEndTab));
-    }
-    else
-    {
-        m_xBtnColHead->set_active(true);
-        m_xBtnRowHead->set_active(false);
-        m_xEdAssign->SetText( EMPTY_OUSTRING );
-        m_xEdAssign2->SetText( EMPTY_OUSTRING );
-    }
+    SCCOL nStartCol = 0;
+    SCROW nStartRow = 0;
+    SCTAB nStartTab = 0;
+    SCCOL nEndCol   = 0;
+    SCROW nEndRow   = 0;
+    SCTAB nEndTab   = 0;
+    m_rViewData.GetSimpleArea(nStartCol, nStartRow, nStartTab,
+                              nEndCol,   nEndRow,  nEndTab );
+    SetColRowData( ScRange( nStartCol, nStartRow, nStartTab, nEndCol, nEndRow, 
nEndTab));
 
     m_xBtnColHead->set_sensitive(true);
     m_xBtnRowHead->set_sensitive(true);
@@ -496,7 +486,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, OkBtnHdl, 
weld::Button&, void)
     rDoc.GetRowNameRangesRef() = xRowNameRanges;
     // changed ranges need to take effect
     rDoc.CompileColRowNameFormula();
-    ScDocShell* pDocShell = pViewData->GetDocShell();
+    ScDocShell* pDocShell = m_rViewData.GetDocShell();
     pDocShell->PostPaint(ScRange(0, 0, 0, rDoc.MaxCol(), rDoc.MaxRow(), 
MAXTAB), PaintPartFlags::Grid);
     pDocShell->SetDocumentModified();
 
diff --git a/sc/source/ui/miscdlgs/highred.cxx 
b/sc/source/ui/miscdlgs/highred.cxx
index c6cc22765e0d..5a63bb87fb36 100644
--- a/sc/source/ui/miscdlgs/highred.cxx
+++ b/sc/source/ui/miscdlgs/highred.cxx
@@ -26,10 +26,10 @@
 
 
 ScHighlightChgDlg::ScHighlightChgDlg(SfxBindings* pB, SfxChildWindow* pCW, 
weld::Window* pParent,
-                                     ScViewData* ptrViewData)
+                                     ScViewData& rViewData)
     : ScAnyRefDlgController(pB, pCW, pParent, 
"modules/scalc/ui/showchangesdialog.ui", "ShowChangesDialog")
-    , pViewData(ptrViewData)
-    , rDoc(ptrViewData->GetDocument())
+    , m_rViewData(rViewData)
+    , rDoc(rViewData.GetDocument())
     , m_xHighlightBox(m_xBuilder->weld_check_button("showchanges"))
     , m_xCbAccept(m_xBuilder->weld_check_button("showaccepted"))
     , m_xCbReject(m_xBuilder->weld_check_button("showrejected"))
@@ -59,8 +59,6 @@ ScHighlightChgDlg::~ScHighlightChgDlg()
 
 void ScHighlightChgDlg::Init()
 {
-    OSL_ENSURE( pViewData, "ViewData or Document not found!" );
-
     ScChangeTrack* pChanges = rDoc.GetChangeTrack();
     if(pChanges!=nullptr)
     {
@@ -216,7 +214,7 @@ IMPL_LINK_NOARG(ScHighlightChgDlg, OKBtnHdl, weld::Button&, 
void)
     aChangeViewSet.SetTheRangeList(aLocalRangeList);
     aChangeViewSet.AdjustDateMode( rDoc );
     rDoc.SetChangeViewSettings(aChangeViewSet);
-    pViewData->GetDocShell()->PostPaintGridAll();
+    m_rViewData.GetDocShell()->PostPaintGridAll();
     response(RET_OK);
 }
 
diff --git a/sc/source/ui/namedlg/namedefdlg.cxx 
b/sc/source/ui/namedlg/namedefdlg.cxx
index c5404c634ac4..b66b1cfc0b27 100644
--- a/sc/source/ui/namedlg/namedefdlg.cxx
+++ b/sc/source/ui/namedlg/namedefdlg.cxx
@@ -26,12 +26,12 @@
 #include <tokenarray.hxx>
 
 ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* pCW, 
weld::Window* pParent,
-        const ScViewData* pViewData, const std::map<OUString, ScRangeName*>& 
aRangeMap,
+        const ScViewData& rViewData, const std::map<OUString, ScRangeName*>& 
aRangeMap,
         const ScAddress& aCursorPos, const bool bUndo )
     : ScAnyRefDlgController( pB, pCW, pParent, 
"modules/scalc/ui/definename.ui", "DefineNameDialog")
     , mbUndo( bUndo )
-    , mrDoc(pViewData->GetDocument())
-    , mpDocShell ( pViewData->GetDocShell() )
+    , mrDoc(rViewData.GetDocument())
+    , mpDocShell ( rViewData.GetDocShell() )
     , maCursorPos( aCursorPos )
     , maGlobalNameStr  ( ScResId(STR_GLOBAL_SCOPE) )
     , maErrInvalidNameStr( ScResId(STR_ERR_NAME_INVALID))
@@ -76,7 +76,7 @@ ScNameDefDlg::ScNameDefDlg( SfxBindings* pB, SfxChildWindow* 
pCW, weld::Window*
 
     ScRange aRange;
 
-    pViewData->GetSimpleArea( aRange );
+    rViewData.GetSimpleArea( aRange );
     OUString aAreaStr(aRange.Format(mrDoc, ScRefFlags::RANGE_ABS_3D,
             ScAddress::Details(mrDoc.GetAddressConvention(), 0, 0)));
 
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 85e391890182..bff39913e504 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -42,7 +42,7 @@
 //logic
 
 ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
-        ScViewData*       ptrViewData,
+        ScViewData&  rViewData,
         const ScAddress&  aCursorPos,
         std::map<OUString, std::unique_ptr<ScRangeName>> *const pRangeMap)
     : ScAnyRefDlgController(pB, pCW, pParent, 
"modules/scalc/ui/managenamesdialog.ui",
@@ -53,8 +53,8 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, 
weld::Window* pParen
     , maErrNameInUse(ScResId(STR_ERR_NAME_EXISTS))
     , maStrMultiSelect(ScResId(STR_MULTI_SELECT))
 
-    , mpViewData(ptrViewData)
-    , mrDoc(ptrViewData->GetDocument())
+    , mrViewData(rViewData)
+    , mrDoc(rViewData.GetDocument())
     , maCursorPos(aCursorPos)
     , mbDataChanged(false)
     , mbCloseWithoutUndo(false)
@@ -171,7 +171,7 @@ void ScNameDlg::SetReference( const ScRange& rRef, 
ScDocument& rDocP )
 void ScNameDlg::Close()
 {
     if (mbDataChanged && !mbCloseWithoutUndo)
-        mpViewData->GetDocFunc().ModifyAllRangeNames(m_RangeMap);
+        mrViewData.GetDocFunc().ModifyAllRangeNames(m_RangeMap);
     DoClose(ScNameDlgWrapper::GetChildWindowId());
 }
 
diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx
index db2a4f4fed6c..4fe603fd2b6d 100644
--- a/sc/source/ui/view/tabvwshc.cxx
+++ b/sc/source/ui/view/tabvwshc.cxx
@@ -189,14 +189,14 @@ std::shared_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
         {
             if (!mbInSwitch)
             {
-                xResult = std::make_shared<ScNameDlg>(pB, pCW, pParent, 
&GetViewData(),
+                xResult = std::make_shared<ScNameDlg>(pB, pCW, pParent, 
GetViewData(),
                                      ScAddress( GetViewData().GetCurX(),
                                                 GetViewData().GetCurY(),
                                                 GetViewData().GetTabNo() ) );
             }
             else
             {
-                xResult = std::make_shared<ScNameDlg>( pB, pCW, pParent, 
&GetViewData(),
+                xResult = std::make_shared<ScNameDlg>( pB, pCW, pParent, 
GetViewData(),
                                      ScAddress( GetViewData().GetCurX(),
                                                 GetViewData().GetCurY(),
                                                 GetViewData().GetTabNo() ), 
&m_RangeMap);
@@ -211,7 +211,7 @@ std::shared_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
             {
                 std::map<OUString, ScRangeName*> aRangeMap;
                 rDoc.GetRangeNameMap(aRangeMap);
-                xResult = std::make_shared<ScNameDefDlg>(pB, pCW, pParent, 
&GetViewData(), aRangeMap,
+                xResult = std::make_shared<ScNameDefDlg>(pB, pCW, pParent, 
GetViewData(), aRangeMap,
                                 ScAddress(GetViewData().GetCurX(),
                                           GetViewData().GetCurY(),
                                           GetViewData().GetTabNo()), true);
@@ -223,7 +223,7 @@ std::shared_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
                 {
                     aRangeMap.insert(std::pair<OUString, 
ScRangeName*>(itr.first, itr.second.get()));
                 }
-                xResult = std::make_shared<ScNameDefDlg>(pB, pCW, pParent, 
&GetViewData(), aRangeMap,
+                xResult = std::make_shared<ScNameDefDlg>(pB, pCW, pParent, 
GetViewData(), aRangeMap,
                                 ScAddress(GetViewData().GetCurX(),
                                           GetViewData().GetCurY(),
                                           GetViewData().GetTabNo()), false);
@@ -241,14 +241,14 @@ std::shared_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
             if ( !rMark.IsMarked() && !rMark.IsMultiMarked() )
                 MarkDataArea( false );
 
-            xResult = std::make_shared<ScDbNameDlg>(pB, pCW, pParent, 
&GetViewData());
+            xResult = std::make_shared<ScDbNameDlg>(pB, pCW, pParent, 
GetViewData());
             break;
         }
         case SID_OPENDLG_EDIT_PRINTAREA:
             xResult = std::make_shared<ScPrintAreasDlg>(pB, pCW, pParent);
             break;
         case SID_DEFINE_COLROWNAMERANGES:
-            xResult = std::make_shared<ScColRowNameRangesDlg>(pB, pCW, 
pParent, &GetViewData());
+            xResult = std::make_shared<ScColRowNameRangesDlg>(pB, pCW, 
pParent, GetViewData());
             break;
         case SID_OPENDLG_SOLVE:
         {
@@ -370,7 +370,7 @@ std::shared_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
         case FID_CHG_SHOW:
         {
             // dialog checks, what is in the cell
-            xResult = std::make_shared<ScHighlightChgDlg>(pB, pCW, pParent, 
&GetViewData());
+            xResult = std::make_shared<ScHighlightChgDlg>(pB, pCW, pParent, 
GetViewData());
             break;
         }
         case SID_MANAGE_XML_SOURCE:
@@ -398,7 +398,7 @@ std::shared_ptr<SfxModelessDialogController> 
ScTabViewShell::CreateRefDialogCont
             if (!isLOKMobilePhone())
             {
                 // dialog checks, what is in the cell
-                xResult = o3tl::make_shared<ScFormulaDlg>(pB, pCW, pParent, 
&GetViewData(),ScGlobal::GetStarCalcFunctionMgr());
+                xResult = o3tl::make_shared<ScFormulaDlg>(pB, pCW, pParent, 
GetViewData(), ScGlobal::GetStarCalcFunctionMgr());
             }
             break;
         }
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to