sc/source/ui/inc/target.hxx    |    6 +++---
 sc/source/ui/undo/undoblk.cxx  |   34 +++++++++++++++++-----------------
 sc/source/ui/undo/undoblk2.cxx |    2 +-
 sc/source/ui/undo/undoblk3.cxx |   18 +++++++++---------
 sc/source/ui/undo/undocell.cxx |   10 +++++-----
 sc/source/ui/undo/undodat.cxx  |   14 +++++++-------
 sc/source/ui/undo/undotab.cxx  |   16 ++++++++--------
 sc/source/ui/view/tabvwsh4.cxx |    2 +-
 8 files changed, 51 insertions(+), 51 deletions(-)

New commits:
commit f663f56d227b4cd3395710b1fdf99f73c5f6290a
Author:     Xisco Fauli <xiscofa...@libreoffice.org>
AuthorDate: Mon May 19 13:59:45 2025 +0200
Commit:     Xisco Fauli <xiscofa...@libreoffice.org>
CommitDate: Mon May 19 22:52:45 2025 +0200

    ScTabViewTarget: pass ScTabViewShell by ref
    
    Change-Id: I1a0afa75ccccfc72188f839d462f71699ad1995c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185528
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <xiscofa...@libreoffice.org>

diff --git a/sc/source/ui/inc/target.hxx b/sc/source/ui/inc/target.hxx
index b7c5c78e243d..2be7d1d52f9f 100644
--- a/sc/source/ui/inc/target.hxx
+++ b/sc/source/ui/inc/target.hxx
@@ -26,14 +26,14 @@ class ScTabViewShell;
 class ScTabViewTarget : public SfxRepeatTarget
 {
 private:
-    ScTabViewShell* pViewShell;
+    ScTabViewShell& rViewShell;
 
 public:
 
-                    ScTabViewTarget( ScTabViewShell* pShell ) : pViewShell( 
pShell ) {}
+                    ScTabViewTarget( ScTabViewShell& rShell ) : rViewShell( 
rShell ) {}
     virtual         ~ScTabViewTarget() override;
 
-    ScTabViewShell* GetViewShell() const { return pViewShell; }
+    ScTabViewShell& GetViewShell() const { return rViewShell; }
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 2d3a0af9bfe5..c1e944738b9a 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -332,7 +332,7 @@ void ScUndoInsertCells::Repeat(SfxRepeatTarget& rTarget)
             pPasteUndo->Repeat( rTarget );
         }
         else
-            
static_cast<ScTabViewTarget&>(rTarget).GetViewShell()->InsertCells( eCmd );
+            static_cast<ScTabViewTarget&>(rTarget).GetViewShell().InsertCells( 
eCmd );
     }
 }
 
@@ -626,7 +626,7 @@ void ScUndoDeleteCells::Redo()
 void ScUndoDeleteCells::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget) )
-        pViewTarget->GetViewShell()->DeleteCells( eCmd );
+        pViewTarget->GetViewShell().DeleteCells( eCmd );
 }
 
 bool ScUndoDeleteCells::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -804,7 +804,7 @@ void ScUndoDeleteMulti::Repeat(SfxRepeatTarget& rTarget)
 {
     // if single selection
     if (auto pTabViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pTabViewTarget->GetViewShell()->DeleteCells( DelCellCmd::Rows );
+        pTabViewTarget->GetViewShell().DeleteCells( DelCellCmd::Rows );
 }
 
 bool ScUndoDeleteMulti::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -903,7 +903,7 @@ void ScUndoCut::Redo()
 void ScUndoCut::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->CutToClip();
+        pViewTarget->GetViewShell().CutToClip();
 }
 
 bool ScUndoCut::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -1187,12 +1187,12 @@ void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
     if (!pViewTarget)
         return;
 
-    ScTabViewShell* pViewSh = pViewTarget->GetViewShell();
+    ScTabViewShell& rViewSh = pViewTarget->GetViewShell();
     // keep a reference in case the clipboard is changed during PasteFromClip
-    const ScTransferObj* pOwnClip = 
ScTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(pViewSh->GetViewData().GetActiveWin()));
+    const ScTransferObj* pOwnClip = 
ScTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(rViewSh.GetViewData().GetActiveWin()));
     if (pOwnClip)
     {
-        pViewSh->PasteFromClip( nFlags, pOwnClip->GetDocument(),
+        rViewSh.PasteFromClip( nFlags, pOwnClip->GetDocument(),
                                 aPasteOptions.nFunction, 
aPasteOptions.bSkipEmptyCells, aPasteOptions.bTranspose,
                                 aPasteOptions.bAsLink, 
aPasteOptions.eMoveMode, InsertDeleteFlags::NONE,
                                 true );     // allow warning dialog
@@ -1601,7 +1601,7 @@ void ScUndoListNames::Redo()
 void ScUndoListNames::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pTabViewTarget = dynamic_cast<ScTabViewTarget*>(&rTarget))
-        pTabViewTarget->GetViewShell()->InsertNameList();
+        pTabViewTarget->GetViewShell().InsertNameList();
 }
 
 bool ScUndoListNames::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -1857,7 +1857,7 @@ void ScUndoUseScenario::Repeat(SfxRepeatTarget& rTarget)
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
         OUString aTemp = aName;
