[Libreoffice-commits] core.git: basctl/source basegfx/Library_basegfx.mk basegfx/source chart2/source cui/source filter/source include/basegfx include/filter include/svx reportdesign/inc reportdesign/source sc/inc sc/qa sc/source sd/inc sd/source svx/inc svx/source sw/inc sw/source xmloff/source

Armin Le Grand (CIB) Armin.Le.Grand at cib.de
Fri Apr 6 22:30:33 UTC 2018


 basctl/source/dlged/dlged.cxx                                     |   12 
 basctl/source/dlged/dlgedfac.cxx                                  |   60 
 basctl/source/dlged/dlgedobj.cxx                                  |   38 
 basctl/source/dlged/dlgedpage.cxx                                 |   32 
 basctl/source/dlged/dlgedview.cxx                                 |    8 
 basctl/source/inc/dlgedobj.hxx                                    |   14 
 basctl/source/inc/dlgedpage.hxx                                   |    7 
 basctl/source/inc/dlgedview.hxx                                   |    6 
 basegfx/Library_basegfx.mk                                        |    1 
 basegfx/source/matrix/b2dhommatrix.cxx                            |   15 
 basegfx/source/matrix/b3dhommatrix.cxx                            |   15 
 basegfx/source/matrix/b3dhommatrixtools.cxx                       |   73 
 basegfx/source/numeric/ftools.cxx                                 |   53 
 basegfx/source/range/b2drange.cxx                                 |   20 
 basegfx/source/range/b3drange.cxx                                 |   19 
 chart2/source/controller/drawinglayer/DrawViewWrapper.cxx         |   12 
 chart2/source/controller/drawinglayer/ViewElementListProvider.cxx |    2 
 chart2/source/controller/inc/DrawViewWrapper.hxx                  |    5 
 chart2/source/controller/main/ChartController.cxx                 |    2 
 chart2/source/controller/main/ChartController_Tools.cxx           |   11 
 chart2/source/controller/main/ChartTransferable.cxx               |   11 
 chart2/source/controller/main/ChartTransferable.hxx               |   11 
 chart2/source/controller/main/DrawCommandDispatch.cxx             |   13 
 chart2/source/view/diagram/VDiagram.cxx                           |    8 
 cui/source/dialogs/sdrcelldlg.cxx                                 |   12 
 cui/source/factory/dlgfact.cxx                                    |    4 
 cui/source/factory/dlgfact.hxx                                    |    2 
 cui/source/inc/sdrcelldlg.hxx                                     |    2 
 cui/source/tabpages/measure.cxx                                   |    9 
 cui/source/tabpages/tpline.cxx                                    |    4 
 cui/source/tabpages/transfrm.cxx                                  |   12 
 filter/source/msfilter/escherex.cxx                               |    5 
 filter/source/msfilter/msdffimp.cxx                               |   86 
 filter/source/msfilter/svdfppt.cxx                                |   39 
 filter/source/svg/svgexport.cxx                                   |   14 
 include/basegfx/matrix/b2dhommatrix.hxx                           |    2 
 include/basegfx/matrix/b3dhommatrix.hxx                           |    3 
 include/basegfx/matrix/b3dhommatrixtools.hxx                      |   46 
 include/basegfx/numeric/ftools.hxx                                |   19 
 include/basegfx/range/b1drange.hxx                                |    5 
 include/basegfx/range/b2drange.hxx                                |   25 
 include/basegfx/range/b2irange.hxx                                |    7 
 include/basegfx/range/b3drange.hxx                                |   25 
 include/basegfx/range/basicrange.hxx                              |   22 
 include/filter/msfilter/msdffimp.hxx                              |   24 
 include/svx/connctrl.hxx                                          |    4 
 include/svx/cube3d.hxx                                            |   14 
 include/svx/deflt3d.hxx                                           |    8 
 include/svx/e3dsceneupdater.hxx                                   |    4 
 include/svx/e3dundo.hxx                                           |   64 
 include/svx/extedit.hxx                                           |   12 
 include/svx/extrud3d.hxx                                          |   16 
 include/svx/fmpage.hxx                                            |   11 
 include/svx/fmview.hxx                                            |    4 
 include/svx/graphctl.hxx                                          |   11 
 include/svx/lathe3d.hxx                                           |   14 
 include/svx/obj3d.hxx                                             |   17 
 include/svx/polygn3d.hxx                                          |   12 
 include/svx/scene3d.hxx                                           |    4 
 include/svx/sdr/properties/defaultproperties.hxx                  |    3 
 include/svx/sdr/properties/properties.hxx                         |   33 
 include/svx/sdr/table/tablecontroller.hxx                         |   26 
 include/svx/sphere3d.hxx                                          |   16 
 include/svx/svdcrtv.hxx                                           |    7 
 include/svx/svddrgv.hxx                                           |    7 
 include/svx/svdedtv.hxx                                           |    7 
 include/svx/svdedxv.hxx                                           |    7 
 include/svx/svdglev.hxx                                           |    7 
 include/svx/svdmrkv.hxx                                           |    5 
 include/svx/svdoashp.hxx                                          |   13 
 include/svx/svdoattr.hxx                                          |   10 
 include/svx/svdobj.hxx                                            |  109 -
 include/svx/svdocapt.hxx                                          |   22 
 include/svx/svdocirc.hxx                                          |   23 
 include/svx/svdoedge.hxx                                          |    5 
 include/svx/svdograf.hxx                                          |   19 
 include/svx/svdogrp.hxx                                           |   18 
 include/svx/svdomeas.hxx                                          |   12 
 include/svx/svdomedia.hxx                                         |   10 
 include/svx/svdoole2.hxx                                          |   16 
 include/svx/svdopage.hxx                                          |   12 
 include/svx/svdopath.hxx                                          |   12 
 include/svx/svdorect.hxx                                          |   18 
 include/svx/svdotable.hxx                                         |   18 
 include/svx/svdotext.hxx                                          |   22 
 include/svx/svdouno.hxx                                           |   14 
 include/svx/svdovirt.hxx                                          |   10 
 include/svx/svdpage.hxx                                           |   59 
 include/svx/svdpntv.hxx                                           |   32 
 include/svx/svdpoev.hxx                                           |    7 
 include/svx/svdsnpv.hxx                                           |    7 
 include/svx/svdtext.hxx                                           |    5 
 include/svx/svdview.hxx                                           |    7 
 include/svx/svdxcgv.hxx                                           |   18 
 include/svx/svxdlg.hxx                                            |    2 
 include/svx/unomod.hxx                                            |    4 
 include/svx/unomodel.hxx                                          |   15 
 include/svx/unopage.hxx                                           |    5 
 include/svx/unoshape.hxx                                          |   15 
 include/svx/unoshtxt.hxx                                          |    2 
 include/svx/view3d.hxx                                            |    5 
 reportdesign/inc/ReportDefinition.hxx                             |    7 
 reportdesign/inc/RptObject.hxx                                    |   55 
 reportdesign/inc/RptPage.hxx                                      |    9 
 reportdesign/source/core/api/ReportDefinition.cxx                 |   32 
 reportdesign/source/core/sdr/ReportDrawPage.cxx                   |   15 
 reportdesign/source/core/sdr/ReportUndoFactory.cxx                |    4 
 reportdesign/source/core/sdr/RptObject.cxx                        |  221 +-
 reportdesign/source/core/sdr/RptPage.cxx                          |   45 
 reportdesign/source/ui/inc/SectionView.hxx                        |    6 
 reportdesign/source/ui/report/ReportController.cxx                |   12 
 reportdesign/source/ui/report/ReportSection.cxx                   |   11 
 reportdesign/source/ui/report/SectionView.cxx                     |    8 
 reportdesign/source/ui/report/ViewsWindow.cxx                     |    6 
 reportdesign/source/ui/report/dlgedfac.cxx                        |   15 
 reportdesign/source/ui/report/dlgedfunc.cxx                       |   30 
 sc/inc/docuno.hxx                                                 |    3 
 sc/inc/drawpage.hxx                                               |    9 
 sc/qa/extras/anchor.cxx                                           |    2 
 sc/qa/unit/ucalc.cxx                                              |   14 
 sc/qa/unit/ucalc_sort.cxx                                         |    2 
 sc/source/core/data/documen9.cxx                                  |    6 
 sc/source/core/data/drawpage.cxx                                  |   30 
 sc/source/core/data/drwlayer.cxx                                  |   22 
 sc/source/core/data/postit.cxx                                    |   11 
 sc/source/core/tool/detfunc.cxx                                   |   23 
 sc/source/filter/excel/xichart.cxx                                |    2 
 sc/source/filter/excel/xiescher.cxx                               |   72 
 sc/source/filter/html/htmlexp2.cxx                                |    3 
 sc/source/filter/rtf/eeimpars.cxx                                 |    6 
 sc/source/ui/app/drwtrans.cxx                                     |   10 
 sc/source/ui/drawfunc/fuconarc.cxx                                |    5 
 sc/source/ui/drawfunc/fuconcustomshape.cxx                        |    9 
 sc/source/ui/drawfunc/fuconpol.cxx                                |    5 
 sc/source/ui/drawfunc/fuconrec.cxx                                |   21 
 sc/source/ui/drawfunc/fuconuno.cxx                                |    5 
 sc/source/ui/drawfunc/fuins1.cxx                                  |   12 
 sc/source/ui/drawfunc/fuins2.cxx                                  |   18 
 sc/source/ui/drawfunc/futext.cxx                                  |    5 
 sc/source/ui/inc/drawview.hxx                                     |    7 
 sc/source/ui/navipi/content.cxx                                   |    2 
 sc/source/ui/unoobj/TablePivotCharts.cxx                          |    7 
 sc/source/ui/unoobj/chartuno.cxx                                  |    6 
 sc/source/ui/unoobj/docuno.cxx                                    |   16 
 sc/source/ui/unoobj/shapeuno.cxx                                  |  129 -
 sc/source/ui/view/drawvie3.cxx                                    |    6 
 sc/source/ui/view/gridwin4.cxx                                    |    5 
 sc/source/ui/view/preview.cxx                                     |    4 
 sc/source/ui/view/printfun.cxx                                    |    5 
 sc/source/ui/view/tabvwshg.cxx                                    |    7 
 sc/source/ui/view/viewfun7.cxx                                    |   21 
 sd/inc/CustomAnimationEffect.hxx                                  |    6 
 sd/inc/sdpage.hxx                                                 |    9 
 sd/source/core/CustomAnimationEffect.cxx                          |    4 
 sd/source/core/annotations/Annotation.cxx                         |    4 
 sd/source/core/drawdoc.cxx                                        |   15 
 sd/source/core/drawdoc3.cxx                                       |    2 
 sd/source/core/pglink.cxx                                         |    2 
 sd/source/core/sdpage.cxx                                         |  142 -
 sd/source/core/sdpage2.cxx                                        |  174 -
 sd/source/core/undo/undoobjects.cxx                               |   10 
 sd/source/filter/grf/sdgrffilter.cxx                              |   84 
 sd/source/filter/ppt/pptin.cxx                                    |    5 
 sd/source/ui/animations/motionpathtag.cxx                         |    2 
 sd/source/ui/app/sdmod2.cxx                                       |    2 
 sd/source/ui/dlg/animobjs.cxx                                     |   25 
 sd/source/ui/func/fucon3d.cxx                                     |   38 
 sd/source/ui/func/fuconarc.cxx                                    |   15 
 sd/source/ui/func/fuconbez.cxx                                    |    5 
 sd/source/ui/func/fuconcs.cxx                                     |    7 
 sd/source/ui/func/fuconrec.cxx                                    |   31 
 sd/source/ui/func/fuconstr.cxx                                    |   12 
 sd/source/ui/func/fuconuno.cxx                                    |    5 
 sd/source/ui/func/fuinsert.cxx                                    |   13 
 sd/source/ui/func/fuinsfil.cxx                                    |    4 
 sd/source/ui/func/fumorph.cxx                                     |    7 
 sd/source/ui/func/futext.cxx                                      |    9 
 sd/source/ui/func/unoaprms.cxx                                    |    2 
 sd/source/ui/inc/unomodel.hxx                                     |    4 
 sd/source/ui/sidebar/DocumentHelper.cxx                           |   96 
 sd/source/ui/table/tablefunction.cxx                              |   12 
 sd/source/ui/tools/PreviewRenderer.cxx                            |   14 
 sd/source/ui/unoidl/unomodel.cxx                                  |    5 
 sd/source/ui/unoidl/unopage.cxx                                   |  248 +-
 sd/source/ui/view/DocumentRenderer.cxx                            |   10 
 sd/source/ui/view/drawview.cxx                                    |   15 
 sd/source/ui/view/drviews2.cxx                                    |   12 
 sd/source/ui/view/drviews8.cxx                                    |    5 
 sd/source/ui/view/drviews9.cxx                                    |    5 
 sd/source/ui/view/drviewse.cxx                                    |   12 
 sd/source/ui/view/frmview.cxx                                     |    2 
 sd/source/ui/view/sdview.cxx                                      |   11 
 sd/source/ui/view/sdview3.cxx                                     |   18 
 sd/source/ui/view/sdview4.cxx                                     |   20 
 svx/inc/dragmt3d.hxx                                              |    9 
 svx/inc/sdr/properties/attributeproperties.hxx                    |   16 
 svx/inc/sdr/properties/e3dsceneproperties.hxx                     |    3 
 svx/inc/sdr/properties/groupproperties.hxx                        |    3 
 svx/source/accessibility/AccessibleEmptyEditSource.cxx            |    9 
 svx/source/accessibility/AccessibleGraphicShape.cxx               |    2 
 svx/source/core/extedit.cxx                                       |    9 
 svx/source/customshapes/EnhancedCustomShape2d.cxx                 |   16 
 svx/source/customshapes/EnhancedCustomShape3d.cxx                 |   54 
 svx/source/customshapes/EnhancedCustomShapeEngine.cxx             |   16 
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx           |    6 
 svx/source/dialog/connctrl.cxx                                    |   32 
 svx/source/dialog/contwnd.cxx                                     |    5 
 svx/source/dialog/dlgctl3d.cxx                                    |   10 
 svx/source/dialog/dlgctrl.cxx                                     |   35 
 svx/source/dialog/graphctl.cxx                                    |    2 
 svx/source/dialog/imapwnd.cxx                                     |   32 
 svx/source/dialog/measctrl.cxx                                    |    6 
 svx/source/engine3d/cube3d.cxx                                    |   37 
 svx/source/engine3d/dragmt3d.cxx                                  |   47 
 svx/source/engine3d/e3dsceneupdater.cxx                           |   35 
 svx/source/engine3d/e3dundo.cxx                                   |   43 
 svx/source/engine3d/extrud3d.cxx                                  |   37 
 svx/source/engine3d/lathe3d.cxx                                   |   37 
 svx/source/engine3d/obj3d.cxx                                     |   46 
 svx/source/engine3d/objfac3d.cxx                                  |   19 
 svx/source/engine3d/polygn3d.cxx                                  |   29 
 svx/source/engine3d/scene3d.cxx                                   |   38 
 svx/source/engine3d/sphere3d.cxx                                  |   46 
 svx/source/engine3d/view3d.cxx                                    |   25 
 svx/source/form/fmdmod.cxx                                        |    9 
 svx/source/form/fmdpage.cxx                                       |    7 
 svx/source/form/fmobj.cxx                                         |   51 
 svx/source/form/fmobjfac.cxx                                      |    8 
 svx/source/form/fmpage.cxx                                        |   82 
 svx/source/form/fmpgeimp.cxx                                      |   52 
 svx/source/form/fmshimp.cxx                                       |   11 
 svx/source/form/fmview.cxx                                        |    8 
 svx/source/form/fmvwimp.cxx                                       |   27 
 svx/source/gallery2/galobj.cxx                                    |    2 
 svx/source/gallery2/galtheme.cxx                                  |    4 
 svx/source/inc/cell.hxx                                           |    2 
 svx/source/inc/fmobj.hxx                                          |   13 
 svx/source/inc/tablemodel.hxx                                     |    2 
 svx/source/sdr/contact/viewcontactofgraphic.cxx                   |    5 
 svx/source/sdr/contact/viewcontactofsdrrectobj.cxx                |    3 
 svx/source/sdr/contact/viewobjectcontactofgraphic.cxx             |    2 
 svx/source/sdr/primitive2d/sdrattributecreator.cxx                |    4 
 svx/source/sdr/primitive2d/sdrtextprimitive2d.cxx                 |   14 
 svx/source/sdr/properties/attributeproperties.cxx                 |  426 +---
 svx/source/sdr/properties/defaultproperties.cxx                   |   28 
 svx/source/sdr/properties/e3dsceneproperties.cxx                  |   25 
 svx/source/sdr/properties/groupproperties.cxx                     |   25 
 svx/source/sdr/properties/properties.cxx                          |   12 
 svx/source/sdr/properties/textproperties.cxx                      |   12 
 svx/source/svdraw/svdcrtv.cxx                                     |   21 
 svx/source/svdraw/svddrgv.cxx                                     |    6 
 svx/source/svdraw/svdedtv.cxx                                     |    7 
 svx/source/svdraw/svdedtv2.cxx                                    |   28 
 svx/source/svdraw/svdedxv.cxx                                     |   23 
 svx/source/svdraw/svdetc.cxx                                      |    6 
 svx/source/svdraw/svdfmtf.cxx                                     |  126 +
 svx/source/svdraw/svdglev.cxx                                     |    8 
 svx/source/svdraw/svdhdl.cxx                                      |   12 
 svx/source/svdraw/svdmodel.cxx                                    |   45 
 svx/source/svdraw/svdmrkv.cxx                                     |    8 
 svx/source/svdraw/svdoashp.cxx                                    |   37 
 svx/source/svdraw/svdoattr.cxx                                    |   22 
 svx/source/svdraw/svdobj.cxx                                      |  504 ++---
 svx/source/svdraw/svdocapt.cxx                                    |   45 
 svx/source/svdraw/svdocirc.cxx                                    |   43 
 svx/source/svdraw/svdoedge.cxx                                    |   17 
 svx/source/svdraw/svdograf.cxx                                    |  296 +--
 svx/source/svdraw/svdogrp.cxx                                     |  195 -
 svx/source/svdraw/svdomeas.cxx                                    |  190 +
 svx/source/svdraw/svdomedia.cxx                                   |   48 
 svx/source/svdraw/svdoole2.cxx                                    |  348 +--
 svx/source/svdraw/svdopage.cxx                                    |   20 
 svx/source/svdraw/svdopath.cxx                                    |   43 
 svx/source/svdraw/svdorect.cxx                                    |   58 
 svx/source/svdraw/svdotext.cxx                                    |  123 -
 svx/source/svdraw/svdotextdecomposition.cxx                       |    5 
 svx/source/svdraw/svdotxat.cxx                                    |    8 
 svx/source/svdraw/svdotxed.cxx                                    |   10 
 svx/source/svdraw/svdotxln.cxx                                    |    9 
 svx/source/svdraw/svdotxtr.cxx                                    |   45 
 svx/source/svdraw/svdouno.cxx                                     |   53 
 svx/source/svdraw/svdovirt.cxx                                    |   59 
 svx/source/svdraw/svdpage.cxx                                     |  313 ---
 svx/source/svdraw/svdpagv.cxx                                     |   26 
 svx/source/svdraw/svdpntv.cxx                                     |   11 
 svx/source/svdraw/svdpoev.cxx                                     |    6 
 svx/source/svdraw/svdsnpv.cxx                                     |   49 
 svx/source/svdraw/svdtext.cxx                                     |   90 
 svx/source/svdraw/svdundo.cxx                                     |   30 
 svx/source/svdraw/svdview.cxx                                     |    8 
 svx/source/svdraw/svdviter.cxx                                    |    4 
 svx/source/svdraw/svdxcgv.cxx                                     |  150 -
 svx/source/table/cell.cxx                                         |  120 -
 svx/source/table/cellcursor.cxx                                   |   23 
 svx/source/table/svdotable.cxx                                    |  125 -
 svx/source/table/tablecolumn.cxx                                  |    8 
 svx/source/table/tablecontroller.cxx                              |  981 +++++-----
 svx/source/table/tablemodel.cxx                                   |   74 
 svx/source/table/tablerow.cxx                                     |   18 
 svx/source/table/tablertfimporter.cxx                             |    4 
 svx/source/table/tableundo.cxx                                    |   54 
 svx/source/tbxctrls/fontworkgallery.cxx                           |    8 
 svx/source/unodraw/UnoGraphicExporter.cxx                         |   53 
 svx/source/unodraw/tableshape.cxx                                 |   34 
 svx/source/unodraw/unomod.cxx                                     |   22 
 svx/source/unodraw/unopage.cxx                                    |  128 -
 svx/source/unodraw/unoshap2.cxx                                   |  180 -
 svx/source/unodraw/unoshap3.cxx                                   |  182 -
 svx/source/unodraw/unoshap4.cxx                                   |   80 
 svx/source/unodraw/unoshape.cxx                                   |  553 ++---
 svx/source/unodraw/unoshtxt.cxx                                   |   72 
 svx/source/unogallery/unogaltheme.cxx                             |    5 
 sw/inc/dcontact.hxx                                               |   10 
 sw/inc/dpage.hxx                                                  |    8 
 sw/inc/frmfmt.hxx                                                 |    2 
 sw/inc/unotxdoc.hxx                                               |    3 
 sw/source/core/doc/doclay.cxx                                     |    4 
 sw/source/core/draw/dcontact.cxx                                  |   47 
 sw/source/core/draw/dflyobj.cxx                                   |   14 
 sw/source/core/draw/dobjfac.cxx                                   |    2 
 sw/source/core/draw/dpage.cxx                                     |   52 
 sw/source/core/draw/dview.cxx                                     |    7 
 sw/source/core/frmedt/fecopy.cxx                                  |    5 
 sw/source/core/frmedt/feshview.cxx                                |   21 
 sw/source/core/inc/dflyobj.hxx                                    |    7 
 sw/source/core/inc/dview.hxx                                      |    5 
 sw/source/core/layout/atrfrm.cxx                                  |    6 
 sw/source/core/layout/paintfrm.cxx                                |    2 
 sw/source/core/view/viewimp.cxx                                   |    5 
 sw/source/filter/html/htmldrawreader.cxx                          |    8 
 sw/source/filter/ww8/wrtw8esh.cxx                                 |    6 
 sw/source/filter/ww8/wrtww8gr.cxx                                 |   15 
 sw/source/filter/ww8/ww8graf.cxx                                  |   52 
 sw/source/filter/ww8/ww8par.cxx                                   |   28 
 sw/source/filter/ww8/ww8par4.cxx                                  |   16 
 sw/source/filter/xml/swxml.cxx                                    |    6 
 sw/source/uibase/ribbar/concustomshape.cxx                        |    2 
 sw/source/uibase/ribbar/conrect.cxx                               |    2 
 sw/source/uibase/shells/grfshex.cxx                               |    5 
 sw/source/uibase/uno/unotxdoc.cxx                                 |    6 
 xmloff/source/draw/xexptran.cxx                                   |   39 
 341 files changed, 6096 insertions(+), 5489 deletions(-)

