basctl/source/dlged/dlged.cxx                              |    2 
 basctl/source/dlged/propbrw.cxx                            |    6 -
 chart2/source/controller/drawinglayer/DrawViewWrapper.cxx  |    8 -
 chart2/source/controller/main/DrawCommandDispatch.cxx      |    2 
 chart2/source/controller/main/ShapeController.cxx          |    6 -
 cui/source/tabpages/tpbitmap.cxx                           |    4 
 cui/source/tabpages/transfrm.cxx                           |   22 +--
 include/svx/svdedtv.hxx                                    |   37 +++++-
 include/svx/svdpntv.hxx                                    |    8 -
 reportdesign/source/ui/report/ReportSection.cxx            |    4 
 reportdesign/source/ui/report/ViewsWindow.cxx              |    8 -
 reportdesign/source/ui/report/propbrw.cxx                  |    6 -
 sc/source/ui/app/drwtrans.cxx                              |   10 -
 sc/source/ui/drawfunc/drawsh2.cxx                          |    4 
 sc/source/ui/drawfunc/drawsh4.cxx                          |    2 
 sc/source/ui/drawfunc/drtxtob.cxx                          |   10 -
 sc/source/ui/drawfunc/drtxtob2.cxx                         |    6 -
 sc/source/ui/drawfunc/fuconuno.cxx                         |    4 
 sc/source/ui/drawfunc/fuins1.cxx                           |    2 
 sc/source/ui/navipi/content.cxx                            |    2 
 sc/source/ui/unoobj/docuno.cxx                             |    2 
 sc/source/ui/unoobj/viewuno.cxx                            |    6 -
 sc/source/ui/view/drawvie4.cxx                             |    4 
 sc/source/ui/view/drawview.cxx                             |   26 ++--
 sc/source/ui/view/gridwin4.cxx                             |    2 
 sc/source/ui/view/gridwin5.cxx                             |    2 
 sc/source/ui/view/printfun.cxx                             |    2 
 sc/source/ui/view/tabview5.cxx                             |    4 
 sc/source/ui/view/tabvwsh2.cxx                             |   20 +--
 sc/source/ui/view/tabvwshb.cxx                             |   14 +-
 sc/source/ui/view/tabvwshg.cxx                             |    4 
 sc/source/ui/view/viewfun3.cxx                             |    2 
 sc/source/ui/view/viewfun7.cxx                             |   18 +--
 sd/source/core/drawdoc3.cxx                                |    2 
 sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx |    8 -
 sd/source/ui/app/optsitem.cxx                              |    2 
 sd/source/ui/app/sdxfer.cxx                                |    3 
 sd/source/ui/func/fuolbull.cxx                             |    2 
 sd/source/ui/func/fuprlout.cxx                             |    2 
 sd/source/ui/table/TableDesignPane.cxx                     |    2 
 sd/source/ui/tools/PreviewRenderer.cxx                     |    2 
 sd/source/ui/view/drbezob.cxx                              |    2 
 sd/source/ui/view/drviews1.cxx                             |    6 -
 sd/source/ui/view/drviews7.cxx                             |   10 -
 sd/source/ui/view/drviewsg.cxx                             |    4 
 sd/source/ui/view/frmview.cxx                              |   12 +-
 sd/source/ui/view/sdview.cxx                               |   28 ++---
 sd/source/ui/view/sdview3.cxx                              |    8 -
 sd/source/ui/view/sdview4.cxx                              |    2 
 svx/source/dialog/graphctl.cxx                             |    2 
 svx/source/engine3d/view3d.cxx                             |   12 +-
 svx/source/engine3d/view3d1.cxx                            |   14 +-
 svx/source/form/fmshell.cxx                                |    2 
 svx/source/form/fmshimp.cxx                                |    5 
 svx/source/form/fmview.cxx                                 |    4 
 svx/source/gallery2/galtheme.cxx                           |    2 
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx        |   14 +-
 svx/source/svdraw/sdrpagewindow.cxx                        |    4 
 svx/source/svdraw/svdcrtv.cxx                              |   15 +-
 svx/source/svdraw/svddrgmt.cxx                             |   26 ++--
 svx/source/svdraw/svddrgv.cxx                              |    4 
 svx/source/svdraw/svdedtv.cxx                              |   56 +++++-----
 svx/source/svdraw/svdedtv1.cxx                             |   48 ++++----
 svx/source/svdraw/svdedtv2.cxx                             |   72 ++++++-------
 svx/source/svdraw/svdedxv.cxx                              |   66 +++++------
 svx/source/svdraw/svdglev.cxx                              |   18 +--
 svx/source/svdraw/svdmrkv.cxx                              |   12 +-
 svx/source/svdraw/svdpagv.cxx                              |    2 
 svx/source/svdraw/svdpntv.cxx                              |   12 --
 svx/source/svdraw/svdpoev.cxx                              |   22 +--
 svx/source/svdraw/svdview.cxx                              |   10 -
 svx/source/svdraw/svdxcgv.cxx                              |   34 +++---
 svx/source/tbxctrls/colrctrl.cxx                           |    2 
 svx/source/tbxctrls/grafctrl.cxx                           |    6 -
 svx/source/toolbars/extrusionbar.cxx                       |   10 -
 svx/source/toolbars/fontworkbar.cxx                        |    4 
 sw/source/core/draw/dview.cxx                              |    6 -
 sw/source/core/frmedt/fecopy.cxx                           |    2 
 sw/source/core/frmedt/feshview.cxx                         |   10 -
 sw/source/core/layout/paintfrm.cxx                         |    2 
 sw/source/core/view/vdraw.cxx                              |   12 +-
 sw/source/uibase/ribbar/conrect.cxx                        |    4 
 sw/source/uibase/shells/beziersh.cxx                       |    8 -
 sw/source/uibase/shells/drawdlg.cxx                        |   40 +++----
 sw/source/uibase/shells/drawsh.cxx                         |   18 +--
 sw/source/uibase/shells/drwbassh.cxx                       |   14 +-
 sw/source/uibase/shells/drwtxtsh.cxx                       |    6 -
 sw/source/uibase/shells/frmsh.cxx                          |    6 -
 sw/source/uibase/shells/mediash.cxx                        |    8 -
 sw/source/uibase/shells/navsh.cxx                          |    8 -
 sw/source/uibase/uiview/viewdraw.cxx                       |    6 -
 91 files changed, 495 insertions(+), 487 deletions(-)

New commits:
commit c2f8f7fc5a7ef17e87d9380d1a15994059f2dd95
Author:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
AuthorDate: Mon Jan 30 20:14:10 2023 +0900
Commit:     Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
CommitDate: Tue Jan 31 11:07:10 2023 +0900

    svx: SdrPaintView remove mpModel and change code to GetModel
    
    mpModel is always the same as the input model in SdrPaintView
    and it's subclasses (all down to SdrView), so there is no need
    to have the variable.
    
    Change the strange and confucing var. name mrSdrModelFromSdrView
    to just mrModel. GetModel returns a pointer to the mrModel.
    
    Change-Id: I18351a417fd82f49262a83de036ec1420a65399c

diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index 93072072af92..02a9cc32736f 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -218,7 +218,7 @@ DlgEditor::DlgEditor (
     Size aPageSize = rWindow.PixelToLogic(Size(DLGED_PAGE_WIDTH_MIN, 
DLGED_PAGE_HEIGHT_MIN));
     pDlgEdPage->setSize({ gfx::Length::hmm(aPageSize.Width()), 
gfx::Length::hmm(aPageSize.Height()) });
 
-    pDlgEdView->ShowSdrPage(pDlgEdView->GetModel()->GetPage(0));
+    pDlgEdView->ShowSdrPage(pDlgEdView->GetModel().GetPage(0));
     pDlgEdView->SetLayerVisible( "HiddenLayer", false );
     pDlgEdView->SetMoveSnapOnlyTopLeft(true);
     
pDlgEdView->SetWorkArea(gfx::length::toRectangleHmm(pDlgEdPage->getRectangle()));
diff --git a/basctl/source/dlged/propbrw.cxx b/basctl/source/dlged/propbrw.cxx
index 30823a1da7cd..f95157d4f7d7 100644
--- a/basctl/source/dlged/propbrw.cxx
+++ b/basctl/source/dlged/propbrw.cxx
@@ -443,7 +443,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& 
_rxContextDocument, SdrView
     {
         if ( pView )
         {
-            EndListening( *(pView->GetModel()) );
+            EndListening(pView->GetModel());
             pView = nullptr;
         }
 
@@ -464,7 +464,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& 
_rxContextDocument, SdrView
 
         if ( nMarkCount == 0 )
         {
-            EndListening( *(pView->GetModel()) );
+            EndListening(pView->GetModel());
             pView = nullptr;
             implSetNewObject( nullptr );
             return;
@@ -492,7 +492,7 @@ void PropBrw::ImplUpdate( const Reference< XModel >& 
_rxContextDocument, SdrView
         else
             implSetNewObject( xNewObject );
 
-        StartListening( *(pView->GetModel()) );
+        StartListening(pView->GetModel());
     }
     catch ( const PropertyVetoException& ) { /* silence */ }
     catch ( const Exception& )
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx 
b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index cb63c2d690a8..10062a6b1a95 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -122,7 +122,7 @@ void DrawViewWrapper::ReInit()
     tools::Rectangle aRect(Point(0,0), aOutputSize);
     SetWorkArea(aRect);
 
-    ShowSdrPage(GetModel()->GetPage(0));
+    ShowSdrPage(GetModel().GetPage(0));
 }
 
 DrawViewWrapper::~DrawViewWrapper()
@@ -256,7 +256,7 @@ SdrOutliner* DrawViewWrapper::getOutliner() const
 SfxItemSet DrawViewWrapper::getPositionAndSizeItemSetFromMarkedObject() const
 {
     SfxItemSet aFullSet(
-        GetModel()->GetItemPool(),
+        GetModel().GetItemPool(),
         svl::Items<
             SDRATTR_CORNER_RADIUS, SDRATTR_CORNER_RADIUS,
             SID_ATTR_TRANSFORM_POS_X, SID_ATTR_TRANSFORM_ANGLE,
@@ -293,8 +293,8 @@ bool DrawViewWrapper::IsObjectHit( SdrObject const * pObj, 
const Point& rPnt )
 void DrawViewWrapper::Notify(SfxBroadcaster& rBC, const SfxHint& rHint)
 {
     //prevent wrong reselection of objects
-    SdrModel* pSdrModel( GetModel() );
-    if( pSdrModel && pSdrModel->isLocked() )
+    SdrModel& rSdrModel = GetModel();
+    if (rSdrModel.isLocked())
         return;
 
     const SdrHint* pSdrHint = ( rHint.GetId() == SfxHintId::ThisIsAnSdrHint ? 
static_cast<const SdrHint*>(&rHint) : nullptr );
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx 
b/chart2/source/controller/main/DrawCommandDispatch.cxx
index cafdd83a87ef..2653ef9df274 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -184,7 +184,7 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
         aArrow.append( aNewArrow );
     }
 
-    SfxItemSet aSet( pDrawViewWrapper->GetModel()->GetItemPool() );
+    SfxItemSet aSet(pDrawViewWrapper->GetModel().GetItemPool());
     pDrawViewWrapper->GetAttributes( aSet );
 
     tools::Long nWidth = 300; // (1/100th mm)
diff --git a/chart2/source/controller/main/ShapeController.cxx 
b/chart2/source/controller/main/ShapeController.cxx
index 4cf6a4f7df34..14d6c082d9af 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -353,7 +353,7 @@ void ShapeController::executeDispatch_TransformDialog()
     if ( pSelectedObj && pSelectedObj->GetObjIdentifier() == 
SdrObjKind::Caption )
     {
         // item set for caption
-        SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+        SfxItemSet aAttr(pDrawViewWrapper->GetModel().GetItemPool());
         pDrawViewWrapper->GetAttributes( aAttr );
         // item set for position and size
         SfxItemSet aGeoAttr( pDrawViewWrapper->GetGeoAttrFromMarked() );
@@ -505,7 +505,7 @@ void ShapeController::executeDispatch_FontDialog()
     DrawViewWrapper* pDrawViewWrapper = 
m_pChartController->GetDrawViewWrapper();
     if ( pChartWindow && pDrawModelWrapper && pDrawViewWrapper )
     {
-        SfxItemSet aAttr( pDrawViewWrapper->GetModel()->GetItemPool() );
+        SfxItemSet aAttr(pDrawViewWrapper->GetModel().GetItemPool());
         pDrawViewWrapper->GetAttributes( aAttr );
         ViewElementListProvider aViewElementListProvider( pDrawModelWrapper );
         ShapeFontDialog aDlg(pChartWindow, &aAttr, &aViewElementListProvider);
@@ -528,7 +528,7 @@ void ShapeController::executeDispatch_ParagraphDialog()
     if ( !(pChartWindow && pDrawViewWrapper) )
         return;
 
-    SfxItemPool& rPool = pDrawViewWrapper->GetModel()->GetItemPool();
+    SfxItemPool& rPool = pDrawViewWrapper->GetModel().GetItemPool();
     SfxItemSet aAttr( rPool );
     pDrawViewWrapper->GetAttributes( aAttr );
 
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index b515d6bd9a36..187dc2f87b24 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -260,7 +260,7 @@ void SvxBitmapTabPage::Reset( const SfxItemSet* rAttrs )
     double fUIScale  = 1.0;
     if (mpView)
     {
-        fUIScale  = ( mpView->GetModel() ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
+        fUIScale  = double(mpView->GetModel().GetUIScale());
 
 
         if (mpView->AreObjectsMarked())
@@ -487,7 +487,7 @@ IMPL_LINK_NOARG(SvxBitmapTabPage, ModifyBitmapHdl, 
ValueSet*, void)
     {
         BitmapEx aBmpEx(pGraphicObject->GetGraphic().GetBitmapEx());
         Size aTempBitmapSize = aBmpEx.GetSizePixel();
-        const double fUIScale = ( (mpView && mpView->GetModel()) ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
+        const double fUIScale = mpView && 
double(mpView->GetModel().GetUIScale());
         Size aBitmapSize100mm = o3tl::convert(aTempBitmapSize, 
o3tl::Length::pt, o3tl::Length::mm100);
 
         rBitmapSize.setWidth(aBitmapSize100mm.Width() / fUIScale);
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index c9fd14095b9d..40f54d302a3f 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -207,7 +207,7 @@ void SvxAngleTabPage::Construct()
     }
 
     // take scale into account
-    const Fraction aUIScale(pView->GetModel()->GetUIScale());
+    const Fraction aUIScale(pView->GetModel().GetUIScale());
     TransfrmHelper::ScaleRect(maRange, aUIScale);
 
     // take UI units into account
@@ -227,7 +227,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
 
     if (m_xCtlAngle->IsValueModified() || 
m_xMtrPosX->get_value_changed_from_saved() || 
m_xMtrPosY->get_value_changed_from_saved())
     {
-        const double fUIScale(double(pView->GetModel()->GetUIScale()));
+        const double fUIScale(double(pView->GetModel().GetUIScale()));
         const double fTmpX((GetCoreValue(*m_xMtrPosX, ePoolUnit) + 
maAnchor.getX()) * fUIScale);
         const double fTmpY((GetCoreValue(*m_xMtrPosY, ePoolUnit) + 
maAnchor.getY()) * fUIScale);
 
@@ -244,7 +244,7 @@ bool SvxAngleTabPage::FillItemSet(SfxItemSet* rSet)
 
 void SvxAngleTabPage::Reset(const SfxItemSet* rAttrs)
 {
-    const double fUIScale(double(pView->GetModel()->GetUIScale()));
+    const double fUIScale(double(pView->GetModel().GetUIScale()));
 
     const SfxPoolItem* pItem = GetItem( *rAttrs, SID_ATTR_TRANSFORM_ROT_X );
     if(pItem)
@@ -430,7 +430,7 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
 
     if (m_xMtrRadius->get_value_changed_from_saved())
     {
-        Fraction aUIScale = pView->GetModel()->GetUIScale();
+        Fraction aUIScale = pView->GetModel().GetUIScale();
         tools::Long nTmp = tools::Long(GetCoreValue(*m_xMtrRadius, ePoolUnit) 
* aUIScale);
 
         rAttrs->Put( makeSdrEckenradiusItem( nTmp ) );
@@ -561,7 +561,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
 
         if( pItem )
         {
-            const double fUIScale(double(pView->GetModel()->GetUIScale()));
+            const double fUIScale(double(pView->GetModel().GetUIScale()));
             const double fTmp(static_cast<double>(static_cast<const 
SdrMetricItem*>(pItem)->GetValue()) / fUIScale);
             SetMetricValue(*m_xMtrRadius, basegfx::fround(fTmp), ePoolUnit);
         }
@@ -627,7 +627,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
                 *pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()));
 
         //save geometry
-        const bool bOrigModelChangeState = pView->GetModel()->IsChanged();
+        const bool bOrigModelChangeState = pView->GetModel().IsChanged();
         SdrCustomShapeGeometryItem 
aInitialGeometry(rSdrObjCustomShape.GetMergedItem(SDRATTR_CUSTOMSHAPE_GEOMETRY));
         EnhancedCustomShape2d aShape(rSdrObjCustomShape);
 
@@ -671,7 +671,7 @@ void SvxSlantTabPage::Reset(const SfxItemSet* rAttrs)
 
         //restore geometry
         rSdrObjCustomShape.SetMergedItem(aInitialGeometry);
-        pView->GetModel()->SetChanged(bOrigModelChangeState);
+        pView->GetModel().SetChanged(bOrigModelChangeState);
     }
 
     for (int i = 0; i < 2; ++i)
@@ -860,7 +860,7 @@ void SvxPositionSizeTabPage::Construct()
     }
 
     // take scale into account
-    const Fraction aUIScale(mpView->GetModel()->GetUIScale());
+    const Fraction aUIScale(mpView->GetModel().GetUIScale());
     TransfrmHelper::ScaleRect( maWorkRange, aUIScale );
     TransfrmHelper::ScaleRect( maRange, aUIScale );
 
@@ -891,7 +891,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* 
rOutAttrs )
     {
         if (m_xMtrPosX->get_value_changed_from_saved() || 
m_xMtrPosY->get_value_changed_from_saved())
         {
-            const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+            const double fUIScale(double(mpView->GetModel().GetUIScale()));
             double fX((GetCoreValue( *m_xMtrPosX, mePoolUnit ) + 
maAnchor.getX()) * fUIScale);
             double fY((GetCoreValue( *m_xMtrPosY, mePoolUnit ) + 
maAnchor.getY()) * fUIScale);
 
@@ -929,7 +929,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* 
rOutAttrs )
 
     if (m_xMtrWidth->get_value_changed_from_saved() || 
m_xMtrHeight->get_value_changed_from_saved())
     {
-        Fraction aUIScale = mpView->GetModel()->GetUIScale();
+        Fraction aUIScale = mpView->GetModel().GetUIScale();
 
         // get Width
         double nWidth = 
static_cast<double>(m_xMtrWidth->get_value(FieldUnit::MM_100TH));
@@ -999,7 +999,7 @@ bool SvxPositionSizeTabPage::FillItemSet( SfxItemSet* 
rOutAttrs )
 void SvxPositionSizeTabPage::Reset( const SfxItemSet*  )
 {
     const SfxPoolItem* pItem;
-    const double fUIScale(double(mpView->GetModel()->GetUIScale()));
+    const double fUIScale(double(mpView->GetModel().GetUIScale()));
 
     if ( !mbPageDisabled )
     {
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 1a6ba3897152..2ff56e71b17b 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -174,14 +174,37 @@ public:
     // between BegUndo() and EndUndo() calls (unlimited).
     // The comment used for the UndoAction is the first BegUndo(String).
     // In this case NotifyNewUndoAction is called at the last EndUndo().
-    // NotifyNewUndoAction() is not called for an empty group.
-    void BegUndo()                         { mpModel->BegUndo();         } // 
open undo-grouping
-    void BegUndo(const OUString& rComment) { mpModel->BegUndo(rComment); } // 
open undo-grouping
-    void BegUndo(const OUString& rComment, const OUString& rObjDescr, 
SdrRepeatFunc eFunc=SdrRepeatFunc::NONE) { 
mpModel->BegUndo(rComment,rObjDescr,eFunc); } // open undo-grouping
-    void EndUndo();                                                   // close 
undo-grouping  (incl. BroadcastEdges)
-    void AddUndo(std::unique_ptr<SdrUndoAction> pUndo)   { 
mpModel->AddUndo(std::move(pUndo));    } // add action
+    // NotifyNewUndoAction() is not called for an empty group
+    void BegUndo()
+    {
+        // open undo-grouping
+        GetModel().BegUndo();
+    }
+    void BegUndo(const OUString& rComment)
+    {
+        // open undo-grouping
+        GetModel().BegUndo(rComment);
+    }
+    void BegUndo(const OUString& rComment, const OUString& rObjDescr, 
SdrRepeatFunc eFunc=SdrRepeatFunc::NONE)
+    {
+        // open undo-grouping
+        GetModel().BegUndo(rComment,rObjDescr,eFunc);
+    }
+
+    void EndUndo(); // close undo-grouping  (incl. BroadcastEdges)
+
+    void AddUndo(std::unique_ptr<SdrUndoAction> pUndo)
+    {
+        // add action
+        GetModel().AddUndo(std::move(pUndo));
+    }
+
     // only after first BegUndo or before last EndUndo:
-    void SetUndoComment(const OUString& rComment, const OUString& rObjDescr) { 
mpModel->SetUndoComment(rComment,rObjDescr); }
+    void SetUndoComment(const OUString& rComment, const OUString& rObjDescr)
+    {
+        GetModel().SetUndoComment(rComment,rObjDescr);
+    }
+
     bool IsUndoEnabled() const;
 
     /**
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index 7e49d959232b..f6be42ee1e9a 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -118,11 +118,10 @@ private:
     friend class SdrGrafObj;
 
     // the SdrModel this view was created with, unchanged during lifetime
-    SdrModel& mrSdrModelFromSdrView;
+    SdrModel& mrModel;
 
     std::unique_ptr<SdrPageView> mpPageView;
 protected:
-    SdrModel* mpModel;
     VclPtr<OutputDevice> mpActualOutDev; // Only for comparison
     VclPtr<OutputDevice> mpDragWin;
     SfxStyleSheet* mpDefaultStyleSheet;
@@ -255,10 +254,11 @@ protected:
 
 public:
     // SdrModel access on SdrView level
-    SdrModel& getSdrModelFromSdrView() const { return mrSdrModelFromSdrView; }
+    SdrModel& getSdrModelFromSdrView() const { return mrModel; }
+
+    SdrModel& GetModel() const { return mrModel; }
 
     virtual void ClearPageView();
-    SdrModel* GetModel() const { return mpModel; }
 
     virtual bool IsAction() const;
     virtual void MovAction(const Point& rPnt);
diff --git a/reportdesign/source/ui/report/ReportSection.cxx 
b/reportdesign/source/ui/report/ReportSection.cxx
index 966b400eea83..21b36325156d 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -269,7 +269,7 @@ void OReportSection::Paste(const uno::Sequence< 
beans::NamedValue >& _aAllreadyC
                                 pNewObj->SetLogicRect(aRet);
                             }
                         }
-                        m_pView->AddUndo( 
m_pView->GetModel()->GetSdrUndoFactory().CreateUndoNewObject( *pNewObj ) );
+                        
m_pView->AddUndo(m_pView->GetModel().GetSdrUndoFactory().CreateUndoNewObject(*pNewObj));
                         m_pView->MarkObj( pNewObj.get(), 
m_pView->GetSdrPageView() );
                         if ( m_xSection.is() && 
(o3tl::make_unsigned(aRet.getOpenHeight() + aRet.Top()) > 
m_xSection->getHeight()) )
                             m_xSection->setHeight(aRet.getOpenHeight() + 
aRet.Top());
@@ -331,7 +331,7 @@ void OReportSection::Copy(uno::Sequence< beans::NamedValue 
>& _rAllreadyCopiedOb
     ::std::vector< uno::Reference<report::XReportComponent> > aCopies;
     aCopies.reserve(nMark);
 
-    SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory();
+    SdrUndoFactory& rUndo = m_pView->GetModel().GetSdrUndoFactory();
 
     for( size_t i = nMark; i > 0; )
     {
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx 
b/reportdesign/source/ui/report/ViewsWindow.cxx
index 996d2530a1e3..e11735bf72ca 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -816,7 +816,7 @@ void OViewsWindow::alignMarkedObjects(ControlModification 
_nControlModification,
             if ( 
lcl_getNewRectSize(aObjRect,nXMov,nYMov,pObj,pView,_nControlModification) )
             {
                 const Size aSize(nXMov,nYMov);
-                
pView->AddUndo(pView->GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pObj,aSize));
+                
pView->AddUndo(pView->GetModel().GetSdrUndoFactory().CreateUndoMoveObject(*pObj,aSize));
                 pObj->Move(aSize);
                 aObjRect =   pObj->GetSnapRect();
             }
@@ -838,7 +838,7 @@ void OViewsWindow::alignMarkedObjects(ControlModification 
_nControlModification,
                         [[fallthrough]];
                     case ControlModification::WIDTH_SMALLEST:
                     case ControlModification::HEIGHT_SMALLEST:
-                        pView->AddUndo( 
pView->GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+                        pView->AddUndo( 
pView->GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
                         {
                             OObjectBase* pObjBase = 
dynamic_cast<OObjectBase*>(pObj);
                             OSL_ENSURE(pObjBase,"Where comes this object 
from?");
@@ -974,9 +974,9 @@ void 
OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const tools::Recta
 
             pNewObj->SetLogicRect(_aRect);
             pNewObj->Move(Size(0, aNewPos.Y()));
-            bool bChanged = rView.GetModel()->IsChanged();
+            bool bChanged = rView.GetModel().IsChanged();
             rReportSection.getPage()->InsertObject(pNewObj.get());
-            rView.GetModel()->SetChanged(bChanged);
+            rView.GetModel().SetChanged(bChanged);
             m_aBegDragTempList.push_back(pNewObj.get());
 
             rView.MarkObj( pNewObj.get(), rView.GetSdrPageView() );
diff --git a/reportdesign/source/ui/report/propbrw.cxx 
b/reportdesign/source/ui/report/propbrw.cxx
index babf2266b4f5..41893a9a35ed 100644
--- a/reportdesign/source/ui/report/propbrw.cxx
+++ b/reportdesign/source/ui/report/propbrw.cxx
@@ -421,7 +421,7 @@ void PropBrw::Update( OSectionView* pNewView )
     {
         if ( m_pView )
         {
-            EndListening( *(m_pView->GetModel()) );
+            EndListening(m_pView->GetModel());
             m_pView = nullptr;
         }
 
@@ -480,7 +480,7 @@ void PropBrw::Update( OSectionView* pNewView )
             implSetNewObject( uno::Sequence< uno::Reference< uno::XInterface> 
>(&xTemp,1) );
         }
 
-        StartListening( *(m_pView->GetModel()) );
+        StartListening(m_pView->GetModel());
     }
     catch ( Exception& )
     {
@@ -498,7 +498,7 @@ void PropBrw::Update( const uno::Reference< 
uno::XInterface>& _xReportComponent)
     {
         if ( m_pView )
         {
-            EndListening( *(m_pView->GetModel()) );
+            EndListening(m_pView->GetModel());
             m_pView = nullptr;
         }
 
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 2ec8c57354b6..bdcddd616063 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -182,7 +182,7 @@ ScDrawTransferObj::ScDrawTransferObj( 
std::unique_ptr<SdrModel> pClipModel, ScDo
     // #i71538# use complete SdrViews
     // SdrExchangeView aView(pModel);
     SdrView aView(*m_pModel);
-    SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
+    SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel().GetPage(0));
     aView.MarkAllObj(pPv);
     m_aSrcSize = aView.GetAllMarkedRect().GetSize();
 
@@ -367,7 +367,7 @@ bool ScDrawTransferObj::GetData( const 
css::datatransfer::DataFlavor& rFlavor, c
             // #i71538# use complete SdrViews
             // SdrExchangeView aView( pModel );
             SdrView aView(*m_pModel);
-            SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
+            SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel().GetPage(0));
             OSL_ENSURE( pPv, "pPv not there..." );
             aView.MarkAllObj( pPv );
             if ( nFormat == SotClipboardFormatId::GDIMETAFILE )
@@ -576,7 +576,7 @@ void ScDrawTransferObj::SetDrawPersist( const 
SfxObjectShellRef& rRef )
 
 static void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, 
SCTAB nTab )
 {
-    rDest.ShowSdrPage(rDest.GetModel()->GetPage(nTab));
+    rDest.ShowSdrPage(rDest.GetModel().GetPage(nTab));
     SdrPageView* pDestPV = rDest.GetSdrPageView();
     OSL_ENSURE(pDestPV,"PageView ?");
 
@@ -602,7 +602,7 @@ void ScDrawTransferObj::SetDragSource( const ScDrawView* 
pView )
 void ScDrawTransferObj::SetDragSourceObj( SdrObject& rObj, SCTAB nTab )
 {
     m_pDragSourceView.reset(new SdrView(rObj.getSdrModelFromSdrObject()));
-    
m_pDragSourceView->ShowSdrPage(m_pDragSourceView->GetModel()->GetPage(nTab));
+    
m_pDragSourceView->ShowSdrPage(m_pDragSourceView->GetModel().GetPage(nTab));
     SdrPageView* pPV = m_pDragSourceView->GetSdrPageView();
     m_pDragSourceView->MarkObj(&rObj, pPV); // TTTT MarkObj should take 
SdrObject&
 
@@ -681,7 +681,7 @@ void ScDrawTransferObj::InitDocShell()
     // #i71538# use complete SdrViews
     // SdrExchangeView aDestView( pDestModel );
     SdrView aDestView(*pDestModel);
-    aDestView.ShowSdrPage(aDestView.GetModel()->GetPage(0));
+    aDestView.ShowSdrPage(aDestView.GetModel().GetPage(0));
     aDestView.Paste(
         *m_pModel,
         Point(m_aSrcSize.Width()/2, m_aSrcSize.Height()/2),
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx 
b/sc/source/ui/drawfunc/drawsh2.cxx
index 806216137a6d..db3fd0541b83 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -67,7 +67,7 @@ ScDrawShell::ScDrawShell( ScViewData& rData ) :
             GetFrame()->GetFrame().GetController(),
             vcl::EnumContext::Context::Cell))
 {
-    SetPool( &rViewData.GetScDrawView()->GetModel()->GetItemPool() );
+    SetPool( &rViewData.GetScDrawView()->GetModel().GetItemPool() );
     SfxUndoManager* pMgr = rViewData.GetSfxDocShell()->GetUndoManager();
     SetUndoManager( pMgr );
     if ( !rViewData.GetDocument().IsUndoEnabled() )
@@ -305,7 +305,7 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet )      
// disable functions
 
     if ( rSet.GetItemState( SID_ENABLE_HYPHENATION ) != SfxItemState::UNKNOWN )
     {
-        SfxItemSet aAttrs( pView->GetModel()->GetItemPool() );
+        SfxItemSet aAttrs( pView->GetModel().GetItemPool() );
         pView->GetAttributes( aAttrs );
         if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT )
         {
diff --git a/sc/source/ui/drawfunc/drawsh4.cxx 
b/sc/source/ui/drawfunc/drawsh4.cxx
index 226407b2ee1b..5c9b8cf926bb 100644
--- a/sc/source/ui/drawfunc/drawsh4.cxx
+++ b/sc/source/ui/drawfunc/drawsh4.cxx
@@ -56,7 +56,7 @@ void ScDrawShell::GetFormTextState(SfxItemSet& rSet)
     }
     else
     {
-        SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
+        SfxItemSet aViewAttr(pDrView->GetModel().GetItemPool());
         pDrView->GetAttributes(aViewAttr);
         rSet.Set(aViewAttr);
     }
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx 
b/sc/source/ui/drawfunc/drtxtob.cxx
index 37a493178e39..c17ea9c19baf 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -428,7 +428,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
     if ( rSet.GetItemState( SID_ENABLE_HYPHENATION ) != SfxItemState::UNKNOWN )
     {
         SdrView* pView = mrViewData.GetScDrawView();
-        SfxItemSet aAttrs( pView->GetModel()->GetItemPool() );
+        SfxItemSet aAttrs(pView->GetModel().GetItemPool());
         pView->GetAttributes( aAttrs );
         if( aAttrs.GetItemState( EE_PARA_HYPHENATE ) >= SfxItemState::DEFAULT )
         {
@@ -550,7 +550,7 @@ void ScDrawTextObjectBar::ExecuteToggle( SfxRequest &rReq )
 
     SfxItemSet aSet( pView->GetDefaultAttr() );
 
-    SfxItemSet aViewAttr(pView->GetModel()->GetItemPool());
+    SfxItemSet aViewAttr(pView->GetModel().GetItemPool());
     pView->GetAttributes(aViewAttr);
 
     //  Underline
@@ -662,7 +662,7 @@ void ScDrawTextObjectBar::ExecuteAttr( SfxRequest &rReq )
     const SfxItemSet*   pArgs = rReq.GetArgs();
     sal_uInt16          nSlot = rReq.GetSlot();
 
-    SfxItemSet aEditAttr( pView->GetModel()->GetItemPool() );
+    SfxItemSet aEditAttr( pView->GetModel().GetItemPool() );
     pView->GetAttributes( aEditAttr );
     SfxItemSet  aNewAttr( *aEditAttr.GetPool(), aEditAttr.GetRanges() );
 
@@ -969,7 +969,7 @@ void ScDrawTextObjectBar::GetAttrState( SfxItemSet& 
rDestSet )
     bool bDisableVerticalText = !SvtCJKOptions::IsVerticalTextEnabled();
 
     SdrView* pView = mrViewData.GetScDrawView();
-    SfxItemSet aAttrSet(pView->GetModel()->GetItemPool());
+    SfxItemSet aAttrSet(pView->GetModel().GetItemPool());
     pView->GetAttributes(aAttrSet);
 
     //  direct attributes
@@ -1192,7 +1192,7 @@ void 
ScDrawTextObjectBar::GetStatePropPanelAttr(SfxItemSet &rSet)
 
     SdrView*            pView = mrViewData.GetScDrawView();
 
-    SfxItemSet aEditAttr(pView->GetModel()->GetItemPool());
+    SfxItemSet aEditAttr(pView->GetModel().GetItemPool());
     pView->GetAttributes(aEditAttr);
     //SfxItemSet    aAttrs( *aEditAttr.GetPool(), aEditAttr.GetRanges() );
 
diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx 
b/sc/source/ui/drawfunc/drtxtob2.cxx
index 2c8ed5ac89cb..2f615104b62c 100644
--- a/sc/source/ui/drawfunc/drtxtob2.cxx
+++ b/sc/source/ui/drawfunc/drtxtob2.cxx
@@ -82,7 +82,7 @@ void ScDrawTextObjectBar::ExecuteGlobal( SfxRequest &rReq )
         case SID_TEXTDIRECTION_LEFT_TO_RIGHT:
         case SID_TEXTDIRECTION_TOP_TO_BOTTOM:
             {
-                SfxItemSetFixed<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION> 
aAttr( pView->GetModel()->GetItemPool() );
+                SfxItemSetFixed<SDRATTR_TEXTDIRECTION, SDRATTR_TEXTDIRECTION> 
aAttr(pView->GetModel().GetItemPool());
                 aAttr.Put( SvxWritingModeItem(
                     nSlot == SID_TEXTDIRECTION_LEFT_TO_RIGHT ?
                         css::text::WritingMode_LR_TB : 
css::text::WritingMode_TB_RL,
@@ -154,7 +154,7 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq )
         case SID_ATTR_PARA_RIGHT_TO_LEFT:
             {
                 SfxItemSetFixed<EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
-                                    EE_PARA_JUST, EE_PARA_JUST>  aAttr( 
pView->GetModel()->GetItemPool() );
+                                    EE_PARA_JUST, EE_PARA_JUST>  
aAttr(pView->GetModel().GetItemPool());
                 bool bLeft = ( nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT );
                 aAttr.Put( SvxFrameDirectionItem(
                                 bLeft ? SvxFrameDirection::Horizontal_LR_TB : 
SvxFrameDirection::Horizontal_RL_TB,
@@ -220,7 +220,7 @@ void ScDrawTextObjectBar::GetFormTextState(SfxItemSet& rSet)
     }
     else
     {
-        SfxItemSet aViewAttr(pDrView->GetModel()->GetItemPool());
+        SfxItemSet aViewAttr(pDrView->GetModel().GetItemPool());
         pDrView->GetAttributes(aViewAttr);
         rSet.Set(aViewAttr);
     }
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx 
b/sc/source/ui/drawfunc/fuconuno.cxx
index f113b1825051..e3c8f0b4d70e 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -81,7 +81,7 @@ void FuConstUnoControl::Activate()
     aOldPointer = pWindow->GetPointer();
     rViewShell.SetActivePointer( aNewPointer );
 
-    SdrLayer* pLayer = 
pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
+    SdrLayer* pLayer = 
pView->GetModel().GetLayerAdmin().GetLayerPerID(SC_LAYER_CONTROLS);
     if (pLayer)
         pView->SetActiveLayer( pLayer->GetName() );
 
@@ -92,7 +92,7 @@ void FuConstUnoControl::Deactivate()
 {
     FuConstruct::Deactivate();
 
-    SdrLayer* pLayer = 
pView->GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_FRONT);
+    SdrLayer* pLayer = 
pView->GetModel().GetLayerAdmin().GetLayerPerID(SC_LAYER_FRONT);
     if (pLayer)
         pView->SetActiveLayer( pLayer->GetName() );
 
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 6ab0aa7d50a1..0c1174781438 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -188,7 +188,7 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
     // Yes, due to the SdrObject had no SdrModel
     //  Path is no longer used as name for the graphics object
 
-    ScDrawLayer* pLayer = static_cast<ScDrawLayer*>(pView->GetModel());
+    ScDrawLayer* pLayer = static_cast<ScDrawLayer*>(&pView->GetModel());
     OUString aName = pLayer->GetNewGraphicName();                 // "Graphics"
     pObj->SetName(aName);
 
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 1387abd44346..d3f709b2a94c 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1110,7 +1110,7 @@ static bool lcl_DoDragObject( ScDocShell* pSrcShell, 
std::u16string_view rName,
         if (pObject)
         {
             SdrView aEditView(*pModel);
-            aEditView.ShowSdrPage(aEditView.GetModel()->GetPage(nTab));
+            aEditView.ShowSdrPage(aEditView.GetModel().GetPage(nTab));
             SdrPageView* pPV = aEditView.GetSdrPageView();
             aEditView.MarkObj(pObject, pPV);
 
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 2246e1db58ec..ba951e95da84 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -2192,7 +2192,7 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, 
const uno::Any& aSelec
         aDrawViewKeeper.mpDrawView.reset( new FmFormView(
             *pModel,
             pDev) );
-        
aDrawViewKeeper.mpDrawView->ShowSdrPage(aDrawViewKeeper.mpDrawView->GetModel()->GetPage(nTab));
+        
aDrawViewKeeper.mpDrawView->ShowSdrPage(aDrawViewKeeper.mpDrawView->GetModel().GetPage(nTab));
         aDrawViewKeeper.mpDrawView->SetPrintPreview();
     }
 
diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx
index 3a67c7686c20..984ef70566da 100644
--- a/sc/source/ui/unoobj/viewuno.cxx
+++ b/sc/source/ui/unoobj/viewuno.cxx
@@ -616,11 +616,11 @@ static void lcl_ShowObject( ScTabViewShell& rViewSh, 
const ScDrawView& rDrawView
     bool bFound = false;
     SCTAB nObjectTab = 0;
 
-    SdrModel* pModel = rDrawView.GetModel();
-    sal_uInt16 nPageCount = pModel->GetPageCount();
+    SdrModel& rModel = rDrawView.GetModel();
+    sal_uInt16 nPageCount = rModel.GetPageCount();
     for (sal_uInt16 i=0; i<nPageCount && !bFound; i++)
     {
-        SdrPage* pPage = pModel->GetPage(i);
+        SdrPage* pPage = rModel.GetPage(i);
         if (pPage)
         {
             SdrObjListIter aIter( pPage, SdrIterMode::DeepWithGroups );
diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx
index 052c12c03857..f720ecd76d33 100644
--- a/sc/source/ui/view/drawvie4.cxx
+++ b/sc/source/ui/view/drawvie4.cxx
@@ -430,7 +430,7 @@ void ScDrawView::CalcNormScale( Fraction& rFractX, 
Fraction& rFractY ) const
 
 void ScDrawView::SetMarkedOriginalSize()
 {
-    std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
+    std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(GetModel()));
 
     const SdrMarkList& rMarkList = GetMarkedObjectList();
     tools::Long nDone = 0;
@@ -545,7 +545,7 @@ void ScDrawView::FitToCellSize()
         return;
     }
 
-    std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(*GetModel()));
+    std::unique_ptr<SdrUndoGroup> pUndoGroup(new SdrUndoGroup(GetModel()));
     tools::Rectangle aGraphicRect = pObj->GetSnapRect();
     tools::Rectangle aCellRect = ScDrawLayer::GetCellRect( rDoc, 
pObjData->maStart, true);
 
diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx
index b0b293bc38bd..52a217fef170 100644
--- a/sc/source/ui/view/drawview.cxx
+++ b/sc/source/ui/view/drawview.cxx
@@ -81,14 +81,14 @@ void ScDrawView::Construct()
     if (pViewData)
     {
         SCTAB nViewTab = pViewData->GetTabNo();
-        ShowSdrPage(GetModel()->GetPage(nViewTab));
+        ShowSdrPage(GetModel().GetPage(nViewTab));
 
         bool bEx = pViewData->GetViewShell()->IsDrawSelMode();
         bool bProt = rDoc.IsTabProtected( nViewTab ) ||
                      pViewData->GetSfxDocShell()->IsReadOnly();
 
         SdrLayer* pLayer;
-        SdrLayerAdmin& rAdmin = GetModel()->GetLayerAdmin();
+        SdrLayerAdmin& rAdmin = GetModel().GetLayerAdmin();
         pLayer = rAdmin.GetLayerPerID(SC_LAYER_BACK);
         if (pLayer)
             SetLayerLocked( pLayer->GetName(), bProt || !bEx );
@@ -115,7 +115,7 @@ void ScDrawView::Construct()
     }
     else
     {
-        ShowSdrPage(GetModel()->GetPage(nTab));
+        ShowSdrPage(GetModel().GetPage(nTab));
     }
 
     UpdateUserViewOptions();
@@ -262,7 +262,7 @@ bool ScDrawView::HasMarkedInternal() const
 
 void ScDrawView::UpdateWorkArea()
 {
-    SdrPage* pPage = GetModel()->GetPage(static_cast<sal_uInt16>(nTab));
+    SdrPage* pPage = GetModel().GetPage(static_cast<sal_uInt16>(nTab));
     if (pPage)
     {
         Size aPageSize(pPage->GetSizeHmm());
@@ -654,11 +654,11 @@ SdrObject* 
ScDrawView::GetObjectByName(std::u16string_view rName)
     SfxObjectShell* pShell = rDoc.GetDocumentShell();
     if (pShell)
     {
-        SdrModel* pDrawLayer = GetModel();
+        SdrModel& rDrawLayer = GetModel();
         sal_uInt16 nTabCount = rDoc.GetTableCount();
         for (sal_uInt16 i=0; i<nTabCount; i++)
         {
-            SdrPage* pPage = pDrawLayer->GetPage(i);
+            SdrPage* pPage = rDrawLayer.GetPage(i);
             DBG_ASSERT(pPage,"Page ?");
             if (pPage)
             {
@@ -687,11 +687,11 @@ void ScDrawView::SelectCurrentViewObject( 
std::u16string_view rName )
     SfxObjectShell* pShell = rDoc.GetDocumentShell();
     if (pShell)
     {
-        SdrModel* pDrawLayer = GetModel();
+        SdrModel& rDrawLayer = GetModel();
         sal_uInt16 nTabCount = rDoc.GetTableCount();
         for (sal_uInt16 i=0; i<nTabCount && !pFound; i++)
         {
-            SdrPage* pPage = pDrawLayer->GetPage(i);
+            SdrPage* pPage = rDrawLayer.GetPage(i);
             DBG_ASSERT(pPage,"Page ?");
             if (pPage)
             {
@@ -722,7 +722,7 @@ void ScDrawView::SelectCurrentViewObject( 
std::u16string_view rName )
             !rDoc.IsTabProtected( nTab ) &&
             !pViewData->GetSfxDocShell()->IsReadOnly() )
     {
-        SdrLayer* pLayer = 
GetModel()->GetLayerAdmin().GetLayerPerID(SC_LAYER_BACK);
+        SdrLayer* pLayer = 
GetModel().GetLayerAdmin().GetLayerPerID(SC_LAYER_BACK);
         if (pLayer)
             SetLayerLocked( pLayer->GetName(), false );
     }
@@ -741,11 +741,11 @@ bool ScDrawView::SelectObject( std::u16string_view rName )
     SfxObjectShell* pShell = rDoc.GetDocumentShell();
     if (pShell)
     {
-        SdrModel* pDrawLayer = GetModel();
+        SdrModel& rDrawLayer = GetModel();
         SCTAB nTabCount = rDoc.GetTableCount();
         for (SCTAB i=0; i<nTabCount && !pFound; i++)
         {
-            SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(i));
+            SdrPage* pPage = rDrawLayer.GetPage(static_cast<sal_uInt16>(i));
             OSL_ENSURE(pPage,"Page ?");
             if (pPage)
             {
@@ -836,7 +836,7 @@ SdrObject* ScDrawView::GetMarkedNoteCaption( 
ScDrawObjData** ppCaptData )
 
 void ScDrawView::LockCalcLayer( SdrLayerID nLayer, bool bLock )
 {
-    SdrLayer* pLockLayer = GetModel()->GetLayerAdmin().GetLayerPerID( nLayer );
+    SdrLayer* pLockLayer = GetModel().GetLayerAdmin().GetLayerPerID( nLayer );
     if( pLockLayer && (IsLayerLocked( pLockLayer->GetName() ) != bLock) )
         SetLayerLocked( pLockLayer->GetName(), bLock );
 }
@@ -1147,7 +1147,7 @@ SdrObject* ScDrawView::ApplyGraphicToObject(
     {
         AddUndo(std::make_unique<SdrUndoAttrObj>(rHitObject));
 
-        SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLBITMAP> 
aSet(GetModel()->GetItemPool());
+        SfxItemSetFixed<XATTR_FILLSTYLE, XATTR_FILLBITMAP> 
aSet(GetModel().GetItemPool());
 
         aSet.Put(XFillStyleItem(drawing::FillStyle_BITMAP));
         aSet.Put(XFillBitmapItem(OUString(), rGraphic));
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 5b41a6227b54..a7b814c233fb 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1666,7 +1666,7 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
                 &rDevice));
 
         mpLOKDrawView->SetNegativeX(bLayoutRTL);
-        mpLOKDrawView->ShowSdrPage(mpLOKDrawView->GetModel()->GetPage(nTab));
+        mpLOKDrawView->ShowSdrPage(mpLOKDrawView->GetModel().GetPage(nTab));
         aOutputData.SetDrawView(mpLOKDrawView.get());
         aOutputData.SetSpellCheckContext(mpSpellCheckCxt.get());
     }
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index ffa6569ac6dd..ff26f2e5709f 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -359,7 +359,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
 bool ScGridWindow::IsMyModel(const SdrEditView* pSdrView)
 {
     return pSdrView &&
-            pSdrView->GetModel() == mrViewData.GetDocument().GetDrawLayer();
+            &pSdrView->GetModel() == mrViewData.GetDocument().GetDrawLayer();
 }
 
 void ScGridWindow::HideNoteMarker()
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index c07abc7100ac..73eb7430ba71 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -585,7 +585,7 @@ void ScPrintFunc::DrawToDev(ScDocument& rDoc, OutputDevice* 
pDev, double /* nPri
             new FmFormView(
                 *pModel,
                 pDev));
-        pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
+        pDrawView->ShowSdrPage(pDrawView->GetModel().GetPage(nTab));
         pDrawView->SetPrintPreview();
         aOutputData.SetDrawView( pDrawView.get() );
     }
diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 5e4956eb482b..bb10ad93e5f7 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -285,7 +285,7 @@ void ScTabView::TabChanged( bool bSameTabButMoved )
 
         SCTAB nTab = aViewData.GetTabNo();
         pDrawView->HideSdrPage();
-        pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
+        pDrawView->ShowSdrPage(pDrawView->GetModel().GetPage(nTab));
 
         UpdateLayerLocks();
 
@@ -363,7 +363,7 @@ void ScTabView::UpdateLayerLocks()
     bool bShared = aViewData.GetDocShell()->IsDocShared();
 
     SdrLayer* pLayer;
-    SdrLayerAdmin& rAdmin = pDrawView->GetModel()->GetLayerAdmin();
+    SdrLayerAdmin& rAdmin = pDrawView->GetModel().GetLayerAdmin();
     pLayer = rAdmin.GetLayerPerID(SC_LAYER_BACK);
     if (pLayer)
         pDrawView->SetLayerLocked( pLayer->GetName(), bProt || !bEx || bShared 
);
diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx
index c25d3412d3fa..031a32d59c4d 100644
--- a/sc/source/ui/view/tabvwsh2.cxx
+++ b/sc/source/ui/view/tabvwsh2.cxx
@@ -80,7 +80,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
 
     vcl::Window*     pWin    = pTabView->GetActiveWin();
     ScDrawView* pView   = pTabView->GetScDrawView();
-    SdrModel*   pDoc    = pView->GetModel();
+    SdrModel& rModel = pView->GetModel();
 
     const SfxItemSet *pArgs = rReq.GetArgs();
     sal_uInt16 nNewId = rReq.GetSlot();
@@ -88,7 +88,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
     if ( nNewId == SID_DRAW_CHART )
     {
         // #i71254# directly insert a chart instead of drawing its output 
rectangle
-        FuInsertChart(*this, pWin, pView, pDoc, rReq, LINK( this, 
ScTabViewShell, DialogClosedHdl ));
+        FuInsertChart(*this, pWin, pView, &rModel, rReq, LINK( this, 
ScTabViewShell, DialogClosedHdl ));
         return;
     }
 
@@ -215,7 +215,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
         case SID_OBJECT_SELECT:
             // not always switch back
             if(pView->GetMarkedObjectList().GetMarkCount() == 0) 
SetDrawShell(bEx);
-            pTabView->SetDrawFuncPtr(new FuSelection(*this, pWin, pView, pDoc, 
aNewReq));
+            pTabView->SetDrawFuncPtr(new FuSelection(*this, pWin, pView, 
&rModel, aNewReq));
             break;
 
         case SID_DRAW_LINE:
@@ -230,13 +230,13 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
         case SID_DRAW_RECT:
         case SID_DRAW_ELLIPSE:
         case SID_DRAW_MEASURELINE:
-            pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, 
pDoc, aNewReq));
+            pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, 
&rModel, aNewReq));
             bCreateDirectly = comphelper::LibreOfficeKit::isActive();
             break;
 
         case SID_DRAW_CAPTION:
         case SID_DRAW_CAPTION_VERTICAL:
-            pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, 
pDoc, aNewReq));
+            pTabView->SetDrawFuncPtr(new FuConstRectangle(*this, pWin, pView, 
&rModel, aNewReq));
             pView->SetFrameDragSingles( false );
             rBindings.Invalidate( SID_BEZIER_EDIT );
             break;
@@ -249,26 +249,26 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
         case SID_DRAW_BEZIER_FILL:
         case SID_DRAW_FREELINE:
         case SID_DRAW_FREELINE_NOFILL:
-            pTabView->SetDrawFuncPtr(new FuConstPolygon(*this, pWin, pView, 
pDoc, aNewReq));
+            pTabView->SetDrawFuncPtr(new FuConstPolygon(*this, pWin, pView, 
&rModel, aNewReq));
             break;
 
         case SID_DRAW_ARC:
         case SID_DRAW_PIE:
         case SID_DRAW_CIRCLECUT:
-            pTabView->SetDrawFuncPtr(new FuConstArc(*this, pWin, pView, pDoc, 
aNewReq));
+            pTabView->SetDrawFuncPtr(new FuConstArc(*this, pWin, pView, 
&rModel, aNewReq));
             break;
 
         case SID_DRAW_TEXT:
         case SID_DRAW_TEXT_VERTICAL:
         case SID_DRAW_TEXT_MARQUEE:
         case SID_DRAW_NOTEEDIT:
-            pTabView->SetDrawFuncPtr(new FuText(*this, pWin, pView, pDoc, 
aNewReq));
+            pTabView->SetDrawFuncPtr(new FuText(*this, pWin, pView, &rModel, 
aNewReq));
             bCreateDirectly = comphelper::LibreOfficeKit::isActive();
             break;
 
         case SID_FM_CREATE_CONTROL:
             SetDrawFormShell(true);
-            pTabView->SetDrawFuncPtr(new FuConstUnoControl(*this, pWin, pView, 
pDoc, aNewReq));
+            pTabView->SetDrawFuncPtr(new FuConstUnoControl(*this, pWin, pView, 
&rModel, aNewReq));
             eFormObjKind = eNewFormObjKind;
             break;
 
@@ -280,7 +280,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq)
         case SID_DRAWTBX_CS_STAR :
         case SID_DRAW_CS_ID :
         {
-            pTabView->SetDrawFuncPtr(new FuConstCustomShape(*this, pWin, 
pView, pDoc, aNewReq));
+            pTabView->SetDrawFuncPtr(new FuConstCustomShape(*this, pWin, 
pView, &rModel, aNewReq));
 
             bCreateDirectly = comphelper::LibreOfficeKit::isActive();
 
diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx
index d718a2e2cd00..adfdba7228e1 100644
--- a/sc/source/ui/view/tabvwshb.cxx
+++ b/sc/source/ui/view/tabvwshb.cxx
@@ -82,7 +82,7 @@ void ScTabViewShell::ConnectObject( const SdrOle2Obj* pObj )
     if ( pClient )
         return;
 
-    pClient = new ScClient( this, pWin, GetScDrawView()->GetModel(), pObj );
+    pClient = new ScClient( this, pWin, &GetScDrawView()->GetModel(), pObj );
     ScViewData& rViewData = GetViewData();
     ScDocShell* pDocSh = rViewData.GetDocShell();
     ScDocument& rDoc = pDocSh->GetDocument();
@@ -169,7 +169,7 @@ void ScTabViewShell::ActivateObject(SdrOle2Obj* pObj, 
sal_Int32 nVerb)
         bool bNegativeX = comphelper::LibreOfficeKit::isActive() && 
rDoc.IsNegativePage(rViewData.GetTabNo());
         SfxInPlaceClient* pClient = FindIPClient( xObj, pWin );
         if ( !pClient )
-            pClient = new ScClient( this, pWin, GetScDrawView()->GetModel(), 
pObj );
+            pClient = new ScClient( this, pWin, &GetScDrawView()->GetModel(), 
pObj );
 
         if (bNegativeX)
             pClient->SetNegativeX(true);
@@ -370,22 +370,22 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
     ScDrawView*  pView     = pTabView->GetScDrawView();
     ScDocShell*  pDocSh    = GetViewData().GetDocShell();
     ScDocument&  rDoc      = pDocSh->GetDocument();
-    SdrModel*    pDrModel  = pView->GetModel();
+    SdrModel& rModel = pView->GetModel();
 
     switch ( nSlot )
     {
         case SID_INSERT_GRAPHIC:
-            FuInsertGraphic(*this, pWin, pView, pDrModel, rReq);
+            FuInsertGraphic(*this, pWin, pView, &rModel, rReq);
             // shell is set in MarkListHasChanged
             break;
 
         case SID_INSERT_AVMEDIA:
-            FuInsertMedia(*this, pWin, pView, pDrModel, rReq);
+            FuInsertMedia(*this, pWin, pView, &rModel, rReq);
             // shell is set in MarkListHasChanged
             break;
 
         case SID_INSERT_DIAGRAM:
-            FuInsertChart(*this, pWin, pView, pDrModel, rReq, LINK( this, 
ScTabViewShell, DialogClosedHdl ));
+            FuInsertChart(*this, pWin, pView, &rModel, rReq, LINK( this, 
ScTabViewShell, DialogClosedHdl ));
             if (comphelper::LibreOfficeKit::isActive())
                 pDocSh->SetModified();
             break;
@@ -393,7 +393,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq)
         case SID_INSERT_OBJECT:
         case SID_INSERT_SMATH:
         case SID_INSERT_FLOATINGFRAME:
-            FuInsertOLE(*this, pWin, pView, pDrModel, rReq);
+            FuInsertOLE(*this, pWin, pView, &rModel, rReq);
             break;
 
         case SID_INSERT_SIGNATURELINE:
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index f4fc1f02bae0..09be14ad22ec 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -58,10 +58,10 @@ void ScTabViewShell::InsertURLButton( const OUString& 
rName, const OUString& rUR
 
     ScTabView*  pView   = rViewData.GetView();
     ScDrawView* pDrView = pView->GetScDrawView();
-    SdrModel*   pModel  = pDrView->GetModel();
+    SdrModel& rModel = pDrView->GetModel();
 
     rtl::Reference<SdrObject> pObj = SdrObjFactory::MakeNewObject(
-        *pModel,
+        rModel,
         SdrInventor::FmForm,
         SdrObjKind::FormButton);
 
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index b2f05416a6bd..b9172ad11f39 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1343,7 +1343,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, 
ScDocument* pClipDoc,
     if ( nFlags & InsertDeleteFlags::OBJECTS )
     {
         ScDrawView* pScDrawView = GetScDrawView();
-        SdrModel* pModel = ( pScDrawView ? pScDrawView->GetModel() : nullptr );
+        SdrModel* pModel = ( pScDrawView ? &pScDrawView->GetModel() : nullptr 
);
         pPage = ( pModel ? pModel->GetPage( static_cast< sal_uInt16 >( 
nStartTab ) ) : nullptr );
         if ( pPage )
         {
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index 3a0795562701..b6255928c857 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -54,7 +54,7 @@ using namespace com::sun::star;
 
 static void lcl_AdjustInsertPos( ScViewData& rData, Point& rPos, const Size& 
rSize )
 {
-    SdrPage* pPage = rData.GetScDrawView()->GetModel()->GetPage( 
static_cast<sal_uInt16>(rData.GetTabNo()) );
+    SdrPage* pPage = rData.GetScDrawView()->GetModel().GetPage( 
static_cast<sal_uInt16>(rData.GetTabNo()) );
     OSL_ENSURE(pPage,"pPage ???");
     Size aPgSize(pPage->GetSizeHmm());
     if (aPgSize.Width() < 0)
@@ -114,7 +114,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, 
SdrModel* pModel,
     if (bGroup)
         pScDrawView->BegUndo( ScResId( STR_UNDO_PASTE ) );
 
-    bool bSameDoc = ( pDragEditView && pDragEditView->GetModel() == 
pScDrawView->GetModel() );
+    bool bSameDoc = ( pDragEditView && &pDragEditView->GetModel() == 
&pScDrawView->GetModel() );
     if (bSameDoc)
     {
             // copy locally - incl. charts
@@ -134,9 +134,9 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, 
SdrModel* pModel,
         }
         else
         {
-            SdrModel* pDrawModel = pDragEditView->GetModel();
+            SdrModel& rDrawModel = pDragEditView->GetModel();
             SCTAB nTab = GetViewData().GetTabNo();
-            SdrPage* pDestPage = pDrawModel->GetPage( static_cast< sal_uInt16 
>( nTab ) );
+            SdrPage* pDestPage = rDrawModel.GetPage( static_cast< sal_uInt16 
>( nTab ) );
             OSL_ENSURE(pDestPage,"who is this, Page?");
 
             ::std::vector< OUString > aExcludedChartNames;
@@ -153,13 +153,13 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, 
SdrModel* pModel,
                 const SdrObject* pObj=pM->GetMarkedSdrObj();
 
                 // Directly Clone to target SdrModel
-                rtl::Reference<SdrObject> 
pNewObj(pObj->CloneSdrObject(*pDrawModel));
+                rtl::Reference<SdrObject> 
pNewObj(pObj->CloneSdrObject(rDrawModel));
 
                 if (pNewObj!=nullptr)
                 {
                     //  copy graphics within the same model - always needs new 
name
                     if ( dynamic_cast<const SdrGrafObj*>( pNewObj.get()) !=  
nullptr && !bPasteIsMove )
-                        
pNewObj->SetName(static_cast<ScDrawLayer*>(pDrawModel)->GetNewGraphicName());
+                        
pNewObj->SetName(static_cast<ScDrawLayer*>(&rDrawModel)->GetNewGraphicName());
 
                     if (nDiffX!=0 || nDiffY!=0)
                         pNewObj->NbcMove(Size(nDiffX,nDiffY));
@@ -191,7 +191,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, 
SdrModel* pModel,
     {
         bPasteIsMove = false;       // no internal move happened
         SdrView aView(*pModel);     // #i71529# never create a base class of 
SdrView directly!
-        SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
+        SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel().GetPage(0));
         aView.MarkAllObj(pPv);
         Size aSize = aView.GetAllMarkedRect().GetSize();
         lcl_AdjustInsertPos( GetViewData(), aPos, aSize );
@@ -206,7 +206,7 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, 
SdrModel* pModel,
 
         ::std::vector< OUString > aExcludedChartNames;
         SCTAB nTab = GetViewData().GetTabNo();
-        SdrPage* pPage = pScDrawView->GetModel()->GetPage( static_cast< 
sal_uInt16 >( nTab ) );
+        SdrPage* pPage = pScDrawView->GetModel().GetPage( static_cast< 
sal_uInt16 >( nTab ) );
         OSL_ENSURE( pPage, "Page?" );
         if ( pPage )
         {
@@ -437,7 +437,7 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const 
Graphic& rGraphic,
 
     // path was the name of the graphic in history
 
-    ScDrawLayer* pLayer = static_cast<ScDrawLayer*>( pScDrawView->GetModel() );
+    ScDrawLayer* pLayer = static_cast<ScDrawLayer*>(&pScDrawView->GetModel());
     OUString aName = pLayer->GetNewGraphicName();                 // "Graphics"
     pGrafObj->SetName(aName);
 
diff --git a/sd/source/core/drawdoc3.cxx b/sd/source/core/drawdoc3.cxx
index b3bb4940c27d..75eb509fab5a 100644
--- a/sd/source/core/drawdoc3.cxx
+++ b/sd/source/core/drawdoc3.cxx
@@ -1028,7 +1028,7 @@ bool SdDrawDocument::InsertBookmarkAsObject(
 
                 if (pPage->IsMasterPage())
                 {
-                    pPV = 
pBMView->ShowSdrPage(pBMView->GetModel()->GetMasterPage(pPage->GetPageNum()));
+                    pPV = 
pBMView->ShowSdrPage(pBMView->GetModel().GetMasterPage(pPage->GetPageNum()));
                 }
                 else
                 {
diff --git a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx 
b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
index a1a79a67815f..90c3776ac689 100644
--- a/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
+++ b/sd/source/ui/accessibility/AccessibleOutlineEditSource.cxx
@@ -122,10 +122,10 @@ namespace accessibility
 
     Point AccessibleOutlineEditSource::LogicToPixel( const Point& rPoint, 
const MapMode& rMapMode ) const
     {
-        if( IsValid() && mrView.GetModel() )
+        if (IsValid())
         {
             Point aPoint( OutputDevice::LogicToLogic( rPoint, rMapMode,
-                                                      
MapMode(mrView.GetModel()->GetScaleUnit()) ) );
+                                                      
MapMode(mrView.GetModel().GetScaleUnit()) ) );
             MapMode aMapMode(mrWindow.GetMapMode());
             aMapMode.SetOrigin(Point());
             return mrWindow.LogicToPixel( aPoint, aMapMode );
@@ -136,13 +136,13 @@ namespace accessibility
 
     Point AccessibleOutlineEditSource::PixelToLogic( const Point& rPoint, 
const MapMode& rMapMode ) const
     {
-        if( IsValid() && mrView.GetModel() )
+        if (IsValid())
         {
             MapMode aMapMode(mrWindow.GetMapMode());
             aMapMode.SetOrigin(Point());
             Point aPoint( mrWindow.PixelToLogic( rPoint, aMapMode ) );
             return OutputDevice::LogicToLogic( aPoint,
-                                               
MapMode(mrView.GetModel()->GetScaleUnit()),
+                                               
MapMode(mrView.GetModel().GetScaleUnit()),
                                                rMapMode );
         }
 
diff --git a/sd/source/ui/app/optsitem.cxx b/sd/source/ui/app/optsitem.cxx
index fb9aac86d491..91c0048246e6 100644
--- a/sd/source/ui/app/optsitem.cxx
+++ b/sd/source/ui/app/optsitem.cxx
@@ -670,7 +670,7 @@ SdOptionsMiscItem::SdOptionsMiscItem( SdOptions const * 
pOpts, ::sd::FrameView c
         maOptionsMisc.SetMasterPagePaintCaching( 
pView->IsMasterPagePaintCaching() );
 
         maOptionsMisc.SetDragWithCopy( pView->IsDragWithCopy() );
-        maOptionsMisc.SetPickThrough( 
pView->GetModel()->IsPickThroughTransparentTextFrames() );
+        
maOptionsMisc.SetPickThrough(pView->GetModel().IsPickThroughTransparentTextFrames());
         maOptionsMisc.SetDoubleClickTextEdit( pView->IsDoubleClickTextEdit() );
         maOptionsMisc.SetClickChangeRotation( pView->IsClickChangeRotation() );
         maOptionsMisc.SetSolidDragging( pView->IsSolidDragging() );
diff --git a/sd/source/ui/app/sdxfer.cxx b/sd/source/ui/app/sdxfer.cxx
index 7740f2515201..b73fabca3f60 100644
--- a/sd/source/ui/app/sdxfer.cxx
+++ b/sd/source/ui/app/sdxfer.cxx
@@ -283,8 +283,7 @@ void SdTransferable::CreateData()
         // Use dimension of source page
         SdrPageView*        pPgView = mpSdView->GetSdrPageView();
         SdPage*             pOldPage = static_cast<SdPage*>( 
pPgView->GetPage() );
-        SdrModel*           pOldModel = mpSdView->GetModel();
-        SdStyleSheetPool*   pOldStylePool = static_cast<SdStyleSheetPool*>( 
pOldModel->GetStyleSheetPool() );
+        SdStyleSheetPool*   pOldStylePool = 
static_cast<SdStyleSheetPool*>(mpSdView->GetModel().GetStyleSheetPool());
         SdStyleSheetPool*   pNewStylePool = static_cast<SdStyleSheetPool*>( 
mpSdDrawDocumentIntern->GetStyleSheetPool() );
         SdPage*             pPage = mpSdDrawDocumentIntern->GetSdPage( 0, 
PageKind::Standard );
         OUString            aOldLayoutName( pOldPage->GetLayoutName() );
diff --git a/sd/source/ui/func/fuolbull.cxx b/sd/source/ui/func/fuolbull.cxx
index beb57db5b31e..1f5a056b7ef7 100644
--- a/sd/source/ui/func/fuolbull.cxx
+++ b/sd/source/ui/func/fuolbull.cxx
@@ -222,7 +222,7 @@ void 
FuBulletAndPosition::SetCurrentBulletsNumbering(SfxRequest& rReq)
 
     SdrOutliner* pOwner = bInMasterView ? mpView->GetTextEditOutliner() : 
nullptr;
     const bool bOutlinerUndoEnabled = pOwner && !pOwner->IsInUndo() && 
pOwner->IsUndoEnabled();
-    SdrModel* pSdrModel = bInMasterView ? mpView->GetModel() : nullptr;
+    SdrModel* pSdrModel = bInMasterView ? &mpView->GetModel() : nullptr;
     const bool bModelUndoEnabled = pSdrModel && pSdrModel->IsUndoEnabled();
 
     if ( bOutlinerUndoEnabled )
diff --git a/sd/source/ui/func/fuprlout.cxx b/sd/source/ui/func/fuprlout.cxx
index c436b78f05c4..829380b7aa5a 100644
--- a/sd/source/ui/func/fuprlout.cxx
+++ b/sd/source/ui/func/fuprlout.cxx
@@ -241,7 +241,7 @@ void FuPresentationLayout::DoExecute( SfxRequest& rReq )
                         nPgNum++;
 
                     pView->HideSdrPage();
-                    
pView->ShowSdrPage(pView->GetModel()->GetMasterPage(nPgNum));
+                    
pView->ShowSdrPage(pView->GetModel().GetMasterPage(nPgNum));
                 }
             }
 
diff --git a/sd/source/ui/table/TableDesignPane.cxx 
b/sd/source/ui/table/TableDesignPane.cxx
index cab67aa87f4f..dad8d2c0fec3 100644
--- a/sd/source/ui/table/TableDesignPane.cxx
+++ b/sd/source/ui/table/TableDesignPane.cxx
@@ -382,7 +382,7 @@ void TableDesignWidget::EditStyle(std::string_view rCommand)
 
         SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
         ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact ? 
pFact->CreateSvxFormatCellsDialog(
-            mrBase.GetFrameWeld(), &aNewAttr, 
*mrBase.GetDrawView()->GetModel(), true) : nullptr);
+            mrBase.GetFrameWeld(), &aNewAttr, 
mrBase.GetDrawView()->GetModel(), true) : nullptr);
         if (pDlg && pDlg->Execute() == RET_OK)
         {
             endTextEditForStyle(xTableStyle);
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx 
b/sd/source/ui/tools/PreviewRenderer.cxx
index 0c845487befe..6558666a7572 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -227,7 +227,7 @@ bool PreviewRenderer::Initialize (
     SdPage* pNonConstPage = const_cast<SdPage*>(pPage);
     if (pPage->IsMasterPage())
     {
-        
mpView->ShowSdrPage(mpView->GetModel()->GetMasterPage(pPage->GetPageNum()));
+        
mpView->ShowSdrPage(mpView->GetModel().GetMasterPage(pPage->GetPageNum()));
     }
     else
     {
diff --git a/sd/source/ui/view/drbezob.cxx b/sd/source/ui/view/drbezob.cxx
index c84489042672..0db363aa21b2 100644
--- a/sd/source/ui/view/drbezob.cxx
+++ b/sd/source/ui/view/drbezob.cxx
@@ -261,7 +261,7 @@ void BezierObjectBar::Execute(SfxRequest& rReq)
                         mpView->UnmarkAllPoints();
 
                         if( bUndo )
-                            
mpView->AddUndo(mpView->GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pPathObj));
+                            
mpView->AddUndo(mpView->GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pPathObj));
 
                         pPathObj->ToggleClosed();
 
diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index efd54a520f8b..ed0e84516849 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -420,7 +420,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
         SwitchPage(maTabControl->GetPagePos(nActualPageId));
 
         //tdf#102343 re-enable common undo on switch back from master mode
-        mpDrawView->GetModel()->SetDisableTextEditUsesCommonUndoManager(false);
+        mpDrawView->GetModel().SetDisableTextEditUsesCommonUndoManager(false);
     }
     else
     {
@@ -466,7 +466,7 @@ void DrawViewShell::ChangeEditMode(EditMode eEMode, bool 
bIsLayerModeActive)
         //changes the stylesheet they are linked to, so if the common
         //undo manager is in use, those stylesheet changes are thrown
         //away at present
-        mpDrawView->GetModel()->SetDisableTextEditUsesCommonUndoManager(true);
+        mpDrawView->GetModel().SetDisableTextEditUsesCommonUndoManager(true);
     }
 
     // If the master view toolbar is to be shown we turn it on after the
@@ -1118,7 +1118,7 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, 
bool bAllowChangeFocus)
                 pMaster = GetDoc()->GetMasterSdPage(0, mePageKind);
 
             sal_uInt16 nNum = pMaster->GetPageNum();
-            
mpDrawView->ShowSdrPage(mpDrawView->GetModel()->GetMasterPage(nNum));
+            
mpDrawView->ShowSdrPage(mpDrawView->GetModel().GetMasterPage(nNum));
 
             
GetViewShellBase().GetDrawController()->FireSwitchCurrentPage(pMaster);
 
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index caf3bb3cf107..110ad9ba3129 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -1782,7 +1782,7 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
     {
         SdrPageProperties& rPageProperties = pPage->getSdrPageProperties();
         const SfxItemSet &aPageItemSet = rPageProperties.GetItemSet();
-        SfxItemSet aTempSet = aPageItemSet.CloneAsValue(false, 
&mpDrawView->GetModel()->GetItemPool());
+        SfxItemSet aTempSet = aPageItemSet.CloneAsValue(false, 
&mpDrawView->GetModel().GetItemPool());
         const SfxPoolItem* pItem = nullptr;
 
         rPageProperties.ClearItem(XATTR_FILLSTYLE);
@@ -1820,9 +1820,9 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
                     XFillGradientItem aGradientItem( 
XGradient::fromJSON(pJSON->GetValue()) );
 
                     // MigrateItemSet guarantees unique gradient names
-                    SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> 
aMigrateSet( mpDrawView->GetModel()->GetItemPool() );
+                    SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> 
aMigrateSet(mpDrawView->GetModel().GetItemPool());
                     aMigrateSet.Put( aGradientItem );
-                    SdrModel::MigrateItemSet( &aMigrateSet, &aTempSet, 
mpDrawView->GetModel() );
+                    SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, 
&mpDrawView->GetModel());
 
                     rPageProperties.PutItem( XFillStyleItem( 
drawing::FillStyle_GRADIENT ) );
                     rPageProperties.PutItemSet( aTempSet );
@@ -1832,9 +1832,9 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
                     XFillGradientItem aGradientItem( pArgs->Get( 
XATTR_FILLGRADIENT ) );
 
                     // MigrateItemSet guarantees unique gradient names
-                    SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> 
aMigrateSet( mpDrawView->GetModel()->GetItemPool() );
+                    SfxItemSetFixed<XATTR_FILLGRADIENT, XATTR_FILLGRADIENT> 
aMigrateSet(mpDrawView->GetModel().GetItemPool());
                     aMigrateSet.Put( aGradientItem );
-                    SdrModel::MigrateItemSet( &aMigrateSet, &aTempSet, 
mpDrawView->GetModel() );
+                    SdrModel::MigrateItemSet(&aMigrateSet, &aTempSet, 
&mpDrawView->GetModel());
 
                     rPageProperties.PutItem( XFillStyleItem( 
drawing::FillStyle_GRADIENT ) );
                     rPageProperties.PutItemSet( aTempSet );
diff --git a/sd/source/ui/view/drviewsg.cxx b/sd/source/ui/view/drviewsg.cxx
index e3930fa7e6e5..2563168433d8 100644
--- a/sd/source/ui/view/drviewsg.cxx
+++ b/sd/source/ui/view/drviewsg.cxx
@@ -168,7 +168,7 @@ void DrawViewShell::ExecOptionsBar( SfxRequest& rReq )
         case SID_PICK_THROUGH:
         {
             pOptions->SetPickThrough(
-                !mpDrawView->GetModel()->IsPickThroughTransparentTextFrames() 
);
+                !mpDrawView->GetModel().IsPickThroughTransparentTextFrames() );
         }
         break;
 
@@ -221,7 +221,7 @@ void DrawViewShell::GetOptionsBarState( SfxItemSet& rSet )
 
     rSet.Put( SfxBoolItem( SID_QUICKEDIT, mpDrawView->IsQuickTextEditMode() ) 
);
     rSet.Put( SfxBoolItem( SID_PICK_THROUGH,
-                mpDrawView->GetModel()->IsPickThroughTransparentTextFrames() ) 
);
+                mpDrawView->GetModel().IsPickThroughTransparentTextFrames() ) 
);
 
     rSet.Put( SfxBoolItem( SID_DOUBLECLICK_TEXTEDIT, 
mpFrameView->IsDoubleClickTextEdit() ) );
     rSet.Put( SfxBoolItem( SID_CLICK_CHANGE_ROTATION, 
mpFrameView->IsClickChangeRotation() ) );
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 22d85aac91d5..7df57671014e 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -301,7 +301,7 @@ void FrameView::Update(SdOptions const * pOptions)
     SetBigOrtho( pOptions->IsBigOrtho() );
     SetOrtho( pOptions->IsOrtho() );
     SetEliminatePolyPointLimitAngle( 
pOptions->GetEliminatePolyPointLimitAngle() );
-    GetModel()->SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() 
);
+    GetModel().SetPickThroughTransparentTextFrames( pOptions->IsPickThrough() 
);
 
     SetSolidDragging( pOptions->IsSolidDragging() );
 
@@ -538,7 +538,7 @@ void FrameView::ReadUserDataSequence ( const 
css::uno::Sequence < css::beans::Pr
     if (!nLength)
         return;
 
-    SdDrawDocument* pDrawDocument = dynamic_cast<SdDrawDocument*>(GetModel());
+    SdDrawDocument* pDrawDocument = dynamic_cast<SdDrawDocument*>(&GetModel());
     const bool bImpress = pDrawDocument && pDrawDocument->GetDocumentType() == 
DocumentType::Impress;
 
     bool bBool = false;
@@ -595,7 +595,7 @@ void FrameView::ReadUserDataSequence ( const 
css::uno::Sequence < css::beans::Pr
         {
             if( rValue.Value >>= nInt16 )
             {
-                SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( 
GetModel() );
+                SdDrawDocument* pDoc = 
dynamic_cast<SdDrawDocument*>(&GetModel());
                 if( pDoc && pDoc->GetDocSh() && ( 
SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                     SetPageKind( static_cast<PageKind>(nInt16) );
 
@@ -606,7 +606,7 @@ void FrameView::ReadUserDataSequence ( const 
css::uno::Sequence < css::beans::Pr
         {
             if( rValue.Value >>= nInt16 )
             {
-                SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( 
GetModel() );
+                SdDrawDocument* pDoc = 
dynamic_cast<SdDrawDocument*>(&GetModel());
                 if( pDoc && pDoc->GetDocSh() && ( 
SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                     SetSelectedPage( static_cast<sal_uInt16>(nInt16) );
 
@@ -645,7 +645,7 @@ void FrameView::ReadUserDataSequence ( const 
css::uno::Sequence < css::beans::Pr
         {
             if( rValue.Value >>= nInt32 )
             {
-                SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( 
GetModel() );
+                SdDrawDocument* pDoc = 
dynamic_cast<SdDrawDocument*>(&GetModel());
                 if( pDoc && pDoc->GetDocSh() && ( 
SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                     SetViewShEditMode( static_cast<EditMode>(nInt32) );
             }
@@ -657,7 +657,7 @@ void FrameView::ReadUserDataSequence ( const 
css::uno::Sequence < css::beans::Pr
         {
             if( rValue.Value >>= nInt32 )
             {
-                SdDrawDocument* pDoc = dynamic_cast< SdDrawDocument* >( 
GetModel() );
+                SdDrawDocument* pDoc = 
dynamic_cast<SdDrawDocument*>(&GetModel());
                 if( pDoc && pDoc->GetDocSh() && ( 
SfxObjectCreateMode::EMBEDDED == pDoc->GetDocSh()->GetCreateMode() ) )
                     SetViewShEditMode( static_cast<EditMode>(nInt32) );
             }
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index cc217bfb8ba2..02a1243e0264 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -911,7 +911,7 @@ void View::SetMarkedOriginalSize()
             {
                 const SdrGrafObj* pSdrGrafObj = static_cast< const SdrGrafObj* 
>(pObj);
                 const Size aSize = pSdrGrafObj->getOriginalSize( );
-                pUndoGroup->AddAction( 
GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj ) );
+                
pUndoGroup->AddAction(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
                 ::tools::Rectangle aRect( pObj->GetLogicRect() );
                 aRect.SetSize( aSize );
                 pObj->SetLogicRect( aRect );
@@ -1227,12 +1227,10 @@ bool View::ShouldToggleOn(
     // If setting bullets/numbering by the dialog, always should toggle on.
     if (!bBulletOnOffMode)
         return true;
-    SdrModel* pSdrModel = GetModel();
-    if (!pSdrModel)
-        return false;
+    SdrModel& rSdrModel = GetModel();
 
     bool bToggleOn = false;
-    std::unique_ptr<SdrOutliner> 
pOutliner(SdrMakeOutliner(OutlinerMode::TextObject, *pSdrModel));
+    std::unique_ptr<SdrOutliner> 
pOutliner(SdrMakeOutliner(OutlinerMode::TextObject, rSdrModel));
     const size_t nMarkCount = GetMarkedObjectCount();
     for (size_t nIndex = 0; nIndex < nMarkCount && !bToggleOn; ++nIndex)
     {
@@ -1290,18 +1288,18 @@ void View::ChangeMarkedObjectsBulletsNumbering(
     const bool bHandleBullets,
     const SvxNumRule* pNumRule )
 {
-    SdrModel* pSdrModel = GetModel();
+    SdrModel& rSdrModel = GetModel();
     OutputDevice* pOut = GetFirstOutputDevice();
     vcl::Window* pWindow = pOut ? pOut->GetOwnerWindow() : nullptr;
-    if (!pSdrModel || !pWindow)
+    if (!pWindow)
         return;
 
-    const bool bUndoEnabled = pSdrModel->IsUndoEnabled();
-    std::unique_ptr<SdrUndoGroup> pUndoGroup(bUndoEnabled ? new 
SdrUndoGroup(*pSdrModel) : nullptr);
+    const bool bUndoEnabled = rSdrModel.IsUndoEnabled();
+    std::unique_ptr<SdrUndoGroup> pUndoGroup(bUndoEnabled ? new 
SdrUndoGroup(rSdrModel) : nullptr);
 
     const bool bToggleOn = ShouldToggleOn( bToggle, bHandleBullets );
 
-    std::unique_ptr<SdrOutliner> 
pOutliner(SdrMakeOutliner(OutlinerMode::TextObject, *pSdrModel));
+    std::unique_ptr<SdrOutliner> 
pOutliner(SdrMakeOutliner(OutlinerMode::TextObject, rSdrModel));
     OutlinerView aOutlinerView(pOutliner.get(), pWindow);
 
     const size_t nMarkCount = GetMarkedObjectCount();
@@ -1339,7 +1337,7 @@ void View::ChangeMarkedObjectsBulletsNumbering(
                     pOutliner->SetText(*(pText->GetOutlinerParaObject()));
                     if (bUndoEnabled)
                     {
-                        
pUndoGroup->AddAction(pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj,
 nCellIndex));
+                        
pUndoGroup->AddAction(rSdrModel.GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj,
 nCellIndex));
                     }
                     if ( !bToggleOn )
                     {
@@ -1370,7 +1368,7 @@ void View::ChangeMarkedObjectsBulletsNumbering(
             if (bUndoEnabled)
             {
                 pUndoGroup->AddAction(
-                    
pSdrModel->GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0));
+                    
rSdrModel.GetSdrUndoFactory().CreateUndoObjectSetText(*pTextObj, 0));
             }
             if ( !bToggleOn )
             {
@@ -1388,9 +1386,9 @@ void View::ChangeMarkedObjectsBulletsNumbering(
 
     if ( bUndoEnabled && pUndoGroup->GetActionCount() > 0 )
     {
-        pSdrModel->BegUndo();
-        pSdrModel->AddUndo(std::move(pUndoGroup));
-        pSdrModel->EndUndo();
+        rSdrModel.BegUndo();
+        rSdrModel.AddUndo(std::move(pUndoGroup));
+        rSdrModel.EndUndo();
     }
 }
 
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index f96cd774a92a..0cbd41b00950 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -417,7 +417,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
                                 if( IsUndoEnabled() )
                                 {
                                     BegUndo(SdResId(STR_MODIFYLAYER));
-                                    
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoObjectLayerChange(*pO, 
pO->GetLayer(), nLayer));
+                                    
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoObjectLayerChange(*pO, 
pO->GetLayer(), nLayer));
                                     EndUndo();
                                 }
 
@@ -506,7 +506,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
                                         if( IsUndoEnabled() )
                                         {
                                             
BegUndo(SdResId(STR_UNDO_DRAGDROP));
-                                            
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pObj));
+                                            
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoNewObject(*pObj));
                                             EndUndo();
                                         }
 
@@ -625,7 +625,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
                 if( !pSourceView->IsPresObjSelected() )
                 {
                     // model is owned by from AllocModel() created DocShell
-                    SdDrawDocument* pSourceDoc = static_cast<SdDrawDocument*>( 
pSourceView->GetModel() );
+                    SdDrawDocument* pSourceDoc = 
static_cast<SdDrawDocument*>(&pSourceView->GetModel());
                     pSourceDoc->CreatingDataObj( pOwnData );
                     SdDrawDocument* pModel = static_cast<SdDrawDocument*>( 
pSourceView->CreateMarkedObjModel().release() );
                     bReturn = Paste(*pModel, maDropPos, pPage, nPasteOptions);
@@ -1354,7 +1354,7 @@ bool View::InsertData( const TransferableDataHelper& 
rDataHelper,
             if( IsUndoEnabled() )
             {
                 BegUndo( SdResId(STR_UNDO_DRAGDROP) );
-                AddUndo( GetModel()->GetSdrUndoFactory().CreateUndoAttrObject( 
*pPickObj ) );
+                
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
                 EndUndo();
             }
 
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index cf8082ab97e9..7e3adad9146f 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -161,7 +161,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, 
sal_Int8& rAction,
         if( IsUndoEnabled() )
         {
             BegUndo(SdResId(STR_UNDO_DRAGDROP));
-            
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
+            
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pPickObj));
             EndUndo();
         }
 
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index b560a25c514a..aaf381e7bc71 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -136,7 +136,7 @@ void GraphCtrl::InitSdrModel()
     pView.reset(new GraphCtrlView(*pModel, this));
     pView->SetWorkArea( tools::Rectangle( Point(), aGraphSize ) );
     pView->EnableExtendedMouseEventDispatcher( true );
-    pView->ShowSdrPage(pView->GetModel()->GetPage(0));
+    pView->ShowSdrPage(pView->GetModel().GetPage(0));
     pView->SetFrameDragSingles();
     pView->SetMarkedPointsSmooth( SdrPathSmoothKind::Symmetric );
     pView->SetEditMode();
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index ece5281baf63..29a048e3f055 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -572,8 +572,8 @@ bool E3dView::ImpCloneAll3DObjectsToDestScene(E3dScene 
const * pSrcScene, E3dSce
                     bRetval = true;
 
                     // Create undo
-                    if( GetModel()->IsUndoEnabled() )
-                        
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewObject(*pNewCompoundObj));
+                    if( GetModel().IsUndoEnabled() )
+                        
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoNewObject(*pNewCompoundObj));
                 }
             }
         }
@@ -648,8 +648,8 @@ void 
E3dView::ImpChangeSomeAttributesFor3DConversion(SdrObject* pObj)
         pObj->SetMergedItem(SvxColorItem(COL_BLACK, EE_CHAR_COLOR));
 
         // add undo now
-        if( GetModel()->IsUndoEnabled() )
-            
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+        if (GetModel().IsUndoEnabled())
+            
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
     }
 
     pObj->SetMergedItem(SvxColorItem(COL_GRAY, EE_CHAR_COLOR));
@@ -671,9 +671,9 @@ void 
E3dView::ImpChangeSomeAttributesFor3DConversion2(SdrObject* pObj)
         && !nLineWidth
         && eFillStyle != drawing::FillStyle_NONE)
     {
-        if(pObj->getSdrPageFromSdrObject() && GetModel()->IsUndoEnabled() )
+        if (pObj->getSdrPageFromSdrObject() && GetModel().IsUndoEnabled())
         {
-            
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+            
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
         }
 
         pObj->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
diff --git a/svx/source/engine3d/view3d1.cxx b/svx/source/engine3d/view3d1.cxx
index e647fe11625c..bc5cfbaf5116 100644
--- a/svx/source/engine3d/view3d1.cxx
+++ b/svx/source/engine3d/view3d1.cxx
@@ -91,10 +91,10 @@ static void Imp_E3dView_InorderRun3DObjects(const 
SdrObject* pObj, sal_uInt32& r
 SfxItemSet E3dView::Get3DAttributes() const
 {
     // Creating itemset with corresponding field
+    SfxItemPool& rPool = GetModel().GetItemPool();
     SfxItemSet aSet(
-        mpModel->GetItemPool(),
-        svl::Items<SDRATTR_START,      SDRATTR_END,
-        SID_ATTR_3D_INTERN, SID_ATTR_3D_INTERN>);
+        rPool,
+        svl::Items<SDRATTR_START, SDRATTR_END, SID_ATTR_3D_INTERN, 
SID_ATTR_3D_INTERN>);
 
     sal_uInt32 nSelectedItems(0);
 
@@ -118,7 +118,7 @@ SfxItemSet E3dView::Get3DAttributes() const
     if(!nSelectedItems)
     {
         // Get defaults and apply
-        SfxItemSetFixed<SDRATTR_3D_FIRST, SDRATTR_3D_LAST> 
aDefaultSet(mpModel->GetItemPool());
+        SfxItemSetFixed<SDRATTR_3D_FIRST, SDRATTR_3D_LAST> 
aDefaultSet(GetModel().GetItemPool());
         GetAttributes(aDefaultSet);
         aSet.Put(aDefaultSet);
 
@@ -158,7 +158,7 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr)
     if(!nSelectedItems)
     {
         // Set defaults
-        SfxItemSetFixed<SDRATTR_3D_FIRST, SDRATTR_3D_LAST> 
aDefaultSet(mpModel->GetItemPool());
+        SfxItemSetFixed<SDRATTR_3D_FIRST, SDRATTR_3D_LAST> 
aDefaultSet(GetModel().GetItemPool());
         aDefaultSet.Put(rAttr);
         SetAttributes(aDefaultSet);
     }
@@ -166,12 +166,12 @@ void E3dView::Set3DAttributes( const SfxItemSet& rAttr)
 
 double E3dView::GetDefaultCamPosZ()
 {
-    return 
static_cast<double>(mpModel->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_DISTANCE).GetValue());
+    return 
static_cast<double>(GetModel().GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_DISTANCE).GetValue());
 }
 
 double E3dView::GetDefaultCamFocal()
 {
-    return 
static_cast<double>(mpModel->GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_FOCAL_LENGTH).GetValue());
+    return 
static_cast<double>(GetModel().GetItemPool().GetDefaultItem(SDRATTR_3DSCENE_FOCAL_LENGTH).GetValue());
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/form/fmshell.cxx b/svx/source/form/fmshell.cxx
index a115b1c896a0..fa485e478c72 100644
--- a/svx/source/form/fmshell.cxx
+++ b/svx/source/form/fmshell.cxx
@@ -1155,7 +1155,7 @@ void FmFormShell::SetView( FmFormView* _pView )
 
     m_pFormView = _pView;
     m_pFormView->SetFormShell( this, FmFormView::FormShellAccess() );
-    m_pFormModel = static_cast<FmFormModel*>(m_pFormView->GetModel());
+    m_pFormModel = static_cast<FmFormModel*>(&m_pFormView->GetModel());
 
     impl_setDesignMode( m_pFormView->IsDesignMode() );
 
diff --git a/svx/source/form/fmshimp.cxx b/svx/source/form/fmshimp.cxx
index 04390bde7063..ee604b6277f2 100644
--- a/svx/source/form/fmshimp.cxx
+++ b/svx/source/form/fmshimp.cxx
@@ -3600,8 +3600,9 @@ void FmXFormShell::viewActivated_Lock(FmFormView& 
_rCurrentView, bool _bSyncActi
         // first-time initializations for the views
         if ( !_rCurrentView.GetImpl()->hasEverBeenActivated( ) )
         {
-            _rCurrentView.GetImpl()->onFirstViewActivation( 
dynamic_cast<FmFormModel*>( _rCurrentView.GetModel() )  );
-            _rCurrentView.GetImpl()->setHasBeenActivated( );
+            auto* pFormModel = 
dynamic_cast<FmFormModel*>(&_rCurrentView.GetModel());
+            _rCurrentView.GetImpl()->onFirstViewActivation(pFormModel);
+            _rCurrentView.GetImpl()->setHasBeenActivated();
         }
 
         // activate the current view
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index d656464f1698..64af0e9aa0fb 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -79,7 +79,7 @@ void FmFormView::Init()
     pImpl = new FmXFormView(this);
 
     // set model
-    SdrModel* pModel = GetModel();
+    SdrModel* pModel = &GetModel();
 
     DBG_ASSERT( dynamic_cast<const FmFormModel*>( pModel) !=  nullptr, "Wrong 
model" );
     FmFormModel* pFormModel = dynamic_cast<FmFormModel*>(pModel);
@@ -201,7 +201,7 @@ void FmFormView::ChangeDesignMode(bool bDesign)
     if (bDesign == IsDesignMode())
         return;
 
-    FmFormModel* pModel = dynamic_cast<FmFormModel*>( GetModel() );
+    FmFormModel* pModel = dynamic_cast<FmFormModel*>(&GetModel());
     if (pModel)
     {   // For the duration of the transition the Undo-Environment is 
disabled. This ensures that non-transient Properties can
         // also be changed (this should be done with care and also reversed 
before switching the mode back. An example is the
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index 94940f355a42..25c072ee65a8 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -347,7 +347,7 @@ bool GalleryTheme::GetGraphic(sal_uInt32 nPos, Graphic& 
rGraphic)
                             FmFormView aView(*aModel.GetModel(), pVDev);
 
                             aView.hideMarkHandles();
-                            aView.ShowSdrPage(aView.GetModel()->GetPage(0));
+                            aView.ShowSdrPage(aView.GetModel().GetPage(0));
                             aView.MarkAll();
                             rGraphic = aView.GetAllMarkedGraphic();
                             bRet = true;
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx 
b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index 7d829d324aab..c8661d11b365 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -237,7 +237,7 @@ void PosSizePropertyPanel::Initialize()
 
     if ( mpView != nullptr )
     {
-        maUIScale = mpView->GetModel()->GetUIScale();
+        maUIScale = mpView->GetModel().GetUIScale();
         mbAdjustEnabled = hasText(*mpView);
     }
 
@@ -400,7 +400,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosXHdl, 
weld::MetricSpinButton&, v
     {
         tools::Long lX = GetCoreValue( *mxMtrPosX, mePoolUnit );
 
-        Fraction aUIScale = mpView->GetModel()->GetUIScale();
+        Fraction aUIScale = mpView->GetModel().GetUIScale();
         lX = tools::Long( lX * aUIScale );
 
         SfxInt32Item aPosXItem( 
SID_ATTR_TRANSFORM_POS_X,static_cast<sal_uInt32>(lX));
@@ -416,7 +416,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, ChangePosYHdl, 
weld::MetricSpinButton&, v
     {
         tools::Long lY = GetCoreValue( *mxMtrPosY, mePoolUnit );
 
-        Fraction aUIScale = mpView->GetModel()->GetUIScale();
+        Fraction aUIScale = mpView->GetModel().GetUIScale();
         lY = tools::Long( lY * aUIScale );
 
         SfxInt32Item aPosYItem( 
SID_ATTR_TRANSFORM_POS_Y,static_cast<sal_uInt32>(lY));
@@ -444,7 +444,7 @@ IMPL_LINK_NOARG( PosSizePropertyPanel, RotationHdl, 
DialControl&, void )
     Degree100 nTmp = mxCtrlDial->GetRotation();
 
     // #i123993# Need to take UIScale into account when executing rotations
-    const double fUIScale(mpView && mpView->GetModel() ? 
double(mpView->GetModel()->GetUIScale()) : 1.0);
+    const double fUIScale(mpView && double(mpView->GetModel().GetUIScale()));
     SdrAngleItem aAngleItem( SID_ATTR_TRANSFORM_ANGLE, nTmp);
     SfxInt32Item aRotXItem( SID_ATTR_TRANSFORM_ROT_X, basegfx::fround(mlRotX * 
fUIScale));
     SfxInt32Item aRotYItem( SID_ATTR_TRANSFORM_ROT_Y, basegfx::fround(mlRotY * 
fUIScale));
@@ -804,7 +804,7 @@ void PosSizePropertyPanel::executeSize()
     if ( !mxMtrWidth->get_value_changed_from_saved() && 
!mxMtrHeight->get_value_changed_from_saved())
         return;
 
-    Fraction aUIScale = mpView->GetModel()->GetUIScale();
+    Fraction aUIScale = mpView->GetModel().GetUIScale();
 
     // get Width
     double nWidth = 
static_cast<double>(mxMtrWidth->get_value(FieldUnit::MM_100TH));
@@ -1021,7 +1021,7 @@ void PosSizePropertyPanel::SetPosSizeMinMax()
     pPV->LogicToPagePos(aTmpRect2);
     maWorkArea = vcl::unotools::b2DRectangleFromRectangle(aTmpRect2);
 
-    const Fraction aUIScale(mpView->GetModel()->GetUIScale());
+    const Fraction aUIScale(mpView->GetModel().GetUIScale());
     TransfrmHelper::ScaleRect( maWorkArea, aUIScale );
     TransfrmHelper::ScaleRect( maRect, aUIScale );
 
@@ -1060,7 +1060,7 @@ void PosSizePropertyPanel::SetPosSizeMinMax()
 
 void PosSizePropertyPanel::UpdateUIScale()
 {
-    const Fraction aUIScale (mpView->GetModel()->GetUIScale());
+    const Fraction aUIScale (mpView->GetModel().GetUIScale());
     if (maUIScale == aUIScale)
         return;
 
diff --git a/svx/source/svdraw/sdrpagewindow.cxx 
b/svx/source/svdraw/sdrpagewindow.cxx
index 01be77135674..123d1d2d03a6 100644
--- a/svx/source/svdraw/sdrpagewindow.cxx
+++ b/svx/source/svdraw/sdrpagewindow.cxx
@@ -324,7 +324,7 @@ void SdrPageWindow::RedrawAll( 
sdr::contact::ViewObjectContactRedirector* pRedir
 
     // set PaintingPageView
     const SdrView& rView = mpImpl->mrPageView.GetView();
-    SdrModel& rModel = *(rView.GetModel());
+    SdrModel& rModel = rView.GetModel();
 
     // get to be processed layers
     const bool bPrinter(GetPaintWindow().OutputToPrinter());
@@ -378,7 +378,7 @@ void SdrPageWindow::RedrawLayer(const SdrLayerID* pId,
 
     // set PaintingPageView
     const SdrView& rView = mpImpl->mrPageView.GetView();
-    SdrModel& rModel = *(rView.GetModel());
+    SdrModel& rModel = rView.GetModel();
 
     // get the layers to process
     const bool bPrinter(GetPaintWindow().OutputToPrinter());
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 7e025cf044e1..8c3c0750377f 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -339,7 +339,7 @@ void SdrCreateView::SetCurrentObj(SdrObjKind nIdent, 
SdrInventor nInvent)
         mnCurrentIdent=nIdent;
         rtl::Reference<SdrObject> pObj = (nIdent == SdrObjKind::NONE) ? 
nullptr :
             SdrObjFactory::MakeNewObject(
-                *GetModel(),
+                GetModel(),
                 nInvent,
                 nIdent);
 
@@ -397,9 +397,7 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, 
SdrObjKind nIdent, cons
             else
             {
                 mpCurrentCreate = SdrObjFactory::MakeNewObject(
-                    *mpModel,
-                    nInvent,
-                    nIdent);
+                    GetModel(), nInvent, nIdent);
             }
 
             Point aPnt(rPnt);
@@ -421,19 +419,18 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, 
SdrObjKind nIdent, cons
                     mpCurrentCreate->SetMergedItemSet(maDefaultAttr);
                 }
 
-                if (mpModel && dynamic_cast<const SdrCaptionObj 
*>(mpCurrentCreate.get()) != nullptr)
+                if (dynamic_cast<const SdrCaptionObj *>(mpCurrentCreate.get()) 
!= nullptr)
                 {
-                    SfxItemSet aSet(mpModel->GetItemPool());
+                    SfxItemSet aSet(GetModel().GetItemPool());
                     aSet.Put(XFillColorItem(OUString(),COL_WHITE)); // in case 
someone turns on Solid
                     aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
 
                     mpCurrentCreate->SetMergedItemSet(aSet);
                 }
-                if (mpModel && nInvent==SdrInventor::Default && 
(nIdent==SdrObjKind::Text ||
-                    nIdent==SdrObjKind::TitleText || 
nIdent==SdrObjKind::OutlineText))
+                if (nInvent == SdrInventor::Default && 
(nIdent==SdrObjKind::Text || nIdent==SdrObjKind::TitleText || 
nIdent==SdrObjKind::OutlineText))
                 {
                     // default for all text frames: no background, no border
-                    SfxItemSet aSet(mpModel->GetItemPool());
+                    SfxItemSet aSet(GetModel().GetItemPool());
                     aSet.Put(XFillColorItem(OUString(),COL_WHITE)); // in case 
someone turns on Solid
                     aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
                     aSet.Put(XLineColorItem(OUString(),COL_BLACK)); // in case 
someone turns on Solid
diff --git a/svx/source/svdraw/svddrgmt.cxx b/svx/source/svdraw/svddrgmt.cxx
index 37531632c5b4..166b174c89be 100644
--- a/svx/source/svdraw/svddrgmt.cxx
+++ b/svx/source/svdraw/svddrgmt.cxx
@@ -1354,18 +1354,18 @@ bool SdrDragObjOwn::EndSdrDrag(bool /*bCopy*/)
             {
                 if (DragStat().IsEndDragChangesAttributes())
                 {
-                    
pUndo=getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj);
+                    
pUndo=getSdrDragView().GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj);
 
                     if (DragStat().IsEndDragChangesGeoAndAttributes())
                     {
                         vConnectorUndoActions = 
getSdrDragView().CreateConnectorUndo( *pObj );
-                        pUndo2 = 
getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
+                        pUndo2 = 
getSdrDragView().GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
                     }
                 }
                 else
                 {
                     vConnectorUndoActions = 
getSdrDragView().CreateConnectorUndo( *pObj );
-                    pUndo= 
getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
+                    pUndo= 
getSdrDragView().GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj);
                 }
             }
 
@@ -1474,9 +1474,9 @@ OUString SdrDragMove::GetSdrDragComment() const
 {
     OUString aStr = ImpGetDescriptionStr(STR_DragMethMove)
             + " (x="
-            + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
+            + getSdrDragView().GetModel().GetMetricString(DragStat().GetDX())
             + " y="
-            + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDY())
+            + getSdrDragView().GetModel().GetMetricString(DragStat().GetDY())
             + ")";
 
     if(getSdrDragView().IsDragWithCopy())
@@ -3352,7 +3352,7 @@ bool SdrDragCrook::EndSdrDrag(bool bCopy)
 
                     Size aSiz(aCtr1.X()-aCtr0.X(),aCtr1.Y()-aCtr0.Y());
                     if( bUndo )
-                        
AddUndo(getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoMoveObject(*pO,aSiz));
+                        
AddUndo(getSdrDragView().GetModel().GetSdrUndoFactory().CreateUndoMoveObject(*pO,aSiz));
                     pO->Move(aSiz);
                 }
             }
@@ -3393,9 +3393,9 @@ OUString SdrDragDistort::GetSdrDragComment() const
 {
     OUString aStr = ImpGetDescriptionStr(STR_DragMethDistort)
             + " (x="
-            + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
+            + getSdrDragView().GetModel().GetMetricString(DragStat().GetDX())
             + " y="
-            + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDY())
+            + getSdrDragView().GetModel().GetMetricString(DragStat().GetDY())
             + ")";
 
     if(getSdrDragView().IsDragWithCopy())
@@ -3538,9 +3538,9 @@ OUString SdrDragCrop::GetSdrDragComment() const
 {
     OUString aStr = ImpGetDescriptionStr(STR_DragMethCrop)
             + " (x="
-            + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDX())
+            + getSdrDragView().GetModel().GetMetricString(DragStat().GetDX())
             + " y="
-            + getSdrDragView().GetModel()->GetMetricString(DragStat().GetDY())
+            + getSdrDragView().GetModel().GetMetricString(DragStat().GetDY())
             + ")";
 
     if(getSdrDragView().IsDragWithCopy())
@@ -3625,9 +3625,9 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
         OUString aUndoStr = ImpGetDescriptionStr(STR_DragMethCrop);
 
         getSdrDragView().BegUndo( aUndoStr );
-        getSdrDragView().AddUndo( 
getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
+        
getSdrDragView().AddUndo(getSdrDragView().GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj));
         // also need attr undo, the SdrGrafCropItem will be changed
-        getSdrDragView().AddUndo( 
getSdrDragView().GetModel()->GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
+        
getSdrDragView().AddUndo(getSdrDragView().GetModel().GetSdrUndoFactory().CreateUndoAttrObject(*pObj));
     }
 
     // get the original objects transformation
@@ -3839,7 +3839,7 @@ bool SdrDragCrop::EndSdrDrag(bool /*bCopy*/)
         sal_Int32 nRightCrop = static_cast<sal_Int32>( rOldCrop.GetRight() - 
nDiffRight * fScaleX );
         sal_Int32 nBottomCrop = static_cast<sal_Int32>( rOldCrop.GetBottom() - 
nDiffBottom * fScaleY );
 
-        SfxItemPool& rPool = getSdrDragView().GetModel()->GetItemPool();
+        SfxItemPool& rPool = getSdrDragView().GetModel().GetItemPool();
         SfxItemSetFixed<SDRATTR_GRAFCROP, SDRATTR_GRAFCROP> aSet( rPool );
         aSet.Put( SdrGrafCropItem( nLeftCrop, nTopCrop, nRightCrop, 
nBottomCrop ) );
         getSdrDragView().SetAttributes( aSet, false );
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index 27b62dd17946..9616b85bcb4c 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -641,7 +641,7 @@ bool SdrDragView::ImpBegInsObjPoint(bool bIdxZwang, const 
Point& rPnt, bool bNew
     if(auto pMarkedPath = dynamic_cast<SdrPathObj*>( mpMarkedObj))
     {
         BrkAction();
-        mpInsPointUndo = dynamic_cast< SdrUndoGeoObj* >( 
GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*mpMarkedObj).release() );
+        mpInsPointUndo = 
dynamic_cast<SdrUndoGeoObj*>(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*mpMarkedObj).release());
         DBG_ASSERT( mpInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could 
not create correct undo object!" );
 
         OUString aStr(SvxResId(STR_DragInsertPoint));
@@ -739,7 +739,7 @@ bool SdrDragView::BegInsGluePoint(const Point& rPnt)
     {
         BrkAction();
         UnmarkAllGluePoints();
-        mpInsPointUndo= dynamic_cast< SdrUndoGeoObj* >( 
GetModel()->GetSdrUndoFactory().CreateUndoGeoObject(*pObj).release() );
+        mpInsPointUndo = 
dynamic_cast<SdrUndoGeoObj*>(GetModel().GetSdrUndoFactory().CreateUndoGeoObject(*pObj).release());
         DBG_ASSERT( mpInsPointUndo, "svx::SdrDragView::BegInsObjPoint(), could 
not create correct undo object!" );
         OUString aStr(SvxResId(STR_DragInsertGluePoint));
 
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index 58812d849403..66ab88e786f7 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -128,15 +128,15 @@ SdrEditView::~SdrEditView()
 
 void SdrEditView::InsertNewLayer(const OUString& rName, sal_uInt16 nPos)
 {
-    SdrLayerAdmin& rLA=mpModel->GetLayerAdmin();
+    SdrLayerAdmin& rLA = GetModel().GetLayerAdmin();
     sal_uInt16 nMax=rLA.GetLayerCount();
     if (nPos>nMax) nPos=nMax;
     rLA.NewLayer(rName,nPos);
 
-    if( GetModel()->IsUndoEnabled() )
-        
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoNewLayer(nPos,rLA,*mpModel));
+    if( GetModel().IsUndoEnabled() )
+        AddUndo(GetModel().GetSdrUndoFactory().CreateUndoNewLayer(nPos,rLA, 
GetModel()));
 
-    mpModel->SetChanged();
+    GetModel().SetChanged();
 }
 
 bool SdrEditView::ImpDelLayerCheck(SdrObjList const * pOL, SdrLayerID nDelID) 
const
@@ -175,7 +175,7 @@ void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, 
SdrLayerID nDelID)
     // make sure OrdNums are correct
     pOL->GetObj(0)->GetOrdNum();
 
-    const bool bUndo = GetModel()->IsUndoEnabled();
+    const bool bUndo = GetModel().IsUndoEnabled();
 
     for(size_t nObjNum = nObjCount; nObjNum > 0;)
     {
@@ -190,7 +190,7 @@ void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, 
SdrLayerID nDelID)
             if(ImpDelLayerCheck(pSubOL, nDelID))
             {
                 if( bUndo )
-                    
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
+                    
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
                 pOL->RemoveObject(nObjNum);
             }
             else
@@ -203,7 +203,7 @@ void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, 
SdrLayerID nDelID)
             if(pObj->GetLayer() == nDelID)
             {
                 if( bUndo )
-                    
AddUndo(GetModel()->GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
+                    
AddUndo(GetModel().GetSdrUndoFactory().CreateUndoDeleteObject(*pObj, true));
                 pOL->RemoveObject(nObjNum);
             }
         }
@@ -212,7 +212,7 @@ void SdrEditView::ImpDelLayerDelObjs(SdrObjList* pOL, 
SdrLayerID nDelID)
 
 void SdrEditView::DeleteLayer(const OUString& rName)
 {
-    SdrLayerAdmin& rLA = mpModel->GetLayerAdmin();
+    SdrLayerAdmin& rLA = GetModel().GetLayerAdmin();
     SdrLayer* pLayer = rLA.GetLayer(rName);
 
     if(!pLayer)
@@ -230,12 +230,12 @@ void SdrEditView::DeleteLayer(const OUString& rName)
     for(sal_uInt16 nPageKind(0); nPageKind < 2; nPageKind++)
     {
         // MasterPages and DrawPages
-        sal_uInt16 nPgCount(bMaPg ? mpModel->GetMasterPageCount() : 
mpModel->GetPageCount());
+        sal_uInt16 nPgCount(bMaPg ? GetModel().GetMasterPageCount() : 
GetModel().GetPageCount());
 
         for(sal_uInt16 nPgNum(0); nPgNum < nPgCount; nPgNum++)
         {
             // over all pages
-            SdrPage* pPage = bMaPg ? mpModel->GetMasterPage(nPgNum) : 
mpModel->GetPage(nPgNum);
+            SdrPage* pPage = bMaPg ? GetModel().GetMasterPage(nPgNum) : 
GetModel().GetPage(nPgNum);
             const size_t nObjCount(pPage->GetObjCount());
 
             // make sure OrdNums are correct
@@ -254,7 +254,7 @@ void SdrEditView::DeleteLayer(const OUString& rName)
                     if(ImpDelLayerCheck(pSubOL, nDelID))
                     {

... etc. - the rest is truncated

Reply via email to