-        pViewTarget->GetViewShell()->UseScenario(aTemp);
+        pViewTarget->GetViewShell().UseScenario(aTemp);
     }
 }
 
@@ -1865,7 +1865,7 @@ bool ScUndoUseScenario::CanRepeat(SfxRepeatTarget& 
rTarget) const
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScViewData& rViewData = pViewTarget->GetViewShell()->GetViewData();
+        ScViewData& rViewData = pViewTarget->GetViewShell().GetViewData();
         return !rViewData.GetDocument().IsScenario( rViewData.GetTabNo() );
     }
     return false;
@@ -1966,7 +1966,7 @@ void ScUndoSelectionStyle::Repeat(SfxRepeatTarget& 
rTarget)
         return;
     }
 
-    ScTabViewShell& rViewShell = 
*static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
+    ScTabViewShell& rViewShell = 
static_cast<ScTabViewTarget&>(rTarget).GetViewShell();
     rViewShell.SetStyleSheetToMarked( pStyleSheet );
 }
 
@@ -2050,7 +2050,7 @@ void ScUndoEnterMatrix::Repeat(SfxRepeatTarget& rTarget)
     {
         OUString aTemp = aFormula;
         ScDocument& rDoc = pDocShell->GetDocument();
-        pTabViewTarget->GetViewShell()->EnterMatrix(aTemp, rDoc.GetGrammar());
+        pTabViewTarget->GetViewShell().EnterMatrix(aTemp, rDoc.GetGrammar());
     }
 }
 
@@ -2113,7 +2113,7 @@ void ScUndoIndent::Redo()
 void ScUndoIndent::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->ChangeIndent( bIsIncrement );
+        pViewTarget->GetViewShell().ChangeIndent( bIsIncrement );
 }
 
 bool ScUndoIndent::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -2168,7 +2168,7 @@ void ScUndoTransliterate::Redo()
 void ScUndoTransliterate::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->TransliterateText( nTransliterationType );
+        pViewTarget->GetViewShell().TransliterateText( nTransliterationType );
 }
 
 bool ScUndoTransliterate::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -2227,7 +2227,7 @@ void ScUndoClearItems::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScViewData& rViewData = pViewTarget->GetViewShell()->GetViewData();
+        ScViewData& rViewData = pViewTarget->GetViewShell().GetViewData();
         rViewData.GetDocFunc().ClearItems( rViewData.GetMarkData(), 
pWhich.get(), false );
     }
 }
@@ -2290,7 +2290,7 @@ void ScUndoRemoveBreaks::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
         rViewShell.RemoveManualBreaks();
     }
 }
@@ -2419,7 +2419,7 @@ void ScUndoRemoveMerge::Redo()
 void ScUndoRemoveMerge::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->RemoveMerge();
+        pViewTarget->GetViewShell().RemoveMerge();
 }
 
 bool ScUndoRemoveMerge::CanRepeat(SfxRepeatTarget& rTarget) const
diff --git a/sc/source/ui/undo/undoblk2.cxx b/sc/source/ui/undo/undoblk2.cxx
index 52ee421cc3de..3fc285e3b43a 100644
--- a/sc/source/ui/undo/undoblk2.cxx
+++ b/sc/source/ui/undo/undoblk2.cxx
@@ -175,7 +175,7 @@ void ScUndoWidthOrHeight::Redo()
 void ScUndoWidthOrHeight::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->SetMarkedWidthOrHeight( bWidth, eMode, 
nNewSize );
+        pViewTarget->GetViewShell().SetMarkedWidthOrHeight( bWidth, eMode, 
nNewSize );
 }
 
 bool ScUndoWidthOrHeight::CanRepeat(SfxRepeatTarget& rTarget) const
diff --git a/sc/source/ui/undo/undoblk3.cxx b/sc/source/ui/undo/undoblk3.cxx
index 8d70b86234a2..1d1be93ba1ad 100644
--- a/sc/source/ui/undo/undoblk3.cxx
+++ b/sc/source/ui/undo/undoblk3.cxx
@@ -195,7 +195,7 @@ void ScUndoDeleteContents::Redo()
 void ScUndoDeleteContents::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->DeleteContents( nFlags );