New commits:
commit dfefe448c41921f2f1e54d3f69b8b9e89031d055
Author: Armin Le Grand <Armin.Le.Grand at cib.de (CIB)>
Date:   Thu Mar 1 15:54:32 2018 +0100

    SOSAW080: Added first bunch of basic changes to helpers
    
    SOSAW080: Make SdrModel& prerequisite to SdrObjects
    
    Added need for SdrModel& in constructors of SdrModel,
    SdrPage, SdrView and SdrObjList. Builds, not finished.
    
    SOSAW080: removed and replaced old SdrModel
    
    Removed and replaced GetModel()/SetModel() in all using
    classes (SdrObject, SdrPage, SdrView), added accessors
    to new referenced SdrModel, adapted all accessing places.
    Refactored/Extended ::Clone and ::operator== for these
    classes to allow cloning objects to a target SdrModel.
    Adapted places where this is done AFAP. Added quite some
    comments (tagged with 'TTTT') where possible further work
    is needed. Builds completely, thus checking in. This does
    not mean that this change is done yet.
    
    SOSAW080: Adapted SdrPage/SdrModel relationship
    
    Also needed to work on copy-construction of SdrPage and hierarchy,
    quite some stuff removed, no copy-constructor anymore, no
    MigrateItemPool stuff. Builds well, test stuck, will need
    some cleanup/finetunung
    
    SOSAW080: Smaller corrections/includes adapted
    
    SOSAW080: Smaller corrections/includes adapted
    
    SOSAW080: Debugging/Stabilizing/MakeUnitTestWork
    
    SOSAW080: Stabilized for UnitTests, cleanups
    
    SOSAW080: Adapted GetObjGraphic to just take a const SdrObject&
    
    SOSAW080: Removed ChangeModel from classes
    
    Classes SvxTextEditSource and SvxDrawPage (including
    TextEditSource stuff) do not need change of SdrModel
    anymore.
    
    SOSAW080: Adapted some comments to make more readable
    
    SOSAW080: Corrected constructor
    
    SOSAW080: getSdrModelFromUnoModel added override marks
    
    SOSAW080: Added missing includes
    
    SOSAW080: Corrected SdrPage constructor
    
    SOSAW080: Corrected some SdrObject::Clone scenarios
    
    Especially when cloning to another SdrModel and taking
    the sdr::properties into account.
    
    SOSAW080: Added include for Mac-Build
    
    SOSAW080: Added Scale to DefaultProperties
    
    If a SdrModel change happens in DefaultProperties copy
    constructor (used from Clone()), potentially a Scale
    for the SfxItems has to be done.
    
    SOSAW080: Added missing include for MacBuild
    
    SOSAW080: Corrected CppunitTest_sc_anchor_test
    
    An adaption of a SdrPathObj instantiation was missing,
    added that. Seems as if that test is no tpart of the
    usual 'make' scenario, but used/executed in gerrit builds
    
    SOSAW080: Reworked SvxShape to use SdrObject's SdrModel
    
    SOSAW080: Reworked SvxShape to use SdrObject's SdrModel
    
    SOSAW080: Free SdrObjects when SdrModel goes down
    
    In an UNO API test problem is that SvxShapes reference
    SdrShapes, but these are not added to a SdrPage and not
    'owned' by the SvxShape. Thus these do not get deleted
    at all (same in master, memory leak). I extended
    SvxShape::Notify the case for ModelCleared to also
    Free the SdrObject when not owner and it's not added to
    a SdrPage (in that case it gets deleted with deleting
    the SdrModel)
    
    SOSAW080: Solve UNO API calls that move SvxShapes to other Model
    
    Due to UNO API tests I got a call to insert an xShape to a
    xDrawPage which was constructed in another Model, this has now to
    be done by Cloning the SdrObject to the new SdrModel, getting
    rid of the old one and getting all the UNO implementation
    stuff right (referemces SdrObject <-> xShape).
    
    1cb7d573d323e98a89761fe662c10c4a654fdec0
    24617494a0ef79f6e33dfcb02782a833a81c6434
    763f39094b6a48b529a6952d01468f8776c97679
    242b9e228a9a042c3a5bdd38b1ea6600144276d5
    242b9e228a9a042c3a5bdd38b1ea6600144276d5
    33a6f3f306b70c223171aef796dd5ee041ad14df
    6878b33f8b05738a44c0910e40a60a0f0d1d58ed
    0a636caf3cb36c2f9c6cd11aa22cb9bc435dc8f2
    8c4626274a5cc531dad27f27c0c45d4c528fb2fb
    446685a49a6d67aedd01cfbbd5e87b07f97a4d7b
    c1b5ed3c99bc7219a0061e4ece24ea42afd2889a
    22de9a1c8af7c25be5c108671ddc548ba323ed47
    4caf6b6fbbe6e8130741d793dffb560fd01d4ed5
    488b9601735ec1822433f82f633990063951fe08
    c366d60299f239e3df856ddffedb19e743e4be0c
    c5137ba8c597c7b5f90318df50e87b93a39a28dc
    f9e646242cf89f6fde1315046952252a2c429779
    f830fbc5fadd89d04be5edd2a5abf9b0d4bf0410
    1694b54903df784385abaa8452e1201e12344238
    17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
    17bcb44d2e29920c0c74430c2d9c703b36cfa0ad
    7b5c241faec7488924e5935ae8b19f785846b5e4
    bf097ee7467895823fbd158a2a9543da3b5a5078
    
    Change-Id: Iaf53535de0502a481466be74a1768bbb39f0e78c
    Reviewed-on: https://gerrit.libreoffice.org/52526
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>

diff --git a/basctl/source/dlged/dlged.cxx b/basctl/source/dlged/dlged.cxx
index ec3a2e0c3045..186e83521b05 100644
--- a/basctl/source/dlged/dlged.cxx
+++ b/basctl/source/dlged/dlged.cxx
@@ -347,7 +347,7 @@ void DlgEditor::SetDialog( const uno::Reference< container::XNameContainer >& xU
     m_xUnoControlDialogModel = xUnoControlDialogModel;
 
     // create dialog form
-    pDlgEdForm = new DlgEdForm(*this);
+    pDlgEdForm = new DlgEdForm(*pDlgEdModel, *this);
     uno::Reference< awt::XControlModel > xDlgMod( m_xUnoControlDialogModel , uno::UNO_QUERY );
     pDlgEdForm->SetUnoControlModel(xDlgMod);
     static_cast<DlgEdPage*>(pDlgEdModel->GetPage(0))->SetDlgEdForm( pDlgEdForm );
@@ -391,7 +391,7 @@ void DlgEditor::SetDialog( const uno::Reference< container::XNameContainer >& xU
             Any aCtrl = xNameAcc->getByName( indexToName.second );
             Reference< css::awt::XControlModel > xCtrlModel;
             aCtrl >>= xCtrlModel;
-            DlgEdObj* pCtrlObj = new DlgEdObj();
+            DlgEdObj* pCtrlObj = new DlgEdObj(*pDlgEdModel);
             pCtrlObj->SetUnoControlModel( xCtrlModel );
             pCtrlObj->SetDlgEdForm( pDlgEdForm );
             pDlgEdForm->AddChild( pCtrlObj );
@@ -609,7 +609,11 @@ void DlgEditor::SetInsertObj( sal_uInt16 eObj )
 void DlgEditor::CreateDefaultObject()
 {
     // create object by factory
-    SdrObject* pObj = SdrObjFactory::MakeNewObject( pDlgEdView->GetCurrentObjInventor(), pDlgEdView->GetCurrentObjIdentifier(), pDlgEdPage );
+    SdrObject* pObj = SdrObjFactory::MakeNewObject(
+        *pDlgEdModel,
+        pDlgEdView->GetCurrentObjInventor(),
+        pDlgEdView->GetCurrentObjIdentifier(),
+        pDlgEdPage);
 
     if (DlgEdObj* pDlgEdObj = dynamic_cast<DlgEdObj*>(pObj))
     {
@@ -920,7 +924,7 @@ void DlgEditor::Paste()
                         Reference< util::XCloneable > xClone( xCM, uno::UNO_QUERY );
                         Reference< awt::XControlModel > xCtrlModel( xClone->createClone(), uno::UNO_QUERY );
 
-                        DlgEdObj* pCtrlObj = new DlgEdObj();
+                        DlgEdObj* pCtrlObj = new DlgEdObj(*pDlgEdModel);
                         pCtrlObj->SetDlgEdForm(pDlgEdForm);         // set parent form
                         pDlgEdForm->AddChild(pCtrlObj);             // add child to parent form
                         pCtrlObj->SetUnoControlModel( xCtrlModel ); // set control model
diff --git a/basctl/source/dlged/dlgedfac.cxx b/basctl/source/dlged/dlgedfac.cxx
index a3e7b62ae14e..be8e592fbd1f 100644
--- a/basctl/source/dlged/dlgedfac.cxx
+++ b/basctl/source/dlged/dlgedfac.cxx
@@ -69,27 +69,27 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
         switch( aParams.nObjIdentifier )
         {
             case OBJ_DLG_PUSHBUTTON:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlButtonModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlButtonModel", xDialogSFact );
                  break;
             case OBJ_DLG_RADIOBUTTON:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlRadioButtonModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlRadioButtonModel", xDialogSFact );
                  break;
             case OBJ_DLG_FORMRADIO:
-                 pNewObj = new DlgEdObj( "com.sun.star.form.component.RadioButton", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.RadioButton", xDialogSFact );
                  static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel );
                  break;
             case OBJ_DLG_CHECKBOX:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlCheckBoxModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlCheckBoxModel", xDialogSFact );
                  break;
             case OBJ_DLG_FORMCHECK:
-                 pNewObj = new DlgEdObj( "com.sun.star.form.component.CheckBox", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.CheckBox", xDialogSFact );
                  static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel );
                  break;
             case OBJ_DLG_LISTBOX:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlListBoxModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlListBoxModel", xDialogSFact );
                  break;
             case OBJ_DLG_FORMLIST:
-                 pNewObj = new DlgEdObj( "com.sun.star.form.component.ListBox", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.ListBox", xDialogSFact );
                  static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel );
                  break;
             case OBJ_DLG_FORMCOMBO:
@@ -97,10 +97,10 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
             {
                  DlgEdObj* pNew = nullptr;
                  if ( aParams.nObjIdentifier == OBJ_DLG_COMBOBOX )
-                     pNew = new DlgEdObj( "com.sun.star.awt.UnoControlComboBoxModel", xDialogSFact );
+                     pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlComboBoxModel", xDialogSFact );
                  else
                  {
-                     pNew = new DlgEdObj( "com.sun.star.form.component.ComboBox", xDialogSFact );
+                     pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.ComboBox", xDialogSFact );
                      pNew->MakeDataAware( mxModel );
                  }
                  pNewObj = pNew;
@@ -118,25 +118,25 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
             }
             break;
             case OBJ_DLG_GROUPBOX:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlGroupBoxModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlGroupBoxModel", xDialogSFact );
                  break;
             case OBJ_DLG_EDIT:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlEditModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlEditModel", xDialogSFact );
                  break;
             case OBJ_DLG_FIXEDTEXT:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlFixedTextModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedTextModel", xDialogSFact );
                  break;
             case OBJ_DLG_IMAGECONTROL:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlImageControlModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlImageControlModel", xDialogSFact );
                  break;
             case OBJ_DLG_PROGRESSBAR:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlProgressBarModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlProgressBarModel", xDialogSFact );
                  break;
             case OBJ_DLG_HSCROLLBAR:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact );
                  break;
             case OBJ_DLG_FORMHSCROLL:
-                 pNewObj = new DlgEdObj( "com.sun.star.form.component.ScrollBar", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.ScrollBar", xDialogSFact );
                  static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel );
                  break;
             case OBJ_DLG_FORMVSCROLL:
@@ -144,10 +144,10 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
             {
                  DlgEdObj* pNew = nullptr;
                  if ( aParams.nObjIdentifier ==  OBJ_DLG_VSCROLLBAR )
-                     pNew = new DlgEdObj( "com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact );
+                     pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlScrollBarModel", xDialogSFact );
                  else
                  {
-                     pNew = new DlgEdObj( "com.sun.star.form.component.ScrollBar", xDialogSFact );
+                     pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.ScrollBar", xDialogSFact );
                      pNew->MakeDataAware( mxModel );
                  }
                  pNewObj = pNew;
@@ -165,11 +165,11 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
                  }
             }    break;
             case OBJ_DLG_HFIXEDLINE:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact );
                  break;
             case OBJ_DLG_VFIXEDLINE:
             {
-                 DlgEdObj* pNew = new DlgEdObj( "com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact );
+                 DlgEdObj* pNew = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFixedLineModel", xDialogSFact );
                  pNewObj = pNew;
                  // set vertical orientation
                  try
@@ -185,35 +185,35 @@ IMPL_LINK( DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
                  }
             }    break;
             case OBJ_DLG_DATEFIELD:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlDateFieldModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlDateFieldModel", xDialogSFact );
                  break;
             case OBJ_DLG_TIMEFIELD:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlTimeFieldModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlTimeFieldModel", xDialogSFact );
                  break;
             case OBJ_DLG_NUMERICFIELD:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlNumericFieldModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlNumericFieldModel", xDialogSFact );
                  break;
             case OBJ_DLG_CURRENCYFIELD:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlCurrencyFieldModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlCurrencyFieldModel", xDialogSFact );
                  break;
             case OBJ_DLG_FORMATTEDFIELD:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlFormattedFieldModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFormattedFieldModel", xDialogSFact );
                  break;
             case OBJ_DLG_PATTERNFIELD:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlPatternFieldModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlPatternFieldModel", xDialogSFact );
                  break;
             case OBJ_DLG_FILECONTROL:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlFileControlModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlFileControlModel", xDialogSFact );
                  break;
             case OBJ_DLG_SPINBUTTON:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.UnoControlSpinButtonModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.UnoControlSpinButtonModel", xDialogSFact );
                  break;
             case OBJ_DLG_FORMSPIN:
-                 pNewObj = new DlgEdObj( "com.sun.star.form.component.SpinButton", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.form.component.SpinButton", xDialogSFact );
                  static_cast< DlgEdObj* >( pNewObj )->MakeDataAware( mxModel );
                  break;
             case OBJ_DLG_TREECONTROL:
-                 pNewObj = new DlgEdObj( "com.sun.star.awt.tree.TreeControlModel", xDialogSFact );
+                 pNewObj = new DlgEdObj(aParams.rSdrModel, "com.sun.star.awt.tree.TreeControlModel", xDialogSFact );
                  break;
         }
     }
diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx
index 41158fed7273..44d7b7a10d55 100644
--- a/basctl/source/dlged/dlgedobj.cxx
+++ b/basctl/source/dlged/dlgedobj.cxx
@@ -63,18 +63,20 @@ DlgEditor& DlgEdObj::GetDialogEditor ()
         return pDlgEdForm->GetDlgEditor();
 }
 
-DlgEdObj::DlgEdObj()
-          :SdrUnoObj(OUString())
-          ,bIsListening(false)
-          ,pDlgEdForm( nullptr )
+DlgEdObj::DlgEdObj(SdrModel& rSdrModel)
+:   SdrUnoObj(rSdrModel, OUString())
+    ,bIsListening(false)
+    ,pDlgEdForm( nullptr )
 {
 }
 
-DlgEdObj::DlgEdObj(const OUString& rModelName,
-                   const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac)
-          :SdrUnoObj(rModelName, rxSFac)
-          ,bIsListening(false)
-          ,pDlgEdForm( nullptr )
+DlgEdObj::DlgEdObj(
+    SdrModel& rSdrModel,
+    const OUString& rModelName,
+    const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac)
+:   SdrUnoObj(rSdrModel, rModelName, rxSFac)
+    ,bIsListening(false)
+    ,pDlgEdForm( nullptr )
 {
 }
 
@@ -500,7 +502,7 @@ void DlgEdObj::UpdateStep()
     sal_Int32 nCurStep = GetDlgEdForm()->GetStep();
     sal_Int32 nStep = GetStep();
 
-    SdrLayerAdmin& rLayerAdmin = GetModel()->GetLayerAdmin();
+    SdrLayerAdmin& rLayerAdmin(getSdrModelFromSdrObject().GetLayerAdmin());
     SdrLayerID nHiddenLayerId   = rLayerAdmin.GetLayerID( "HiddenLayer" );
     SdrLayerID nControlLayerId   = rLayerAdmin.GetLayerID( rLayerAdmin.GetControlLayerName() );
 
@@ -604,7 +606,7 @@ void DlgEdObj::TabIndexChange( const beans::PropertyChangeEvent& evt )
             }
 
             // reorder objects in drawing page
-            GetModel()->GetPage(0)->SetObjectOrdNum( nOldTabIndex + 1, nNewTabIndex + 1 );
+            getSdrModelFromSdrObject().GetPage(0)->SetObjectOrdNum( nOldTabIndex + 1, nNewTabIndex + 1 );
 
             pForm->UpdateTabOrderAndGroups();
         }
@@ -884,9 +886,9 @@ void DlgEdObj::clonedFrom(const DlgEdObj* _pSource)
     StartListening();
 }
 
-DlgEdObj* DlgEdObj::Clone() const
+DlgEdObj* DlgEdObj::Clone(SdrModel* pTargetModel) const
 {
-    DlgEdObj* pDlgEdObj = CloneHelper< DlgEdObj >();
+    DlgEdObj* pDlgEdObj = CloneHelper< DlgEdObj >(pTargetModel);
     DBG_ASSERT( pDlgEdObj != nullptr, "DlgEdObj::Clone: invalid clone!" );
     if ( pDlgEdObj )
         pDlgEdObj->clonedFrom( this );
@@ -898,7 +900,9 @@ SdrObject* DlgEdObj::getFullDragClone() const
 {
     // no need to really add the clone for dragging, it's a temporary
     // object
-    SdrObject* pObj = new SdrUnoObj(OUString());
+    SdrObject* pObj = new SdrUnoObj(
+        getSdrModelFromSdrObject(),
+        OUString());
     *pObj = *static_cast<const SdrUnoObj*>(this);
 
     return pObj;
@@ -1193,8 +1197,10 @@ void DlgEdObj::SetLayer(SdrLayerID nLayer)
     }
 }
 
-
-DlgEdForm::DlgEdForm (DlgEditor& rDlgEditor_) :
+DlgEdForm::DlgEdForm(
+    SdrModel& rSdrModel,
+    DlgEditor& rDlgEditor_)
+:   DlgEdObj(rSdrModel),
     rDlgEditor(rDlgEditor_)
 {
 }
diff --git a/basctl/source/dlged/dlgedpage.cxx b/basctl/source/dlged/dlgedpage.cxx
index 211aa863a12f..da9ba12ef1b0 100644
--- a/basctl/source/dlged/dlgedpage.cxx
+++ b/basctl/source/dlged/dlgedpage.cxx
@@ -27,14 +27,8 @@ namespace basctl
 
 
 DlgEdPage::DlgEdPage(DlgEdModel& rModel, bool bMasterPage)
-    : SdrPage(rModel, bMasterPage)
-    , pDlgEdForm(nullptr)
-{
-}
-
-DlgEdPage::DlgEdPage(const DlgEdPage& rSrcPage)
-    : SdrPage(rSrcPage)
-    , pDlgEdForm(nullptr)
+:   SdrPage(rModel, bMasterPage)
+    ,pDlgEdForm(nullptr)
 {
 }
 
@@ -43,23 +37,15 @@ DlgEdPage::~DlgEdPage()
     Clear();
 }
 
-
-SdrPage* DlgEdPage::Clone() const
-{
-    return Clone(nullptr);
-}
-
 SdrPage* DlgEdPage::Clone(SdrModel* const pNewModel) const
 {
-    DlgEdPage* const pNewPage = new DlgEdPage( *this );
-    DlgEdModel* pDlgEdModel = nullptr;
-    if ( pNewModel )
-    {
-        pDlgEdModel = dynamic_cast<DlgEdModel*>( pNewModel );
-        assert(pDlgEdModel);
-    }
-    pNewPage->lateInit( *this, pDlgEdModel );
-    return pNewPage;
+    DlgEdModel& rDlgEdModel(static_cast< DlgEdModel& >(nullptr == pNewModel ? getSdrModelFromSdrPage() : *pNewModel));
+    DlgEdPage* pClonedDlgEdPage(
+        new DlgEdPage(
+            rDlgEdModel,
+            IsMasterPage()));
+    pClonedDlgEdPage->SdrPage::lateInit(*this);
+    return pClonedDlgEdPage;
 }
 
 