+        pViewTarget->GetViewShell().DeleteContents( nFlags );
 }
 
 bool ScUndoDeleteContents::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -331,7 +331,7 @@ void ScUndoFillTable::Redo()
 void ScUndoFillTable::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->FillTab( nFlags, nFunction, bSkipEmpty, 
bAsLink );
+        pViewTarget->GetViewShell().FillTab( nFlags, nFunction, bSkipEmpty, 
bAsLink );
 }
 
 bool ScUndoFillTable::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -462,7 +462,7 @@ void ScUndoSelectionAttr::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
         if (maLineOuter.getItem())
             rViewShell.ApplyPatternLines(*aApplyPattern.getScPatternAttr(),
                 *static_cast<const SvxBoxItem*>(maLineOuter.getItem()),
@@ -617,7 +617,7 @@ void ScUndoAutoFill::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
         if (eFillCmd==FILL_SIMPLE)
             rViewShell.FillSimple( eFillDir );
         else
@@ -750,7 +750,7 @@ void ScUndoMerge::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
         rViewShell.MergeCells( false, false, false, 0 );
     }
 }
@@ -902,7 +902,7 @@ void ScUndoAutoFormat::Redo()
 void ScUndoAutoFormat::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->AutoFormat( nFormatNo );
+        pViewTarget->GetViewShell().AutoFormat( nFormatNo );
 }
 
 bool ScUndoAutoFormat::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -1081,7 +1081,7 @@ void ScUndoReplace::Redo()
 void ScUndoReplace::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->SearchAndReplace( pSearchItem.get(), 
true, false );
+        pViewTarget->GetViewShell().SearchAndReplace( pSearchItem.get(), true, 
false );
 }
 
 bool ScUndoReplace::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -1266,7 +1266,7 @@ void ScUndoConversion::Redo()
 void ScUndoConversion::Repeat( SfxRepeatTarget& rTarget )
 {
     if( auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget) )
-        pViewTarget->GetViewShell()->DoSheetConversion( maConvParam );
+        pViewTarget->GetViewShell().DoSheetConversion( maConvParam );
 }
 
 bool ScUndoConversion::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -1352,7 +1352,7 @@ void ScUndoRefConversion::Redo()
 void ScUndoRefConversion::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->DoRefConversion();
+        pViewTarget->GetViewShell().DoRefConversion();
 }
 
 bool ScUndoRefConversion::CanRepeat(SfxRepeatTarget& rTarget) const
diff --git a/sc/source/ui/undo/undocell.cxx b/sc/source/ui/undo/undocell.cxx
index c7c085d1fe15..d146f6bedc16 100644
--- a/sc/source/ui/undo/undocell.cxx
+++ b/sc/source/ui/undo/undocell.cxx
@@ -150,7 +150,7 @@ void ScUndoCursorAttr::Redo()
 void ScUndoCursorAttr::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->ApplySelectionPattern( 
*aApplyPattern.getScPatternAttr() );
+        pViewTarget->GetViewShell().ApplySelectionPattern( 
*aApplyPattern.getScPatternAttr() );
 }
 
 bool ScUndoCursorAttr::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -298,7 +298,7 @@ void ScUndoEnterData::Repeat(SfxRepeatTarget& rTarget)
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
         OUString aTemp = maNewString;
-        pViewTarget->GetViewShell()->EnterDataAtCursor( aTemp );
+        pViewTarget->GetViewShell().EnterDataAtCursor( aTemp );
     }
 }
 
@@ -557,7 +557,7 @@ void ScUndoPageBreak::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
 
         if (bInsert)
             rViewShell.InsertPageBreak(bColumn);
@@ -630,7 +630,7 @@ void ScUndoPrintZoom::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
         ScViewData& rViewData = rViewShell.GetViewData();
         rViewData.GetDocShell()->SetPrintZoom( rViewData.GetTabNo(), 
nNewScale, nNewPages );
     }
@@ -714,7 +714,7 @@ void ScUndoThesaurus::Redo()
 void ScUndoThesaurus::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->DoThesaurus();
+        pViewTarget->GetViewShell().DoThesaurus();
 }
 
 bool ScUndoThesaurus::CanRepeat(SfxRepeatTarget& rTarget) const
diff --git a/sc/source/ui/undo/undodat.cxx b/sc/source/ui/undo/undodat.cxx
index f34ebba87d32..340ef998e292 100644
--- a/sc/source/ui/undo/undodat.cxx
+++ b/sc/source/ui/undo/undodat.cxx
@@ -228,7 +228,7 @@ void ScUndoMakeOutline::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
 
         if (bMake)
             rViewShell.MakeOutline( bColumns );