diff --git a/basctl/source/dlged/dlgedview.cxx b/basctl/source/dlged/dlgedview.cxx
index aa7f1e4bfbff..12d2d57bb99a 100644
--- a/basctl/source/dlged/dlgedview.cxx
+++ b/basctl/source/dlged/dlgedview.cxx
@@ -31,9 +31,11 @@
 namespace basctl
 {
 
-
-DlgEdView::DlgEdView (SdrModel& rModel, OutputDevice& rOut, DlgEditor& rEditor) :
-    SdrView(&rModel, &rOut),
+DlgEdView::DlgEdView(
+    SdrModel& rSdrModel,
+    OutputDevice& rOut,
+    DlgEditor& rEditor)
+:   SdrView(rSdrModel, &rOut),
     rDlgEditor(rEditor)
 {
     SetBufferedOutputAllowed(true);
diff --git a/basctl/source/inc/dlgedobj.hxx b/basctl/source/inc/dlgedobj.hxx
index 58f60447c9eb..4660c29d2682 100644
--- a/basctl/source/inc/dlgedobj.hxx
+++ b/basctl/source/inc/dlgedobj.hxx
@@ -57,9 +57,11 @@ private:
     DlgEditor& GetDialogEditor ();
 
 protected:
-    DlgEdObj();
-    DlgEdObj(const OUString& rModelName,
-             const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac);
+    DlgEdObj(SdrModel& rSdrModel);
+    DlgEdObj(
+        SdrModel& rSdrModel,
+        const OUString& rModelName,
+        const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac);
 
     virtual void NbcMove( const Size& rSize ) override;
     virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
@@ -94,7 +96,7 @@ public:
     virtual SdrInventor GetObjInventor() const override;
     virtual sal_uInt16 GetObjIdentifier() const override;
 
-    virtual DlgEdObj*   Clone() const override;                                          // not working yet
+    virtual DlgEdObj* Clone(SdrModel* pTargetModel = nullptr) const override;                                          // not working yet
     void clonedFrom(const DlgEdObj* _pSource);                          // not working yet
 
     // FullDrag support
@@ -152,7 +154,9 @@ private:
     mutable ::boost::optional< css::awt::DeviceInfo >   mpDeviceInfo;
 
 private:
-    explicit DlgEdForm (DlgEditor&);
+    explicit DlgEdForm(
+        SdrModel& rSdrModel,
+        DlgEditor&);
 
 protected:
     virtual void NbcMove( const Size& rSize ) override;
diff --git a/basctl/source/inc/dlgedpage.hxx b/basctl/source/inc/dlgedpage.hxx
index 814826e02f77..164f725f85ee 100644
--- a/basctl/source/inc/dlgedpage.hxx
+++ b/basctl/source/inc/dlgedpage.hxx
@@ -35,6 +35,7 @@ class DlgEdForm;
 class DlgEdPage final : public SdrPage
 {
     DlgEdPage& operator=(const DlgEdPage&) = delete;
+    DlgEdPage(const DlgEdPage&) = delete;
 
     DlgEdForm*      pDlgEdForm;
 
@@ -43,16 +44,12 @@ public:
     explicit DlgEdPage( DlgEdModel& rModel, bool bMasterPage = false );
     virtual ~DlgEdPage() override;
 
-    virtual SdrPage* Clone() const override;
-    virtual SdrPage* Clone( SdrModel* pNewModel ) const override;
+    virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override;
 
     void            SetDlgEdForm( DlgEdForm* pForm ) { pDlgEdForm = pForm; }
     DlgEdForm*      GetDlgEdForm() const { return pDlgEdForm; }
 
     virtual SdrObject* SetObjectOrdNum(size_t nOldObjNum, size_t nNewObjNum) override;
-
-private:
-    DlgEdPage(const DlgEdPage& rSrcPage);
 };
 
 } // namespace basctl
diff --git a/basctl/source/inc/dlgedview.hxx b/basctl/source/inc/dlgedview.hxx
index 511abfc841e3..c194c1216d11 100644
--- a/basctl/source/inc/dlgedview.hxx
+++ b/basctl/source/inc/dlgedview.hxx
@@ -39,7 +39,11 @@ private:
 
 public:
 
-    DlgEdView (SdrModel& rModel, OutputDevice& rOut, DlgEditor& rEditor);
+    DlgEdView(
+        SdrModel& rSdrModel,
+        OutputDevice& rOut,
+        DlgEditor& rEditor);
+
     virtual ~DlgEdView() override;
 
     virtual void MarkListHasChanged() override;
diff --git a/basegfx/Library_basegfx.mk b/basegfx/Library_basegfx.mk
index 087e4a081419..de744b5a15ce 100644
--- a/basegfx/Library_basegfx.mk
+++ b/basegfx/Library_basegfx.mk
@@ -38,6 +38,7 @@ $(eval $(call gb_Library_add_exception_objects,basegfx,\
     basegfx/source/matrix/b2dhommatrix \
     basegfx/source/matrix/b2dhommatrixtools \
     basegfx/source/matrix/b3dhommatrix \
+    basegfx/source/matrix/b3dhommatrixtools \
 	basegfx/source/numeric/ftools \
     basegfx/source/pixel/bpixel \
     basegfx/source/point/b2dpoint \
diff --git a/basegfx/source/matrix/b2dhommatrix.cxx b/basegfx/source/matrix/b2dhommatrix.cxx
index 9f7d5bff0156..466e9037d149 100644
--- a/basegfx/source/matrix/b2dhommatrix.cxx
+++ b/basegfx/source/matrix/b2dhommatrix.cxx
@@ -115,6 +115,11 @@ namespace basegfx
 
     bool B2DHomMatrix::invert()
     {
+        if(isIdentity())
+        {
+            return true;
+        }
+
         Impl2DHomMatrix aWork(*mpImpl);
         std::unique_ptr<sal_uInt16[]> pIndex( new sal_uInt16[Impl2DHomMatrix_Base::getEdgeLength()] );
         sal_Int16 nParity;
@@ -213,6 +218,11 @@ namespace basegfx
         }
     }
 
+    void B2DHomMatrix::translate(const B2DTuple& rTuple)
+    {
+        translate(rTuple.getX(), rTuple.getY());
+    }
+
     void B2DHomMatrix::scale(double fX, double fY)
     {
         const double fOne(1.0);
@@ -228,6 +238,11 @@ namespace basegfx
         }
     }
 
+    void B2DHomMatrix::scale(const B2DTuple& rTuple)
+    {
+        scale(rTuple.getX(), rTuple.getY());
+    }
+
     void B2DHomMatrix::shearX(double fSx)
     {
         // #i76239# do not test against 1.0, but against 0.0. We are talking about a value not on the diagonal (!)
diff --git a/basegfx/source/matrix/b3dhommatrix.cxx b/basegfx/source/matrix/b3dhommatrix.cxx
index 6cfd054992ec..b55dd079b514 100644
--- a/basegfx/source/matrix/b3dhommatrix.cxx
+++ b/basegfx/source/matrix/b3dhommatrix.cxx
@@ -203,6 +203,11 @@ namespace basegfx
         }
     }
 
+    void B3DHomMatrix::rotate(const B3DTuple& rRotation)
+    {
+        rotate(rRotation.getX(), rRotation.getY(), rRotation.getZ());
+    }
+
     void B3DHomMatrix::translate(double fX, double fY, double fZ)
     {
         if(!fTools::equalZero(fX) || !fTools::equalZero(fY) || !fTools::equalZero(fZ))
@@ -217,6 +222,11 @@ namespace basegfx
         }
     }
 
+    void B3DHomMatrix::translate(const B3DTuple& rRotation)
+    {
+        translate(rRotation.getX(), rRotation.getY(), rRotation.getZ());
+    }
+
     void B3DHomMatrix::scale(double fX, double fY, double fZ)
     {
         const double fOne(1.0);
@@ -233,6 +243,11 @@ namespace basegfx
         }
     }
 
+    void B3DHomMatrix::scale(const B3DTuple& rRotation)
+    {
+        scale(rRotation.getX(), rRotation.getY(), rRotation.getZ());
+    }
+
     void B3DHomMatrix::shearXY(double fSx, double fSy)
     {
         // #i76239# do not test against 1.0, but against 0.0. We are talking about a value not on the diagonal (!)
diff --git a/basegfx/source/matrix/b3dhommatrixtools.cxx b/basegfx/source/matrix/b3dhommatrixtools.cxx
new file mode 100755
index 000000000000..02dfe63d6741
--- /dev/null
+++ b/basegfx/source/matrix/b3dhommatrixtools.cxx
@@ -0,0 +1,73 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <basegfx/matrix/b3dhommatrixtools.hxx>
+
+namespace basegfx
+{
+namespace utils
+{
+B3DHomMatrix UnoHomogenMatrixToB3DHomMatrix(const com::sun::star::drawing::HomogenMatrix& rMatrixIn)
+{
+    B3DHomMatrix aRetval;
+
+    aRetval.set(0, 0, rMatrixIn.Line1.Column1);
+    aRetval.set(0, 1, rMatrixIn.Line1.Column2);
+    aRetval.set(0, 2, rMatrixIn.Line1.Column3);
+    aRetval.set(0, 3, rMatrixIn.Line1.Column4);
+    aRetval.set(1, 0, rMatrixIn.Line2.Column1);
+    aRetval.set(1, 1, rMatrixIn.Line2.Column2);
+    aRetval.set(1, 2, rMatrixIn.Line2.Column3);
+    aRetval.set(1, 3, rMatrixIn.Line2.Column4);
+    aRetval.set(2, 0, rMatrixIn.Line3.Column1);
+    aRetval.set(2, 1, rMatrixIn.Line3.Column2);
+    aRetval.set(2, 2, rMatrixIn.Line3.Column3);
+    aRetval.set(2, 3, rMatrixIn.Line3.Column4);
+    aRetval.set(3, 0, rMatrixIn.Line4.Column1);
+    aRetval.set(3, 1, rMatrixIn.Line4.Column2);
+    aRetval.set(3, 2, rMatrixIn.Line4.Column3);
+    aRetval.set(3, 3, rMatrixIn.Line4.Column4);
+
+    return aRetval;
+}
+
+void B3DHomMatrixToUnoHomogenMatrix(const B3DHomMatrix& rMatrixIn,
+                                    com::sun::star::drawing::HomogenMatrix& rMatrixOut)
+{
+    rMatrixOut.Line1.Column1 = rMatrixIn.get(0, 0);
+    rMatrixOut.Line1.Column2 = rMatrixIn.get(0, 1);
+    rMatrixOut.Line1.Column3 = rMatrixIn.get(0, 2);
+    rMatrixOut.Line1.Column4 = rMatrixIn.get(0, 3);
+    rMatrixOut.Line2.Column1 = rMatrixIn.get(1, 0);
+    rMatrixOut.Line2.Column2 = rMatrixIn.get(1, 1);
+    rMatrixOut.Line2.Column3 = rMatrixIn.get(1, 2);
+    rMatrixOut.Line2.Column4 = rMatrixIn.get(1, 3);
+    rMatrixOut.Line3.Column1 = rMatrixIn.get(2, 0);
+    rMatrixOut.Line3.Column2 = rMatrixIn.get(2, 1);
+    rMatrixOut.Line3.Column3 = rMatrixIn.get(2, 2);
+    rMatrixOut.Line3.Column4 = rMatrixIn.get(2, 3);
+    rMatrixOut.Line4.Column1 = rMatrixIn.get(3, 0);
+    rMatrixOut.Line4.Column2 = rMatrixIn.get(3, 1);
+    rMatrixOut.Line4.Column3 = rMatrixIn.get(3, 2);
+    rMatrixOut.Line4.Column4 = rMatrixIn.get(3, 3);
+}
+} // end of namespace tools
+} // end of namespace basegfx
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/source/numeric/ftools.cxx b/basegfx/source/numeric/ftools.cxx
index 994bd29e30eb..d1eca66ca2fc 100644
--- a/basegfx/source/numeric/ftools.cxx
+++ b/basegfx/source/numeric/ftools.cxx
@@ -45,6 +45,59 @@ namespace basegfx
         }
     }
 
+    double snapToZeroRange(double v, double fWidth)
+    {
+        if(fTools::equalZero(fWidth))
+        {
+            // with no range all snaps to range bound
+            return 0.0;
+        }
+        else
+        {
+            if(v < 0.0 || v > fWidth)
+            {
+                double fRetval(fmod(v, fWidth));
+
+                if(fRetval < 0.0)
+                {
+                    fRetval += fWidth;
+                }
+
+                return fRetval;
+            }
+            else
+            {
+                return v;
+            }
+        }
+    }
+
+    double snapToRange(double v, double fLow, double fHigh)
+    {
+        if(fTools::equal(fLow, fHigh))
+        {
+            // with no range all snaps to range bound
+            return 0.0;
+        }
+        else
+        {
+            if(fLow > fHigh)
+            {
+                // correct range order. Evtl. assert this (?)
+                std::swap(fLow, fHigh);
+            }
+
+            if(v < fLow || v > fHigh)
+            {
+                return snapToZeroRange(v - fLow, fHigh - fLow) + fLow;
+            }
+            else
+            {
+                return v;
+            }
+        }
+    }
+
     double normalizeToRange(double v, const double fRange)
     {
         if(fTools::lessOrEqual(fRange, 0.0))
diff --git a/basegfx/source/range/b2drange.cxx b/basegfx/source/range/b2drange.cxx
index 2f4a3e08e69e..331c5431bcf3 100644
--- a/basegfx/source/range/b2drange.cxx
+++ b/basegfx/source/range/b2drange.cxx
@@ -51,6 +51,19 @@ namespace basegfx
         }
     }
 
+    B2DRange& B2DRange::operator*=( const ::basegfx::B2DHomMatrix& rMat )
+    {
+        transform(rMat);
+        return *this;
+    }
+
+    const B2DRange& B2DRange::getUnitB2DRange()
+    {
+        static const B2DRange aUnitB2DRange(0.0, 0.0, 1.0, 1.0);
+
+        return aUnitB2DRange;
+    }
+
     B2IRange fround(const B2DRange& rRange)
     {
         return rRange.isEmpty() ?
@@ -58,6 +71,13 @@ namespace basegfx
             B2IRange(fround(rRange.getMinimum()),
                      fround(rRange.getMaximum()));
     }
+
+    B2DRange operator*( const ::basegfx::B2DHomMatrix& rMat, const B2DRange& rB2DRange )
+    {
+        B2DRange aRes( rB2DRange );
+        return aRes *= rMat;
+    }
+
 } // end of namespace basegfx
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basegfx/source/range/b3drange.cxx b/basegfx/source/range/b3drange.cxx
index f779f1855d79..879dbb0f9974 100644
--- a/basegfx/source/range/b3drange.cxx
+++ b/basegfx/source/range/b3drange.cxx
@@ -40,6 +40,25 @@ namespace basegfx
         }
     }
 
+    B3DRange& B3DRange::operator*=( const ::basegfx::B3DHomMatrix& rMat )
+    {
+        transform(rMat);
+        return *this;
+    }
+
+    const B3DRange& B3DRange::getUnitB3DRange()
+    {
+        static const B3DRange aUnitB3DRange(0.0, 0.0, 0.0, 1.0, 1.0, 1.0);
+
+        return aUnitB3DRange;
+    }
+
+    B3DRange operator*( const ::basegfx::B3DHomMatrix& rMat, const B3DRange& rB3DRange )
+    {
+        B3DRange aRes( rB3DRange );
+        return aRes *= rMat;
+    }
+
 } // end of namespace basegfx
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
index 5efd976dcef5..b86980f47782 100644
--- a/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
+++ b/chart2/source/controller/drawinglayer/DrawViewWrapper.cxx
@@ -96,11 +96,13 @@ OutputDevice * lcl_GetParentRefDevice( const uno::Reference< frame::XModel > & x
 
 }
 