@@ -322,7 +322,7 @@ void ScUndoOutlineLevel::Redo()
 void ScUndoOutlineLevel::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->SelectLevel( bColumns, nLevel );
+        pViewTarget->GetViewShell().SelectLevel( bColumns, nLevel );
 }
 
 bool ScUndoOutlineLevel::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -425,7 +425,7 @@ void ScUndoOutlineBlock::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
 
         if (bShow)
             rViewShell.ShowMarkedOutlines();
@@ -522,7 +522,7 @@ void ScUndoRemoveAllOutlines::Redo()
 void ScUndoRemoveAllOutlines::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->RemoveAllOutlines();
+        pViewTarget->GetViewShell().RemoveAllOutlines();
 }
 
 bool ScUndoRemoveAllOutlines::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -620,7 +620,7 @@ void ScUndoAutoOutline::Redo()
 void ScUndoAutoOutline::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->AutoOutline();
+        pViewTarget->GetViewShell().AutoOutline();
 }
 
 bool ScUndoAutoOutline::CanRepeat(SfxRepeatTarget& rTarget) const
@@ -1264,7 +1264,7 @@ void ScUndoImportData::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell& rViewShell = *pViewTarget->GetViewShell();
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
 
         SCTAB nDummy;
         ScImportParam aNewParam(aImportParam);
@@ -1445,7 +1445,7 @@ void ScUndoRepeatDB::Redo()
 void ScUndoRepeatDB::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->RepeatDB();
+        pViewTarget->GetViewShell().RepeatDB();
 }
 
 bool ScUndoRepeatDB::CanRepeat(SfxRepeatTarget& rTarget) const
diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 52d1a18ff62d..19c543a5b50b 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -227,7 +227,7 @@ void ScUndoInsertTab::Redo()
 void ScUndoInsertTab::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
+        pViewTarget->GetViewShell().GetViewData().GetDispatcher().
             Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
 }
 
@@ -326,7 +326,7 @@ void ScUndoInsertTables::Redo()
 void ScUndoInsertTables::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
+        pViewTarget->GetViewShell().GetViewData().GetDispatcher().
             Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
 }
 
@@ -505,8 +505,8 @@ void ScUndoDeleteTab::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        ScTabViewShell* pViewShell = pViewTarget->GetViewShell();
-        pViewShell->DeleteTable( pViewShell->GetViewData().GetTabNo() );
+        ScTabViewShell& rViewShell = pViewTarget->GetViewShell();
+        rViewShell.DeleteTable( rViewShell.GetViewData().GetTabNo() );
     }
 }
 
@@ -970,7 +970,7 @@ void ScUndoMakeScenario::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
     {
-        pViewTarget->GetViewShell()->MakeScenario( aName, aComment, aColor, 
nFlags );
+        pViewTarget->GetViewShell().MakeScenario( aName, aComment, aColor, 
nFlags );
     }
 }
 
@@ -1123,7 +1123,7 @@ void ScUndoImportTab::Redo()
 void ScUndoImportTab::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
+        pViewTarget->GetViewShell().GetViewData().GetDispatcher().
             Execute(FID_INS_TABLE, SfxCallMode::SLOT | SfxCallMode::RECORD);
 }
 
@@ -1251,7 +1251,7 @@ void ScUndoShowHideTab::Redo()
 void ScUndoShowHideTab::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
+        pViewTarget->GetViewShell().GetViewData().GetDispatcher().
             Execute( bShow ? FID_TABLE_SHOW : FID_TABLE_HIDE,
                                 SfxCallMode::SLOT | SfxCallMode::RECORD);
 }
@@ -1672,7 +1672,7 @@ void ScUndoLayoutRTL::Redo()
 void ScUndoLayoutRTL::Repeat(SfxRepeatTarget& rTarget)
 {
     if (auto pViewTarget = dynamic_cast<ScTabViewTarget*>( &rTarget))
-        pViewTarget->GetViewShell()->GetViewData().GetDispatcher().
+        pViewTarget->GetViewShell().GetViewData().GetDispatcher().
             Execute( FID_TAB_RTL, SfxCallMode::SLOT | SfxCallMode::RECORD);
 }
 
diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index b1bff569e6a6..86c0800c0204 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -2021,7 +2021,7 @@ ScTabViewShell::ScTabViewShell( SfxViewFrame& rViewFrame,
     ScDBFunc( &rViewFrame.GetWindow(), 
static_cast<ScDocShell&>(*rViewFrame.GetObjectShell()), this ),
     eCurOST(OST_NONE),
     nDrawSfxId(0),
-    aTarget(this),
+    aTarget(*this),
     bActiveDrawSh(false),
     bActiveDrawTextSh(false),
     bActiveDrawFormSh(false),

Reply via email to