-DrawViewWrapper::DrawViewWrapper( SdrModel* pSdrModel, OutputDevice* pOut)
-            : E3dView(pSdrModel, pOut)
-            , m_pMarkHandleProvider(nullptr)
-            , m_apOutliner(SdrMakeOutliner(OutlinerMode::TextObject, *pSdrModel))
-            , m_bRestoreMapMode( false )
+DrawViewWrapper::DrawViewWrapper(
+    SdrModel& rSdrModel,
+    OutputDevice* pOut)
+:   E3dView(rSdrModel, pOut)
+    ,m_pMarkHandleProvider(nullptr)
+    ,m_apOutliner(SdrMakeOutliner(OutlinerMode::TextObject, rSdrModel))
+    ,m_bRestoreMapMode( false )
 {
     SetBufferedOutputAllowed(true);
     SetBufferedOverlayAllowed(true);
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index 954426f925a5..500488aaa39c 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -161,7 +161,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co
     SdrPage* pPage = new SdrPage( *pModel, false );
     pPage->SetSize(Size(1000,1000));
     pModel->InsertPage( pPage, 0 );
-    std::unique_ptr<SdrView> pView( new SdrView( pModel.get(), pVDev ) );
+    std::unique_ptr<SdrView> pView( new SdrView( *pModel.get(), pVDev ) );
     pView->hideMarkHandles();
     SdrPageView* pPageView = pView->ShowSdrPage(pPage);
 
diff --git a/chart2/source/controller/inc/DrawViewWrapper.hxx b/chart2/source/controller/inc/DrawViewWrapper.hxx
index 91ffdf7eeb1b..2adf512fe015 100644
--- a/chart2/source/controller/inc/DrawViewWrapper.hxx
+++ b/chart2/source/controller/inc/DrawViewWrapper.hxx
@@ -46,7 +46,10 @@ protected:
 class DrawViewWrapper : public E3dView
 {
 public:
-    DrawViewWrapper(SdrModel* pModel, OutputDevice* pOut);
+    DrawViewWrapper(
+        SdrModel& rSdrModel,
+        OutputDevice* pOut);
+
     virtual ~DrawViewWrapper() override;
 
     //triggers the use of an updated first page
diff --git a/chart2/source/controller/main/ChartController.cxx b/chart2/source/controller/main/ChartController.cxx
index 139f17279b40..02c444d8f041 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -727,7 +727,7 @@ void ChartController::impl_createDrawViewController()
     {
         if( m_pDrawModelWrapper )
         {
-            m_pDrawViewWrapper = new DrawViewWrapper(&m_pDrawModelWrapper->getSdrModel(),GetChartWindow());
+            m_pDrawViewWrapper = new DrawViewWrapper(m_pDrawModelWrapper->getSdrModel(),GetChartWindow());
             m_pDrawViewWrapper->attachParentReferenceDevice( getModel() );
         }
     }
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx
index d06524480847..00abbf63ad5e 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -395,11 +395,12 @@ void ChartController::impl_PasteShapes( SdrModel* pModel )
                 SdrObjListIter aIter( *pPage, SdrIterMode::DeepNoGroups );
                 while ( aIter.IsMore() )
                 {
-                    SdrObject* pObj = aIter.Next();
-                    SdrObject* pNewObj = ( pObj ? pObj->Clone() : nullptr );
+                    SdrObject* pObj(aIter.Next());
+                    // Clone to new SdrModel
+                    SdrObject* pNewObj(pObj ? pObj->Clone(&pDrawModelWrapper->getSdrModel()) : nullptr);
+
                     if ( pNewObj )
                     {
-                        pNewObj->SetModel( &pDrawModelWrapper->getSdrModel() );
                         pNewObj->SetPage( pDestPage );
 
                         // set position
@@ -516,7 +517,9 @@ void ChartController::executeDispatch_Copy()
                     if ( pSelectedObj )
                     {
                         xTransferable.set( new ChartTransferable(
-                                &m_pDrawModelWrapper->getSdrModel(), pSelectedObj, aSelOID.isAdditionalShape() ) );
+                                m_pDrawModelWrapper->getSdrModel(),
+                                pSelectedObj,
+                                aSelOID.isAdditionalShape() ) );
                     }
                 }
             }
diff --git a/chart2/source/controller/main/ChartTransferable.cxx b/chart2/source/controller/main/ChartTransferable.cxx
index 2eeb46a764f2..4888c4802b9f 100644
--- a/chart2/source/controller/main/ChartTransferable.cxx
+++ b/chart2/source/controller/main/ChartTransferable.cxx
@@ -46,12 +46,15 @@ using ::com::sun::star::uno::Reference;
 namespace chart
 {
 
-ChartTransferable::ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelectedObj, bool bDrawing )
-    :m_pMarkedObjModel( nullptr )
+ChartTransferable::ChartTransferable(
+    SdrModel& rSdrModel,
+    SdrObject* pSelectedObj,
+    bool bDrawing)
+:   m_pMarkedObjModel( nullptr )
     ,m_bDrawing( bDrawing )
 {
-    std::unique_ptr<SdrExchangeView> pExchgView(o3tl::make_unique<SdrView>( pDrawModel ));
-    SdrPageView* pPv = pExchgView->ShowSdrPage( pDrawModel->GetPage( 0 ));
+    std::unique_ptr<SdrExchangeView> pExchgView(o3tl::make_unique<SdrView>( rSdrModel ));
+    SdrPageView* pPv = pExchgView->ShowSdrPage( rSdrModel.GetPage( 0 ));
     if( pSelectedObj )
         pExchgView->MarkObj( pSelectedObj, pPv );
     else
diff --git a/chart2/source/controller/main/ChartTransferable.hxx b/chart2/source/controller/main/ChartTransferable.hxx
index 35e4f5d514c1..6fc8b4c26f8c 100644
--- a/chart2/source/controller/main/ChartTransferable.hxx
+++ b/chart2/source/controller/main/ChartTransferable.hxx
@@ -36,16 +36,19 @@ namespace chart
 class ChartTransferable : public TransferableHelper
 {
 public:
-    explicit ChartTransferable( SdrModel* pDrawModel, SdrObject* pSelectedObj, bool bDrawing );
+    explicit ChartTransferable(
+        SdrModel& rSdrModel,
+        SdrObject* pSelectedObj,
+        bool bDrawing );
     virtual ~ChartTransferable() override;
 
 protected:
 
     // implementation of TransferableHelper methods
-    virtual void        AddSupportedFormats() override;
+    virtual void AddSupportedFormats() override;
     virtual bool GetData( const css::datatransfer::DataFlavor& rFlavor, const OUString& rDestDoc ) override;
-    virtual bool        WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
-                                        const css::datatransfer::DataFlavor& rFlavor ) override;
+    virtual bool WriteObject( tools::SvRef<SotStorageStream>& rxOStm, void* pUserObject, sal_uInt32 nUserObjectId,
+        const css::datatransfer::DataFlavor& rFlavor ) override;
 
 private:
     css::uno::Reference< css::graphic::XGraphic > m_xMetaFileGraphic;
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 7e318646ebf5..6c59620ce6c1 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -74,7 +74,7 @@ bool DrawCommandDispatch::isFeatureSupported( const OUString& rCommandURL )
     return parseCommandURL( rCommandURL, &nFeatureId, &aBaseCommand, &aCustomShapeType );
 }
 
-::basegfx::B2DPolyPolygon getPolygon(const char* pResId, SdrModel const & rModel)
+::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel)
 {
     ::basegfx::B2DPolyPolygon aReturn;
     XLineEndListRef pLineEndList = rModel.GetLineEndList();
@@ -123,7 +123,7 @@ void DrawCommandDispatch::setAttributes( SdrObject* pObj )
                                 {
                                     const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
                                     SfxItemSet aDest(
-                                        pObj->GetModel()->GetItemPool(),
+                                        pObj->getSdrModelFromSdrObject().GetItemPool(),
                                         svl::Items<
                                             // Ranges from SdrAttrObj:
                                             SDRATTR_START, SDRATTR_SHADOW_LAST,
@@ -425,8 +425,13 @@ SdrObject* DrawCommandDispatch::createDefaultObject( const sal_uInt16 nID )
         if ( pPage )
         {
             SolarMutexGuard aGuard;
-            pObj = SdrObjFactory::MakeNewObject( pDrawViewWrapper->GetCurrentObjInventor(),
-                pDrawViewWrapper->GetCurrentObjIdentifier(), pPage );
+
+            pObj = SdrObjFactory::MakeNewObject(
+                pDrawModelWrapper->getSdrModel(),
+                pDrawViewWrapper->GetCurrentObjInventor(),
+                pDrawViewWrapper->GetCurrentObjIdentifier(),
+                pPage);
+
             if ( pObj )
             {
                 Size aObjectSize( 4000, 2500 );
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index 4c5bac5abfc0..897bbe390ea4 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -436,7 +436,7 @@ void VDiagram::adjustAspectRatio3d( const awt::Size& rAvailableSize )
             // To get the 3D aspect ratio's effect on the 2D scene size, the scene's 2D size needs to be adapted to
             // 3D content changes here. The tooling class remembers the current 3D transformation stack
             // and in its destructor, calculates a new 2D SnapRect for the scene and it's modified 3D geometry.
-            E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape ));
+            E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene(m_xOuterGroupShape));
 
             m_xAspectRatio3D->setPropertyValue( UNO_NAME_3D_TRANSFORM_MATRIX
                 , uno::Any(BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aResult )) );
@@ -599,7 +599,8 @@ void VDiagram::createShapes_3d()
                 aEffectiveTranformation.shearXY(m_fYAnglePi,-m_fXAnglePi);
 
             //#i98497# 3D charts are rendered with wrong size
-            E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape ));
+            E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene(m_xOuterGroupShape));
+
             xDestProp->setPropertyValue( UNO_NAME_3D_TRANSFORM_MATRIX,
                     uno::Any( BaseGFXHelper::B3DHomMatrixToHomogenMatrix( aEffectiveTranformation ) ) );
         }
@@ -656,7 +657,8 @@ void VDiagram::createShapes_3d()
                 ::basegfx::B3DHomMatrix aM;
                 aM.translate(GRID_TO_WALL_DISTANCE/fXScale, GRID_TO_WALL_DISTANCE/fYScale, GRID_TO_WALL_DISTANCE/fZScale);
                 aM.scale( fXScale, fYScale, fZScale );
-                E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene( m_xOuterGroupShape ));
+                E3DModifySceneSnapRectUpdater aUpdater(lcl_getE3dScene(m_xOuterGroupShape));
+
                 xShapeProp->setPropertyValue( UNO_NAME_3D_TRANSFORM_MATRIX
                     , uno::Any(BaseGFXHelper::B3DHomMatrixToHomogenMatrix(aM)) );
             }
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 7789ddd64c13..a7de7c1f2ed2 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -26,14 +26,14 @@
 #include <border.hxx>
 #include <svx/dialogs.hrc>
 
-SvxFormatCellsDialog::SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel const * pModel )
+SvxFormatCellsDialog::SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel )
     : SfxTabDialog(pParent, "FormatCellsDialog", "cui/ui/formatcellsdialog.ui", pAttr)
     , mrOutAttrs(*pAttr)
-    , mpColorTab(pModel->GetColorList())
-    , mpGradientList(pModel->GetGradientList())
-    , mpHatchingList(pModel->GetHatchList())
-    , mpBitmapList(pModel->GetBitmapList())
-    , mpPatternList(pModel->GetPatternList())
+    , mpColorTab(rModel.GetColorList())
+    , mpGradientList(rModel.GetGradientList())
+    , mpHatchingList(rModel.GetHatchList())
+    , mpBitmapList(rModel.GetBitmapList())
+    , mpPatternList(rModel.GetPatternList())
     , m_nAreaPageId(0)
 {
     AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 8a8647b088af..51c7d5afd500 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -1524,9 +1524,9 @@ VclPtr<SfxAbstractLinksDialog> AbstractDialogFactory_Impl::CreateLinksDialog( vc
     return VclPtr<AbstractLinksDialog_Impl>::Create( pLinkDlg );
 }
 
-VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* /*pObj*/ )
+VclPtr<SfxAbstractTabDialog> AbstractDialogFactory_Impl::CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* /*pObj*/ )
 {
-    return VclPtr<CuiAbstractTabDialog_Impl>::Create( VclPtr<SvxFormatCellsDialog>::Create( nullptr, pAttr, pModel ) );
+    return VclPtr<CuiAbstractTabDialog_Impl>::Create( VclPtr<SvxFormatCellsDialog>::Create( nullptr, pAttr, rModel ) );
 }
 
 VclPtr<SvxAbstractSplitTableDialog> AbstractDialogFactory_Impl::CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical)
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index ae87ab25bb72..e9ea89b340e3 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -690,7 +690,7 @@ public:
                 const sal_uInt16 _nInitiallySelectedEvent
             ) override;
 
-    virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, SdrModel* pModel, const SdrObject* pObj ) override;
+    virtual VclPtr<SfxAbstractTabDialog> CreateSvxFormatCellsDialog( const SfxItemSet* pAttr, const SdrModel& rModel, const SdrObject* pObj ) override;
 
     virtual VclPtr<SvxAbstractSplitTableDialog> CreateSvxSplitTableDialog(weld::Window* pParent, bool bIsTableVertical, long nMaxVertical) override;
 
diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx
index 97a2abeec613..0a38f759a494 100644
--- a/cui/source/inc/sdrcelldlg.hxx
+++ b/cui/source/inc/sdrcelldlg.hxx
@@ -40,7 +40,7 @@ private:
     sal_uInt16          m_nBorderPageId;
 
 public:
-    SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, SdrModel const * pModel );
+    SvxFormatCellsDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel );
 
     virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override;
 
diff --git a/cui/source/tabpages/measure.cxx b/cui/source/tabpages/measure.cxx
index adfb0ec6fa26..58ae066ae39b 100644
--- a/cui/source/tabpages/measure.cxx
+++ b/cui/source/tabpages/measure.cxx
@@ -598,7 +598,14 @@ void SvxMeasurePage::Construct()
 {
     DBG_ASSERT( pView, "No valid View transferred!" );
 
-    m_pCtlPreview->pMeasureObj->SetModel( pView->GetModel() );
+    // TTTT
+    // pMeasureObj is member of SvxXMeasurePreview and can only be accessed due to
+    // SvxMeasurePage being a friend. It has it's own SdrModel (also in SvxXMeasurePreview)
+    // and 'setting' the SdrModel is a hack. The comment above about 'notify unit and
+    // floatingpoint-values' is not clear, but has to be done another way - if needed.
+    // Checked on original aw080, is just commented out there, too.
+
+    // m_pCtlPreview->pMeasureObj->SetModel( pView->GetModel() );
     m_pCtlPreview->Invalidate();
 }
 
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 85f2d856ecfc..145a30466576 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -349,7 +349,7 @@ void SvxLineTabPage::InitSymbols(MenuButton const * pButton)
         pModel->InsertPage( pPage, 0 );
         {
         // 3D View
-        std::unique_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
+        std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev ));
         pView->hideMarkHandles();
         pView->ShowSdrPage(pPage);
 
@@ -1119,7 +1119,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs )
         pPage->SetSize(Size(1000,1000));
         pModel->InsertPage( pPage, 0 );
         {
-        std::unique_ptr<SdrView> pView(new SdrView( pModel.get(), pVDev ));
+        std::unique_ptr<SdrView> pView(new SdrView( *pModel, pVDev ));
         pView->hideMarkHandles();
         pView->ShowSdrPage(pPage);
         SdrObject *pObj=nullptr;
diff --git a/cui/source/tabpages/transfrm.cxx b/cui/source/tabpages/transfrm.cxx
index 226947059a7b..ee3f76be840f 100644
--- a/cui/source/tabpages/transfrm.cxx
+++ b/cui/source/tabpages/transfrm.cxx
@@ -566,15 +566,15 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
         SdrObjCustomShape& rSdrObjCustomShape(
             static_cast< SdrObjCustomShape& >(
                 *pView->GetMarkedObjectList().GetMark(0)->GetMarkedSdrObj()));
-        SdrModel* pModel(rSdrObjCustomShape.GetModel());
+        SdrModel& rModel(rSdrObjCustomShape.getSdrModelFromSdrObject());
         SdrUndoAction* pUndo(
-            pModel->IsUndoEnabled()
-                ? pModel->GetSdrUndoFactory().CreateUndoAttrObject(rSdrObjCustomShape)
+            rModel.IsUndoEnabled()
+                ? rModel.GetSdrUndoFactory().CreateUndoAttrObject(rSdrObjCustomShape)
                 : nullptr);
 
         if(pUndo)
         {
-            pModel->BegUndo(pUndo->GetComment());
+            rModel.BegUndo(pUndo->GetComment());
         }
 
         EnhancedCustomShape2d aShape(rSdrObjCustomShape);
@@ -602,8 +602,8 @@ bool SvxSlantTabPage::FillItemSet(SfxItemSet* rAttrs)
 
         if (pUndo)
         {
-            pModel->AddUndo(pUndo);
-            pModel->EndUndo();
+            rModel.AddUndo(pUndo);
+            rModel.EndUndo();
         }
     }
 
diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx
index 0eb9efe66e86..3b3fc0562bf5 100644
--- a/filter/source/msfilter/escherex.cxx
+++ b/filter/source/msfilter/escherex.cxx
@@ -3774,10 +3774,9 @@ bool EscherPropertyContainer::CreateBlipPropertiesforOLEControl(const uno::Refer
     SdrObject* pShape = GetSdrObjectFromXShape( rXShape );
     if ( pShape )
     {
-        SdrModel* pMod = pShape->GetModel();
-        Graphic aGraphic(SdrExchangeView::GetObjGraphic( pMod, pShape));
+        const Graphic aGraphic(SdrExchangeView::GetObjGraphic(*pShape));
+        const GraphicObject aGraphicObject(aGraphic);
 
-        GraphicObject aGraphicObject(aGraphic);
         if (!aGraphicObject.GetUniqueID().isEmpty())
         {
             if ( pGraphicProvider && pPicOutStrm && pShapeBoundRect )
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index ac281e0bfdd1..e958c813068c 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -3955,7 +3955,7 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
         }
         if( !pRet )
         {
-            pRet = new SdrGrafObj;
+            pRet = new SdrGrafObj(*pSdrModel);
             if( bGrfRead )
                 static_cast<SdrGrafObj*>(pRet)->SetGraphic( aGraf );
 
@@ -3997,7 +3997,6 @@ SdrObject* SvxMSDffManager::ImportGraphic( SvStream& rSt, SfxItemSet& rSet, cons
                 pRet->SetName( aFileName );
         }
     }
-    pRet->SetModel( pSdrModel ); // required for GraphicLink
     pRet->SetLogicRect( rObjData.aBoundRect );
 
     if ( dynamic_cast<const SdrGrafObj* >(pRet) !=  nullptr )
@@ -4307,7 +4306,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
 
         if ( aObjData.nSpFlags & ShapeFlag::Group )
         {
-            pRet = new SdrObjGroup;
+            pRet = new SdrObjGroup(*pSdrModel);
             /*  After CWS aw033 has been integrated, an empty group object
                 cannot store its resulting bounding rectangle anymore. We have
                 to return this rectangle via rClientRect now, but only, if
@@ -4337,8 +4336,10 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                 basegfx::B2DPolygon aPoly;
                 aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Left(), aObjData.aBoundRect.Top()));
                 aPoly.append(basegfx::B2DPoint(aObjData.aBoundRect.Right(), aObjData.aBoundRect.Bottom()));
-                pRet = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
-                pRet->SetModel( pSdrModel );
+                pRet = new SdrPathObj(
+                    *pSdrModel,
+                    OBJ_LINE,
+                    basegfx::B2DPolyPolygon(aPoly));
                 ApplyAttributes( rSt, aSet, aObjData );
                 pRet->SetMergedItemSet(aSet);
             }
@@ -4349,8 +4350,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
 
                     ApplyAttributes( rSt, aSet, aObjData );
 
-                    pRet = new SdrObjCustomShape();
-                    pRet->SetModel( pSdrModel );
+                    pRet = new SdrObjCustomShape(*pSdrModel);
 
                     sal_uInt32 ngtextFStrikethrough = GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 );
                     bool bIsFontwork = ( ngtextFStrikethrough & 0x4000 ) != 0;
@@ -4471,9 +4471,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                         {
                             SdrOutliner& rOutliner = static_cast<SdrObjCustomShape*>(pRet)->ImpGetDrawOutliner();
                             bool bOldUpdateMode = rOutliner.GetUpdateMode();
-                            SdrModel* pModel = pRet->GetModel();
-                            if ( pModel )
-                                rOutliner.SetStyleSheetPool( static_cast<SfxStyleSheetPool*>(pModel->GetStyleSheetPool()) );
+                            rOutliner.SetStyleSheetPool(static_cast< SfxStyleSheetPool* >(pRet->getSdrModelFromSdrObject().GetStyleSheetPool()));
                             rOutliner.SetUpdateMode( false );
                             rOutliner.SetText( *pParaObj );
                             ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK);
@@ -4735,7 +4733,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
                         basegfx::B2DPolyPolygon aPoly( static_cast<SdrObjCustomShape*>(pRet)->GetLineGeometry( true ) );
                         SdrObject::Free( pRet );
 
-                        pRet = new SdrEdgeObj();
+                        pRet = new SdrEdgeObj(*pSdrModel);
                         ApplyAttributes( rSt, aSet, aObjData );
                         pRet->SetLogicRect( aObjData.aBoundRect );
                         pRet->SetMergedItemSet(aSet);
@@ -5235,7 +5233,10 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
                 }
             }
 
-            pTextObj = new SdrRectObj(OBJ_TEXT, rTextRect);
+            pTextObj = new SdrRectObj(
+                *pSdrModel,
+                OBJ_TEXT,
+                rTextRect);
             pTextImpRec = new SvxMSDffImportRec(*pImpRec);
             bDeleteTextImpRec = true;
 
@@ -5364,7 +5365,6 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
             }
 
             pTextObj->SetMergedItemSet(aSet);
-            pTextObj->SetModel(pSdrModel);
 
             if (bVerticalText)
                 pTextObj->SetVerticalWriting(true);
@@ -5397,7 +5397,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
             {
                 if( pTextObj != pObj )
                 {
-                    SdrObject* pGroup = new SdrObjGroup;
+                    SdrObject* pGroup = new SdrObjGroup(*pSdrModel);
                     pGroup->GetSubList()->NbcInsertObject( pObj );
                     pGroup->GetSubList()->NbcInsertObject( pTextObj );
                     if (pOrgObj == pObj)
@@ -5413,9 +5413,11 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
             // simple rectangular objects are ignored by ImportObj()  :-(
             // this is OK for Draw but not for Calc and Writer
             // cause here these objects have a default border
-            pObj = new SdrRectObj(rTextRect);
+            pObj = new SdrRectObj(
+                *pSdrModel,
+                rTextRect);
+
             pOrgObj = pObj;
-            pObj->SetModel( pSdrModel );
             SfxItemSet aSet( pSdrModel->GetItemPool() );
             ApplyAttributes( rSt, aSet, rObjData );
 
@@ -6615,9 +6617,19 @@ SdrObject* SvxMSDffManager::ImportOLE( sal_uInt32 nOLEId,
     ErrCode nError = ERRCODE_NONE;
     uno::Reference < embed::XStorage > xDstStg;
     if( GetOLEStorageName( nOLEId, sStorageName, xSrcStg, xDstStg ))
-        pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
-                                        rGrf, rBoundRect, rVisArea, pStData, nError,
-                                        nSvxMSDffOLEConvFlags, embed::Aspects::MSOLE_CONTENT, maBaseURL);
+        pRet = CreateSdrOLEFromStorage(
+            *GetModel(),
+            sStorageName,
+            xSrcStg,
+            xDstStg,
+            rGrf,
+            rBoundRect,
+            rVisArea,
+            pStData,
+            nError,
+            nSvxMSDffOLEConvFlags,
+            embed::Aspects::MSOLE_CONTENT,
+            maBaseURL);
     return pRet;
 }
 
@@ -7106,17 +7118,18 @@ css::uno::Reference < css::embed::XEmbeddedObject >  SvxMSDffManager::CheckForCo
 
 // TODO/MBA: code review and testing!
 SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
-                const OUString& rStorageName,
-                tools::SvRef<SotStorage> const & rSrcStorage,
-                const uno::Reference < embed::XStorage >& xDestStorage,
-                const Graphic& rGrf,
-                const tools::Rectangle& rBoundRect,
-                const tools::Rectangle& rVisArea,
-                SvStream* pDataStrm,
-                ErrCode& rError,
-                sal_uInt32 nConvertFlags,
-                sal_Int64 nRecommendedAspect,
-                OUString const& rBaseURL)
+    SdrModel& rSdrModel,
+    const OUString& rStorageName,
+    tools::SvRef<SotStorage> const & rSrcStorage,
+    const uno::Reference < embed::XStorage >& xDestStorage,
+    const Graphic& rGrf,
+    const tools::Rectangle& rBoundRect,
+    const tools::Rectangle& rVisArea,
+    SvStream* pDataStrm,
+    ErrCode& rError,
+    sal_uInt32 nConvertFlags,
+    sal_Int64 nRecommendedAspect,
+    OUString const& rBaseURL)
 {
     sal_Int64 nAspect = nRecommendedAspect;
     SdrOle2Obj* pRet = nullptr;
@@ -7184,7 +7197,12 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
                         aObj.SetGraphic( rGrf, OUString() );
 
                         // TODO/MBA: check setting of PersistName
-                        pRet = new SdrOle2Obj( aObj, OUString(), rBoundRect);
+                        pRet = new SdrOle2Obj(
+                            rSdrModel,
+                            aObj,
+                            OUString(),
+                            rBoundRect);
+
                         // we have the Object, don't create another
                         bValidStorage = false;
                     }
@@ -7280,7 +7298,11 @@ SdrOle2Obj* SvxMSDffManager::CreateSdrOLEFromStorage(
                 // TODO/LATER: need MediaType
                 aObj.SetGraphic( rGrf, OUString() );
 
-                pRet = new SdrOle2Obj( aObj, aDstStgName, rBoundRect);
+                pRet = new SdrOle2Obj(
+                    rSdrModel,
+                    aObj,
+                    aDstStgName,
+                    rBoundRect);
             }
         }
     }
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index 22d21cb1a74e..5758ca606a1b 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -807,7 +807,10 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
 
             // replacing the object which we will return with a SdrPageObj
             SdrObject::Free( pRet );
-            pRet = new SdrPageObj( rObjData.aBoundRect, pSdrModel->GetPage( nPageNum - 1 ) );
+            pRet = new SdrPageObj(
+                *pSdrModel,
+                rObjData.aBoundRect,
+                pSdrModel->GetPage(nPageNum - 1));
         }
         else
         {
@@ -1069,8 +1072,9 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                         SdrObject::Free( pRet );
                         pRet = nullptr;
                     }
-                    pTObj = new SdrRectObj( eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT );
-                    pTObj->SetModel( pSdrModel );
+                    pTObj = new SdrRectObj(
+                        *pSdrModel,
+                        eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT);
                     SfxItemSet aSet( pSdrModel->GetItemPool() );
                     if ( !pRet )
                         ApplyAttributes( rSt, aSet, rObjData );
@@ -1197,7 +1201,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
                     }
                     if ( pRet )
                     {
-                        SdrObject* pGroup = new SdrObjGroup;
+                        SdrObject* pGroup = new SdrObjGroup(*pSdrModel);
                         pGroup->GetSubList()->NbcInsertObject( pRet );
                         pGroup->GetSubList()->NbcInsertObject( pTObj );
                         pRet = pGroup;
@@ -1880,7 +1884,11 @@ SdrObject* SdrPowerPointImport::ImportOLE( sal_uInt32 nOLEId,
 
                                         // TODO/LATER: need MediaType for Graphic
                                         aObj.SetGraphic( rGraf, OUString() );
-                                        pRet = new SdrOle2Obj( aObj, aNm, rBoundRect );
+                                        pRet = new SdrOle2Obj(
+                                            *pSdrModel,
+                                            aObj,
+                                            aNm,
+                                            rBoundRect);
                                     }
                                 }
                                 if ( !pRet && ( rOe.nType == PPT_PST_ExControl ) )
@@ -1943,7 +1951,11 @@ SdrObject* SdrPowerPointImport::ImportOLE( sal_uInt32 nOLEId,
                                         // TODO/LATER: need MediaType for Graphic
                                         aObj.SetGraphic( aGraphic, OUString() );
 
-                                        pRet = new SdrOle2Obj( aObj, aNm, rBoundRect );
+                                        pRet = new SdrOle2Obj(
+                                            *pSdrModel,
+                                            aObj,
+                                            aNm,
+                                            rBoundRect);
                                     }
                                 }
                             }
@@ -3062,12 +3074,17 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
         pSet->Put( XFillStyleItem( drawing::FillStyle_NONE ) );
     }
     pSet->Put( XLineStyleItem( drawing::LineStyle_NONE ) );
-    tools::Rectangle aRect( rPage.GetLeftBorder(), rPage.GetUpperBorder(), rPage.GetWidth()-rPage.GetRightBorder(), rPage.GetHeight()-rPage.GetLowerBorder() );
-    pRet = new SdrRectObj( aRect );
-    pRet->SetModel( pSdrModel );
+    tools::Rectangle aRect(
+        rPage.GetLeftBorder(),
+        rPage.GetUpperBorder(),
+        rPage.GetWidth() - rPage.GetRightBorder(),
+        rPage.GetHeight() - rPage.GetLowerBorder());
 
-    pRet->SetMergedItemSet(*pSet);
+    pRet = new SdrRectObj(
+        *pSdrModel,
+        aRect);
 
+    pRet->SetMergedItemSet(*pSet);
     pRet->SetMarkProtect( true );
     pRet->SetMoveProtect( true );
     pRet->SetResizeProtect( true );
@@ -7572,7 +7589,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, const sal_uInt32
     if (aRows.empty())
         return pRet;
 
-    sdr::table::SdrTableObj* pTable = new sdr::table::SdrTableObj( pSdrModel );
+    sdr::table::SdrTableObj* pTable = new sdr::table::SdrTableObj(*pSdrModel);
     pTable->uno_lock();
     Reference< XTable > xTable( pTable->getTable() );
 
diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index e923eb92c021..056c1c7fa5c9 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -560,9 +560,9 @@ bool SVGFilter::implExport( const Sequence< PropertyValue >& rDescriptor )
                         if( pSvxDrawPage )
                         {
                             mpDefaultSdrPage = pSvxDrawPage->GetSdrPage();
-                            mpSdrModel = mpDefaultSdrPage->GetModel();
+                            mpSdrModel = &mpDefaultSdrPage->getSdrModelFromSdrPage();
 
-                            if( mpSdrModel )
+                            if( mpSdrModel ) // TTTT should be reference
                             {
                                 SdrOutliner& rOutl = mpSdrModel->GetDrawOutliner();
 
@@ -921,8 +921,8 @@ void SVGFilter::implGenerateMetaData()
         if( pSvxDrawPage )
         {
             SdrPage* pSdrPage = pSvxDrawPage->GetSdrPage();
-            SdrModel* pSdrModel = pSdrPage->GetModel();
-            nPageNumberingType = pSdrModel->GetPageNumType();
+            SdrModel& rSdrModel(pSdrPage->getSdrModelFromSdrPage());
+            nPageNumberingType = rSdrModel.GetPageNumType();
 
             // That is used by CalcFieldHdl method.
             mVisiblePagePropSet.nPageNumberingType = nPageNumberingType;
@@ -1384,8 +1384,8 @@ void SVGFilter::implGetPagePropSet( const Reference< css::drawing::XDrawPage > &
                 if( pSvxDrawPage )
                 {
                     SdrPage* pSdrPage = pSvxDrawPage->GetSdrPage();
-                    SdrModel* pSdrModel = pSdrPage->GetModel();
-                    mVisiblePagePropSet.nPageNumberingType = pSdrModel->GetPageNumType();
+                    SdrModel& rSdrModel(pSdrPage->getSdrModelFromSdrPage());
+                    mVisiblePagePropSet.nPageNumberingType = rSdrModel.GetPageNumType();
                 }
             }
         }
@@ -1931,7 +1931,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< css::drawing::XDraw
 
         if( pObj )
         {
-            Graphic aGraphic( SdrExchangeView::GetObjGraphic( pObj->GetModel(), pObj ) );
+            const Graphic aGraphic(SdrExchangeView::GetObjGraphic(*pObj));
 
             if( aGraphic.GetType() != GraphicType::NONE )
             {
diff --git a/include/basegfx/matrix/b2dhommatrix.hxx b/include/basegfx/matrix/b2dhommatrix.hxx
index a7ab0c3f5917..9f2c8a338412 100644
--- a/include/basegfx/matrix/b2dhommatrix.hxx
+++ b/include/basegfx/matrix/b2dhommatrix.hxx
@@ -74,8 +74,10 @@ namespace basegfx
         void rotate(double fRadiant);
 
         void translate(double fX, double fY);
+        void translate(const B2DTuple& rTuple);
 
         void scale(double fX, double fY);
+        void scale(const B2DTuple& rTuple);
 
         // Shearing-Matrices
         void shearX(double fSx);
diff --git a/include/basegfx/matrix/b3dhommatrix.hxx b/include/basegfx/matrix/b3dhommatrix.hxx
index 09d700547363..6d5d5c486b9b 100644
--- a/include/basegfx/matrix/b3dhommatrix.hxx
+++ b/include/basegfx/matrix/b3dhommatrix.hxx
@@ -64,12 +64,15 @@ namespace basegfx
 
         /// Rotation
         void rotate(double fAngleX,double fAngleY,double fAngleZ);
+        void rotate(const B3DTuple& rRotation);
 
         /// Translation
         void translate(double fX, double fY, double fZ);
+        void translate(const B3DTuple& rTranslation);
 
         /// Scaling
         void scale(double fX, double fY, double fZ);
+        void scale(const B3DTuple& rScale);
 
         // Shearing-Matrices
         void shearXY(double fSx, double fSy);
diff --git a/include/basegfx/matrix/b3dhommatrixtools.hxx b/include/basegfx/matrix/b3dhommatrixtools.hxx
new file mode 100755
index 000000000000..16debfad981b
--- /dev/null
+++ b/include/basegfx/matrix/b3dhommatrixtools.hxx
@@ -0,0 +1,46 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASEGFX_MATRIX_B3DHOMMATRIXTOOLS_HXX
+#define INCLUDED_BASEGFX_MATRIX_B3DHOMMATRIXTOOLS_HXX
+
+#include <sal/types.h>
+#include <basegfx/matrix/b3dhommatrix.hxx>
+#include <com/sun/star/drawing/HomogenMatrix.hpp>
+
+namespace basegfx
+{
+namespace utils
+{
+/* tooling methods for converting API matrices (drawing::HomogenMatrix) to
+    B3DHomMatrix. drawing::HomogenMatrix4 is not used by OOo
+ */
+BASEGFX_DLLPUBLIC B3DHomMatrix
+UnoHomogenMatrixToB3DHomMatrix(const com::sun::star::drawing::HomogenMatrix& rMatrixIn);
+
+BASEGFX_DLLPUBLIC void
+B3DHomMatrixToUnoHomogenMatrix(const B3DHomMatrix& rMatrixIn,
+                               com::sun::star::drawing::HomogenMatrix& rMatrixOut);
+
+} // end of namespace tools
+} // end of namespace basegfx
+
+#endif // INCLUDED_BASEGFX_MATRIX_B3DHOMMATRIXTOOLS_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/basegfx/numeric/ftools.hxx b/include/basegfx/numeric/ftools.hxx
index 52909c9cd75b..1ade3bb3a3d6 100644
--- a/include/basegfx/numeric/ftools.hxx
+++ b/include/basegfx/numeric/ftools.hxx
@@ -153,6 +153,25 @@ namespace basegfx
      */
     BASEGFX_DLLPUBLIC double snapToNearestMultiple(double v, const double fStep);
 
+    /** Snap v to the range [0.0 .. fWidth] using modulo
+     */
+    double snapToZeroRange(double v, double fWidth);
+
+    /** Snap v to the range [fLow .. fHigh] using modulo
+     */
+    double snapToRange(double v, double fLow, double fHigh);
+
+    /** return fValue with the sign of fSignCarrier, thus evtl. changed
+    */
+    inline double copySign(double fValue, double fSignCarrier)
+    {
+#ifdef WNT
+        return _copysign(fValue, fSignCarrier);
+#else
+        return copysign(fValue, fSignCarrier);
+#endif
+    }
+
     /** RotateFlyFrame3: Normalize to range defined by [0.0 ... fRange[, independent
         if v is positive or negative.
 
diff --git a/include/basegfx/range/b1drange.hxx b/include/basegfx/range/b1drange.hxx
index c1e35b13605c..7b0d22869559 100644
--- a/include/basegfx/range/b1drange.hxx
+++ b/include/basegfx/range/b1drange.hxx
@@ -141,6 +141,11 @@ namespace basegfx
             maRange.intersect(rRange.maRange);
         }
 
+        /// clamp value on range
+        double clamp(double fValue) const
+        {
+            return maRange.clamp(fValue);
+        }
     };
 
 } // end of namespace basegfx
diff --git a/include/basegfx/range/b2drange.hxx b/include/basegfx/range/b2drange.hxx
index 0de9dba0e783..00eab63d1472 100644
--- a/include/basegfx/range/b2drange.hxx
+++ b/include/basegfx/range/b2drange.hxx
@@ -274,8 +274,29 @@ namespace basegfx
             maRangeY.grow(fValue);
         }
 
+        /// clamp value on range
+        B2DTuple clamp(const B2DTuple& rTuple) const
+        {
+            return B2DTuple(
+                maRangeX.clamp(rTuple.getX()),
+                maRangeY.clamp(rTuple.getY()));
+        }
+
+        /** Transform Range by given transformation matrix. */
         BASEGFX_DLLPUBLIC void transform(const B2DHomMatrix& rMatrix);
 
+        /** Transform Range by given transformation matrix.
+
+            This operation transforms the Range by transforming all four possible
+            extrema points (corners) of the given range and building a new one.
+            This means that the range will grow evtl. when a shear and/or rotation
+            is part of the transformation.
+        */
+        B2DRange& operator*=( const ::basegfx::B2DHomMatrix& rMat );
+
+        /** Get a range filled with (0.0, 0.0, 1.0, 1.0) */
+        static const B2DRange& getUnitB2DRange();
+
     private:
         typedef ::basegfx::BasicRange< ValueType, TraitsType >  MyBasicRange;
 
@@ -283,6 +304,10 @@ namespace basegfx
         MyBasicRange        maRangeY;
     };
 
+    /** Transform B2DRange by given transformation matrix (see operator*=())
+    */
+    B2DRange operator*( const B2DHomMatrix& rMat, const B2DRange& rB2DRange );
+
     /** Round double to nearest integer for 2D range
 
         @return the nearest integer for this range
diff --git a/include/basegfx/range/b2irange.hxx b/include/basegfx/range/b2irange.hxx
index 3d7d0edba6c9..a8a95d69ceed 100644
--- a/include/basegfx/range/b2irange.hxx
+++ b/include/basegfx/range/b2irange.hxx
@@ -208,6 +208,13 @@ namespace basegfx
             maRangeY.intersect(rRange.maRangeY);
         }
 
+        B2ITuple clamp(const B2ITuple& rTuple) const
+        {
+            return B2ITuple(
+                maRangeX.clamp(rTuple.getX()),
+                maRangeY.clamp(rTuple.getY()));
+        }
+
     private:
         typedef ::basegfx::BasicRange< ValueType, TraitsType >  MyBasicRange;
 
diff --git a/include/basegfx/range/b3drange.hxx b/include/basegfx/range/b3drange.hxx
index 881dce612297..e1c44393813a 100644
--- a/include/basegfx/range/b3drange.hxx
+++ b/include/basegfx/range/b3drange.hxx
@@ -195,9 +195,34 @@ namespace basegfx
             maRangeZ.grow(fValue);
         }
 
+        /// clamp value on range
+        B3DTuple clamp(const B3DTuple& rTuple) const
+        {
+            return B3DTuple(
+                maRangeX.clamp(rTuple.getX()),
+                maRangeY.clamp(rTuple.getY()),
+                maRangeZ.clamp(rTuple.getZ()));
+        }
+
          BASEGFX_DLLPUBLIC void transform(const B3DHomMatrix& rMatrix);
+
+        /** Transform Range by given transformation matrix.
+
+            This operation transforms the Range by transforming all eight possible
+            extrema points (corners) of the given range and building a new one.
+            This means that the range will grow evtl. when a shear and/or rotation
+            is part of the transformation.
+        */
+        B3DRange& operator*=( const ::basegfx::B3DHomMatrix& rMat );
+
+        /** Get a range filled with (0.0, 0.0, 0.0, 1.0, 1.0, 1.0) */
+        static const B3DRange& getUnitB3DRange();
     };
 
+    /** Transform B3DRange by given transformation matrix (see operator*=())
+    */
+    B3DRange operator*( const B3DHomMatrix& rMat, const B3DRange& rB2DRange );
+
 } // end of namespace basegfx
 
 
diff --git a/include/basegfx/range/basicrange.hxx b/include/basegfx/range/basicrange.hxx
index bea40dd3ded2..17f31ea42f19 100644
--- a/include/basegfx/range/basicrange.hxx
+++ b/include/basegfx/range/basicrange.hxx
@@ -248,6 +248,28 @@ namespace basegfx
             }
         }
 
+        T clamp(T nValue) const
+        {
+            if(isEmpty())
+            {
+                return nValue;
+            }
+            else
+            {
+                if(nValue < mnMinimum)
+                {
+                    return mnMinimum;
+                }
+
+                if(nValue > mnMaximum)
+                {
+                    return mnMaximum;
+                }
+
+                return nValue;
+            }
+        }
+
         typename Traits::DifferenceType getRange() const
         {
             if(isEmpty())
diff --git a/include/filter/msfilter/msdffimp.hxx b/include/filter/msfilter/msdffimp.hxx
index ba8e6897492d..fedce1b33112 100644
--- a/include/filter/msfilter/msdffimp.hxx
+++ b/include/filter/msfilter/msdffimp.hxx
@@ -697,17 +697,19 @@ public:
 
     void RemoveFromShapeOrder( SdrObject const * pObject ) const;
 
-    static SdrOle2Obj* CreateSdrOLEFromStorage( const OUString& rStorageName,
-                                                tools::SvRef<SotStorage> const & rSrcStorage,
-                                                const css::uno::Reference < css::embed::XStorage >& xDestStg,
-                                                const Graphic& rGraf,
-                                                const tools::Rectangle& rBoundRect,
-                                                const tools::Rectangle& rVisArea,
-                                                SvStream* pDataStrrm,
-                                                ErrCode& rError,
-                                                sal_uInt32 nConvertFlags,
-                                                sal_Int64 nAspect,
-                                                OUString const& rBaseURL);
+    static SdrOle2Obj* CreateSdrOLEFromStorage(
+        SdrModel& rSdrModel,
+        const OUString& rStorageName,
+        tools::SvRef<SotStorage> const & rSrcStorage,
+        const css::uno::Reference < css::embed::XStorage >& xDestStg,
+        const Graphic& rGraf,
+        const tools::Rectangle& rBoundRect,
+        const tools::Rectangle& rVisArea,
+        SvStream* pDataStrrm,
+        ErrCode& rError,
+        sal_uInt32 nConvertFlags,
+        sal_Int64 nAspect,
+        OUString const& rBaseURL);
 
     /** Create connections between shapes.
         This method should be called after a page is imported.
diff --git a/include/svx/connctrl.hxx b/include/svx/connctrl.hxx
index 360ff38522da..106140dfa374 100644
--- a/include/svx/connctrl.hxx
+++ b/include/svx/connctrl.hxx
@@ -32,7 +32,7 @@ namespace vcl { class Window; }
 class SfxItemSet;
 class SdrEdgeObj;
 class SdrView;
-class SdrObjList;
+class SdrPage;
 
 /*************************************************************************
 |*
@@ -45,7 +45,7 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxXConnectionPreview : public Control
 
 private:
     SdrEdgeObj*         pEdgeObj;
-    SdrObjList*         pObjList;
+    SdrPage*            pSdrPage;
     const SdrView*      pView;
 
     SVX_DLLPRIVATE void SetStyles();
diff --git a/include/svx/cube3d.hxx b/include/svx/cube3d.hxx
index 4a74777e0cff..95acaab386cd 100644
--- a/include/svx/cube3d.hxx
+++ b/include/svx/cube3d.hxx
@@ -54,17 +54,23 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dCubeObj final : public E3dCompoundObject
     // BOOLeans
     bool                                bPosIsCenter : 1;
 
-    void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+    void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
 
 public:
-    E3dCubeObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& aPos, const basegfx::B3DVector& r3DSize);
-    E3dCubeObj();
+    E3dCubeObj(SdrModel& rSdrModel,
+        const E3dDefaultAttributes& rDefault,
+        const basegfx::B3DPoint& aPos,
+        const basegfx::B3DVector& r3DSize);
+    E3dCubeObj(SdrModel& rSdrModel);
 
     virtual sal_uInt16 GetObjIdentifier() const override;
     virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
 
-    virtual E3dCubeObj* Clone() const override;
+    virtual E3dCubeObj* Clone(SdrModel* pTargetModel = nullptr) const override;
+
+    // implemented mainly for the purposes of Clone()
+    E3dCubeObj& operator=(const E3dCubeObj& rObj);
 
     // Set local parameters with geometry recreation
     void SetCubePos(const basegfx::B3DPoint& rNew);
diff --git a/include/svx/deflt3d.hxx b/include/svx/deflt3d.hxx
index e69a62a1625e..e08e9945fa96 100644
--- a/include/svx/deflt3d.hxx
+++ b/include/svx/deflt3d.hxx
@@ -65,13 +65,13 @@ public:
     void Reset();
 
     // Cube object
-    const basegfx::B3DPoint& GetDefaultCubePos() { return aDefaultCubePos; }
-    const basegfx::B3DVector& GetDefaultCubeSize() { return aDefaultCubeSize; }
+    const basegfx::B3DPoint& GetDefaultCubePos() const { return aDefaultCubePos; }
+    const basegfx::B3DVector& GetDefaultCubeSize() const { return aDefaultCubeSize; }
     bool GetDefaultCubePosIsCenter() const { return bDefaultCubePosIsCenter; }
 
     // Sphere object
-    const basegfx::B3DPoint& GetDefaultSphereCenter() { return aDefaultSphereCenter; }
-    const basegfx::B3DVector& GetDefaultSphereSize() { return aDefaultSphereSize; }
+    const basegfx::B3DPoint& GetDefaultSphereCenter() const { return aDefaultSphereCenter; }
+    const basegfx::B3DVector& GetDefaultSphereSize() const { return aDefaultSphereSize; }
 
     // Lathe object
     bool GetDefaultLatheSmoothed() const { return bDefaultLatheSmoothed; }
diff --git a/include/svx/e3dsceneupdater.hxx b/include/svx/e3dsceneupdater.hxx
index ad01d667b4f5..e6800e845e01 100644
--- a/include/svx/e3dsceneupdater.hxx
+++ b/include/svx/e3dsceneupdater.hxx
@@ -50,7 +50,7 @@ class SVX_DLLPUBLIC E3DModifySceneSnapRectUpdater
     // of the to-be-changed 3D object when the scene has a 3d transformation
     // stack at construction time. In all other cases it's set to zero and
     // no action needs to be taken
-    E3dScene*                                   mpScene;
+    E3dScene*       mpScene;
 
     // the 3d transformation stack at the time of construction, valid when
     // mpScene is not zero
@@ -58,7 +58,7 @@ class SVX_DLLPUBLIC E3DModifySceneSnapRectUpdater
 
 public:
     // the constructor evaluates and sets the members at construction time
-    E3DModifySceneSnapRectUpdater(const SdrObject* pObject);
+    E3DModifySceneSnapRectUpdater(const SdrObject* mpObject);
 
     // the destructor will take action if mpScene is not zero and modify the
     // 2D geomeztry of the target scene
diff --git a/include/svx/e3dundo.hxx b/include/svx/e3dundo.hxx
index 8be61b7b9e0e..17335ea1e8e0 100644
--- a/include/svx/e3dundo.hxx
+++ b/include/svx/e3dundo.hxx
@@ -31,17 +31,15 @@
 \************************************************************************/
 class SAL_WARN_UNUSED E3dUndoAction : public SdrUndoAction
 {
-
     protected:
-        E3dObject *pMy3DObj;
+        E3dObject&      mrMy3DObj;
 
     public:
-        E3dUndoAction (SdrModel  *pModel,
-                       E3dObject *p3DObj) :
-            SdrUndoAction (*pModel),
-            pMy3DObj (p3DObj)
-            {
-            }
+        E3dUndoAction(E3dObject &r3DObj)
+        :   SdrUndoAction(r3DObj.getSdrModelFromSdrObject()),
+            mrMy3DObj(r3DObj)
+        {
+        }
 
         virtual ~E3dUndoAction () override;
 
@@ -55,25 +53,25 @@ class SAL_WARN_UNUSED E3dUndoAction : public SdrUndoAction
 \************************************************************************/
 class SAL_WARN_UNUSED E3dRotateUndoAction : public E3dUndoAction
 {
-        basegfx::B3DHomMatrix aMyOldRotation;
-        basegfx::B3DHomMatrix aMyNewRotation;
-
-    public:
-        E3dRotateUndoAction (SdrModel       *pModel,
-                             E3dObject      *p3DObj,
-                             const basegfx::B3DHomMatrix &aOldRotation,
-                             const basegfx::B3DHomMatrix &aNewRotation) :
-            E3dUndoAction (pModel, p3DObj),
-            aMyOldRotation (aOldRotation),
-            aMyNewRotation (aNewRotation)
-            {
-            }
-
-        virtual ~E3dRotateUndoAction () override;
-
-        virtual void Undo() override;
-        virtual void Redo() override;
-
+private:
+    basegfx::B3DHomMatrix   maMyOldRotation;
+    basegfx::B3DHomMatrix   maMyNewRotation;
+
+public:
+    E3dRotateUndoAction(
+        E3dObject& r3DObj,
+        const basegfx::B3DHomMatrix &aOldRotation,
+        const basegfx::B3DHomMatrix &aNewRotation)
+    :   E3dUndoAction(r3DObj),
+        maMyOldRotation(aOldRotation),
+        maMyNewRotation(aNewRotation)
+    {
+    }
+
+    virtual ~E3dRotateUndoAction () override;
+
+    virtual void Undo() override;
+    virtual void Redo() override;
 };
 
 /************************************************************************\
@@ -83,16 +81,16 @@ class SAL_WARN_UNUSED E3dRotateUndoAction : public E3dUndoAction
 \************************************************************************/
 class SAL_WARN_UNUSED SVX_DLLPUBLIC E3dAttributesUndoAction : public SdrUndoAction
 {
+private:
     using SdrUndoAction::Repeat;
 
-    SdrObject*  pObject;
-
-    const SfxItemSet aNewSet;
-    const SfxItemSet aOldSet;
+    SdrObject&          mrObject;
+    const SfxItemSet    maNewSet;
+    const SfxItemSet    maOldSet;
 
  public:
-        E3dAttributesUndoAction( SdrModel &rModel,
-            E3dObject* pInObject,
+        E3dAttributesUndoAction(
+            E3dObject& rInObject,
             const SfxItemSet& rNewSet,
             const SfxItemSet& rOldSet);
 
diff --git a/include/svx/extedit.hxx b/include/svx/extedit.hxx
index 5ee2864a94a2..82afea29c83f 100644
--- a/include/svx/extedit.hxx
+++ b/include/svx/extedit.hxx
@@ -43,18 +43,20 @@ class FmFormView;
 class SdrObject;
 
 class SAL_WARN_UNUSED SVX_DLLPUBLIC SdrExternalToolEdit
-    : public ExternalToolEdit
-    , public SfxListener
+:   public ExternalToolEdit
+    ,public SfxListener
 {
 private:
-    FmFormView * m_pView;
-    SdrObject *  m_pObj;
+    FmFormView* m_pView;
+    SdrObject*  m_pObj;
 
     SAL_DLLPRIVATE virtual void Update(Graphic&) override;
     SAL_DLLPRIVATE virtual void Notify(SfxBroadcaster&, const SfxHint&) override;
 
 public:
-    SdrExternalToolEdit(FmFormView * pView, SdrObject * pObj);
+    SdrExternalToolEdit(
+        FmFormView* pView,
+        SdrObject* pObj);
 };
 
 #endif
diff --git a/include/svx/extrud3d.hxx b/include/svx/extrud3d.hxx
index 1b78d4547740..5c121343af4d 100644
--- a/include/svx/extrud3d.hxx
+++ b/include/svx/extrud3d.hxx
@@ -40,12 +40,15 @@ private:
 
     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
-    void SetDefaultAttributes(E3dDefaultAttributes const & rDefault);
+    void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
 
 public:
-
-    E3dExtrudeObj(E3dDefaultAttributes const & rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth);
-    E3dExtrudeObj();
+    E3dExtrudeObj(
+        SdrModel& rSdrModel,
+        const E3dDefaultAttributes& rDefault,
+        const basegfx::B2DPolyPolygon& rPP,
+        double fDepth);
+    E3dExtrudeObj(SdrModel& rSdrModel);
 
     // PercentDiagonal: 0..100, before 0.0..0.5
     sal_uInt16 GetPercentDiagonal() const
@@ -81,7 +84,10 @@ public:
 
     virtual sal_uInt16 GetObjIdentifier() const override;
 
-    virtual E3dExtrudeObj* Clone() const override;
+    virtual E3dExtrudeObj* Clone(SdrModel* pTargetModel = nullptr) const override;
+
+    // implemented mainly for the purposes of Clone()
+    E3dExtrudeObj& operator=(const E3dExtrudeObj& rObj);
 
     // TakeObjName...() is for the display in the UI (for example "3 frames selected")
     virtual OUString TakeObjNameSingul() const override;
diff --git a/include/svx/fmpage.hxx b/include/svx/fmpage.hxx
index 808d814452b1..2605a6067517 100644
--- a/include/svx/fmpage.hxx
+++ b/include/svx/fmpage.hxx
@@ -42,6 +42,7 @@ class HelpEvent;
 class SVX_DLLPUBLIC FmFormPage : public SdrPage
 {
     FmFormPage& operator=(const FmFormPage&) = delete;
+    FmFormPage(const FmFormPage&) = delete;
 
     friend class FmFormObj;
     std::unique_ptr<FmFormPageImpl>     m_pImpl;
@@ -52,10 +53,7 @@ public:
     explicit FmFormPage(FmFormModel& rModel, bool bMasterPage=false);
     virtual ~FmFormPage() override;
 
-    virtual void    SetModel(SdrModel* pNewModel) override;
-
-    virtual SdrPage* Clone() const override;
-    virtual SdrPage* Clone(SdrModel* pNewModel) const override;
+    virtual SdrPage* Clone(SdrModel* pNewModel = nullptr) const override;
 
     virtual void    InsertObject(SdrObject* pObj, size_t nPos = SAL_MAX_SIZE) override;
 
@@ -75,9 +73,8 @@ public:
                             const HelpEvent& rEvt );
 
 protected:
-    FmFormPage(const FmFormPage& rPage);
-
-    void lateInit(const FmFormPage& rPage, FmFormModel* pNewModel = nullptr);
+    // lateInit -> copyValuesToClonedInstance (?)
+    void lateInit(const FmFormPage& rPage);
 };
 
 #endif // INCLUDED_SVX_FMPAGE_HXX
diff --git a/include/svx/fmview.hxx b/include/svx/fmview.hxx
index a4245150337a..d0a7eb79836f 100644
--- a/include/svx/fmview.hxx
+++ b/include/svx/fmview.hxx
@@ -61,8 +61,10 @@ class SVX_DLLPUBLIC FmFormView : public E3dView
     void Init();
 
 public:
+    FmFormView(
+        SdrModel& rSdrModel,
+        OutputDevice* pOut);
 
-    FmFormView(FmFormModel* pModel, OutputDevice* pOut);
     virtual ~FmFormView() override;
 
     /** create a control pair (label/bound control) for the database field description given.
diff --git a/include/svx/graphctl.hxx b/include/svx/graphctl.hxx
index 85ecc62e904f..f32454a56ae4 100644
--- a/include/svx/graphctl.hxx
+++ b/include/svx/graphctl.hxx
@@ -141,10 +141,13 @@ protected:
     }
 
 public:
-    GraphCtrlView(SdrModel* pModel, GraphCtrl* pWindow)
-        : SdrView(pModel, pWindow)
-        , rGraphCtrl(*pWindow)
-    {}
+    GraphCtrlView(
+        SdrModel& rSdrModel,
+        GraphCtrl* pWindow)
+        :   SdrView(rSdrModel, pWindow)
+        ,rGraphCtrl(*pWindow)
+    {
+    }
 };
 
 #endif // INCLUDED_SVX_GRAPHCTL_HXX
diff --git a/include/svx/lathe3d.hxx b/include/svx/lathe3d.hxx
index 3c5a0e23b015..89df10369045 100644
--- a/include/svx/lathe3d.hxx
+++ b/include/svx/lathe3d.hxx
@@ -39,11 +39,14 @@ class SVX_DLLPUBLIC E3dLatheObj final : public E3dCompoundObject
 
     virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
     virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
-    void SetDefaultAttributes(E3dDefaultAttributes const & rDefault);
+    void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
 
 public:
-    E3dLatheObj(E3dDefaultAttributes const & rDefault, const basegfx::B2DPolyPolygon& rPoly2D);
-    E3dLatheObj();
+    E3dLatheObj(
+        SdrModel& rSdrModel,
+        const E3dDefaultAttributes& rDefault,
+        const basegfx::B2DPolyPolygon& rPoly2D);
+    E3dLatheObj(SdrModel& rSdrModel);
 
     // HorizontalSegments:
     sal_uInt32 GetHorizontalSegments() const
@@ -87,7 +90,10 @@ public:
 
     virtual sal_uInt16 GetObjIdentifier() const override;
 
-    virtual E3dLatheObj* Clone() const override;
+    virtual E3dLatheObj* Clone(SdrModel* pTargetModel = nullptr) const override;
+
+    // implemented mainly for the purposes of Clone()
+    E3dLatheObj& operator=(const E3dLatheObj& rObj);
 
     virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
 
diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx
index 87117cc5d203..7ad18848d4cd 100644
--- a/include/svx/obj3d.hxx
+++ b/include/svx/obj3d.hxx
@@ -81,6 +81,8 @@ public:
     E3dObjList();
     SVX_DLLPUBLIC virtual ~E3dObjList() override;
 
+    virtual E3dObjList* CloneSdrObjList(SdrModel* pNewModel = nullptr) const override;
+
     virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override;
     virtual void InsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override;
     virtual SdrObject* NbcRemoveObject(size_t nObjNum) override;
@@ -88,8 +90,7 @@ public:
 
 private:
     E3dObjList &operator=(const E3dObjList& rSrcList) = delete;
-
-    SVX_DLLPUBLIC E3dObjList(const E3dObjList& rSrcList);
+    E3dObjList(const E3dObjList& rSrcList) = delete;
 };
 
 /*************************************************************************
@@ -131,7 +132,7 @@ protected:
     // E3dObject is only a helper class (for E3DScene and E3DCompoundObject)
     // and no instances should be created from anyone, so i move the constructors
     // to protected area
-    E3dObject();
+    E3dObject(SdrModel& rSdrModel);
 
 public:
     virtual void RecalcSnapRect() override;
@@ -148,7 +149,6 @@ public:
 
     virtual void        SetObjList(SdrObjList* pNewObjList) override;
     virtual void        SetPage(SdrPage* pNewPage) override;
-    virtual void        SetModel(SdrModel* pNewModel) override;
     virtual void        NbcMove(const Size& rSize) override;
     virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
     virtual SdrObjList* GetSubList() const override;
@@ -183,7 +183,7 @@ public:
     // TakeObjName...() is for the display in the UI, for example "3 frames selected".
     virtual OUString TakeObjNameSingul() const override;
     virtual OUString TakeObjNamePlural() const override;
-    virtual E3dObject* Clone() const override;
+    virtual E3dObject* Clone(SdrModel* pTargetModel = nullptr) const override;
     E3dObject& operator=( const E3dObject& rObj );
 
     virtual SdrObjGeoData *NewGeoData() const override;
@@ -232,7 +232,7 @@ protected:
 
 public:
 
-    E3dCompoundObject();
+    E3dCompoundObject(SdrModel& rSdrModel);
     virtual ~E3dCompoundObject() override;
 
     virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
@@ -242,7 +242,10 @@ public:
     virtual sal_uInt16 GetObjIdentifier() const override;
     virtual void RecalcSnapRect() override;
 
-    virtual E3dCompoundObject* Clone() const override;
+    virtual E3dCompoundObject* Clone(SdrModel* pTargetModel = nullptr) const override;
+
+    // implemented mainly for the purposes of Clone()
+    E3dCompoundObject& operator=(const E3dCompoundObject& rObj);
 
     bool IsAOrdNumRemapCandidate(E3dScene*& prScene) const;
 };
diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx
index 98778dd493e3..9f5acca38ce2 100644
--- a/include/svx/polygn3d.hxx
+++ b/include/svx/polygn3d.hxx
@@ -43,10 +43,11 @@ public:
     void SetPolyNormals3D(const basegfx::B3DPolyPolygon& rNewPolyPoly3D);
     void SetPolyTexture2D(const basegfx::B2DPolyPolygon& rNewPolyPoly2D);
 
+    E3dPolygonObj(
+        SdrModel& rSdrModel,
+        const basegfx::B3DPolyPolygon& rPolyPoly3D);
+    E3dPolygonObj(SdrModel& rSdrModel);
 
-    E3dPolygonObj(const basegfx::B3DPolyPolygon& rPolyPoly3D);
-
-    E3dPolygonObj();
     virtual ~E3dPolygonObj() override;
 
     const basegfx::B3DPolyPolygon& GetPolyPolygon3D() const { return aPolyPoly3D; }
@@ -56,7 +57,10 @@ public:
     virtual sal_uInt16 GetObjIdentifier() const override;
     virtual SdrObject* DoConvertToPolyObj(bool bBezier, bool bAddText) const override;
 
-    virtual E3dPolygonObj* Clone() const override;
+    virtual E3dPolygonObj* Clone(SdrModel* pTargetModel = nullptr) const override;
+
+    // implemented mainly for the purposes of Clone()
+    E3dPolygonObj& operator=(const E3dPolygonObj& rObj);
 
     // LineOnly?
     bool GetLineOnly() const { return bLineOnly; }
diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx
index b6562093a6f1..eef2c0422ba9 100644
--- a/include/svx/scene3d.hxx
+++ b/include/svx/scene3d.hxx
@@ -90,7 +90,7 @@ protected:
     void ImpCleanup3DDepthMapper();
 
 public:
-    E3dScene();
+    E3dScene(SdrModel& rSdrModel);
     virtual ~E3dScene() override;
 

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list