summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArmin Le Grand <Armin.Le.Grand@cib.de (CIB)>2018-03-07 15:43:20 +0100
committerArmin Le Grand <Armin.Le.Grand@cib.de>2018-04-06 16:47:35 +0200
commitd240987998d56f5d53a2b0d48dff8cc7aa62ba5b (patch)
tree70612383c8cfe32c2b1965df15b68a400b2234b2
parentf91d22bfefd1a5f1b8e31f25004e6ef9b34b5db0 (diff)
SOSAW080: Make SdrModel& prerequisite to SdrObjects
Added need for SdrModel& in constructors of SdrModel, SdrPage, SdrView and SdrObjList. Builds, not finished. Change-Id: I1cb7d573d323e98a89761fe662c10c4a654fdec0
-rw-r--r--basctl/source/dlged/dlged.cxx12
-rw-r--r--basctl/source/dlged/dlgedfac.cxx60
-rw-r--r--basctl/source/dlged/dlgedobj.cxx30
-rw-r--r--basctl/source/dlged/dlgedpage.cxx8
-rw-r--r--basctl/source/dlged/dlgedview.cxx8
-rw-r--r--basctl/source/inc/dlgedobj.hxx12
-rw-r--r--basctl/source/inc/dlgedview.hxx6
-rw-r--r--chart2/source/controller/drawinglayer/DrawViewWrapper.cxx12
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx2
-rw-r--r--chart2/source/controller/inc/DrawViewWrapper.hxx5
-rw-r--r--chart2/source/controller/main/ChartController.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx4
-rw-r--r--chart2/source/controller/main/ChartTransferable.cxx11
-rw-r--r--chart2/source/controller/main/ChartTransferable.hxx11
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx9
-rw-r--r--cui/source/tabpages/tpline.cxx4
-rw-r--r--filter/source/msfilter/msdffimp.cxx76
-rw-r--r--filter/source/msfilter/svdfppt.cxx29
-rw-r--r--include/filter/msfilter/msdffimp.hxx24
-rw-r--r--include/svx/cube3d.hxx9
-rw-r--r--include/svx/deflt3d.hxx8
-rw-r--r--include/svx/extrud3d.hxx11
-rw-r--r--include/svx/fmview.hxx4
-rw-r--r--include/svx/graphctl.hxx11
-rw-r--r--include/svx/lathe3d.hxx9
-rw-r--r--include/svx/obj3d.hxx6
-rw-r--r--include/svx/polygn3d.hxx7
-rw-r--r--include/svx/scene3d.hxx2
-rw-r--r--include/svx/sphere3d.hxx11
-rw-r--r--include/svx/svdcrtv.hxx7
-rw-r--r--include/svx/svddrgv.hxx7
-rw-r--r--include/svx/svdedtv.hxx7
-rw-r--r--include/svx/svdedxv.hxx7
-rw-r--r--include/svx/svdglev.hxx7
-rw-r--r--include/svx/svdmrkv.hxx5
-rw-r--r--include/svx/svdoashp.hxx9
-rw-r--r--include/svx/svdoattr.hxx2
-rw-r--r--include/svx/svdobj.hxx85
-rw-r--r--include/svx/svdocapt.hxx16
-rw-r--r--include/svx/svdocirc.hxx17
-rw-r--r--include/svx/svdoedge.hxx3
-rw-r--r--include/svx/svdograf.hxx16
-rw-r--r--include/svx/svdogrp.hxx2
-rw-r--r--include/svx/svdomeas.hxx7
-rw-r--r--include/svx/svdomedia.hxx8
-rw-r--r--include/svx/svdoole2.hxx11
-rw-r--r--include/svx/svdopage.hxx10
-rw-r--r--include/svx/svdopath.hxx10
-rw-r--r--include/svx/svdorect.hxx16
-rw-r--r--include/svx/svdotable.hxx10
-rw-r--r--include/svx/svdotext.hxx19
-rw-r--r--include/svx/svdouno.hxx12
-rw-r--r--include/svx/svdovirt.hxx5
-rw-r--r--include/svx/svdpage.hxx28
-rw-r--r--include/svx/svdpntv.hxx32
-rw-r--r--include/svx/svdpoev.hxx7
-rw-r--r--include/svx/svdsnpv.hxx7
-rw-r--r--include/svx/svdview.hxx7
-rw-r--r--include/svx/svdxcgv.hxx6
-rw-r--r--include/svx/unomod.hxx4
-rw-r--r--include/svx/unomodel.hxx15
-rw-r--r--include/svx/view3d.hxx5
-rw-r--r--reportdesign/inc/ReportDefinition.hxx4
-rw-r--r--reportdesign/inc/RptObject.hxx51
-rw-r--r--reportdesign/inc/RptPage.hxx2
-rw-r--r--reportdesign/source/core/api/ReportDefinition.cxx32
-rw-r--r--reportdesign/source/core/sdr/ReportDrawPage.cxx9
-rw-r--r--reportdesign/source/core/sdr/RptObject.cxx120
-rw-r--r--reportdesign/source/core/sdr/RptPage.cxx22
-rw-r--r--reportdesign/source/ui/inc/SectionView.hxx6
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx14
-rw-r--r--reportdesign/source/ui/report/ReportSection.cxx5
-rw-r--r--reportdesign/source/ui/report/SectionView.cxx8
-rw-r--r--reportdesign/source/ui/report/ViewsWindow.cxx6
-rw-r--r--reportdesign/source/ui/report/dlgedfac.cxx15
-rw-r--r--sc/inc/docuno.hxx3
-rw-r--r--sc/source/core/data/drawpage.cxx6
-rw-r--r--sc/source/core/data/postit.cxx6
-rw-r--r--sc/source/core/tool/detfunc.cxx23
-rw-r--r--sc/source/filter/excel/xiescher.cxx69
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx6
-rw-r--r--sc/source/ui/app/drwtrans.cxx10
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx7
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx9
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx7
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx7
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx7
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx11
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx18
-rw-r--r--sc/source/ui/drawfunc/futext.cxx7
-rw-r--r--sc/source/ui/inc/drawview.hxx7
-rw-r--r--sc/source/ui/navipi/content.cxx2
-rw-r--r--sc/source/ui/unoobj/TablePivotCharts.cxx7
-rw-r--r--sc/source/ui/unoobj/chartuno.cxx6
-rw-r--r--sc/source/ui/unoobj/docuno.cxx16
-rw-r--r--sc/source/ui/view/drawvie3.cxx6
-rw-r--r--sc/source/ui/view/gridwin4.cxx5
-rw-r--r--sc/source/ui/view/preview.cxx4
-rw-r--r--sc/source/ui/view/printfun.cxx5
-rw-r--r--sc/source/ui/view/tabvwshg.cxx8
-rw-r--r--sc/source/ui/view/viewfun7.cxx15
-rw-r--r--sd/inc/CustomAnimationEffect.hxx6
-rw-r--r--sd/source/core/CustomAnimationEffect.cxx4
-rw-r--r--sd/source/core/sdpage.cxx26
-rw-r--r--sd/source/filter/grf/sdgrffilter.cxx84
-rw-r--r--sd/source/filter/ppt/pptin.cxx4
-rw-r--r--sd/source/ui/animations/motionpathtag.cxx2
-rw-r--r--sd/source/ui/dlg/animobjs.cxx8
-rw-r--r--sd/source/ui/func/fucon3d.cxx34
-rw-r--r--sd/source/ui/func/fuconarc.cxx17
-rw-r--r--sd/source/ui/func/fuconbez.cxx7
-rw-r--r--sd/source/ui/func/fuconcs.cxx4
-rw-r--r--sd/source/ui/func/fuconrec.cxx13
-rw-r--r--sd/source/ui/func/fuconuno.cxx4
-rw-r--r--sd/source/ui/func/fuinsert.cxx13
-rw-r--r--sd/source/ui/func/fuinsfil.cxx4
-rw-r--r--sd/source/ui/func/fumorph.cxx7
-rw-r--r--sd/source/ui/func/futext.cxx8
-rw-r--r--sd/source/ui/inc/unomodel.hxx4
-rw-r--r--sd/source/ui/table/tablefunction.cxx12
-rw-r--r--sd/source/ui/unoidl/unomodel.cxx5
-rw-r--r--sd/source/ui/view/DocumentRenderer.cxx10
-rw-r--r--sd/source/ui/view/drawview.cxx15
-rw-r--r--sd/source/ui/view/drviews2.cxx12
-rw-r--r--sd/source/ui/view/drviews8.cxx5
-rw-r--r--sd/source/ui/view/drviews9.cxx5
-rw-r--r--sd/source/ui/view/drviewse.cxx13
-rw-r--r--sd/source/ui/view/frmview.cxx2
-rw-r--r--sd/source/ui/view/sdview.cxx9
-rw-r--r--sd/source/ui/view/sdview3.cxx12
-rw-r--r--sd/source/ui/view/sdview4.cxx20
-rw-r--r--svx/source/customshapes/EnhancedCustomShape2d.cxx16
-rw-r--r--svx/source/customshapes/EnhancedCustomShape3d.cxx21
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeEngine.cxx7
-rw-r--r--svx/source/customshapes/EnhancedCustomShapeFontWork.cxx6
-rw-r--r--svx/source/dialog/connctrl.cxx8
-rw-r--r--svx/source/dialog/contwnd.cxx5
-rw-r--r--svx/source/dialog/dlgctl3d.cxx10
-rw-r--r--svx/source/dialog/dlgctrl.cxx26
-rw-r--r--svx/source/dialog/graphctl.cxx2
-rw-r--r--svx/source/dialog/imapwnd.cxx34
-rw-r--r--svx/source/dialog/measctrl.cxx5
-rw-r--r--svx/source/engine3d/cube3d.cxx20
-rw-r--r--svx/source/engine3d/extrud3d.cxx23
-rw-r--r--svx/source/engine3d/lathe3d.cxx22
-rw-r--r--svx/source/engine3d/obj3d.cxx18
-rw-r--r--svx/source/engine3d/objfac3d.cxx19
-rw-r--r--svx/source/engine3d/polygn3d.cxx11
-rw-r--r--svx/source/engine3d/scene3d.cxx4
-rw-r--r--svx/source/engine3d/sphere3d.cxx30
-rw-r--r--svx/source/engine3d/view3d.cxx24
-rw-r--r--svx/source/form/fmdmod.cxx9
-rw-r--r--svx/source/form/fmdpage.cxx7
-rw-r--r--svx/source/form/fmobj.cxx21
-rw-r--r--svx/source/form/fmobjfac.cxx8
-rw-r--r--svx/source/form/fmpage.cxx8
-rw-r--r--svx/source/form/fmview.cxx8
-rw-r--r--svx/source/form/fmvwimp.cxx30
-rw-r--r--svx/source/gallery2/galobj.cxx2
-rw-r--r--svx/source/gallery2/galtheme.cxx4
-rw-r--r--svx/source/inc/fmobj.hxx7
-rw-r--r--svx/source/sdr/contact/viewcontactofgraphic.cxx2
-rw-r--r--svx/source/svdraw/svdcrtv.cxx10
-rw-r--r--svx/source/svdraw/svddrgv.cxx6
-rw-r--r--svx/source/svdraw/svdedtv.cxx7
-rw-r--r--svx/source/svdraw/svdedtv2.cxx27
-rw-r--r--svx/source/svdraw/svdedxv.cxx6
-rw-r--r--svx/source/svdraw/svdfmtf.cxx125
-rw-r--r--svx/source/svdraw/svdglev.cxx8
-rw-r--r--svx/source/svdraw/svdmrkv.cxx8
-rw-r--r--svx/source/svdraw/svdoashp.cxx4
-rw-r--r--svx/source/svdraw/svdoattr.cxx3
-rw-r--r--svx/source/svdraw/svdobj.cxx207
-rw-r--r--svx/source/svdraw/svdocapt.cxx16
-rw-r--r--svx/source/svdraw/svdocirc.cxx22
-rw-r--r--svx/source/svdraw/svdoedge.cxx4
-rw-r--r--svx/source/svdraw/svdograf.cxx59
-rw-r--r--svx/source/svdraw/svdogrp.cxx13
-rw-r--r--svx/source/svdraw/svdomeas.cxx41
-rw-r--r--svx/source/svdraw/svdomedia.cxx15
-rw-r--r--svx/source/svdraw/svdoole2.cxx21
-rw-r--r--svx/source/svdraw/svdopage.cxx16
-rw-r--r--svx/source/svdraw/svdopath.cxx15
-rw-r--r--svx/source/svdraw/svdorect.cxx24
-rw-r--r--svx/source/svdraw/svdotext.cxx28
-rw-r--r--svx/source/svdraw/svdotxtr.cxx19
-rw-r--r--svx/source/svdraw/svdouno.cxx49
-rw-r--r--svx/source/svdraw/svdovirt.cxx34
-rw-r--r--svx/source/svdraw/svdpage.cxx19
-rw-r--r--svx/source/svdraw/svdpntv.cxx11
-rw-r--r--svx/source/svdraw/svdpoev.cxx6
-rw-r--r--svx/source/svdraw/svdsnpv.cxx49
-rw-r--r--svx/source/svdraw/svdview.cxx8
-rw-r--r--svx/source/svdraw/svdxcgv.cxx24
-rw-r--r--svx/source/table/svdotable.cxx24
-rw-r--r--svx/source/unodraw/UnoGraphicExporter.cxx18
-rw-r--r--svx/source/unodraw/unomod.cxx22
-rw-r--r--svx/source/unodraw/unopage.cxx23
-rw-r--r--svx/source/unodraw/unoshape.cxx5
-rw-r--r--sw/inc/dcontact.hxx8
-rw-r--r--sw/inc/frmfmt.hxx2
-rw-r--r--sw/inc/unotxdoc.hxx3
-rw-r--r--sw/source/core/draw/dcontact.cxx44
-rw-r--r--sw/source/core/draw/dflyobj.cxx14
-rw-r--r--sw/source/core/draw/dobjfac.cxx2
-rw-r--r--sw/source/core/draw/dpage.cxx8
-rw-r--r--sw/source/core/draw/dview.cxx7
-rw-r--r--sw/source/core/frmedt/fecopy.cxx5
-rw-r--r--sw/source/core/frmedt/feshview.cxx7
-rw-r--r--sw/source/core/inc/dflyobj.hxx7
-rw-r--r--sw/source/core/inc/dview.hxx5
-rw-r--r--sw/source/core/layout/atrfrm.cxx6
-rw-r--r--sw/source/core/layout/paintfrm.cxx2
-rw-r--r--sw/source/core/view/viewimp.cxx5
-rw-r--r--sw/source/filter/html/htmldrawreader.cxx9
-rw-r--r--sw/source/filter/ww8/wrtw8esh.cxx2
-rw-r--r--sw/source/filter/ww8/wrtww8gr.cxx13
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx49
-rw-r--r--sw/source/filter/ww8/ww8par.cxx25
-rw-r--r--sw/source/filter/ww8/ww8par4.cxx16
-rw-r--r--sw/source/filter/xml/swxml.cxx6
-rw-r--r--sw/source/uibase/shells/grfshex.cxx4
-rw-r--r--sw/source/uibase/uno/unotxdoc.cxx6
223 files changed, 2264 insertions, 1156 deletions
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..26027c117a44 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 )
{
}
@@ -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..243154c7cd99 100644
--- a/basctl/source/dlged/dlgedpage.cxx
+++ b/basctl/source/dlged/dlgedpage.cxx
@@ -27,14 +27,14 @@ namespace basctl
DlgEdPage::DlgEdPage(DlgEdModel& rModel, bool bMasterPage)
- : SdrPage(rModel, bMasterPage)
- , pDlgEdForm(nullptr)
+: SdrPage(rModel, bMasterPage)
+ ,pDlgEdForm(nullptr)
{
}
DlgEdPage::DlgEdPage(const DlgEdPage& rSrcPage)
- : SdrPage(rSrcPage)
- , pDlgEdForm(nullptr)
+: SdrPage(rSrcPage)
+ ,pDlgEdForm(nullptr)
{
}
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..5bef190a4f08 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;
@@ -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/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/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..c1ee7778aa6e 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -516,7 +516,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..22f4b4e9e4a9 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -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/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 36fae228bc34..2d14613082d2 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/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index ac281e0bfdd1..dc6712625d13 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 );
@@ -4307,7 +4307,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,7 +4337,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 = new SdrPathObj(
+ *pSdrModel,
+ OBJ_LINE,
+ basegfx::B2DPolyPolygon(aPoly));
pRet->SetModel( pSdrModel );
ApplyAttributes( rSt, aSet, aObjData );
pRet->SetMergedItemSet(aSet);
@@ -4349,7 +4352,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
ApplyAttributes( rSt, aSet, aObjData );
- pRet = new SdrObjCustomShape();
+ pRet = new SdrObjCustomShape(*pSdrModel);
pRet->SetModel( pSdrModel );
sal_uInt32 ngtextFStrikethrough = GetPropertyValue( DFF_Prop_gtextFStrikethrough, 0 );
@@ -4735,7 +4738,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 +5238,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;
@@ -5397,7 +5403,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,7 +5419,9 @@ 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() );
@@ -6615,9 +6623,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 +7124,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 +7203,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 +7304,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..7e886b6ed479 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,7 +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 = new SdrRectObj(
+ *pSdrModel,
+ eTextKind != OBJ_RECT ? eTextKind : OBJ_TEXT);
pTObj->SetModel( pSdrModel );
SfxItemSet aSet( pSdrModel->GetItemPool() );
if ( !pRet )
@@ -1197,7 +1202,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 +1885,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 +1952,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);
}
}
}
@@ -3063,7 +3076,9 @@ SdrObject* SdrPowerPointImport::ImportPageBackgroundObject( const SdrPage& rPage
}
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 = new SdrRectObj(
+ *pSdrModel,
+ aRect);
pRet->SetModel( pSdrModel );
pRet->SetMergedItemSet(*pSet);
@@ -7572,7 +7587,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/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/cube3d.hxx b/include/svx/cube3d.hxx
index 4a74777e0cff..d78de43ba672 100644
--- a/include/svx/cube3d.hxx
+++ b/include/svx/cube3d.hxx
@@ -54,12 +54,15 @@ 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;
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/extrud3d.hxx b/include/svx/extrud3d.hxx
index 1b78d4547740..02065927efe3 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
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..dd4e9cdb626a 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
diff --git a/include/svx/obj3d.hxx b/include/svx/obj3d.hxx
index 87117cc5d203..36d9e61d75d7 100644
--- a/include/svx/obj3d.hxx
+++ b/include/svx/obj3d.hxx
@@ -78,7 +78,7 @@ public:
class E3dObjList final : public SdrObjList
{
public:
- E3dObjList();
+ E3dObjList(SdrModel& rSdrModel);
SVX_DLLPUBLIC virtual ~E3dObjList() override;
virtual void NbcInsertObject(SdrObject* pObj, size_t nPos=SAL_MAX_SIZE) override;
@@ -131,7 +131,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;
@@ -232,7 +232,7 @@ protected:
public:
- E3dCompoundObject();
+ E3dCompoundObject(SdrModel& rSdrModel);
virtual ~E3dCompoundObject() override;
virtual basegfx::B2DPolyPolygon TakeXorPoly() const override;
diff --git a/include/svx/polygn3d.hxx b/include/svx/polygn3d.hxx
index 98778dd493e3..68bc22260092 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; }
diff --git a/include/svx/scene3d.hxx b/include/svx/scene3d.hxx
index b6562093a6f1..e4ca3e4a779c 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;
virtual void SetBoundRectDirty() override;
diff --git a/include/svx/sphere3d.hxx b/include/svx/sphere3d.hxx
index 9c4bc5d21468..b26c5dc881aa 100644
--- a/include/svx/sphere3d.hxx
+++ b/include/svx/sphere3d.hxx
@@ -35,16 +35,19 @@ private:
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
- void SetDefaultAttributes(E3dDefaultAttributes& rDefault);
+ void SetDefaultAttributes(const E3dDefaultAttributes& rDefault);
public:
- E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize);
+ E3dSphereObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint& rCenter,
+ const basegfx::B3DVector& r3DSize);
// FG: This constructor is only called from MakeObject from the 3d-Objectfactory
// when a document with a sphere is loaded. This constructor does not call
// CreateSphere, or create any spheres.
- enum Dummy { DUMMY };
- E3dSphereObj(Dummy dummy);
+ E3dSphereObj(SdrModel& rSdrModel);
// horizontal segments:
sal_uInt32 GetHorizontalSegments() const
diff --git a/include/svx/svdcrtv.hxx b/include/svx/svdcrtv.hxx
index 3b71a5088510..47858b29cf4e 100644
--- a/include/svx/svdcrtv.hxx
+++ b/include/svx/svdcrtv.hxx
@@ -31,7 +31,7 @@ class SdrObjConnection;
class ImplConnectMarkerOverlay;
class ImpSdrCreateViewExtraData;
-class SVX_DLLPUBLIC SdrCreateView: public SdrDragView
+class SVX_DLLPUBLIC SdrCreateView : public SdrDragView
{
friend class SdrPageView;
@@ -69,7 +69,10 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrCreateView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrCreateView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrCreateView() override;
public:
diff --git a/include/svx/svddrgv.hxx b/include/svx/svddrgv.hxx
index 19b56414e9b0..180d8cc09269 100644
--- a/include/svx/svddrgv.hxx
+++ b/include/svx/svddrgv.hxx
@@ -25,7 +25,7 @@
class SdrUndoGeoObj;
-class SVX_DLLPUBLIC SdrDragView: public SdrExchangeView
+class SVX_DLLPUBLIC SdrDragView : public SdrExchangeView
{
friend class SdrPageView;
friend class SdrDragMethod;
@@ -69,7 +69,10 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrDragView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrDragView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrDragView() override;
public:
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 0c1e2f6a9dc1..51dbb4872e51 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -68,7 +68,7 @@ namespace o3tl
template<> struct typed_flags<SdrInsertFlags> : is_typed_flags<SdrInsertFlags, 0x1f> {};
}
-class SVX_DLLPUBLIC SdrEditView: public SdrMarkView
+class SVX_DLLPUBLIC SdrEditView : public SdrMarkView
{
friend class SdrPageView;
friend class SdrDragDistort;
@@ -163,7 +163,10 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrEditView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrEditView() override;
public:
diff --git a/include/svx/svdedxv.hxx b/include/svx/svdedxv.hxx
index 2c8710a90af0..97abbc9e2d93 100644
--- a/include/svx/svdedxv.hxx
+++ b/include/svx/svdedxv.hxx
@@ -58,7 +58,7 @@ enum class SdrEndTextEditKind
// - macromod
-class SVX_DLLPUBLIC SdrObjEditView: public SdrGlueEditView, public EditViewCallbacks
+class SVX_DLLPUBLIC SdrObjEditView : public SdrGlueEditView, public EditViewCallbacks
{
friend class SdrPageView;
friend class ImpSdrEditPara;
@@ -150,7 +150,10 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrObjEditView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrObjEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrObjEditView() override;
public:
diff --git a/include/svx/svdglev.hxx b/include/svx/svdglev.hxx
index 10645f0a5aaa..be365e368c7e 100644
--- a/include/svx/svdglev.hxx
+++ b/include/svx/svdglev.hxx
@@ -29,7 +29,7 @@ class SdrGluePoint;
// Edit GluePoints at the objects (GluePoints for connector)
-class SVX_DLLPUBLIC SdrGlueEditView: public SdrPolyEditView
+class SVX_DLLPUBLIC SdrGlueEditView : public SdrPolyEditView
{
// copy marked GluePoints and mark instead of the old ones
void ImpCopyMarkedGluePoints();
@@ -40,7 +40,10 @@ class SVX_DLLPUBLIC SdrGlueEditView: public SdrPolyEditView
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrGlueEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrGlueEditView() override;
public:
diff --git a/include/svx/svdmrkv.hxx b/include/svx/svdmrkv.hxx
index 981b1e29e5d1..36e80416087b 100644
--- a/include/svx/svdmrkv.hxx
+++ b/include/svx/svdmrkv.hxx
@@ -166,7 +166,10 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrMarkView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrMarkView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrMarkView() override;
public:
diff --git a/include/svx/svdoashp.hxx b/include/svx/svdoashp.hxx
index 85f5e9dc68ca..9e60509c8f54 100644
--- a/include/svx/svdoashp.hxx
+++ b/include/svx/svdoashp.hxx
@@ -98,15 +98,8 @@ public:
css::uno::Reference< css::drawing::XCustomShapeEngine > const & GetCustomShapeEngine() const;
-// SVX_DLLPRIVATE css::uno::Sequence< css::uno::Reference< css::drawing::XCustomShapeHandle > >
-// SdrObjCustomShape::GetInteraction( const SdrObjCustomShape* pCustomShape ) const;
-// #i47293#
-// SVX_DLLPRIVATE std::vector< css::uno::Reference< css::drawing::XCustomShapeHandle > > GetFixedInteractionHandle() const;
-
SVX_DLLPRIVATE std::vector< SdrCustomShapeInteraction > GetInteractionHandles() const;
-
SVX_DLLPRIVATE void DragCreateObject( SdrDragStat& rDrag );
-
SVX_DLLPRIVATE void DragResizeCustomShape( const tools::Rectangle& rNewRect );
SVX_DLLPRIVATE void DragMoveCustomShapeHdl( const Point& rDestination,
const sal_uInt16 nCustomShapeHdlNum, bool bMoveCalloutRectangle );
@@ -147,7 +140,7 @@ public:
double GetObjectRotation() const { return fObjectRotation;}
double GetExtraTextRotation( const bool bPreRotation = false ) const;
- SdrObjCustomShape();
+ SdrObjCustomShape(SdrModel& rSdrModel);
virtual ~SdrObjCustomShape() override;
/* is merging default attributes from type-shape into the SdrCustomShapeGeometryItem. If pType
diff --git a/include/svx/svdoattr.hxx b/include/svx/svdoattr.hxx
index 10c163b3b9b0..dceb694adc61 100644
--- a/include/svx/svdoattr.hxx
+++ b/include/svx/svdoattr.hxx
@@ -59,7 +59,7 @@ protected:
/// Detects when a stylesheet is changed
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
- SdrAttrObj();
+ SdrAttrObj(SdrModel& rSdrModel);
virtual ~SdrAttrObj() override;
public:
diff --git a/include/svx/svdobj.hxx b/include/svx/svdobj.hxx
index 3f01cbb82ff6..bd65d70d554b 100644
--- a/include/svx/svdobj.hxx
+++ b/include/svx/svdobj.hxx
@@ -74,10 +74,11 @@ class SdrLayerIDSet;
class OutputDevice;
class Fraction;
-namespace basegfx {
-class B2DPoint;
-class B2DPolyPolygon;
-class B2DHomMatrix;
+namespace basegfx
+{
+ class B2DPoint;
+ class B2DPolyPolygon;
+ class B2DHomMatrix;
}
namespace sdr
@@ -103,6 +104,8 @@ namespace svx
class PropertyChangeNotifier;
}
+class SvxShape;
+
enum SdrObjKind {
OBJ_NONE = 0, /// abstract object (SdrObject)
OBJ_GRUP = 1, /// object group
@@ -265,9 +268,45 @@ public:
SdrObjTransformInfoRec();
};
-/// Abstract DrawObject
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// SdrObject
+// SdrAttrObj
+// E3dObject
+// E3dCompoundObject
+// E3dCubeObj
+// E3dExtrudeObj
+// E3dLatheObj
+// E3dPolygonObj
+// E3dSphereObj
+// E3dScene
+// SdrTextObj
+// SdrObjCustomShape
+// OCustomShape
+// SdrEdgeObj
+// SdrMeasureObj
+// SdrPathObj
+// SdrRectObj
+// SdrCaptionObj
+// SdrCircObj
+// SdrGrafObj
+// SdrMediaObj
+// SdrOle2Obj
+// OOle2Obj
+// SdrUnoObj
+// DlgEdObj
+// DlgEdForm
+// OUnoObject
+// FmFormObj
+// SdrTableObj
+// SdrObjGroup
+// SdrPageObj
+// SdrVirtObj
+// SwDrawVirtObj
+// SwVirtFlyDrawObj
+// SwFlyDrawObj
-class SvxShape;
+/// Abstract DrawObject
class SVX_DLLPUBLIC SdrObject: public SfxListener, public virtual tools::WeakBase
{
private:
@@ -295,9 +334,16 @@ private:
void setFillGeometryDefiningShape(const SdrObject* pNew) { mpFillGeometryDefiningShape = pNew; }
public:
const SdrObject* getFillGeometryDefiningShape() const { return mpFillGeometryDefiningShape; }
+private:
+ // the SdrModel this objects was created with, unchanged during SdrObject lifetime
+ SdrModel& mrSdrModelFromSdrObject;
public:
- SdrObject();
+ // A SdrObject always needs a SdrModel for lifetime (Pool, ...)
+ SdrObject(SdrModel& rSdrModel);
+
+ // SdrModel access on SdrObject level
+ SdrModel& getSdrModelFromSdrObject() const { return mrSdrModelFromSdrObject; }
void AddObjectUser(sdr::ObjectUser& rNewUser);
void RemoveObjectUser(sdr::ObjectUser& rOldUser);
@@ -724,7 +770,9 @@ public:
// when there is no filled new polygon created from line-to-polygon conversion,
// specially used for XLINE_DASH and 3D conversion
SdrObject* ConvertToContourObj(SdrObject* pRet, bool bForceLineDash = false) const;
- static SdrObject* ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash);
+private:
+ SdrObject* ImpConvertToContourObj(bool bForceLineDash);
+public:
// if true, reference onto an object
bool IsVirtualObj() const { return bVirtObj;}
@@ -1006,6 +1054,7 @@ struct SdrObjCreatorParams
{
SdrInventor nInventor;
sal_uInt16 nObjIdentifier;
+ SdrModel& rSdrModel;
};
/**
@@ -1019,13 +1068,25 @@ struct SdrObjCreatorParams
class SVX_DLLPUBLIC SdrObjFactory
{
public:
- static SdrObject* MakeNewObject(SdrInventor nInventor, sal_uInt16 nObjIdentifier, SdrPage* pPage, SdrModel* pModel=nullptr);
- static SdrObject* MakeNewObject(SdrInventor nInventor, sal_uInt16 nObjIdentifier, const tools::Rectangle& rSnapRect, SdrPage* pPage);
+ static SdrObject* MakeNewObject(
+ SdrModel& rSdrModel, // TTTT check usages, may be better to put to a class
+ SdrInventor nInventor,
+ sal_uInt16 nObjIdentifier,
+ SdrPage* pPage,
+ SdrModel* pModel=nullptr);
+
+ static SdrObject* MakeNewObject(
+ SdrModel& rSdrModel,
+ SdrInventor nInventor,
+ sal_uInt16 nObjIdentifier,
+ const tools::Rectangle& rSnapRect,
+ SdrPage* pPage);
+
static void InsertMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> const & rLink);
static void RemoveMakeObjectHdl(Link<SdrObjCreatorParams, SdrObject*> const & rLink);
private:
- static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory( SdrInventor nInventor, sal_uInt16 nIdentifier );
+ static SVX_DLLPRIVATE SdrObject* CreateObjectFromFactory(SdrModel& rSdrModel, SdrInventor nInventor, sal_uInt16 nIdentifier);
SdrObjFactory() = delete;
};
@@ -1033,7 +1094,7 @@ private:
template< typename T > T* SdrObject::CloneHelper() const
{
OSL_ASSERT( typeid( T ) == typeid( *this ));
- T* pObj = dynamic_cast< T* >( SdrObjFactory::MakeNewObject(GetObjInventor(),GetObjIdentifier(),nullptr));
+ T* pObj = dynamic_cast< T* >(SdrObjFactory::MakeNewObject(getSdrModelFromSdrObject(), GetObjInventor(), GetObjIdentifier(), nullptr));
if (pObj!=nullptr)
*pObj=*static_cast< const T* >( this );
return pObj;
diff --git a/include/svx/svdocapt.hxx b/include/svx/svdocapt.hxx
index 3dd68293708a..078c51fc7741 100644
--- a/include/svx/svdocapt.hxx
+++ b/include/svx/svdocapt.hxx
@@ -25,28 +25,20 @@
// Forward Declarations
-
-
class ImpCaptParams;
namespace sdr { namespace properties {
class CaptionProperties;
}}
-
// Helper Class SdrCaptObjGeoData
-
-
class SdrCaptObjGeoData : public SdrTextObjGeoData
{
public:
tools::Polygon aTailPoly;
};
-
// SdrCaptionObj
-
-
class SVX_DLLPUBLIC SdrCaptionObj : public SdrRectObj
{
private:
@@ -73,8 +65,12 @@ private:
SVX_DLLPRIVATE void ImpRecalcTail();
public:
- SdrCaptionObj();
- SdrCaptionObj(const tools::Rectangle& rRect, const Point& rTail);
+ SdrCaptionObj(SdrModel& rSdrModel);
+ SdrCaptionObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect,
+ const Point& rTail);
+
virtual ~SdrCaptionObj() override;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
diff --git a/include/svx/svdocirc.hxx b/include/svx/svdocirc.hxx
index d3bc9c2116f5..56028e49a370 100644
--- a/include/svx/svdocirc.hxx
+++ b/include/svx/svdocirc.hxx
@@ -66,14 +66,25 @@ private:
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
public:
- SdrCircObj(SdrObjKind eNewKind); // Circ, CArc, Sect or CCut
- SdrCircObj(SdrObjKind eNewKind, const tools::Rectangle& rRect);
+ SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind); // Circ, CArc, Sect or CCut
+ SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind,
+ const tools::Rectangle& rRect);
// 0=0.00Deg=3h 9000=90.00Deg=12h 18000=180.00Deg=9h 27000=270.00Deg=6h
// The circle is build up from StartAngle to EndWink anti-clockwise.
// If nNewStartAngle==nNewEndWink, then arc has an angle of 0 degrees.
// If nNewStartAngle+36000==nNewEndWink, then the arc has angle of 360 degrees.
- SdrCircObj(SdrObjKind eNewKind, const tools::Rectangle& rRect, long nNewStartAngle, long nNewEndWink);
+ SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind,
+ const tools::Rectangle& rRect,
+ long nNewStartAngle,
+ long nNewEndWink);
+
virtual ~SdrCircObj() override;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
diff --git a/include/svx/svdoedge.hxx b/include/svx/svdoedge.hxx
index 5b11da0feaef..94e02d167872 100644
--- a/include/svx/svdoedge.hxx
+++ b/include/svx/svdoedge.hxx
@@ -187,8 +187,7 @@ protected:
void ImpSetEdgeInfoToAttr(); // copying values from the aEdgeInfo to the pool
public:
-
- SdrEdgeObj();
+ SdrEdgeObj(SdrModel& rSdrModel);
virtual ~SdrEdgeObj() override;
SdrObjConnection& GetConnection(bool bTail1) { return *(bTail1 ? &aCon1 : &aCon2); }
diff --git a/include/svx/svdograf.hxx b/include/svx/svdograf.hxx
index 65b934847489..7d7e0cbe0854 100644
--- a/include/svx/svdograf.hxx
+++ b/include/svx/svdograf.hxx
@@ -129,10 +129,16 @@ private:
public:
- SdrGrafObj();
- SdrGrafObj(const Graphic& rGrf);
- SdrGrafObj(const Graphic& rGrf, const tools::Rectangle& rRect);
- virtual ~SdrGrafObj() override;
+ SdrGrafObj(SdrModel& rSdrModel);
+ SdrGrafObj(
+ SdrModel& rSdrModel,
+ const Graphic& rGrf);
+ SdrGrafObj(
+ SdrModel& rSdrModel,
+ const Graphic& rGrf,
+ const tools::Rectangle& rRect);
+
+ virtual ~SdrGrafObj() override;
void SetGraphicObject( const GraphicObject& rGrfObj );
const GraphicObject& GetGraphicObject(bool bForceSwapIn = false) const;
@@ -143,9 +149,7 @@ public:
const Graphic& GetGraphic() const;
Graphic GetTransformedGraphic( SdrGrafObjTransformsAttrs nTransformFlags = SdrGrafObjTransformsAttrs::ALL ) const;
-
GraphicType GetGraphicType() const;
-
GraphicAttr GetGraphicAttr( SdrGrafObjTransformsAttrs nTransformFlags = SdrGrafObjTransformsAttrs::ALL ) const;
// Keep ATM for SD.
diff --git a/include/svx/svdogrp.hxx b/include/svx/svdogrp.hxx
index f15a9b92fb47..068a14ecdb1b 100644
--- a/include/svx/svdogrp.hxx
+++ b/include/svx/svdogrp.hxx
@@ -46,7 +46,7 @@ private:
Point aRefPoint; // Reference point inside the object group
public:
- SdrObjGroup();
+ SdrObjGroup(SdrModel& rSdrModel);
virtual ~SdrObjGroup() override;
virtual void SetBoundRectDirty() override;
diff --git a/include/svx/svdomeas.hxx b/include/svx/svdomeas.hxx
index be2ce849890b..1f6aa000806a 100644
--- a/include/svx/svdomeas.hxx
+++ b/include/svx/svdomeas.hxx
@@ -85,8 +85,11 @@ protected:
virtual void RestGeoData(const SdrObjGeoData& rGeo) override;
public:
- SdrMeasureObj();
- SdrMeasureObj(const Point& rPt1, const Point& rPt2);
+ SdrMeasureObj(SdrModel& rSdrModel);
+ SdrMeasureObj(
+ SdrModel& rSdrModel,
+ const Point& rPt1,
+ const Point& rPt2);
virtual ~SdrMeasureObj() override;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
diff --git a/include/svx/svdomedia.hxx b/include/svx/svdomedia.hxx
index 43356da4e302..c4aafc46cce8 100644
--- a/include/svx/svdomedia.hxx
+++ b/include/svx/svdomedia.hxx
@@ -37,10 +37,12 @@ class SVX_DLLPUBLIC SdrMediaObj final : public SdrRectObj
public:
- SdrMediaObj();
- SdrMediaObj( const tools::Rectangle& rRect );
+ SdrMediaObj(SdrModel& rSdrModel);
+ SdrMediaObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect);
- virtual ~SdrMediaObj() override;
+ virtual ~SdrMediaObj() override;
virtual bool HasTextEdit() const override;
diff --git a/include/svx/svdoole2.hxx b/include/svx/svdoole2.hxx
index edeccfa5984a..7e9241d5a660 100644
--- a/include/svx/svdoole2.hxx
+++ b/include/svx/svdoole2.hxx
@@ -67,8 +67,15 @@ protected:
public:
OUString GetStyleString();
- SdrOle2Obj( bool bFrame_ = false );
- SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const OUString& rNewObjName, const tools::Rectangle& rNewRect );
+ SdrOle2Obj(
+ SdrModel& rSdrModel,
+ bool bFrame_ = false);
+ SdrOle2Obj(
+ SdrModel& rSdrModel,
+ const svt::EmbeddedObjectRef& rNewObjRef,
+ const OUString& rNewObjName,
+ const tools::Rectangle& rNewRect);
+
virtual ~SdrOle2Obj() override;
const svt::EmbeddedObjectRef& getEmbeddedObjectRef() const;
diff --git a/include/svx/svdopage.hxx b/include/svx/svdopage.hxx
index 8893e812d783..7e0bc3aa7f34 100644
--- a/include/svx/svdopage.hxx
+++ b/include/svx/svdopage.hxx
@@ -41,8 +41,14 @@ protected:
virtual sdr::properties::BaseProperties* CreateObjectSpecificProperties() override;
public:
- SdrPageObj(SdrPage* pNewPage = nullptr);
- SdrPageObj(const tools::Rectangle& rRect, SdrPage* pNewPage = nullptr);
+ SdrPageObj(
+ SdrModel& rSdrModel,
+ SdrPage* pNewPage = nullptr);
+ SdrPageObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect,
+ SdrPage* pNewPage = nullptr);
+
virtual ~SdrPageObj() override;
SdrPage* GetReferencedPage() const { return mpShownPage;}
diff --git a/include/svx/svdopath.hxx b/include/svx/svdopath.hxx
index e32ccf5116df..77e2752f3866 100644
--- a/include/svx/svdopath.hxx
+++ b/include/svx/svdopath.hxx
@@ -62,8 +62,14 @@ private:
ImpPathForDragAndCreate& impGetDAC() const;
public:
- SdrPathObj(SdrObjKind eNewKind);
- SdrPathObj(SdrObjKind eNewKind, const basegfx::B2DPolyPolygon& rPathPoly);
+ SdrPathObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind);
+ SdrPathObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind,
+ const basegfx::B2DPolyPolygon& rPathPoly);
+
virtual ~SdrPathObj() override;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
diff --git a/include/svx/svdorect.hxx b/include/svx/svdorect.hxx
index 729d3f221a05..665ccfeba885 100644
--- a/include/svx/svdorect.hxx
+++ b/include/svx/svdorect.hxx
@@ -66,14 +66,22 @@ public:
*
* Constructor of a rectangular drawing object
*/
- SdrRectObj();
- SdrRectObj(const tools::Rectangle& rRect);
+ SdrRectObj(SdrModel& rSdrModel);
+ SdrRectObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect);
SdrRectObj& operator=(const SdrRectObj& rCopy);
// Constructor of a text frame
- SdrRectObj(SdrObjKind eNewTextKind);
- SdrRectObj(SdrObjKind eNewTextKind, const tools::Rectangle& rRect);
+ SdrRectObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind);
+ SdrRectObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind,
+ const tools::Rectangle& rRect);
+
virtual ~SdrRectObj() override;
virtual void TakeObjInfo(SdrObjTransformInfoRec& rInfo) const override;
diff --git a/include/svx/svdotable.hxx b/include/svx/svdotable.hxx
index c33551cccac7..29923b5f5160 100644
--- a/include/svx/svdotable.hxx
+++ b/include/svx/svdotable.hxx
@@ -98,10 +98,14 @@ class SVX_DLLPUBLIC SdrTableObj : public ::SdrTextObj
friend class SdrTableObjImpl;
public:
- SdrTableObj(SdrModel* _pModel);
- SdrTableObj(SdrModel* _pModel, const ::tools::Rectangle& rNewRect, sal_Int32 nColumns, sal_Int32 nRows);
- virtual ~SdrTableObj() override;
+ SdrTableObj(SdrModel& rSdrModel);
+ SdrTableObj(
+ SdrModel& rSdrModel,
+ const ::tools::Rectangle& rNewRect,
+ sal_Int32 nColumns,
+ sal_Int32 nRows);
+ virtual ~SdrTableObj() override;
// Table stuff
SdrTableObj* CloneRange( const CellPos& rStartPos, const CellPos& rEndPos );
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 277f51ebba2c..9acaf3e2f119 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -136,16 +136,13 @@ class SVX_DLLPUBLIC SdrTextObj : public SdrAttrObj, public svx::ITextProvider
{
private:
// Cell needs access to ImpGetDrawOutliner();
-
friend class sdr::table::Cell;
friend class sdr::table::SdrTableRtfExporter;
friend class sdr::table::SdrTableRTFParser;
-
friend class TextChain;
friend class TextChainFlow;
friend class EditingTextChainFlow;
-
// CustomShapeproperties need to access the "bTextFrame" member:
friend class sdr::properties::CustomShapeProperties;
@@ -272,7 +269,6 @@ private:
SVX_DLLPRIVATE void ImpRegisterLink();
SVX_DLLPRIVATE void ImpDeregisterLink();
SVX_DLLPRIVATE ImpSdrObjTextLinkUserData* GetLinkUserData() const;
-// void ImpCheckItemSetChanges(const SfxItemSet& rAttr);
/** Appends the style family to a provided style name */
static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily family);
@@ -306,12 +302,19 @@ protected:
virtual void AdaptTextMinSize();
// constructors for labeled graphical objects
- SdrTextObj();
- SdrTextObj(const tools::Rectangle& rNewRect);
+ SdrTextObj(SdrModel& rSdrModel);
+ SdrTextObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rNewRect);
// constructors for text frames
- SdrTextObj(SdrObjKind eNewTextKind);
- SdrTextObj(SdrObjKind eNewTextKind, const tools::Rectangle& rNewRect);
+ SdrTextObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind);
+ SdrTextObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind,
+ const tools::Rectangle& rNewRect);
virtual ~SdrTextObj() override;
diff --git a/include/svx/svdouno.hxx b/include/svx/svdouno.hxx
index 48098ae65b37..161c52c6d05c 100644
--- a/include/svx/svdouno.hxx
+++ b/include/svx/svdouno.hxx
@@ -61,8 +61,12 @@ private:
public:
- explicit SdrUnoObj(const OUString& rModelName);
- SdrUnoObj(const OUString& rModelName,
+ explicit SdrUnoObj(
+ SdrModel& rSdrModel,
+ const OUString& rModelName);
+ SdrUnoObj(
+ SdrModel& rSdrModel,
+ const OUString& rModelName,
const css::uno::Reference< css::lang::XMultiServiceFactory >& rxSFac);
virtual ~SdrUnoObj() override;
@@ -77,10 +81,6 @@ public:
// SpecialDrag support
virtual bool hasSpecialDrag() const override;
- // FullDrag support
- virtual bool supportsFullDrag() const override;
- virtual SdrObject* getFullDragClone() const override;
-
virtual OUString TakeObjNameSingul() const override;
virtual OUString TakeObjNamePlural() const override;
diff --git a/include/svx/svdovirt.hxx b/include/svx/svdovirt.hxx
index c6d626e1305f..791a2d1fa275 100644
--- a/include/svx/svdovirt.hxx
+++ b/include/svx/svdovirt.hxx
@@ -47,8 +47,11 @@ protected:
virtual void RestGeoData(const SdrObjGeoData& rGeo) override;
public:
- SdrVirtObj(SdrObject& rNewObj);
+ SdrVirtObj(
+ SdrModel& rSdrModel,
+ SdrObject& rNewObj);
virtual ~SdrVirtObj() override;
+
SdrObject& ReferencedObj();
const SdrObject& GetReferencedObj() const;
virtual void NbcSetAnchorPos(const Point& rAnchorPos) override;
diff --git a/include/svx/svdpage.hxx b/include/svx/svdpage.hxx
index 1a7fdb59a7fa..cbf3032baddd 100644
--- a/include/svx/svdpage.hxx
+++ b/include/svx/svdpage.hxx
@@ -53,15 +53,30 @@ class Color;
class SfxStyleSheet;
class SvxUnoDrawPagesAccess;
-// class SdrObjList
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// SdrObjList
+// E3dObjList
+// SdrPage
+// DlgEdPage
+// FmFormPage
+// ScDrawPage
+// SdPage
+// SwDPage
+// OReportPage
+// class SdrObjList
class SVX_DLLPUBLIC SdrObjList
{
SdrObjList(const SdrObjList& rSrcList) = delete;
SdrObjList &operator=(const SdrObjList& rSrcList) = delete;
private:
- ::std::vector<SdrObject*> maList;
+ // the SdrModel this objects was created with, unchanged during SdrObjList lifetime
+ SdrModel& mrSdrModelFromSdrObjList;
+
+private:
+ ::std::vector<SdrObject*> maList;
protected:
friend class SdrObjListIter;
@@ -78,16 +93,21 @@ friend class SdrEditView;
protected:
void RecalcRects();
- SdrObjList();
+ SdrObjList(SdrModel& rSdrModel);
void lateInit(const SdrObjList& rSrcList);
private:
/// simple ActionChildInserted forwarder to have it on a central place
static void impChildInserted(SdrObject const & rChild);
public:
- SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage);
+ SdrObjList(SdrModel& rSdrModel, SdrPage* pNewPage);
virtual ~SdrObjList();
+ virtual SdrObjList* Clone() const;
+
+ // SdrModel access on SdrObjList level
+ SdrModel& getSdrModelFromSdrObjList() const { return mrSdrModelFromSdrObjList; }
+
void CopyObjects(const SdrObjList& rSrcList);
/// clean up everything (without Undo)
void Clear();
diff --git a/include/svx/svdpntv.hxx b/include/svx/svdpntv.hxx
index eb48416af426..2405ad9ca4b5 100644
--- a/include/svx/svdpntv.hxx
+++ b/include/svx/svdpntv.hxx
@@ -100,12 +100,39 @@ BitmapEx SVX_DLLPUBLIC convertMetafileToBitmapEx(
const basegfx::B2DRange& rTargetRange,
const sal_uInt32 nMaximumQuadraticPixels);
+////////////////////////////////////////////////////////////////////////////////////////////////////
+//
+// SdrPaintView
+// SdrSnapView
+// SdrMarkView
+// SdrEditView
+// SdrPolyEditView
+// SdrGlueEditView
+// SdrObjEditView
+// SdrExchangeView
+// SdrDragView
+// SdrCreateView
+// SdrView
+// DlgEdView
+// GraphCtrlView
+// E3dView
+// DrawViewWrapper
+// FmFormView
+// ScDrawView
+// sd::View (may have more?)
+// sd::DrawView
+// SwDrawView
+// OSectionView
class SVX_DLLPUBLIC SdrPaintView : public SfxListener, public SfxRepeatTarget, public SfxBroadcaster, public ::utl::ConfigurationListener
{
+private:
friend class SdrPageView;
friend class SdrGrafObj;
+ // the SdrModel this view was created with, unchanged during lifetime
+ SdrModel& mrSdrModelFromSdrView;
+
SdrPageView* mpPageView;
protected:
SdrModel* mpModel;
@@ -238,10 +265,13 @@ protected:
virtual void ModelHasChanged();
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrPaintView(SdrModel* pModel1, OutputDevice* pOut);
+ // A SdrView always needs a SdrModel for lifetime (Pool, ...)
+ SdrPaintView(SdrModel& rSdrModel, OutputDevice* pOut);
virtual ~SdrPaintView() override;
public:
+ // SdrModel access on SdrView level
+ SdrModel& getSdrModelFromSdrView() const { return mrSdrModelFromSdrView; }
virtual void ClearPageView();
SdrModel* GetModel() const { return mpModel; }
diff --git a/include/svx/svdpoev.hxx b/include/svx/svdpoev.hxx
index c7a33bac1683..187eadd4ca12 100644
--- a/include/svx/svdpoev.hxx
+++ b/include/svx/svdpoev.hxx
@@ -25,7 +25,7 @@
#include <svx/ipolypolygoneditorcontroller.hxx>
-class SVX_DLLPUBLIC SdrPolyEditView: public SdrEditView, public IPolyPolygonEditorController
+class SVX_DLLPUBLIC SdrPolyEditView : public SdrEditView, public IPolyPolygonEditorController
{
friend class SdrEditView;
@@ -45,7 +45,10 @@ private:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrPolyEditView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrPolyEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrPolyEditView() override;
public:
diff --git a/include/svx/svdsnpv.hxx b/include/svx/svdsnpv.hxx
index a90bdf34d392..0a40c9ac59ac 100644
--- a/include/svx/svdsnpv.hxx
+++ b/include/svx/svdsnpv.hxx
@@ -90,7 +90,7 @@ enum class SdrCrookMode {
// #114409#-1 Migrate PageOrigin
class ImplPageOriginOverlay;
-class SVX_DLLPUBLIC SdrSnapView: public SdrPaintView
+class SVX_DLLPUBLIC SdrSnapView : public SdrPaintView
{
protected:
// #114409#-1 Migrate PageOrigin
@@ -127,7 +127,10 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrSnapView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrSnapView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~SdrSnapView() override;
public:
diff --git a/include/svx/svdview.hxx b/include/svx/svdview.hxx
index e9d0f51aa476..2bab7eaed548 100644
--- a/include/svx/svdview.hxx
+++ b/include/svx/svdview.hxx
@@ -144,7 +144,7 @@ public:
};
-class SVX_DLLPUBLIC SdrView: public SdrCreateView, public virtual tools::WeakBase
+class SVX_DLLPUBLIC SdrView : public SdrCreateView, public virtual tools::WeakBase
{
friend class SdrPageView;
@@ -156,7 +156,10 @@ protected:
SvtAccessibilityOptions maAccessibilityOptions;
public:
- explicit SdrView(SdrModel* pModel1, OutputDevice* pOut = nullptr);
+ explicit SdrView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut = nullptr);
+
virtual ~SdrView() override;
// The default value for all dispatchers is activated. If the app for example
diff --git a/include/svx/svdxcgv.hxx b/include/svx/svdxcgv.hxx
index 8c4deca123b9..4625d83d0817 100644
--- a/include/svx/svdxcgv.hxx
+++ b/include/svx/svdxcgv.hxx
@@ -25,7 +25,7 @@
#include <vcl/gdimtf.hxx>
#include <svx/svxdllapi.h>
-class SVX_DLLPUBLIC SdrExchangeView: public SdrObjEditView
+class SVX_DLLPUBLIC SdrExchangeView : public SdrObjEditView
{
friend class SdrPageView;
@@ -40,7 +40,9 @@ protected:
protected:
// #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView
- SdrExchangeView(SdrModel* pModel1, OutputDevice* pOut);
+ SdrExchangeView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
public:
// Output all marked objects on the specified OutputDevice
diff --git a/include/svx/unomod.hxx b/include/svx/unomod.hxx
index 630c51ce52e4..04571c9071b2 100644
--- a/include/svx/unomod.hxx
+++ b/include/svx/unomod.hxx
@@ -32,6 +32,10 @@ SVX_DLLPUBLIC css::uno::Reference< css::container::XIndexReplace > SvxCreateNumR
class SVX_DLLPUBLIC SvxUnoDrawMSFactory : public css::lang::XMultiServiceFactory
{
+protected:
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModelFromUnoModel() const = 0; //TTTT make reference return
+
public:
SvxUnoDrawMSFactory() throw() {};
diff --git a/include/svx/unomodel.hxx b/include/svx/unomodel.hxx
index ab9ab9ed2cec..7f8a27a20f2b 100644
--- a/include/svx/unomodel.hxx
+++ b/include/svx/unomodel.hxx
@@ -31,11 +31,12 @@
class SdrModel;
-class SVX_DLLPUBLIC SvxUnoDrawingModel : public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other
- public SvxFmMSFactory,
- public css::drawing::XDrawPagesSupplier,
- public css::lang::XServiceInfo,
- public css::ucb::XAnyCompareFactory
+class SVX_DLLPUBLIC SvxUnoDrawingModel
+: public SfxBaseModel, // implements SfxListener, OWEAKOBJECT & other
+ public SvxFmMSFactory,
+ public css::drawing::XDrawPagesSupplier,
+ public css::lang::XServiceInfo,
+ public css::ucb::XAnyCompareFactory
{
friend class SvxUnoDrawPagesAccess;
@@ -53,6 +54,10 @@ private:
css::uno::Sequence< css::uno::Type > maTypeSequence;
+protected:
+ // SvxUnoDrawMSFactory
+ virtual SdrModel* getSdrModelFromUnoModel() const;
+
public:
SvxUnoDrawingModel( SdrModel* pDoc ) throw();
virtual ~SvxUnoDrawingModel() throw() override;
diff --git a/include/svx/view3d.hxx b/include/svx/view3d.hxx
index 48ff9b6f12b2..be4381c21351 100644
--- a/include/svx/view3d.hxx
+++ b/include/svx/view3d.hxx
@@ -63,7 +63,10 @@ protected:
void BreakSingle3DObj(E3dObject* pObj);
public:
- E3dView(SdrModel* pModel, OutputDevice* pOut);
+ E3dView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut);
+
virtual ~E3dView() override;
// Output all marked Objects on the given OutputDevice.
diff --git a/reportdesign/inc/ReportDefinition.hxx b/reportdesign/inc/ReportDefinition.hxx
index 6c0883c92a4a..6d877a08ae24 100644
--- a/reportdesign/inc/ReportDefinition.hxx
+++ b/reportdesign/inc/ReportDefinition.hxx
@@ -186,6 +186,10 @@ namespace reportdesign
css::uno::Reference< css::uno::XComponentContext > getContext();
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModelFromUnoModel() const;
+
+ //TTTT Needed? Or same as above?
static std::shared_ptr<rptui::OReportModel> getSdrModel(const css::uno::Reference< css::report::XReportDefinition >& _xReportDefinition);
private:
DECLARE_XINTERFACE( )
diff --git a/reportdesign/inc/RptObject.hxx b/reportdesign/inc/RptObject.hxx
index 201782857e68..b6aca58c5fb3 100644
--- a/reportdesign/inc/RptObject.hxx
+++ b/reportdesign/inc/RptObject.hxx
@@ -112,7 +112,9 @@ public:
*/
void releaseUnoShape() { m_xKeepShapeAlive.clear(); }
- static SdrObject* createObject(const css::uno::Reference< css::report::XReportComponent>& _xComponent);
+ static SdrObject* createObject(
+ SdrModel& rTargetModel,
+ const css::uno::Reference< css::report::XReportComponent>& _xComponent);
static sal_uInt16 getObjectType(const css::uno::Reference< css::report::XReportComponent>& _xComponent);
};
@@ -123,9 +125,11 @@ class REPORTDESIGN_DLLPUBLIC OCustomShape final : public SdrObjCustomShape , pub
friend class OReportPage;
friend class DlgEdFactory;
public:
- static OCustomShape* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent )
+ static OCustomShape* Create(
+ SdrModel& rSdrModel,
+ const css::uno::Reference< css::report::XReportComponent>& _xComponent)
{
- return new OCustomShape( _xComponent );
+ return new OCustomShape(rSdrModel, _xComponent );
}
virtual ~OCustomShape() override;
@@ -139,8 +143,12 @@ public:
private:
virtual void impl_setUnoShape( const css::uno::Reference< css::uno::XInterface >& rxUnoShape ) override;
- OCustomShape(const css::uno::Reference< css::report::XReportComponent>& _xComponent);
- OCustomShape(const OUString& _sComponentName);
+ OCustomShape(
+ SdrModel& rSdrModel,
+ const css::uno::Reference< css::report::XReportComponent>& _xComponent);
+ OCustomShape(
+ SdrModel& rSdrModel,
+ const OUString& _sComponentName);
virtual void NbcMove( const Size& rSize ) override;
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
@@ -158,9 +166,12 @@ class REPORTDESIGN_DLLPUBLIC OOle2Obj final : public SdrOle2Obj , public OObject
friend class OReportPage;
friend class DlgEdFactory;
public:
- static OOle2Obj* Create( const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType )
+ static OOle2Obj* Create(
+ SdrModel& rSdrModel,
+ const css::uno::Reference< css::report::XReportComponent>& _xComponent,
+ sal_uInt16 _nType)
{
- return new OOle2Obj( _xComponent,_nType );
+ return new OOle2Obj(rSdrModel, _xComponent, _nType);
}
virtual ~OOle2Obj() override;
@@ -179,9 +190,14 @@ public:
void initializeChart( const css::uno::Reference< css::frame::XModel>& _xModel);
private:
- OOle2Obj(const css::uno::Reference< css::report::XReportComponent>& _xComponent,sal_uInt16 _nType);
- OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType);
-
+ OOle2Obj(
+ SdrModel& rSdrModel,
+ const css::uno::Reference< css::report::XReportComponent>& _xComponent,
+ sal_uInt16 _nType);
+ OOle2Obj(
+ SdrModel& rSdrModel,
+ const OUString& _sComponentName,
+ sal_uInt16 _nType);
virtual void NbcMove( const Size& rSize ) override;
virtual void NbcResize(const Point& rRef, const Fraction& xFact, const Fraction& yFact) override;
@@ -208,12 +224,15 @@ class REPORTDESIGN_DLLPUBLIC OUnoObject: public SdrUnoObj , public OObjectBase
sal_uInt16 m_nObjectType;
protected:
- OUnoObject(const OUString& _sComponentName
- ,const OUString& rModelName
- ,sal_uInt16 _nObjectType);
- OUnoObject( const css::uno::Reference< css::report::XReportComponent>& _xComponent
- ,const OUString& rModelName
- ,sal_uInt16 _nObjectType);
+ OUnoObject(SdrModel& rSdrModel,
+ const OUString& _sComponentName,
+ const OUString& rModelName,
+ sal_uInt16 _nObjectType);
+ OUnoObject(
+ SdrModel& rSdrModel,
+ const css::uno::Reference< css::report::XReportComponent>& _xComponent,
+ const OUString& rModelName,
+ sal_uInt16 _nObjectType);
virtual ~OUnoObject() override;
diff --git a/reportdesign/inc/RptPage.hxx b/reportdesign/inc/RptPage.hxx
index c168cd5f942f..d5a3d42429dc 100644
--- a/reportdesign/inc/RptPage.hxx
+++ b/reportdesign/inc/RptPage.hxx
@@ -49,6 +49,8 @@ class REPORTDESIGN_DLLPUBLIC OReportPage : public SdrPage
virtual ~OReportPage() override;
+ OReportModel& getOReportModelFromOReportPage() const { return rModel; }
+
protected:
virtual css::uno::Reference< css::uno::XInterface > createUnoPage() override;
public:
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx
index 641b88d95e12..11064f21d36e 100644
--- a/reportdesign/source/core/api/ReportDefinition.cxx
+++ b/reportdesign/source/core/api/ReportDefinition.cxx
@@ -532,10 +532,12 @@ struct OReportDefinitionImpl
};
OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext)
-: ReportDefinitionBase(m_aMutex)
-,ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >())
-,m_aProps(new OReportComponentProperties(_xContext))
-,m_pImpl(new OReportDefinitionImpl(m_aMutex))
+: ::cppu::BaseMutex(),
+ ReportDefinitionBase(m_aMutex),
+ ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()),
+ ::comphelper::IEmbeddedHelper(),
+ m_aProps(new OReportComponentProperties(_xContext)),
+ m_pImpl(new OReportDefinitionImpl(m_aMutex))
{
m_aProps->m_sName = RptResId(RID_STR_REPORT);
osl_atomic_increment(&m_refCount);
@@ -548,13 +550,16 @@ OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > co
osl_atomic_decrement( &m_refCount );
}
-OReportDefinition::OReportDefinition(uno::Reference< uno::XComponentContext > const & _xContext
- ,const uno::Reference< lang::XMultiServiceFactory>& _xFactory
- ,uno::Reference< drawing::XShape >& _xShape)
-: ReportDefinitionBase(m_aMutex)
-,ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >())
-,m_aProps(new OReportComponentProperties(_xContext))
-,m_pImpl(new OReportDefinitionImpl(m_aMutex))
+OReportDefinition::OReportDefinition(
+ uno::Reference< uno::XComponentContext > const & _xContext,
+ const uno::Reference< lang::XMultiServiceFactory>& _xFactory,
+ uno::Reference< drawing::XShape >& _xShape)
+: ::cppu::BaseMutex(),
+ ReportDefinitionBase(m_aMutex),
+ ReportDefinitionPropertySet(_xContext,IMPLEMENTS_PROPERTY_SET,uno::Sequence< OUString >()),
+ ::comphelper::IEmbeddedHelper(),
+ m_aProps(new OReportComponentProperties(_xContext)),
+ m_pImpl(new OReportDefinitionImpl(m_aMutex))
{
m_aProps->m_sName = RptResId(RID_STR_REPORT);
m_aProps->m_xFactory = _xFactory;
@@ -2015,6 +2020,11 @@ std::shared_ptr<rptui::OReportModel> OReportDefinition::getSdrModel(const uno::R
return pReportModel;
}
+SdrModel* OReportDefinition::getSdrModelFromUnoModel() const
+{
+ return m_pImpl->m_pReportModel.get();
+}
+
uno::Reference< uno::XInterface > SAL_CALL OReportDefinition::createInstanceWithArguments( const OUString& aServiceSpecifier, const uno::Sequence< uno::Any >& _aArgs)
{
::osl::MutexGuard aGuard(m_aMutex);
diff --git a/reportdesign/source/core/sdr/ReportDrawPage.cxx b/reportdesign/source/core/sdr/ReportDrawPage.cxx
index e67f7a91626d..714e4a7c07d7 100644
--- a/reportdesign/source/core/sdr/ReportDrawPage.cxx
+++ b/reportdesign/source/core/sdr/ReportDrawPage.cxx
@@ -29,9 +29,9 @@
#include <svx/svdmodel.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/embed/Aspects.hpp>
-
#include <tools/diagnose_ex.h>
#include <svx/unoshape.hxx>
+#include <svx/svdpage.hxx>
namespace reportdesign
{
@@ -49,7 +49,12 @@ SdrObject* OReportDrawPage::CreateSdrObject_(const uno::Reference< drawing::XSha
{
uno::Reference< report::XReportComponent> xReportComponent(xDescr,uno::UNO_QUERY);
if ( xReportComponent.is() )
- return OObjectBase::createObject(xReportComponent);
+ {
+ return OObjectBase::createObject(
+ GetSdrPage()->getSdrModelFromSdrObjList(),
+ xReportComponent);
+ }
+
return SvxDrawPage::CreateSdrObject_( xDescr );
}
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index a0af522a616c..c85a88fe04c7 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -107,7 +107,9 @@ sal_uInt16 OObjectBase::getObjectType(const uno::Reference< report::XReportCompo
return 0;
}
-SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportComponent>& _xComponent)
+SdrObject* OObjectBase::createObject(
+ SdrModel& rTargetModel,
+ const uno::Reference< report::XReportComponent>& _xComponent)
{
SdrObject* pNewObj = nullptr;
sal_uInt16 nType = OObjectBase::getObjectType(_xComponent);
@@ -115,9 +117,11 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon
{
case OBJ_DLG_FIXEDTEXT:
{
- OUnoObject* pUnoObj = new OUnoObject( _xComponent
- ,OUString("com.sun.star.form.component.FixedText")
- ,OBJ_DLG_FIXEDTEXT);
+ OUnoObject* pUnoObj = new OUnoObject(
+ rTargetModel,
+ _xComponent,
+ OUString("com.sun.star.form.component.FixedText"),
+ OBJ_DLG_FIXEDTEXT);
pNewObj = pUnoObj;
uno::Reference<beans::XPropertySet> xControlModel(pUnoObj->GetUnoControlModel(),uno::UNO_QUERY);
@@ -126,23 +130,31 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon
}
break;
case OBJ_DLG_IMAGECONTROL:
- pNewObj = new OUnoObject(_xComponent
- ,OUString("com.sun.star.form.component.DatabaseImageControl")
- ,OBJ_DLG_IMAGECONTROL);
+ pNewObj = new OUnoObject(
+ rTargetModel,
+ _xComponent,
+ OUString("com.sun.star.form.component.DatabaseImageControl"),
+ OBJ_DLG_IMAGECONTROL);
break;
case OBJ_DLG_FORMATTEDFIELD:
- pNewObj = new OUnoObject( _xComponent
- ,OUString("com.sun.star.form.component.FormattedField")
- ,OBJ_DLG_FORMATTEDFIELD);
+ pNewObj = new OUnoObject(
+ rTargetModel,
+ _xComponent,
+ OUString("com.sun.star.form.component.FormattedField"),
+ OBJ_DLG_FORMATTEDFIELD);
break;
case OBJ_DLG_HFIXEDLINE:
case OBJ_DLG_VFIXEDLINE:
- pNewObj = new OUnoObject( _xComponent
- ,OUString("com.sun.star.awt.UnoControlFixedLineModel")
- ,nType);
+ pNewObj = new OUnoObject(
+ rTargetModel,
+ _xComponent,
+ OUString("com.sun.star.awt.UnoControlFixedLineModel"),
+ nType);
break;
case OBJ_CUSTOMSHAPE:
- pNewObj = OCustomShape::Create( _xComponent );
+ pNewObj = OCustomShape::Create(
+ rTargetModel,
+ _xComponent);
try
{
bool bOpaque = false;
@@ -156,7 +168,10 @@ SdrObject* OObjectBase::createObject(const uno::Reference< report::XReportCompon
break;
case OBJ_DLG_SUBREPORT:
case OBJ_OLE2:
- pNewObj = OOle2Obj::Create( _xComponent,nType );
+ pNewObj = OOle2Obj::Create(
+ rTargetModel,
+ _xComponent,
+ nType);
break;
default:
OSL_FAIL("Unknown object id");
@@ -455,19 +470,21 @@ uno::Reference< uno::XInterface > OObjectBase::getUnoShapeOf( SdrObject& _rSdrOb
return xShape;
}
-
-OCustomShape::OCustomShape(const uno::Reference< report::XReportComponent>& _xComponent
- )
- :SdrObjCustomShape()
- ,OObjectBase(_xComponent)
+OCustomShape::OCustomShape(
+ SdrModel& rSdrModel,
+ const uno::Reference< report::XReportComponent>& _xComponent)
+: SdrObjCustomShape(rSdrModel)
+ ,OObjectBase(_xComponent)
{
impl_setUnoShape( uno::Reference< uno::XInterface >(_xComponent,uno::UNO_QUERY) );
m_bIsListening = true;
}
-OCustomShape::OCustomShape(const OUString& _sComponentName)
- :SdrObjCustomShape()
- ,OObjectBase(_sComponentName)
+OCustomShape::OCustomShape(
+ SdrModel& rSdrModel,
+ const OUString& _sComponentName)
+: SdrObjCustomShape(rSdrModel)
+ ,OObjectBase(_sComponentName)
{
m_bIsListening = true;
}
@@ -572,24 +589,27 @@ void OCustomShape::impl_setUnoShape( const uno::Reference< uno::XInterface >& rx
m_xReportComponent.clear();
}
-
-OUnoObject::OUnoObject(const OUString& _sComponentName
- ,const OUString& rModelName
- ,sal_uInt16 _nObjectType)
- :SdrUnoObj(rModelName)
- ,OObjectBase(_sComponentName)
- ,m_nObjectType(_nObjectType)
+OUnoObject::OUnoObject(
+ SdrModel& rSdrModel,
+ const OUString& _sComponentName,
+ const OUString& rModelName,
+ sal_uInt16 _nObjectType)
+: SdrUnoObj(rSdrModel, rModelName)
+ ,OObjectBase(_sComponentName)
+ ,m_nObjectType(_nObjectType)
{
if ( !rModelName.isEmpty() )
impl_initializeModel_nothrow();
}
-OUnoObject::OUnoObject(const uno::Reference< report::XReportComponent>& _xComponent
- ,const OUString& rModelName
- ,sal_uInt16 _nObjectType)
- :SdrUnoObj(rModelName)
- ,OObjectBase(_xComponent)
- ,m_nObjectType(_nObjectType)
+OUnoObject::OUnoObject(
+ SdrModel& rSdrModel,
+ const uno::Reference< report::XReportComponent>& _xComponent,
+ const OUString& rModelName,
+ sal_uInt16 _nObjectType)
+: SdrUnoObj(rSdrModel, rModelName)
+ ,OObjectBase(_xComponent)
+ ,m_nObjectType(_nObjectType)
{
impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
@@ -887,23 +907,27 @@ OUnoObject* OUnoObject::Clone() const
}
// OOle2Obj
-
-OOle2Obj::OOle2Obj(const uno::Reference< report::XReportComponent>& _xComponent,sal_uInt16 _nType)
- :SdrOle2Obj()
- ,OObjectBase(_xComponent)
- ,m_nType(_nType)
- ,m_bOnlyOnce(true)
+OOle2Obj::OOle2Obj(
+ SdrModel& rSdrModel,
+ const uno::Reference< report::XReportComponent>& _xComponent,
+ sal_uInt16 _nType)
+: SdrOle2Obj(rSdrModel)
+ ,OObjectBase(_xComponent)
+ ,m_nType(_nType)
+ ,m_bOnlyOnce(true)
{
-
impl_setUnoShape( uno::Reference< uno::XInterface >( _xComponent, uno::UNO_QUERY ) );
m_bIsListening = true;
}
-OOle2Obj::OOle2Obj(const OUString& _sComponentName,sal_uInt16 _nType)
- :SdrOle2Obj()
- ,OObjectBase(_sComponentName)
- ,m_nType(_nType)
- ,m_bOnlyOnce(true)
+OOle2Obj::OOle2Obj(
+ SdrModel& rSdrModel,
+ const OUString& _sComponentName,
+ sal_uInt16 _nType)
+: SdrOle2Obj(rSdrModel)
+ ,OObjectBase(_sComponentName)
+ ,m_nType(_nType)
+ ,m_bOnlyOnce(true)
{
m_bIsListening = true;
}
diff --git a/reportdesign/source/core/sdr/RptPage.cxx b/reportdesign/source/core/sdr/RptPage.cxx
index 0d3465e93b30..9f783bc1723e 100644
--- a/reportdesign/source/core/sdr/RptPage.cxx
+++ b/reportdesign/source/core/sdr/RptPage.cxx
@@ -28,23 +28,23 @@ namespace rptui
{
using namespace ::com::sun::star;
-
-OReportPage::OReportPage( OReportModel& _rModel
- ,const uno::Reference< report::XSection >& _xSection )
- :SdrPage( _rModel, false/*bMasterPage*/ )
+OReportPage::OReportPage(
+ OReportModel& _rModel,
+ const uno::Reference< report::XSection >& _xSection)
+: SdrPage(_rModel, false/*bMasterPage*/)
,rModel(_rModel)
,m_xSection(_xSection)
- ,m_bSpecialInsertMode(false)
+ ,m_bSpecialInsertMode(false)
{
}
-OReportPage::OReportPage( const OReportPage& rPage )
- :SdrPage( rPage )
- ,rModel(rPage.rModel)
- ,m_xSection(rPage.m_xSection)
- ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode)
- ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList)
+OReportPage::OReportPage(const OReportPage& rPage)
+: SdrPage(rPage)
+ ,rModel(rPage.getOReportModelFromOReportPage())
+ ,m_xSection(rPage.m_xSection)
+ ,m_bSpecialInsertMode(rPage.m_bSpecialInsertMode)
+ ,m_aTemporaryObjectList(rPage.m_aTemporaryObjectList)
{
}
diff --git a/reportdesign/source/ui/inc/SectionView.hxx b/reportdesign/source/ui/inc/SectionView.hxx
index c5c48661c059..df3cbc7b060a 100644
--- a/reportdesign/source/ui/inc/SectionView.hxx
+++ b/reportdesign/source/ui/inc/SectionView.hxx
@@ -42,7 +42,11 @@ private:
void operator =(const OSectionView&) = delete;
public:
- OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor );
+ OSectionView(
+ SdrModel& rSdrModel,
+ OReportSection* _pSectionWindow,
+ OReportWindow* pEditor);
+
virtual ~OSectionView() override;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 8a82ef78f5ff..9c10c8bf19e8 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -3107,7 +3107,12 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
uno::Reference< report::XReportComponent> xShapeProp;
if ( _nObjectId == OBJ_CUSTOMSHAPE )
{
- pNewControl = SdrObjFactory::MakeNewObject( SdrInventor::ReportDesign, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
+ pNewControl = SdrObjFactory::MakeNewObject(
+ *m_aReportModel,
+ SdrInventor::ReportDesign,
+ _nObjectId,
+ pSectionWindow->getReportSection().getPage(),
+ m_aReportModel.get());
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY);
OUString sCustomShapeType = getDesignView()->GetInsertObjString();
if ( sCustomShapeType.isEmpty() )
@@ -3117,7 +3122,12 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
}
else if ( _nObjectId == OBJ_OLE2 || OBJ_DLG_SUBREPORT == _nObjectId )
{
- pNewControl = SdrObjFactory::MakeNewObject( SdrInventor::ReportDesign, _nObjectId, pSectionWindow->getReportSection().getPage(),m_aReportModel.get() );
+ pNewControl = SdrObjFactory::MakeNewObject(
+ *m_aReportModel,
+ SdrInventor::ReportDesign,
+ _nObjectId,
+ pSectionWindow->getReportSection().getPage(),
+ m_aReportModel.get());
pNewControl->SetLogicRect(tools::Rectangle(3000,500,8000,5500)); // switch height and width
xShapeProp.set(pNewControl->getUnoShape(),uno::UNO_QUERY_THROW);
diff --git a/reportdesign/source/ui/report/ReportSection.cxx b/reportdesign/source/ui/report/ReportSection.cxx
index 9cca7d85a9b8..cbae30cc481d 100644
--- a/reportdesign/source/ui/report/ReportSection.cxx
+++ b/reportdesign/source/ui/report/ReportSection.cxx
@@ -183,7 +183,10 @@ void OReportSection::fill()
m_pModel = m_pParent->getViewsWindow()->getView()->getReportView()->getController().getSdrModel();
m_pPage = m_pModel->getPage(m_xSection);
- m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getViewsWindow()->getView() );
+ m_pView = new OSectionView(
+ *m_pModel,
+ this,
+ m_pParent->getViewsWindow()->getView());
// #i93597# tell SdrPage that only left and right page border is defined
// instead of the full rectangle definition
diff --git a/reportdesign/source/ui/report/SectionView.cxx b/reportdesign/source/ui/report/SectionView.cxx
index 06b594f63d6e..ea01291b81f6 100644
--- a/reportdesign/source/ui/report/SectionView.cxx
+++ b/reportdesign/source/ui/report/SectionView.cxx
@@ -34,9 +34,11 @@ namespace rptui
{
using namespace ::com::sun::star;
-
-OSectionView::OSectionView( SdrModel* pModel, OReportSection* _pSectionWindow, OReportWindow* pEditor )
- :SdrView( pModel, _pSectionWindow )
+OSectionView::OSectionView(
+ SdrModel& rSdrModel,
+ OReportSection* _pSectionWindow,
+ OReportWindow* pEditor)
+: SdrView(rSdrModel, _pSectionWindow)
,m_pReportWindow( pEditor )
,m_pSectionWindow(_pSectionWindow)
{
diff --git a/reportdesign/source/ui/report/ViewsWindow.cxx b/reportdesign/source/ui/report/ViewsWindow.cxx
index 341dc465a397..72f74f2eff50 100644
--- a/reportdesign/source/ui/report/ViewsWindow.cxx
+++ b/reportdesign/source/ui/report/ViewsWindow.cxx
@@ -1015,9 +1015,11 @@ void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const tools::Recta
if ( &rView != &_rSection )
{
- SdrObject *pNewObj = new SdrUnoObj("com.sun.star.form.component.FixedText");
- pNewObj->SetLogicRect(_aRect);
+ SdrObject *pNewObj = new SdrUnoObj(
+ rView.getSdrModelFromSdrView(),
+ "com.sun.star.form.component.FixedText");
+ pNewObj->SetLogicRect(_aRect);
pNewObj->Move(Size(0, aNewPos.Y()));
bool bChanged = rView.GetModel()->IsChanged();
rReportSection.getPage()->InsertObject(pNewObj);
diff --git a/reportdesign/source/ui/report/dlgedfac.cxx b/reportdesign/source/ui/report/dlgedfac.cxx
index 1a59852f1029..4a416838ebda 100644
--- a/reportdesign/source/ui/report/dlgedfac.cxx
+++ b/reportdesign/source/ui/report/dlgedfac.cxx
@@ -47,29 +47,30 @@ IMPL_STATIC_LINK(
DlgEdFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject* )
{
SdrObject* pNewObj = nullptr;
+
if ( aParams.nInventor == SdrInventor::ReportDesign )
{
switch( aParams.nObjIdentifier )
{
case OBJ_DLG_FIXEDTEXT:
- pNewObj = new OUnoObject( SERVICE_FIXEDTEXT
+ pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDTEXT
,OUString("com.sun.star.form.component.FixedText")
,OBJ_DLG_FIXEDTEXT);
break;
case OBJ_DLG_IMAGECONTROL:
- pNewObj = new OUnoObject( SERVICE_IMAGECONTROL
+ pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_IMAGECONTROL
,OUString("com.sun.star.form.component.DatabaseImageControl")
,OBJ_DLG_IMAGECONTROL);
break;
case OBJ_DLG_FORMATTEDFIELD:
- pNewObj = new OUnoObject( SERVICE_FORMATTEDFIELD
+ pNewObj = new OUnoObject(aParams.rSdrModel, SERVICE_FORMATTEDFIELD
,OUString("com.sun.star.form.component.FormattedField")
,OBJ_DLG_FORMATTEDFIELD);
break;
case OBJ_DLG_VFIXEDLINE:
case OBJ_DLG_HFIXEDLINE:
{
- OUnoObject* pObj = new OUnoObject( SERVICE_FIXEDLINE
+ OUnoObject* pObj = new OUnoObject(aParams.rSdrModel, SERVICE_FIXEDLINE
,OUString("com.sun.star.awt.UnoControlFixedLineModel")
,aParams.nObjIdentifier);
pNewObj = pObj;
@@ -81,13 +82,13 @@ IMPL_STATIC_LINK(
}
break;
case OBJ_CUSTOMSHAPE:
- pNewObj = new OCustomShape(SERVICE_SHAPE);
+ pNewObj = new OCustomShape(aParams.rSdrModel, SERVICE_SHAPE);
break;
case OBJ_DLG_SUBREPORT:
- pNewObj = new OOle2Obj(SERVICE_REPORTDEFINITION,OBJ_DLG_SUBREPORT);
+ pNewObj = new OOle2Obj(aParams.rSdrModel, SERVICE_REPORTDEFINITION, OBJ_DLG_SUBREPORT);
break;
case OBJ_OLE2:
- pNewObj = new OOle2Obj(OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2);
+ pNewObj = new OOle2Obj(aParams.rSdrModel, OUString("com.sun.star.chart2.ChartDocument"),OBJ_OLE2);
break;
default:
OSL_FAIL("Unknown object id");
diff --git a/sc/inc/docuno.hxx b/sc/inc/docuno.hxx
index f86c9048fe03..dd19e0bbdc58 100644
--- a/sc/inc/docuno.hxx
+++ b/sc/inc/docuno.hxx
@@ -124,6 +124,9 @@ private:
protected:
const SfxItemPropertySet& GetPropertySet() const { return aPropSet; }
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModelFromUnoModel() const;
+
public:
ScModelObj(ScDocShell* pDocSh);
virtual ~ScModelObj() override;
diff --git a/sc/source/core/data/drawpage.cxx b/sc/source/core/data/drawpage.cxx
index 5d445983b69e..831cc3a65715 100644
--- a/sc/source/core/data/drawpage.cxx
+++ b/sc/source/core/data/drawpage.cxx
@@ -24,14 +24,14 @@
#include <document.hxx>
#include <pageuno.hxx>
-ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage) :
- FmFormPage(rNewModel, bMasterPage)
+ScDrawPage::ScDrawPage(ScDrawLayer& rNewModel, bool bMasterPage)
+: FmFormPage(rNewModel, bMasterPage)
{
SetSize( Size( RECT_MAX, RECT_MAX ) );
}
ScDrawPage::ScDrawPage(const ScDrawPage& rSrcPage)
- : FmFormPage(rSrcPage)
+: FmFormPage(rSrcPage)
{
}
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d70e87f528c1..aa93fe7b8052 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -375,7 +375,11 @@ void ScCaptionCreator::CreateCaption( bool bShown, bool bTailFront )
// create the caption drawing object
tools::Rectangle aTextRect( Point( 0 , 0 ), Size( SC_NOTECAPTION_WIDTH, SC_NOTECAPTION_HEIGHT ) );
Point aTailPos = CalcTailPos( bTailFront );
- mxCaption.reset( new SdrCaptionObj( aTextRect, aTailPos ));
+ mxCaption.reset(
+ new SdrCaptionObj(
+ *mrDoc.GetDrawLayer(), // TTTT should ret a ref?
+ aTextRect,
+ aTailPos));
// basic caption settings
ScCaptionUtil::SetBasicCaptionSettings( *mxCaption, bShown );
}
diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx
index f8f5ac045c68..77f19b2e39c5 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -453,7 +453,9 @@ bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
// insert the rectangle before the arrow - this is relied on in FindFrameForObject
tools::Rectangle aRect = GetDrawRect( nRefStartCol, nRefStartRow, nRefEndCol, nRefEndRow );
- SdrRectObj* pBox = new SdrRectObj( aRect );
+ SdrRectObj* pBox = new SdrRectObj(
+ *pModel,
+ aRect);
pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
@@ -494,7 +496,10 @@ bool ScDetectiveFunc::InsertArrow( SCCOL nCol, SCROW nRow,
basegfx::B2DPolygon aTempPoly;
aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y()));
aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y()));
- SdrPathObj* pArrow = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aTempPoly));
+ SdrPathObj* pArrow = new SdrPathObj(
+ *pModel,
+ OBJ_LINE,
+ basegfx::B2DPolyPolygon(aTempPoly));
pArrow->NbcSetLogicRect(tools::Rectangle(aStartPos,aEndPos)); //TODO: needed ???
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
@@ -526,7 +531,9 @@ bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
if (bArea)
{
tools::Rectangle aRect = GetDrawRect( nStartCol, nStartRow, nEndCol, nEndRow );
- SdrRectObj* pBox = new SdrRectObj( aRect );
+ SdrRectObj* pBox = new SdrRectObj(
+ *pModel,
+ aRect);
pBox->SetMergedItemSetAndBroadcast(rData.GetBoxSet());
@@ -559,7 +566,10 @@ bool ScDetectiveFunc::InsertToOtherTab( SCCOL nStartCol, SCROW nStartRow,
basegfx::B2DPolygon aTempPoly;
aTempPoly.append(basegfx::B2DPoint(aStartPos.X(), aStartPos.Y()));
aTempPoly.append(basegfx::B2DPoint(aEndPos.X(), aEndPos.Y()));
- SdrPathObj* pArrow = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aTempPoly));
+ SdrPathObj* pArrow = new SdrPathObj(
+ *pModel,
+ OBJ_LINE,
+ basegfx::B2DPolyPolygon(aTempPoly));
pArrow->NbcSetLogicRect(tools::Rectangle(aStartPos,aEndPos)); //TODO: needed ???
pArrow->SetMergedItemSetAndBroadcast(rAttrSet);
@@ -625,7 +635,10 @@ void ScDetectiveFunc::DrawCircle( SCCOL nCol, SCROW nRow, ScDetectiveData& rData
aRect.AdjustTop( -70 );
aRect.AdjustBottom(70 );
- SdrCircObj* pCircle = new SdrCircObj( OBJ_CIRC, aRect );
+ SdrCircObj* pCircle = new SdrCircObj(
+ *pModel,
+ OBJ_CIRC,
+ aRect);
SfxItemSet& rAttrSet = rData.GetCircleSet();
pCircle->SetMergedItemSetAndBroadcast(rAttrSet);
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx
index 94b2d0130d0b..998abab1590c 100644
--- a/sc/source/filter/excel/xiescher.cxx
+++ b/sc/source/filter/excel/xiescher.cxx
@@ -1012,7 +1012,9 @@ std::size_t XclImpGroupObj::DoGetProgressSize() const
SdrObjectPtr XclImpGroupObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& /*rAnchorRect*/ ) const
{
- std::unique_ptr<SdrObjGroup, SdrObjectFree> xSdrObj( new SdrObjGroup );
+ std::unique_ptr<SdrObjGroup, SdrObjectFree> xSdrObj(
+ new SdrObjGroup(
+ *GetDoc().GetDrawLayer()));
// child objects in BIFF2-BIFF5 have absolute size, not needed to pass own anchor rectangle
SdrObjList& rObjList = *xSdrObj->GetSubList(); // SdrObjGroup always returns existing sublist
for( ::std::vector< XclImpDrawObjRef >::const_iterator aIt = maChildren.begin(), aEnd = maChildren.end(); aIt != aEnd; ++aIt )
@@ -1080,7 +1082,11 @@ SdrObjectPtr XclImpLineObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const
aB2DPolygon.append( ::basegfx::B2DPoint( rAnchorRect.Right(), rAnchorRect.Top() ) );
break;
}
- SdrObjectPtr xSdrObj( new SdrPathObj( OBJ_LINE, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
+ SdrObjectPtr xSdrObj(
+ new SdrPathObj(
+ *GetDoc().GetDrawLayer(),
+ OBJ_LINE,
+ ::basegfx::B2DPolyPolygon(aB2DPolygon)));
ConvertLineStyle( *xSdrObj, maLineData );
// line ends
@@ -1195,7 +1201,10 @@ void XclImpRectObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
SdrObjectPtr XclImpRectObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& rAnchorRect ) const
{
- SdrObjectPtr xSdrObj( new SdrRectObj( rAnchorRect ) );
+ SdrObjectPtr xSdrObj(
+ new SdrRectObj(
+ *GetDoc().GetDrawLayer(),
+ rAnchorRect));
ConvertRectStyle( *xSdrObj );
rDffConv.Progress();
return xSdrObj;
@@ -1208,7 +1217,11 @@ XclImpOvalObj::XclImpOvalObj( const XclImpRoot& rRoot ) :
SdrObjectPtr XclImpOvalObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& rAnchorRect ) const
{
- SdrObjectPtr xSdrObj( new SdrCircObj( OBJ_CIRC, rAnchorRect ) );
+ SdrObjectPtr xSdrObj(
+ new SdrCircObj(
+ *GetDoc().GetDrawLayer(),
+ OBJ_CIRC,
+ rAnchorRect));
ConvertRectStyle( *xSdrObj );
rDffConv.Progress();
return xSdrObj;
@@ -1280,7 +1293,13 @@ SdrObjectPtr XclImpArcObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const t
break;
}
SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_SECT : OBJ_CARC;
- SdrObjectPtr xSdrObj( new SdrCircObj( eObjKind, aNewRect, nStartAngle, nEndAngle ) );
+ SdrObjectPtr xSdrObj(
+ new SdrCircObj(
+ *GetDoc().GetDrawLayer(),
+ eObjKind,
+ aNewRect,
+ nStartAngle,
+ nEndAngle));
ConvertFillStyle( *xSdrObj, maFillData );
ConvertLineStyle( *xSdrObj, maLineData );
rDffConv.Progress();
@@ -1358,7 +1377,11 @@ SdrObjectPtr XclImpPolygonObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, con
aB2DPolygon.append( lclGetPolyPoint( rAnchorRect, maCoords.front() ) );
// create the SdrObject
SdrObjKind eObjKind = maFillData.IsFilled() ? OBJ_PATHPOLY : OBJ_PATHPLIN;
- xSdrObj.reset( new SdrPathObj( eObjKind, ::basegfx::B2DPolyPolygon( aB2DPolygon ) ) );
+ xSdrObj.reset(
+ new SdrPathObj(
+ *GetDoc().GetDrawLayer(),
+ eObjKind,
+ ::basegfx::B2DPolyPolygon(aB2DPolygon)));
ConvertRectStyle( *xSdrObj );
}
rDffConv.Progress();
@@ -1420,7 +1443,9 @@ void XclImpTextObj::DoReadObj5( XclImpStream& rStrm, sal_uInt16 nNameLen, sal_uI
SdrObjectPtr XclImpTextObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const tools::Rectangle& rAnchorRect ) const
{
- std::unique_ptr<SdrObjCustomShape, SdrObjectFree> xSdrObj( new SdrObjCustomShape );
+ std::unique_ptr<SdrObjCustomShape, SdrObjectFree> xSdrObj(
+ new SdrObjCustomShape(
+ *GetDoc().GetDrawLayer()));
xSdrObj->NbcSetSnapRect( rAnchorRect );
OUString aRectType = "rectangle";
xSdrObj->MergeDefaultAttributes( &aRectType );
@@ -1710,7 +1735,12 @@ SdrObjectPtr XclImpChartObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, const
// ChartHelper::AdaptDefaultsForChart( xEmbObj );
// create the container OLE object
- xSdrObj.reset( new SdrOle2Obj( svt::EmbeddedObjectRef( xEmbObj, nAspect ), aEmbObjName, rAnchorRect ) );
+ xSdrObj.reset(
+ new SdrOle2Obj(
+ *GetDoc().GetDrawLayer(),
+ svt::EmbeddedObjectRef(xEmbObj, nAspect),
+ aEmbObjName,
+ rAnchorRect));
}
return xSdrObj;
@@ -2953,7 +2983,11 @@ SdrObjectPtr XclImpPictureObj::DoCreateSdrObj( XclImpDffConverter& rDffConv, con
// no OLE - create a plain picture from IMGDATA record data
if( !xSdrObj && (maGraphic.GetType() != GraphicType::NONE) )
{
- xSdrObj.reset( new SdrGrafObj( maGraphic, rAnchorRect ) );
+ xSdrObj.reset(
+ new SdrGrafObj(
+ *GetDoc().GetDrawLayer(),
+ maGraphic,
+ rAnchorRect));
ConvertRectStyle( *xSdrObj );
}
@@ -3434,9 +3468,20 @@ SdrObjectPtr XclImpDffConverter::CreateSdrObject( const XclImpPictureObj& rPicOb
ErrCode nError = ERRCODE_NONE;
namespace cssea = ::com::sun::star::embed::Aspects;
sal_Int64 nAspects = rPicObj.IsSymbol() ? cssea::MSOLE_ICON : cssea::MSOLE_CONTENT;
- xSdrObj.reset( CreateSdrOLEFromStorage(
- aStrgName, xSrcStrg, pDocShell->GetStorage(), aGraphic,
- rAnchorRect, aVisArea, nullptr, nError, mnOleImpFlags, nAspects, GetRoot().GetMedium().GetBaseURL()) );
+ xSdrObj.reset(
+ CreateSdrOLEFromStorage(
+ GetConvData().mrSdrModel,
+ aStrgName,
+ xSrcStrg,
+ pDocShell->GetStorage(),
+ aGraphic,
+ rAnchorRect,
+ aVisArea,
+ nullptr,
+ nError,
+ mnOleImpFlags,
+ nAspects,
+ GetRoot().GetMedium().GetBaseURL()));
}
}
}
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index d6915302aba4..e553df1130ff 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -602,7 +602,11 @@ void ScEEImport::InsertGraphic( SCCOL nCol, SCROW nRow, SCTAB nTab,
if ( pI->pGraphic )
{
tools::Rectangle aRect ( aInsertPos, aLogicSize );
- SdrGrafObj* pObj = new SdrGrafObj( *pI->pGraphic, aRect );
+ SdrGrafObj* pObj = new SdrGrafObj(
+ *pModel,
+ *pI->pGraphic,
+ aRect);
+
// calling SetGraphicLink here doesn't work
pObj->SetName( pI->aURL );
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 1e4c9c868bfc..0a7789540aa5 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -188,7 +188,7 @@ ScDrawTransferObj::ScDrawTransferObj( SdrModel* pClipModel, ScDocShell* pContain
// #i71538# use complete SdrViews
// SdrExchangeView aView(pModel);
- SdrView aView(pModel);
+ SdrView aView(*pModel);
SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
aView.MarkAllObj(pPv);
aSrcSize = aView.GetAllMarkedRect().GetSize();
@@ -395,7 +395,7 @@ bool ScDrawTransferObj::GetData( const css::datatransfer::DataFlavor& rFlavor, c
{
// #i71538# use complete SdrViews
// SdrExchangeView aView( pModel );
- SdrView aView( pModel );
+ SdrView aView(*pModel);
SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
OSL_ENSURE( pPv, "pPv not there..." );
aView.MarkAllObj( pPv );
@@ -632,7 +632,7 @@ static void lcl_InitMarks( SdrMarkView& rDest, const SdrMarkView& rSource, SCTAB
void ScDrawTransferObj::SetDragSource( const ScDrawView* pView )
{
DELETEZ( pDragSourceView );
- pDragSourceView = new SdrView( pView->GetModel() );
+ pDragSourceView = new SdrView(pView->getSdrModelFromSdrView()); // TTTT pView shbe ref
lcl_InitMarks( *pDragSourceView, *pView, pView->GetTab() );
//! add as listener with document, delete pDragSourceView if document gone
@@ -641,7 +641,7 @@ void ScDrawTransferObj::SetDragSource( const ScDrawView* pView )
void ScDrawTransferObj::SetDragSourceObj( SdrObject* pObj, SCTAB nTab )
{
DELETEZ( pDragSourceView );
- pDragSourceView = new SdrView( pObj->GetModel() );
+ pDragSourceView = new SdrView(pObj->getSdrModelFromSdrObject()); // TTTT pObj shbe ref
pDragSourceView->ShowSdrPage(pDragSourceView->GetModel()->GetPage(nTab));
SdrPageView* pPV = pDragSourceView->GetSdrPageView();
pDragSourceView->MarkObj(pObj, pPV);
@@ -719,7 +719,7 @@ void ScDrawTransferObj::InitDocShell()
SdrModel* pDestModel = rDestDoc.GetDrawLayer();
// #i71538# use complete SdrViews
// SdrExchangeView aDestView( pDestModel );
- SdrView aDestView( pDestModel );
+ SdrView aDestView(*pDestModel);
aDestView.ShowSdrPage(aDestView.GetModel()->GetPage(0));
aDestView.Paste(
*pModel,
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index 7ada2107c5b3..7f89725a9e5e 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -123,8 +123,11 @@ SdrObject* FuConstArc::CreateDefaultObject(const sal_uInt16 nID, const tools::Re
// case SID_DRAW_CIRCLECUT:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- nullptr, pDrDoc);
+ *pDrDoc,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pDrDoc);
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index f5a03392f736..df3c807a43e4 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -132,8 +132,12 @@ void FuConstCustomShape::Deactivate()
SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, const tools::Rectangle& rRectangle)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- nullptr, pDrDoc);
+ *pDrDoc,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pDrDoc);
+
if( pObj )
{
tools::Rectangle aRectangle( rRectangle );
@@ -142,6 +146,7 @@ SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, c
ImpForceQuadratic( aRectangle );
pObj->SetLogicRect( aRectangle );
}
+
return pObj;
}
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 330ebf09a41d..809d245651c8 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -185,8 +185,11 @@ SdrObject* FuConstPolygon::CreateDefaultObject(const sal_uInt16 nID, const tools
// case SID_DRAW_FREELINE_NOFILL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- nullptr, pDrDoc);
+ *pDrDoc,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pDrDoc);
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index d3ae4c990850..67b2239fc5dd 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -356,8 +356,11 @@ void FuConstRectangle::Deactivate()
SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- nullptr, pDrDoc);
+ *pDrDoc,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pDrDoc);
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index 619ad1c4f79d..3a505a2638d5 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -111,8 +111,11 @@ SdrObject* FuConstUnoControl::CreateDefaultObject(const sal_uInt16 /* nID */, co
// case SID_FM_CREATE_CONTROL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- nullptr, pDrDoc);
+ *pDrDoc,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pDrDoc);
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index b7c4ed8d5e8b..b612f14fc6c9 100644
--- a/sc/source/ui/drawfunc/fuins1.cxx
+++ b/sc/source/ui/drawfunc/fuins1.cxx
@@ -177,10 +177,13 @@ static void lcl_InsertGraphic( const Graphic& rGraphic,
tools::Rectangle aRect ( aInsertPos, aLogicSize );
- SdrGrafObj* pObj = new SdrGrafObj( rGraphic1, aRect );
+ SdrGrafObj* pObj = new SdrGrafObj(
+ pView->getSdrModelFromSdrView(), // TTTT pView should be reference
+ rGraphic1,
+ aRect);
// calling SetGraphicLink here doesn't work
-
+ // TTTT: Yes, due to the SdrObject had no SdrModel
// Path is no longer used as name for the graphics object
ScDrawLayer* pLayer = static_cast<ScDrawLayer*>(pView->GetModel());
@@ -244,7 +247,9 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi,
#endif
}
- SdrMediaObj* pObj = new SdrMediaObj( tools::Rectangle( aInsertPos, aSize ) );
+ SdrMediaObj* pObj = new SdrMediaObj(
+ *rData.GetDocument()->GetDrawLayer(),
+ tools::Rectangle(aInsertPos, aSize));
pObj->SetModel(rData.GetDocument()->GetDrawLayer()); // set before setURL
pObj->setURL( realURL, ""/*TODO?*/ );
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index b56a1c1d7f0a..ee3ab21f9194 100644
--- a/sc/source/ui/drawfunc/fuins2.cxx
+++ b/sc/source/ui/drawfunc/fuins2.cxx
@@ -350,7 +350,11 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView*
if ( rData.GetDocument()->IsNegativePage( rData.GetTabNo() ) )
aPnt.AdjustX( -(aSize.Width()) ); // move position to left edge
tools::Rectangle aRect (aPnt, aSize);
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ *pDoc, // TTTT shbe ref
+ aObjRef,
+ aName,
+ aRect);
SdrPageView* pPV = pView->GetSdrPageView();
pView->InsertObjectAtView(pObj, *pPV);
@@ -588,7 +592,11 @@ FuInsertChart::FuInsertChart(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawV
Point aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
tools::Rectangle aRect (aStart, aSize);
- SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ *pDoc, // TTTT shbe ref
+ svt::EmbeddedObjectRef(xObj, nAspect),
+ aName,
+ aRect);
SdrPageView* pPV = pView->GetSdrPageView();
// #i121334# This call will change the chart's default background fill from white to transparent.
@@ -747,7 +755,11 @@ FuInsertChartFromFile::FuInsertChartFromFile( ScTabViewShell* pViewSh, vcl::Wind
ScRange aPositionRange = pViewSh->GetViewData().GetCurPos();
Point aStart = pViewSh->GetChartInsertPos( aSize, aPositionRange );
tools::Rectangle aRect (aStart, aSize);
- SdrOle2Obj* pObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect);
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ *pDoc, // TTTT shbe ref
+ svt::EmbeddedObjectRef(xObj, nAspect),
+ aName,
+ aRect);
SdrPageView* pPV = pView->GetSdrPageView();
diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index 38583597b9d2..a6c70e19301b 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -643,8 +643,11 @@ SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const tools::Rectan
// case SID_DRAW_NOTEEDIT:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(),
- nullptr, pDrDoc);
+ *pDrDoc,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pDrDoc);
if(pObj)
{
diff --git a/sc/source/ui/inc/drawview.hxx b/sc/source/ui/inc/drawview.hxx
index 9574cdb63900..ad353cdd7a29 100644
--- a/sc/source/ui/inc/drawview.hxx
+++ b/sc/source/ui/inc/drawview.hxx
@@ -56,8 +56,11 @@ class ScDrawView final : public FmFormView
virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override;
public:
- ScDrawView( OutputDevice* pOut, ScViewData* pData );
- virtual ~ScDrawView() override;
+ ScDrawView(
+ OutputDevice* pOut,
+ ScViewData* pData);
+
+ virtual ~ScDrawView() override;
virtual void MarkListHasChanged() override;
virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 52c3fb9b4e93..a414160700c7 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1248,7 +1248,7 @@ static void lcl_DoDragObject( ScDocShell* pSrcShell, const OUString& rName, ScCo
SdrObject* pObject = pModel->GetNamedObject( rName, nDrawId, nTab );
if (pObject)
{
- SdrView aEditView( pModel );
+ SdrView aEditView(*pModel);
aEditView.ShowSdrPage(aEditView.GetModel()->GetPage(nTab));
SdrPageView* pPV = aEditView.GetSdrPageView();
aEditView.MarkObj(pObject, pPV);
diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx
index a8c19f342abc..7f150e228572 100644
--- a/sc/source/ui/unoobj/TablePivotCharts.cxx
+++ b/sc/source/ui/unoobj/TablePivotCharts.cxx
@@ -154,8 +154,11 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName,
xReceiver->setArguments(aArgs);
}
- SdrOle2Obj* pObject = new SdrOle2Obj(svt::EmbeddedObjectRef(xObject, embed::Aspects::MSOLE_CONTENT),
- aName, aInsRect);
+ SdrOle2Obj* pObject = new SdrOle2Obj(
+ *pModel,
+ svt::EmbeddedObjectRef(xObject, embed::Aspects::MSOLE_CONTENT),
+ aName,
+ aInsRect);
if (xObject.is())
xObject->setVisualAreaSize(nAspect, aAwtSize);
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index c146e3aba2e3..1c98dc40c502 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -246,7 +246,11 @@ void SAL_CALL ScChartsObj::addNewByName( const OUString& rName,
rDoc.GetChartListenerCollection()->insert( pChartListener );
pChartListener->StartListeningTo();
- SdrOle2Obj* pObj = new SdrOle2Obj( ::svt::EmbeddedObjectRef( xObj, embed::Aspects::MSOLE_CONTENT ), aName, aInsRect );
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ *pModel,
+ ::svt::EmbeddedObjectRef(xObj, embed::Aspects::MSOLE_CONTENT),
+ aName,
+ aInsRect);
// set VisArea
if( xObj.is())
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index d16bc895a5d1..ee46cd116c43 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -373,6 +373,18 @@ void ScModelObj::CreateAndSet(ScDocShell* pDocSh)
pDocSh->SetBaseModel( new ScModelObj(pDocSh) );
}
+SdrModel* ScModelObj::getSdrModelFromUnoModel() const
+{
+ ScDocument& rDoc(pDocShell->GetDocument());
+
+ if(!rDoc.GetDrawLayer())
+ {
+ rDoc.InitDrawLayer();
+ }
+
+ return rDoc.GetDrawLayer();
+}
+
ScModelObj::ScModelObj( ScDocShell* pDocSh ) :
SfxBaseModel( pDocSh ),
aPropSet( lcl_GetDocOptPropertyMap() ),
@@ -1947,7 +1959,9 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, const uno::Any& aSelec
if( pModel )
{
- aDrawViewKeeper.mpDrawView = new FmFormView( pModel, pDev );
+ aDrawViewKeeper.mpDrawView = new FmFormView(
+ *pModel,
+ pDev);
aDrawViewKeeper.mpDrawView->ShowSdrPage(aDrawViewKeeper.mpDrawView->GetModel()->GetPage(nTab));
aDrawViewKeeper.mpDrawView->SetPrintPreview();
}
diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx
index 4be43b1354d1..bbe58cda31c9 100644
--- a/sc/source/ui/view/drawvie3.cxx
+++ b/sc/source/ui/view/drawvie3.cxx
@@ -34,8 +34,10 @@
#include <tabvwsh.hxx>
#include <docsh.hxx>
-ScDrawView::ScDrawView( OutputDevice* pOut, ScViewData* pData ) :
- FmFormView( pData->GetDocument()->GetDrawLayer(), pOut ),
+ScDrawView::ScDrawView(
+ OutputDevice* pOut,
+ ScViewData* pData )
+: FmFormView(*pData->GetDocument()->GetDrawLayer(), pOut),
pViewData( pData ),
pDev( pOut ),
pDoc( pData->GetDocument() ),
diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index de4ff2c7e003..0561a41c3d9f 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1197,7 +1197,10 @@ void ScGridWindow::PaintTile( VirtualDevice& rDevice,
ScDrawLayer* pModel = pDoc->GetDrawLayer();
if (pModel)
{
- mpLOKDrawView.reset(new FmFormView(pModel, &rDevice));
+ mpLOKDrawView.reset(
+ new FmFormView(
+ *pModel,
+ &rDevice));
mpLOKDrawView->ShowSdrPage(mpLOKDrawView->GetModel()->GetPage(nTab));
aOutputData.SetDrawView(mpLOKDrawView.get());
aOutputData.SetSpellCheckContext(mpSpellCheckCxt.get());
diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx
index ae4a3fc029cf..11596ac08e5d 100644
--- a/sc/source/ui/view/preview.cxx
+++ b/sc/source/ui/view/preview.cxx
@@ -165,7 +165,9 @@ void ScPreview::UpdateDrawView() // nTab must be right
if ( !pDrawView ) // New Drawing?
{
- pDrawView = new FmFormView( pModel, this );
+ pDrawView = new FmFormView(
+ *pModel,
+ this);
// The DrawView takes over the Design-Mode from the Model
// (Settings "In opening Draftmode"), therefore to restore here
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index cdafc4580165..58316cf16907 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -564,7 +564,10 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr
if( pModel )
{
- pDrawView.reset(new FmFormView( pModel, pDev ));
+ pDrawView.reset(
+ new FmFormView(
+ *pModel,
+ pDev));
pDrawView->ShowSdrPage(pDrawView->GetModel()->GetPage(nTab));
pDrawView->SetPrintPreview();
aOutputData.SetDrawView( pDrawView.get() );
diff --git a/sc/source/ui/view/tabvwshg.cxx b/sc/source/ui/view/tabvwshg.cxx
index ba44266d31b0..285894bc2b73 100644
--- a/sc/source/ui/view/tabvwshg.cxx
+++ b/sc/source/ui/view/tabvwshg.cxx
@@ -60,8 +60,12 @@ void ScTabViewShell::InsertURLButton( const OUString& rName, const OUString& rUR
ScDrawView* pDrView = pView->GetScDrawView();
SdrModel* pModel = pDrView->GetModel();
- SdrObject* pObj = SdrObjFactory::MakeNewObject(SdrInventor::FmForm, OBJ_FM_BUTTON,
- pDrView->GetSdrPageView()->GetPage(), pModel);
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ *pModel,
+ SdrInventor::FmForm,
+ OBJ_FM_BUTTON,
+ pDrView->GetSdrPageView()->GetPage(),
+ pModel);
SdrUnoObj* pUnoCtrl = dynamic_cast<SdrUnoObj*>( pObj );
OSL_ENSURE( pUnoCtrl, "no SdrUnoObj");
if( !pUnoCtrl )
diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx
index e1f521ce992f..1a87f9fc05f8 100644
--- a/sc/source/ui/view/viewfun7.cxx
+++ b/sc/source/ui/view/viewfun7.cxx
@@ -193,8 +193,8 @@ void ScViewFunc::PasteDraw( const Point& rLogicPos, SdrModel* pModel,
else
{
bPasteIsMove = false; // no internal move happened
-
- SdrView aView(pModel); // #i71529# never create a base class of SdrView directly!
+ // TTTT hide all non-direct SdrView constr to disable construct in-between classes
+ SdrView aView(*pModel); // #i71529# never create a base class of SdrView directly!
SdrPageView* pPv = aView.ShowSdrPage(aView.GetModel()->GetPage(0));
aView.MarkAllObj(pPv);
Size aSize = aView.GetAllMarkedRect().GetSize();
@@ -353,7 +353,11 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X
tools::Rectangle aRect( aInsPos, aSize );
ScDrawView* pDrView = GetScDrawView();
- SdrOle2Obj* pSdrObj = new SdrOle2Obj( aObjRef, aName, aRect );
+ SdrOle2Obj* pSdrObj = new SdrOle2Obj(
+ pDrView->getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ aRect);
SdrPageView* pPV = pDrView->GetSdrPageView();
pDrView->InsertObjectSafe( pSdrObj, *pPV ); // don't mark if OLE
@@ -432,7 +436,10 @@ bool ScViewFunc::PasteGraphic( const Point& rPos, const Graphic& rGraphic,
GetViewData().GetViewShell()->SetDrawShell( true );
tools::Rectangle aRect(aPos, aSize);
- SdrGrafObj* pGrafObj = new SdrGrafObj(rGraphic, aRect);
+ SdrGrafObj* pGrafObj = new SdrGrafObj(
+ pScDrawView->getSdrModelFromSdrView(),
+ rGraphic,
+ aRect);
// path was the name of the graphic in history
diff --git a/sd/inc/CustomAnimationEffect.hxx b/sd/inc/CustomAnimationEffect.hxx
index 6322d365b293..53e08b70c4af 100644
--- a/sd/inc/CustomAnimationEffect.hxx
+++ b/sd/inc/CustomAnimationEffect.hxx
@@ -25,17 +25,15 @@
#include <com/sun/star/animations/XAudio.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/util/XChangesListener.hpp>
-
#include <vcl/timer.hxx>
-
#include "sddllapi.h"
-
#include <list>
#include <vector>
#include <map>
#include <memory>
class SdrPathObj;
+class SdrModel;
namespace sd {
@@ -167,7 +165,7 @@ public:
SAL_DLLPRIVATE static sal_Int32 get_node_type( const css::uno::Reference< css::animations::XAnimationNode >& xNode );
SAL_DLLPRIVATE static sal_Int32 getNumberOfSubitems( const css::uno::Any& aTarget, sal_Int16 nIterateType );
- SAL_DLLPRIVATE SdrPathObj* createSdrPathObjFromPath();
+ SAL_DLLPRIVATE SdrPathObj* createSdrPathObjFromPath(SdrModel& rTargetModel);
SAL_DLLPRIVATE void updateSdrPathObjFromPath( SdrPathObj& rPathObj );
SAL_DLLPRIVATE void updatePathFromSdrPathObj( const SdrPathObj& rPathObj );
diff --git a/sd/source/core/CustomAnimationEffect.cxx b/sd/source/core/CustomAnimationEffect.cxx
index 2d1025db6b61..1473358706fc 100644
--- a/sd/source/core/CustomAnimationEffect.cxx
+++ b/sd/source/core/CustomAnimationEffect.cxx
@@ -1528,9 +1528,9 @@ bool CustomAnimationEffect::getStopAudio() const
return mnCommand == EffectCommands::STOPAUDIO;
}
-SdrPathObj* CustomAnimationEffect::createSdrPathObjFromPath()
+SdrPathObj* CustomAnimationEffect::createSdrPathObjFromPath(SdrModel& rTargetModel)
{
- SdrPathObj * pPathObj = new SdrPathObj( OBJ_PATHLINE );
+ SdrPathObj * pPathObj = new SdrPathObj(rTargetModel, OBJ_PATHLINE);
updateSdrPathObjFromPath( *pPathObj );
return pPathObj;
}
diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx
index ad906e23c556..e41c9131cbb4 100644
--- a/sd/source/core/sdpage.cxx
+++ b/sd/source/core/sdpage.cxx
@@ -279,7 +279,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
{
case PRESOBJ_TITLE:
{
- pSdrObj = new SdrRectObj(OBJ_TITLETEXT);
+ pSdrObj = new SdrRectObj(getSdrModelFromSdrObjList(), OBJ_TITLETEXT);
if (mbMaster)
{
@@ -290,7 +290,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_OUTLINE:
{
- pSdrObj = new SdrRectObj(OBJ_OUTLINETEXT);
+ pSdrObj = new SdrRectObj(getSdrModelFromSdrObjList(), OBJ_OUTLINETEXT);
if (mbMaster)
{
@@ -301,7 +301,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_NOTES:
{
- pSdrObj = new SdrRectObj(OBJ_TEXT);
+ pSdrObj = new SdrRectObj(getSdrModelFromSdrObjList(), OBJ_TEXT);
if (mbMaster)
{
@@ -312,7 +312,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_TEXT:
{
- pSdrObj = new SdrRectObj(OBJ_TEXT);
+ pSdrObj = new SdrRectObj(getSdrModelFromSdrObjList(), OBJ_TEXT);
}
break;
@@ -330,7 +330,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
Size aSize = aOutDev.PixelToLogic(aSizePix);
Point aPnt (0, 0);
::tools::Rectangle aRect (aPnt, aSize);
- pSdrObj = new SdrGrafObj(aGraphic, aRect);
+ pSdrObj = new SdrGrafObj(getSdrModelFromSdrObjList(), aGraphic, aRect);
aOutDev.Pop();
}
break;
@@ -338,7 +338,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_MEDIA:
case PRESOBJ_OBJECT:
{
- pSdrObj = new SdrOle2Obj();
+ pSdrObj = new SdrOle2Obj(getSdrModelFromSdrObjList());
BitmapEx aBmpEx(BMP_PRESOBJ_OBJECT);
Graphic aGraphic( aBmpEx );
static_cast<SdrOle2Obj*>(pSdrObj)->SetGraphic(aGraphic);
@@ -347,7 +347,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_CHART:
{
- pSdrObj = new SdrOle2Obj();
+ pSdrObj = new SdrOle2Obj(getSdrModelFromSdrObjList());
static_cast<SdrOle2Obj*>(pSdrObj)->SetProgName( "StarChart" );
BitmapEx aBmpEx(BMP_PRESOBJ_CHART);
Graphic aGraphic( aBmpEx );
@@ -357,7 +357,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_ORGCHART:
{
- pSdrObj = new SdrOle2Obj();
+ pSdrObj = new SdrOle2Obj(getSdrModelFromSdrObjList());
static_cast<SdrOle2Obj*>(pSdrObj)->SetProgName( "StarOrg" );
BitmapEx aBmpEx(BMP_PRESOBJ_ORGCHART);
Graphic aGraphic( aBmpEx );
@@ -368,7 +368,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_TABLE:
case PRESOBJ_CALC:
{
- pSdrObj = new SdrOle2Obj();
+ pSdrObj = new SdrOle2Obj(getSdrModelFromSdrObjList());
static_cast<SdrOle2Obj*>(pSdrObj)->SetProgName( "StarCalc" );
BitmapEx aBmpEx(BMP_PRESOBJ_TABLE);
Graphic aGraphic( aBmpEx );
@@ -381,7 +381,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
// Save the first standard page at SdrPageObj
// #i105146# We want no content to be displayed for PageKind::Handout,
// so just never set a page as content
- pSdrObj = new SdrPageObj(nullptr);
+ pSdrObj = new SdrPageObj(getSdrModelFromSdrObjList(), nullptr);
}
break;
@@ -398,11 +398,11 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
if (pModel && nDestPageNum < pModel->GetPageCount())
{
- pSdrObj = new SdrPageObj(pModel->GetPage(nDestPageNum));
+ pSdrObj = new SdrPageObj(getSdrModelFromSdrObjList(), pModel->GetPage(nDestPageNum));
}
else
{
- pSdrObj = new SdrPageObj();
+ pSdrObj = new SdrPageObj(getSdrModelFromSdrObjList());
}
pSdrObj->SetResizeProtect(true);
@@ -414,7 +414,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t
case PRESOBJ_DATETIME:
case PRESOBJ_SLIDENUMBER:
{
- pSdrObj = new SdrRectObj(OBJ_TEXT);
+ pSdrObj = new SdrRectObj(getSdrModelFromSdrObjList(), OBJ_TEXT);
bEmptyPresObj = false;
bForceText = true;
}
diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx
index 522f2bab8fc4..0822fbb436d6 100644
--- a/sd/source/filter/grf/sdgrffilter.cxx
+++ b/sd/source/filter/grf/sdgrffilter.cxx
@@ -163,62 +163,66 @@ bool SdGRFFilter::Import()
const sal_uInt16 nFilter = rGraphicFilter.GetImportFormatNumberForTypeName( mrMedium.GetFilter()->GetTypeName() );
bool bRet = false;
- SvStream* pIStm = mrMedium.GetInStream();
- ErrCode nReturn = pIStm ? rGraphicFilter.ImportGraphic( aGraphic, aFileName, *pIStm, nFilter ) : ErrCode(1);
+ SvStream* pIStm = mrMedium.GetInStream();
+ ErrCode nReturn = pIStm ? rGraphicFilter.ImportGraphic( aGraphic, aFileName, *pIStm, nFilter ) : ErrCode(1);
- if( nReturn )
- HandleGraphicFilterError( nReturn, rGraphicFilter.GetLastError().nStreamError );
- else
- {
- if( mrDocument.GetPageCount() == 0 )
- mrDocument.CreateFirstPages();
+ if( nReturn )
+ HandleGraphicFilterError( nReturn, rGraphicFilter.GetLastError().nStreamError );
+ else
+ {
+ if( mrDocument.GetPageCount() == 0 )
+ mrDocument.CreateFirstPages();
- SdPage* pPage = mrDocument.GetSdPage( 0, PageKind::Standard );
- Point aPos;
- Size aPagSize( pPage->GetSize() );
- Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
- aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)));
+ SdPage* pPage = mrDocument.GetSdPage( 0, PageKind::Standard );
+ Point aPos;
+ Size aPagSize( pPage->GetSize() );
+ Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(),
+ aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)));
- aPagSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) );
- aPagSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) );
+ aPagSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) );
+ aPagSize.AdjustHeight( -(pPage->GetUpperBorder() + pPage->GetLowerBorder()) );
- // scale to fit page
- if ( ( ( aGrfSize.Height() > aPagSize.Height() ) || ( aGrfSize.Width() > aPagSize.Width() ) ) &&
- aGrfSize.Height() && aPagSize.Height() )
- {
- double fGrfWH = static_cast<double>(aGrfSize.Width()) / aGrfSize.Height();
- double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height();
+ // scale to fit page
+ if ( ( ( aGrfSize.Height() > aPagSize.Height() ) || ( aGrfSize.Width() > aPagSize.Width() ) ) &&
+ aGrfSize.Height() && aPagSize.Height() )
+ {
+ double fGrfWH = static_cast<double>(aGrfSize.Width()) / aGrfSize.Height();
+ double fWinWH = static_cast<double>(aPagSize.Width()) / aPagSize.Height();
- // adjust graphic to page size (scales)
- if( fGrfWH < fWinWH )
- {
- aGrfSize.setWidth( static_cast<long>( aPagSize.Height() * fGrfWH ) );
- aGrfSize.setHeight( aPagSize.Height() );
- }
- else if( fGrfWH > 0.F )
- {
- aGrfSize.setWidth( aPagSize.Width() );
- aGrfSize.setHeight( static_cast<long>( aPagSize.Width() / fGrfWH ) );
- }
+ // adjust graphic to page size (scales)
+ if( fGrfWH < fWinWH )
+ {
+ aGrfSize.setWidth( static_cast<long>( aPagSize.Height() * fGrfWH ) );
+ aGrfSize.setHeight( aPagSize.Height() );
}
+ else if( fGrfWH > 0.F )
+ {
+ aGrfSize.setWidth( aPagSize.Width() );
+ aGrfSize.setHeight( static_cast<long>( aPagSize.Width() / fGrfWH ) );
+ }
+ }
- // set output rectangle for graphic
- aPos.setX( ( ( aPagSize.Width() - aGrfSize.Width() ) >> 1 ) + pPage->GetLeftBorder() );
- aPos.setY( ( ( aPagSize.Height() - aGrfSize.Height() ) >> 1 ) + pPage->GetUpperBorder() );
+ // set output rectangle for graphic
+ aPos.setX( ( ( aPagSize.Width() - aGrfSize.Width() ) >> 1 ) + pPage->GetLeftBorder() );
+ aPos.setY( ( ( aPagSize.Height() - aGrfSize.Height() ) >> 1 ) + pPage->GetUpperBorder() );
+
+ pPage->InsertObject(
+ new SdrGrafObj(
+ pPage->getSdrModelFromSdrObjList(),
+ aGraphic,
+ ::tools::Rectangle(aPos, aGrfSize)));
+ bRet = true;
+ }
- pPage->InsertObject( new SdrGrafObj( aGraphic, ::tools::Rectangle( aPos, aGrfSize ) ) );
- bRet = true;
- }
return bRet;
}
bool SdGRFFilter::Export()
{
// SJ: todo: error handling, the GraphicExportFilter does not support proper errorhandling
-
bool bRet = false;
- uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ uno::Reference< uno::XComponentContext > xContext = ::comphelper::getProcessComponentContext();
uno::Reference< drawing::XGraphicExportFilter > xExporter = drawing::GraphicExportFilter::create( xContext );
SdPage* pPage = nullptr;
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index d93fa3dd8280..56eed187444d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -2688,7 +2688,9 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
aMediaURL = ReadSound( nRef );
if ( !aMediaURL.isEmpty() )
{
- SdrMediaObj* pMediaObj = new SdrMediaObj( pObj->GetSnapRect() );
+ SdrMediaObj* pMediaObj = new SdrMediaObj(
+ pObj->getSdrModelFromSdrObject(),
+ pObj->GetSnapRect());
pMediaObj->SetModel( pObj->GetModel() );
pMediaObj->SetMergedItemSet( pObj->GetMergedItemSet() );
diff --git a/sd/source/ui/animations/motionpathtag.cxx b/sd/source/ui/animations/motionpathtag.cxx
index 373f25149d87..c54d991ba42a 100644
--- a/sd/source/ui/animations/motionpathtag.cxx
+++ b/sd/source/ui/animations/motionpathtag.cxx
@@ -316,7 +316,7 @@ MotionPathTag::MotionPathTag( CustomAnimationPane& rPane, ::sd::View& rView, con
, msLastPath( pEffect->getPath() )
, mbInUpdatePath( false )
{
- mpPathObj = mpEffect->createSdrPathObjFromPath();
+ mpPathObj = mpEffect->createSdrPathObjFromPath(rView.getSdrModelFromSdrView());
mxPolyPoly = mpPathObj->GetPathPoly();
if (mxOrigin.is())
maOriginPos = mxOrigin->getPosition();
diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx
index a9b324d1fd24..5eea85808f02 100644
--- a/sd/source/ui/dlg/animobjs.cxx
+++ b/sd/source/ui/dlg/animobjs.cxx
@@ -852,7 +852,7 @@ void AnimationWindow::AddObj (::sd::View& rView )
}
else
{
- SdrObjGroup* pCloneGroup = new SdrObjGroup;
+ SdrObjGroup* pCloneGroup = new SdrObjGroup(rView.getSdrModelFromSdrView());
SdrObjList* pObjList = pCloneGroup->GetSubList();
for (size_t nObject= 0; nObject < nMarkCount; ++nObject)
@@ -1000,7 +1000,9 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
aAnimation.SetLoopCount( nLoopCount );
}
- SdrGrafObj* pGrafObj = new SdrGrafObj( Graphic( aAnimation ) );
+ SdrGrafObj* pGrafObj = new SdrGrafObj(
+ rView.getSdrModelFromSdrView(),
+ Graphic(aAnimation));
const Point aOrg( aWindowCenter.X() - ( aMaxSizeLog.Width() >> 1 ), aWindowCenter.Y() - ( aMaxSizeLog.Height() >> 1 ) );
pGrafObj->SetLogicRect( ::tools::Rectangle( aOrg, aMaxSizeLog ) );
@@ -1073,7 +1075,7 @@ void AnimationWindow::CreateAnimObj (::sd::View& rView )
if(pTargetSdPage)
{
// create animation group
- SdrObjGroup* pGroup = new SdrObjGroup;
+ SdrObjGroup* pGroup = new SdrObjGroup(rView.getSdrModelFromSdrView());
SdrObjList* pObjList = pGroup->GetSubList();
for (size_t i = 0; i < nCount; ++i)
diff --git a/sd/source/ui/func/fucon3d.cxx b/sd/source/ui/func/fucon3d.cxx
index 5fe097765688..f56f0a6fab2d 100644
--- a/sd/source/ui/func/fucon3d.cxx
+++ b/sd/source/ui/func/fucon3d.cxx
@@ -89,6 +89,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
case SID_3D_CUBE:
{
p3DObj = new E3dCubeObj(
+ mpView->getSdrModelFromSdrView(),
mpView->Get3DDefaultAttributes(),
::basegfx::B3DPoint(-2500, -2500, -2500),
::basegfx::B3DVector(5000, 5000, 5000));
@@ -98,6 +99,7 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
case SID_3D_SPHERE:
{
p3DObj = new E3dSphereObj(
+ mpView->getSdrModelFromSdrView(),
mpView->Get3DDefaultAttributes(),
::basegfx::B3DPoint(0, 0, 0),
::basegfx::B3DVector(5000, 5000, 5000));
@@ -114,7 +116,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
{
aB2DPolygon = ::basegfx::utils::adaptiveSubdivideByAngle(aB2DPolygon);
}
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aB2DPolygon));
+ p3DObj = new E3dLatheObj(
+ mpView->getSdrModelFromSdrView(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aB2DPolygon));
/* this is an open object, therefore it has to be handled double-
sided by default */
@@ -141,7 +146,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
{
aB2DPolygon = ::basegfx::utils::adaptiveSubdivideByAngle(aB2DPolygon);
}
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aB2DPolygon));
+ p3DObj = new E3dLatheObj(
+ mpView->getSdrModelFromSdrView(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aB2DPolygon));
break;
}
@@ -152,7 +160,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
{
aB2DPolygon = ::basegfx::utils::adaptiveSubdivideByAngle(aB2DPolygon);
}
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aB2DPolygon));
+ p3DObj = new E3dLatheObj(
+ mpView->getSdrModelFromSdrView(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aB2DPolygon));
break;
}
@@ -178,7 +189,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
aInnerPoly.append(::basegfx::B2DPoint(0, -1000*5));
aInnerPoly.setClosed(true);
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aInnerPoly));
+ p3DObj = new E3dLatheObj(
+ mpView->getSdrModelFromSdrView(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aInnerPoly));
break;
}
@@ -202,7 +216,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
aInnerPoly.append(::basegfx::B2DPoint(0, 1000*5));
aInnerPoly.setClosed(true);
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aInnerPoly));
+ p3DObj = new E3dLatheObj(
+ mpView->getSdrModelFromSdrView(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aInnerPoly));
break;
}
@@ -226,7 +243,10 @@ E3dCompoundObject* FuConstruct3dObject::ImpCreateBasic3DShape()
aInnerPoly.append(::basegfx::B2DPoint(0, 1000*5));
aInnerPoly.setClosed(true);
- p3DObj = new E3dLatheObj(mpView->Get3DDefaultAttributes(), ::basegfx::B2DPolyPolygon(aInnerPoly));
+ p3DObj = new E3dLatheObj(
+ mpView->getSdrModelFromSdrView(),
+ mpView->Get3DDefaultAttributes(),
+ ::basegfx::B2DPolyPolygon(aInnerPoly));
p3DObj->SetMergedItem(makeSvx3DHorizontalSegmentsItem(4));
break;
}
@@ -373,7 +393,7 @@ SdrObject* FuConstruct3dObject::CreateDefaultObject(const sal_uInt16 nID, const
double fW(aVolume.getWidth());
double fH(aVolume.getHeight());
::tools::Rectangle a3DRect(0, 0, static_cast<long>(fW), static_cast<long>(fH));
- E3dScene* pScene = new E3dScene;
+ E3dScene* pScene = new E3dScene(mpView->getSdrModelFromSdrView());
// copied code from E3dView::InitScene
double fCamZ(aVolume.getMaxZ() + ((fW + fH) / 4.0));
diff --git a/sd/source/ui/func/fuconarc.cxx b/sd/source/ui/func/fuconarc.cxx
index 7d6aca665a37..83facbfd2efc 100644
--- a/sd/source/ui/func/fuconarc.cxx
+++ b/sd/source/ui/func/fuconarc.cxx
@@ -91,10 +91,12 @@ void FuConstructArc::DoExecute( SfxRequest& rReq )
Activate(); // sets aObjKind
SdrCircObj* pNewCircle =
- new SdrCircObj(static_cast<SdrObjKind>(mpView->GetCurrentObjIdentifier()),
- aNewRectangle,
- static_cast<long>(pPhiStart->GetValue () * 10.0),
- static_cast<long>(pPhiEnd->GetValue () * 10.0));
+ new SdrCircObj(
+ mpView->getSdrModelFromSdrView(),
+ static_cast<SdrObjKind>(mpView->GetCurrentObjIdentifier()),
+ aNewRectangle,
+ static_cast<long>(pPhiStart->GetValue () * 10.0),
+ static_cast<long>(pPhiEnd->GetValue () * 10.0));
SdrPageView *pPV = mpView->GetSdrPageView();
mpView->InsertObjectAtView(pNewCircle, *pPV, SdrInsertFlags::SETDEFLAYER);
@@ -202,8 +204,11 @@ SdrObject* FuConstructArc::CreateDefaultObject(const sal_uInt16 nID, const ::too
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- nullptr, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->GetCurrentObjInventor(),
+ mpView->GetCurrentObjIdentifier(),
+ nullptr,
+ mpDoc);
if(pObj)
{
diff --git a/sd/source/ui/func/fuconbez.cxx b/sd/source/ui/func/fuconbez.cxx
index e7cc868d495b..5b72ff9b0d1f 100644
--- a/sd/source/ui/func/fuconbez.cxx
+++ b/sd/source/ui/func/fuconbez.cxx
@@ -309,8 +309,11 @@ SdrObject* FuConstructBezierPolygon::CreateDefaultObject(const sal_uInt16 nID, c
// case SID_DRAW_BEZIER_NOFILL: // BASIC
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- nullptr, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->GetCurrentObjInventor(),
+ mpView->GetCurrentObjIdentifier(),
+ nullptr,
+ mpDoc);
if(pObj)
{
diff --git a/sd/source/ui/func/fuconcs.cxx b/sd/source/ui/func/fuconcs.cxx
index 6396eeb46e82..a70af6b8bb40 100644
--- a/sd/source/ui/func/fuconcs.cxx
+++ b/sd/source/ui/func/fuconcs.cxx
@@ -236,7 +236,9 @@ const OUString& FuConstructCustomShape::GetShapeType() const
SdrObject* FuConstructCustomShape::CreateDefaultObject(const sal_uInt16, const ::tools::Rectangle& rRectangle)
{
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
+ mpView->getSdrModelFromSdrView(),
+ mpView->GetCurrentObjInventor(),
+ mpView->GetCurrentObjIdentifier(),
nullptr, mpDoc);
if( pObj )
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index 1377429ed056..8cf49d7b69d0 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -109,7 +109,10 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq )
pCenterY->GetValue () - pAxisY->GetValue () / 2,
pCenterX->GetValue () + pAxisX->GetValue () / 2,
pCenterY->GetValue () + pAxisY->GetValue () / 2);
- SdrCircObj *pNewCircle = new SdrCircObj (OBJ_CIRC, aNewRectangle);
+ SdrCircObj *pNewCircle = new SdrCircObj(
+ mpView->getSdrModelFromSdrView(),
+ OBJ_CIRC,
+ aNewRectangle);
SdrPageView *pPV = mpView->GetSdrPageView();
mpView->InsertObjectAtView(pNewCircle, *pPV, SdrInsertFlags::SETDEFLAYER | SdrInsertFlags::SETDEFATTR);
@@ -127,7 +130,9 @@ void FuConstructRectangle::DoExecute( SfxRequest& rReq )
pMouseStartY->GetValue (),
pMouseEndX->GetValue (),
pMouseEndY->GetValue ());
- SdrRectObj *pNewRect = new SdrRectObj (aNewRectangle);
+ SdrRectObj *pNewRect = new SdrRectObj(
+ mpView->getSdrModelFromSdrView(),
+ aNewRectangle);
SdrPageView *pPV = mpView->GetSdrPageView();
mpView->InsertObjectAtView(pNewRect, *pPV, SdrInsertFlags::SETDEFLAYER | SdrInsertFlags::SETDEFATTR);
@@ -764,7 +769,9 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
// case SID_CONNECTOR_LINES_CIRCLES:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
+ mpView->getSdrModelFromSdrView(),
+ mpView->GetCurrentObjInventor(),
+ mpView->GetCurrentObjIdentifier(),
nullptr, mpDoc);
if(pObj)
diff --git a/sd/source/ui/func/fuconuno.cxx b/sd/source/ui/func/fuconuno.cxx
index 935cb0c50157..bec0857e4813 100644
--- a/sd/source/ui/func/fuconuno.cxx
+++ b/sd/source/ui/func/fuconuno.cxx
@@ -138,7 +138,9 @@ SdrObject* FuConstructUnoControl::CreateDefaultObject(const sal_uInt16, const ::
// case SID_FM_CREATE_CONTROL:
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
+ mpView->getSdrModelFromSdrView(),
+ mpView->GetCurrentObjInventor(),
+ mpView->GetCurrentObjIdentifier(),
nullptr, mpDoc);
if(pObj)
diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx
index 312a03d4c557..1f9222ad216c 100644
--- a/sd/source/ui/func/fuinsert.cxx
+++ b/sd/source/ui/func/fuinsert.cxx
@@ -386,7 +386,11 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
aRect = ::tools::Rectangle(aPos, aSize);
}
- SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aObjName, aRect );
+ SdrOle2Obj* pOleObj = new SdrOle2Obj(
+ mpView->getSdrModelFromSdrView(),
+ svt::EmbeddedObjectRef( xObj, nAspect ),
+ aObjName,
+ aRect);
SdrPageView* pPV = mpView->GetSdrPageView();
// if we have a pick obj we need to make this new ole a pres obj replacing the current pick obj
@@ -613,8 +617,11 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq )
Point aPnt ((aPageSize.Width() - aSize.Width()) / 2,
(aPageSize.Height() - aSize.Height()) / 2);
::tools::Rectangle aRect (aPnt, aSize);
-
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect);
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ mpView->getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ aRect);
if( mpView->InsertObjectAtView(pObj, *pPV, SdrInsertFlags::SETDEFLAYER) )
{
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index bc1956e2993a..370634172884 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -506,7 +506,9 @@ void FuInsertFile::InsTextOrRTFinDrMode(SfxMedium* pMedium)
}
else
{
- SdrRectObj* pTO = new SdrRectObj(OBJ_TEXT);
+ SdrRectObj* pTO = new SdrRectObj(
+ mpView->getSdrModelFromSdrView(),
+ OBJ_TEXT);
pTO->SetOutlinerParaObject(pOPO);
const bool bUndo = mpView->IsUndoEnabled();
diff --git a/sd/source/ui/func/fumorph.cxx b/sd/source/ui/func/fumorph.cxx
index b78c018747ed..03aa0b0ad656 100644
--- a/sd/source/ui/func/fumorph.cxx
+++ b/sd/source/ui/func/fumorph.cxx
@@ -384,7 +384,7 @@ void FuMorph::ImpInsertPolygons(
if ( pPageView )
{
SfxItemSet aSet( aSet1 );
- SdrObjGroup* pObjGroup = new SdrObjGroup;
+ SdrObjGroup* pObjGroup = new SdrObjGroup(mpView->getSdrModelFromSdrView());
SdrObjList* pObjList = pObjGroup->GetSubList();
const size_t nCount = rPolyPolyList3D.size();
const double fStep = 1. / ( nCount + 1 );
@@ -397,7 +397,10 @@ void FuMorph::ImpInsertPolygons(
for ( size_t i = 0; i < nCount; i++, fFactor += fStep )
{
const ::basegfx::B2DPolyPolygon& rPolyPoly3D = *rPolyPolyList3D[ i ];
- SdrPathObj* pNewObj = new SdrPathObj(OBJ_POLY, rPolyPoly3D);
+ SdrPathObj* pNewObj = new SdrPathObj(
+ mpView->getSdrModelFromSdrView(),
+ OBJ_POLY,
+ rPolyPoly3D);
// line color
if ( bLineColor )
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index 300e17c09cc5..78f01f6bd77f 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -1304,10 +1304,12 @@ void FuText::DoubleClick(const MouseEvent& )
*/
SdrObject* FuText::CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle& rRectangle)
{
-
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- mpView->GetCurrentObjInventor(), mpView->GetCurrentObjIdentifier(),
- nullptr, mpDoc);
+ mpView->getSdrModelFromSdrView(),
+ mpView->GetCurrentObjInventor(),
+ mpView->GetCurrentObjIdentifier(),
+ nullptr,
+ mpDoc);
if(pObj)
{
diff --git a/sd/source/ui/inc/unomodel.hxx b/sd/source/ui/inc/unomodel.hxx
index 67770cc27313..3df8e955fb25 100644
--- a/sd/source/ui/inc/unomodel.hxx
+++ b/sd/source/ui/inc/unomodel.hxx
@@ -128,6 +128,10 @@ private:
sd::DrawViewShell* GetViewShell();
+protected:
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModelFromUnoModel() const;
+
public:
SdXImpressDocument(::sd::DrawDocShell* pShell, bool bClipBoard);
SdXImpressDocument(SdDrawDocument* pDoc, bool bClipBoard);
diff --git a/sd/source/ui/table/tablefunction.cxx b/sd/source/ui/table/tablefunction.cxx
index dd3e6a4f0dd3..c41bd5d4e693 100644
--- a/sd/source/ui/table/tablefunction.cxx
+++ b/sd/source/ui/table/tablefunction.cxx
@@ -183,7 +183,11 @@ void DrawViewShell::FuTable(SfxRequest& rReq)
aRect = ::tools::Rectangle(aPos, aSize);
}
- sdr::table::SdrTableObj* pObj = new sdr::table::SdrTableObj( GetDoc(), aRect, nColumns, nRows );
+ sdr::table::SdrTableObj* pObj = new sdr::table::SdrTableObj(
+ *GetDoc(), // TTTT reference?
+ aRect,
+ nColumns,
+ nRows);
pObj->NbcSetStyleSheet( GetDoc()->GetDefaultStyleSheet(), true );
apply_table_style( pObj, GetDoc(), sTableStyle );
SdrPageView* pPV = mpView->GetSdrPageView();
@@ -271,7 +275,11 @@ void CreateTableFromRTF( SvStream& rStream, SdDrawDocument* pModel )
{
Size aSize( 200, 200 );
::tools::Rectangle aRect (Point(), aSize);
- sdr::table::SdrTableObj* pObj = new sdr::table::SdrTableObj( pModel, aRect, 1, 1 );
+ sdr::table::SdrTableObj* pObj = new sdr::table::SdrTableObj(
+ *pModel,
+ aRect,
+ 1,
+ 1);
pObj->NbcSetStyleSheet( pModel->GetDefaultStyleSheet(), true );
apply_table_style( pObj, pModel, OUString() );
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index afe7ede9bde5..b6ee7d5d1122 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -2714,6 +2714,11 @@ void SdXImpressDocument::initializeDocument()
}
}
+SdrModel* SdXImpressDocument::getSdrModelFromUnoModel() const
+{
+ return GetDoc();
+}
+
void SAL_CALL SdXImpressDocument::dispose()
{
if( !mbDisposed )
diff --git a/sd/source/ui/view/DocumentRenderer.cxx b/sd/source/ui/view/DocumentRenderer.cxx
index c89213c5880d..432146681d78 100644
--- a/sd/source/ui/view/DocumentRenderer.cxx
+++ b/sd/source/ui/view/DocumentRenderer.cxx
@@ -1526,7 +1526,10 @@ private:
std::vector< ::tools::Rectangle >::iterator iter( aAreas.begin() );
while( iter != aAreas.end() )
{
- pHandout->NbcInsertObject( new SdrPageObj((*iter++)) );
+ pHandout->NbcInsertObject(
+ new SdrPageObj(
+ rModel,
+ (*iter++)));
if( bDrawLines && (iter != aAreas.end()) )
{
@@ -1546,7 +1549,10 @@ private:
aPathPoly.append( aPoly );
}
- SdrPathObj* pPathObj = new SdrPathObj(OBJ_PATHLINE, aPathPoly );
+ SdrPathObj* pPathObj = new SdrPathObj(
+ rModel,
+ OBJ_PATHLINE,
+ aPathPoly);
pPathObj->SetMergedItem(XLineStyleItem(drawing::LineStyle_SOLID));
pPathObj->SetMergedItem(XLineColorItem(OUString(), COL_BLACK));
diff --git a/sd/source/ui/view/drawview.cxx b/sd/source/ui/view/drawview.cxx
index 56a07fdb6486..95a4807e43c3 100644
--- a/sd/source/ui/view/drawview.cxx
+++ b/sd/source/ui/view/drawview.cxx
@@ -78,12 +78,15 @@ namespace sd {
* that there is no page a page is created.
*/
-DrawView::DrawView( DrawDocShell* pDocSh, OutputDevice* pOutDev, DrawViewShell* pShell)
-: ::sd::View(*pDocSh->GetDoc(), pOutDev, pShell)
-, mpDocShell(pDocSh)
-, mpDrawViewShell(pShell)
-, mpVDev(nullptr)
-, mnPOCHSmph(0)
+DrawView::DrawView(
+ DrawDocShell* pDocSh,
+ OutputDevice* pOutDev,
+ DrawViewShell* pShell)
+: ::sd::View(*pDocSh->GetDoc(), pOutDev, pShell)
+ ,mpDocShell(pDocSh)
+ ,mpDrawViewShell(pShell)
+ ,mpVDev(nullptr)
+ ,mnPOCHSmph(0)
{
SetCurrentObj(OBJ_RECT);
}
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 04631d87f861..e575b799e35d 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -520,7 +520,9 @@ public:
if (!pMasterPage)
continue;
- SdrRectObj* pObject = new SdrRectObj(OBJ_TEXT);
+ SdrRectObj* pObject = new SdrRectObj(
+ *m_rDrawViewShell.GetDoc(), // TTTT
+ OBJ_TEXT);
pObject->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
pObject->SetOutlinerParaObject(pOutliner->CreateParaObject());
pMasterPage->InsertObject(pObject);
@@ -1085,7 +1087,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
// create new object
- SdrGrafObj* pGraphicObj = new SdrGrafObj (aGraphic);
+ SdrGrafObj* pGraphicObj = new SdrGrafObj(
+ *GetDoc(),
+ aGraphic);
// get some necessary info and ensure it
const SdrMarkList& rMarkList(mpDrawView->GetMarkedObjectList());
@@ -2340,7 +2344,9 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
pOutl->QuickInsertField( *pFieldItem, ESelection() );
OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
- SdrRectObj* pRectObj = new SdrRectObj( OBJ_TEXT );
+ SdrRectObj* pRectObj = new SdrRectObj(
+ *GetDoc(),
+ OBJ_TEXT);
pRectObj->SetMergedItem(makeSdrTextAutoGrowWidthItem(true));
pOutl->UpdateFields();
diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx
index 1181d6c7d820..e396b8ec6ea8 100644
--- a/sd/source/ui/view/drviews8.cxx
+++ b/sd/source/ui/view/drviews8.cxx
@@ -120,7 +120,10 @@ void DrawViewShell::ScannerEvent()
if( bInsertNewObject )
{
- auto pGrafObj = new SdrGrafObj( Graphic( aScanBmp ), aRect );
+ auto pGrafObj = new SdrGrafObj(
+ GetView()->getSdrModelFromSdrView(),
+ Graphic(aScanBmp),
+ aRect);
SdrPageView* pPV = GetView()->GetSdrPageView();
GetView()->InsertObjectAtView( pGrafObj, *pPV, SdrInsertFlags::SETDEFLAYER );
}
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 4c2e6b1c3203..afc151b29a96 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -169,7 +169,10 @@ void DrawViewShell::ExecGallery(SfxRequest const & rReq)
if( bInsertNewObject )
{
- pGrafObj = new SdrGrafObj(aGraphic, aRect);
+ pGrafObj = new SdrGrafObj(
+ GetView()->getSdrModelFromSdrView(),
+ aGraphic,
+ aRect);
SdrPageView* pPV = mpDrawView->GetSdrPageView();
mpDrawView->InsertObjectAtView(pGrafObj, *pPV, SdrInsertFlags::SETDEFLAYER);
}
diff --git a/sd/source/ui/view/drviewse.cxx b/sd/source/ui/view/drviewse.cxx
index 0b082d9e18a9..0709c07d5db3 100644
--- a/sd/source/ui/view/drviewse.cxx
+++ b/sd/source/ui/view/drviewse.cxx
@@ -1458,7 +1458,9 @@ void DrawViewShell::InsertURLField(const OUString& rURL, const OUString& rText,
pOutl->QuickInsertField( aURLItem, ESelection() );
OutlinerParaObject* pOutlParaObject = pOutl->CreateParaObject();
- SdrRectObj* pRectObj = new SdrRectObj(OBJ_TEXT);
+ SdrRectObj* pRectObj = new SdrRectObj(
+ GetView()->getSdrModelFromSdrView(),
+ OBJ_TEXT);
pOutl->UpdateFields();
pOutl->SetUpdateMode( true );
@@ -1534,8 +1536,13 @@ void DrawViewShell::InsertURLButton(const OUString& rURL, const OUString& rText,
if (bNewObj) try
{
- SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >( SdrObjFactory::MakeNewObject(SdrInventor::FmForm, OBJ_FM_BUTTON,
- mpDrawView->GetSdrPageView()->GetPage(), GetDoc()) );
+ SdrUnoObj* pUnoCtrl = static_cast< SdrUnoObj* >(
+ SdrObjFactory::MakeNewObject(
+ GetView()->getSdrModelFromSdrView(),
+ SdrInventor::FmForm,
+ OBJ_FM_BUTTON,
+ mpDrawView->GetSdrPageView()->GetPage(),
+ GetDoc()));
Reference< awt::XControlModel > xControlModel( pUnoCtrl->GetUnoControlModel(), uno::UNO_QUERY_THROW );
Reference< beans::XPropertySet > xPropSet( xControlModel, uno::UNO_QUERY_THROW );
diff --git a/sd/source/ui/view/frmview.cxx b/sd/source/ui/view/frmview.cxx
index 3795f9e09b4f..3ac368ce2673 100644
--- a/sd/source/ui/view/frmview.cxx
+++ b/sd/source/ui/view/frmview.cxx
@@ -51,7 +51,7 @@ using namespace ::std;
namespace sd {
FrameView::FrameView(SdDrawDocument* pDrawDoc, FrameView* pFrameView /* = NULK */)
- : SdrView(pDrawDoc, nullptr),
+: SdrView(*pDrawDoc, nullptr), // TTTT SdDrawDocument* -> reference?
mnRefCount(0),
mnPresViewShellId(SID_VIEWSHELL0),
mbIsNavigatorShowingAllShapes(false)
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index d0344d2ab4e5..d9e0418a43d5 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -104,10 +104,11 @@ using namespace com::sun::star::uno;
using namespace sdr::table;
namespace sd {
-
-View::View(SdDrawDocument& rDrawDoc, OutputDevice* pOutDev,
- ViewShell* pViewShell)
- : FmFormView(&rDrawDoc, pOutDev),
+View::View(
+ SdDrawDocument& rDrawDoc,
+ OutputDevice* pOutDev,
+ ViewShell* pViewShell)
+: FmFormView(rDrawDoc, pOutDev),
mrDoc(rDrawDoc),
mpDocSh(rDrawDoc.GetDocSh()),
mpViewSh(pViewShell),
diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx
index c0f5f5e19413..d36ccbb75528 100644
--- a/sd/source/ui/view/sdview3.cxx
+++ b/sd/source/ui/view/sdview3.cxx
@@ -995,7 +995,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
maDropPos.AdjustY( -(std::min( aSize.Height(), aMaxSize.Height() ) >> 1) );
::tools::Rectangle aRect( maDropPos, aSize );
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect );
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ aRect);
SdrPageView* pPV = GetSdrPageView();
SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER;
@@ -1165,7 +1169,11 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper,
maDropPos.AdjustY( -(std::min( aSize.Height(), aMaxSize.Height() ) >> 1) );
::tools::Rectangle aRect( maDropPos, aSize );
- SdrOle2Obj* pObj = new SdrOle2Obj( aObjRef, aName, aRect );
+ SdrOle2Obj* pObj = new SdrOle2Obj(
+ getSdrModelFromSdrView(),
+ aObjRef,
+ aName,
+ aRect);
SdrPageView* pPV = GetSdrPageView();
SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER;
diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx
index f98a8ab1b216..fb17fcc2df24 100644
--- a/sd/source/ui/view/sdview4.cxx
+++ b/sd/source/ui/view/sdview4.cxx
@@ -116,7 +116,10 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
}
else
{
- pNewGrafObj = new SdrGrafObj( rGraphic, pPickObj->GetLogicRect() );
+ pNewGrafObj = new SdrGrafObj(
+ getSdrModelFromSdrView(),
+ rGraphic,
+ pPickObj->GetLogicRect());
pNewGrafObj->SetEmptyPresObj(true);
}
@@ -189,7 +192,10 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction,
MapMode( MapUnit::Map100thMM ) );
}
- pNewGrafObj = new SdrGrafObj( rGraphic, ::tools::Rectangle( rPos, aSize ) );
+ pNewGrafObj = new SdrGrafObj(
+ getSdrModelFromSdrView(),
+ rGraphic,
+ ::tools::Rectangle(rPos, aSize));
SdrPage* pPage = pPV->GetPage();
Size aPageSize( pPage->GetSize() );
aPageSize.AdjustWidth( -(pPage->GetLeftBorder() + pPage->GetRightBorder()) );
@@ -329,7 +335,9 @@ SdrMediaObj* View::InsertMediaObj( const OUString& rMediaURL, const OUString& rM
pUserCall = pPickObj->GetUserCall(); // ReplaceObjectAtView can free pPickObj
}
- pNewMediaObj = new SdrMediaObj( aRect );
+ pNewMediaObj = new SdrMediaObj(
+ getSdrModelFromSdrView(),
+ aRect);
bool bIsPres = false;
if( pPickObj )
@@ -529,7 +537,11 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void)
aRect = ::tools::Rectangle( maDropPos, aSize );
- SdrOle2Obj* pOleObj = new SdrOle2Obj( svt::EmbeddedObjectRef( xObj, nAspect ), aName, aRect );
+ SdrOle2Obj* pOleObj = new SdrOle2Obj(
+ getSdrModelFromSdrView(),
+ svt::EmbeddedObjectRef(xObj, nAspect),
+ aName,
+ aRect);
SdrInsertFlags nOptions = SdrInsertFlags::SETDEFLAYER;
if (mpViewSh != nullptr)
diff --git a/svx/source/customshapes/EnhancedCustomShape2d.cxx b/svx/source/customshapes/EnhancedCustomShape2d.cxx
index 2386b5887d8f..f2a00feaad80 100644
--- a/svx/source/customshapes/EnhancedCustomShape2d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape2d.cxx
@@ -1980,7 +1980,10 @@ void EnhancedCustomShape2d::CreateSubPath(
{
basegfx::B2DPolyPolygon aClosedPolyPolygon(aNewB2DPolyPolygon);
aClosedPolyPolygon.setClosed(true);
- SdrPathObj* pFill = new SdrPathObj(OBJ_POLY, aClosedPolyPolygon);
+ SdrPathObj* pFill = new SdrPathObj(
+ mrSdrObjCustomShape.getSdrModelFromSdrObject(),
+ OBJ_POLY,
+ aClosedPolyPolygon);
SfxItemSet aTempSet(*this);
aTempSet.Put(makeSdrShadowItem(false));
aTempSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1995,6 +1998,7 @@ void EnhancedCustomShape2d::CreateSubPath(
// to correct the polygon (here: open it) using the type, the last edge may get lost.
// Thus, use a type that fits the polygon
SdrPathObj* pStroke = new SdrPathObj(
+ mrSdrObjCustomShape.getSdrModelFromSdrObject(),
aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN,
aNewB2DPolyPolygon);
SfxItemSet aTempSet(*this);
@@ -2014,6 +2018,7 @@ void EnhancedCustomShape2d::CreateSubPath(
{
// see comment above about OBJ_PLIN
pObj = new SdrPathObj(
+ mrSdrObjCustomShape.getSdrModelFromSdrObject(),
aNewB2DPolyPolygon.isClosed() ? OBJ_POLY : OBJ_PLIN,
aNewB2DPolyPolygon);
aTempSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
@@ -2021,7 +2026,10 @@ void EnhancedCustomShape2d::CreateSubPath(
else
{
aNewB2DPolyPolygon.setClosed(true);
- pObj = new SdrPathObj(OBJ_POLY, aNewB2DPolyPolygon);
+ pObj = new SdrPathObj(
+ mrSdrObjCustomShape.getSdrModelFromSdrObject(),
+ OBJ_POLY,
+ aNewB2DPolyPolygon);
}
if(bNoStroke)
@@ -2372,7 +2380,7 @@ SdrObject* EnhancedCustomShape2d::CreatePathObj( bool bLineGeometryNeededOnly )
// copy remaining objects to pRet
if(vObjectList.size() > 1)
{
- pRet = new SdrObjGroup;
+ pRet = new SdrObjGroup(mrSdrObjCustomShape.getSdrModelFromSdrObject());
for ( std::pair< SdrPathObj*, double >& rCandidate : vObjectList )
{
@@ -2404,7 +2412,7 @@ SdrObject* EnhancedCustomShape2d::CreateObject( bool bLineGeometryNeededOnly )
if ( eSpType == mso_sptRectangle )
{
- pRet = new SdrRectObj( aLogicRect );
+ pRet = new SdrRectObj(mrSdrObjCustomShape.getSdrModelFromSdrObject(), aLogicRect);
pRet->SetMergedItemSet( *this );
}
if ( !pRet )
diff --git a/svx/source/customshapes/EnhancedCustomShape3d.cxx b/svx/source/customshapes/EnhancedCustomShape3d.cxx
index 60177fc9fbe8..4a95f2c7d850 100644
--- a/svx/source/customshapes/EnhancedCustomShape3d.cxx
+++ b/svx/source/customshapes/EnhancedCustomShape3d.cxx
@@ -326,7 +326,7 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
a3DDefaultAttr.SetDefaultLatheCharacterMode( true );
a3DDefaultAttr.SetDefaultExtrudeCharacterMode( true );
- E3dScene* pScene = new E3dScene;
+ E3dScene* pScene = new E3dScene(rSdrObjCustomShape.getSdrModelFromSdrObject());
bool bSceneHasObjects ( false );
bool bUseTwoFillStyles( false );
@@ -480,10 +480,15 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
aBoundRect2d.Union( aBoundRect );
// #i122777# depth 0 is okay for planes when using double-sided
- E3dCompoundObject* p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPoly, bUseTwoFillStyles ? 0 : fDepth );
+ E3dCompoundObject* p3DObj = new E3dExtrudeObj(
+ rSdrObjCustomShape.getSdrModelFromSdrObject(),
+ a3DDefaultAttr,
+ aPolyPoly,
+ bUseTwoFillStyles ? 0 : fDepth );
p3DObj->NbcSetLayer( pShape2d->GetLayer() );
p3DObj->SetMergedItemSet( aLocalSet );
+
if ( bIsPlaceholderObject )
aPlaceholderObjectList.push_back( p3DObj );
else if ( bUseTwoFillStyles )
@@ -530,7 +535,11 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
}
}
pScene->Insert3DObj( p3DObj );
- p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPoly, fDepth );
+ p3DObj = new E3dExtrudeObj(
+ rSdrObjCustomShape.getSdrModelFromSdrObject(),
+ a3DDefaultAttr,
+ aPolyPoly,
+ fDepth);
p3DObj->NbcSetLayer( pShape2d->GetLayer() );
p3DObj->SetMergedItemSet( aLocalSet );
if ( bUseExtrusionColor )
@@ -541,7 +550,11 @@ SdrObject* EnhancedCustomShape3d::Create3DObject(
pScene->Insert3DObj( p3DObj );
// #i122777# depth 0 is okay for planes when using double-sided
- p3DObj = new E3dExtrudeObj( a3DDefaultAttr, aPolyPoly, 0 );
+ p3DObj = new E3dExtrudeObj(
+ rSdrObjCustomShape.getSdrModelFromSdrObject(),
+ a3DDefaultAttr,
+ aPolyPoly,
+ 0);
p3DObj->NbcSetLayer( pShape2d->GetLayer() );
p3DObj->SetMergedItemSet( aLocalSet );
diff --git a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
index 133c008ebc4e..dd9b1b800737 100644
--- a/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeEngine.cxx
@@ -167,7 +167,7 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText(
if ( dynamic_cast<const SdrObjGroup*>( pRenderedShape) == nullptr )
{
SdrObject* pTmp = pRenderedShape;
- pRenderedShape = new SdrObjGroup();
+ pRenderedShape = new SdrObjGroup(rSdrObjCustomShape.getSdrModelFromSdrObject());
static_cast<SdrObjGroup*>(pRenderedShape)->GetSubList()->NbcInsertObject( pTmp );
}
static_cast<SdrObjGroup*>(pRenderedShape)->GetSubList()->NbcInsertObject( pShadowGeometry->Clone(), 0 );
@@ -181,6 +181,7 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText(
{
// #i37011# also create a text object and add at rPos + 1
SdrObject* pTextObj = SdrObjFactory::MakeNewObject(
+ rSdrObjCustomShape.getSdrModelFromSdrObject(),
rSdrObjCustomShape.GetObjInventor(),
OBJ_TEXT,
nullptr,
@@ -233,7 +234,7 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText(
if ( dynamic_cast<const SdrObjGroup*>( pRenderedShape) == nullptr )
{
SdrObject* pTmp = pRenderedShape;
- pRenderedShape = new SdrObjGroup();
+ pRenderedShape = new SdrObjGroup(rSdrObjCustomShape.getSdrModelFromSdrObject());
static_cast<SdrObjGroup*>(pRenderedShape)->GetSubList()->NbcInsertObject( pTmp );
}
static_cast<SdrObjGroup*>(pRenderedShape)->GetSubList()->NbcInsertObject( pTextObj );
@@ -248,7 +249,7 @@ SdrObject* EnhancedCustomShapeEngine::ImplForceGroupWithText(
if ( dynamic_cast<const SdrObjGroup*>( pRenderedShape) == nullptr )
{
SdrObject* pTmp = pRenderedShape;
- pRenderedShape = new SdrObjGroup();
+ pRenderedShape = new SdrObjGroup(rSdrObjCustomShape.getSdrModelFromSdrObject());
static_cast<SdrObjGroup*>(pRenderedShape)->GetSubList()->NbcInsertObject( pTmp );
}
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
index 71dc441f1727..9bfed5d53ab4 100644
--- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
+++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx
@@ -853,13 +853,17 @@ SdrObject* CreateSdrObjectFromParagraphOutlines(
++aTextAreaIter;
}
- pRet = new SdrPathObj( OBJ_POLY, aPolyPoly );
+ pRet = new SdrPathObj(
+ rSdrObjCustomShape.getSdrModelFromSdrObject(),
+ OBJ_POLY,
+ aPolyPoly);
SfxItemSet aSet(rSdrObjCustomShape.GetMergedItemSet());
aSet.ClearItem( SDRATTR_TEXTDIRECTION ); //SJ: vertical writing is not required, by removing this item no outliner is created
aSet.Put(makeSdrShadowItem(false)); // #i37011# NO shadow for FontWork geometry
pRet->SetMergedItemSet( aSet ); // * otherwise we would crash, because the outliner tries to create a Paraobject, but there is no model
}
+
return pRet;
}
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index b9a8ea76b1bd..2f6c1d5aba75 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -173,7 +173,7 @@ void SvxXConnectionPreview::Construct()
// not yet one.
if(!pObjList)
{
- pObjList = new SdrObjList( pView->GetModel(), nullptr );
+ pObjList = new SdrObjList( pView->getSdrModelFromSdrView(), nullptr );
}
if( pTmpObj1 )
@@ -182,19 +182,23 @@ void SvxXConnectionPreview::Construct()
pObjList->InsertObject( pObj1 );
pEdgeObj->ConnectToNode( true, pObj1 );
}
+
if( pTmpObj2 )
{
SdrObject* pObj2 = pTmpObj2->Clone();
pObjList->InsertObject( pObj2 );
pEdgeObj->ConnectToNode( false, pObj2 );
}
+
pObjList->InsertObject( pEdgeObj );
}
}
}
if( !pEdgeObj )
- pEdgeObj = new SdrEdgeObj();
+ {
+ pEdgeObj = new SdrEdgeObj(pView->getSdrModelFromSdrView());
+ }
AdaptSize();
}
diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx
index e404154ed46d..c041a7240032 100644
--- a/svx/source/dialog/contwnd.cxx
+++ b/svx/source/dialog/contwnd.cxx
@@ -61,7 +61,10 @@ void ContourWindow::SetPolyPolygon(const tools::PolyPolygon& rPolyPoly)
{
basegfx::B2DPolyPolygon aPolyPolygon;
aPolyPolygon.append(aPolyPoly[ i ].getB2DPolygon());
- SdrPathObj* pPathObj = new SdrPathObj( OBJ_PATHFILL, aPolyPolygon );
+ SdrPathObj* pPathObj = new SdrPathObj(
+ *pModel,
+ OBJ_PATHFILL,
+ aPolyPolygon);
SfxItemSet aSet(pModel->GetItemPool());
diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx
index 0eee4586f225..22bb53ba2d18 100644
--- a/svx/source/dialog/dlgctl3d.cxx
+++ b/svx/source/dialog/dlgctl3d.cxx
@@ -92,12 +92,12 @@ void Svx3DPreviewControl::Construct()
mpModel->InsertPage( mpFmPage, 0 );
// 3D View
- mp3DView = new E3dView( mpModel, this );
+ mp3DView = new E3dView(*mpModel, this );
mp3DView->SetBufferedOutputAllowed(true);
mp3DView->SetBufferedOverlayAllowed(true);
// 3D Scene
- mpScene = new E3dScene;
+ mpScene = new E3dScene(*mpModel);
// initially create object
SetObjectType(SvxPreviewObjectType::SPHERE);
@@ -204,6 +204,7 @@ void Svx3DPreviewControl::SetObjectType(SvxPreviewObjectType nType)
case SvxPreviewObjectType::SPHERE:
{
mp3DObj = new E3dSphereObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint( 0, 0, 0 ),
basegfx::B3DVector( 5000, 5000, 5000 ));
@@ -213,6 +214,7 @@ void Svx3DPreviewControl::SetObjectType(SvxPreviewObjectType nType)
case SvxPreviewObjectType::CUBE:
{
mp3DObj = new E3dCubeObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint( -2500, -2500, -2500 ),
basegfx::B3DVector( 5000, 5000, 5000 ));
@@ -286,6 +288,7 @@ void Svx3DLightControl::Construct2()
// create invisible expansion object
const double fMaxExpansion(RADIUS_LAMP_BIG + RADIUS_LAMP_PREVIEW_SIZE);
mpExpansionObject = new E3dCubeObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint(-fMaxExpansion, -fMaxExpansion, -fMaxExpansion),
basegfx::B3DVector(2.0 * fMaxExpansion, 2.0 * fMaxExpansion, 2.0 * fMaxExpansion));
@@ -309,6 +312,7 @@ void Svx3DLightControl::Construct2()
// create object for it
mpLampBottomObject = new E3dPolygonObj(
+ *mpModel,
basegfx::B3DPolyPolygon(a3DCircle));
mpScene->Insert3DObj( mpLampBottomObject );
@@ -322,6 +326,7 @@ void Svx3DLightControl::Construct2()
// create object for it
mpLampShaftObject = new E3dPolygonObj(
+ *mpModel,
basegfx::B3DPolyPolygon(a3DHalfCircle));
mpScene->Insert3DObj( mpLampShaftObject );
@@ -383,6 +388,7 @@ void Svx3DLightControl::ConstructLightObjects()
const double fLampSize(bIsSelectedLight ? RADIUS_LAMP_BIG : RADIUS_LAMP_SMALL);
E3dObject* pNewLight = new E3dSphereObj(
+ *mpModel,
mp3DView->Get3DDefaultAttributes(),
basegfx::B3DPoint( 0, 0, 0 ),
basegfx::B3DVector( fLampSize, fLampSize, fLampSize));
diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx
index d89b71b3e2a1..1bf7206ef826 100644
--- a/svx/source/dialog/dlgctrl.cxx
+++ b/svx/source/dialog/dlgctrl.cxx
@@ -1468,13 +1468,13 @@ SvxXLinePreview::SvxXLinePreview(vcl::Window* pParent)
{
InitSettings( true, true );
- mpLineObjA = new SdrPathObj(OBJ_LINE);
+ mpLineObjA = new SdrPathObj(getModel(), OBJ_LINE);
mpLineObjA->SetModel(&getModel());
- mpLineObjB = new SdrPathObj(OBJ_PLIN);
+ mpLineObjB = new SdrPathObj(getModel(), OBJ_PLIN);
mpLineObjB->SetModel(&getModel());
- mpLineObjC = new SdrPathObj(OBJ_PLIN);
+ mpLineObjC = new SdrPathObj(getModel(), OBJ_PLIN);
mpLineObjC->SetModel(&getModel());
}
@@ -1563,14 +1563,16 @@ void SvxXLinePreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rec
}
SvxXRectPreview::SvxXRectPreview(vcl::Window* pParent)
- : SvxPreviewBase(pParent)
- , mpRectangleObject(nullptr)
+: SvxPreviewBase(pParent)
+ ,mpRectangleObject(nullptr)
{
InitSettings(true, true);
// create RectangleObject
const tools::Rectangle aObjectSize(Point(), GetOutputSize());
- mpRectangleObject = new SdrRectObj(aObjectSize);
+ mpRectangleObject = new SdrRectObj(
+ getModel(),
+ aObjectSize);
mpRectangleObject->SetModel(&getModel());
}
@@ -1580,7 +1582,9 @@ void SvxXRectPreview::Resize()
SdrObject *pOrigObject = mpRectangleObject;
if (pOrigObject)
{
- mpRectangleObject = new SdrRectObj(aObjectSize);
+ mpRectangleObject = new SdrRectObj(
+ getModel(),
+ aObjectSize);
mpRectangleObject->SetModel(&getModel());
SetAttributes(pOrigObject->GetMergedItemSet());
SdrObject::Free(pOrigObject);
@@ -1637,12 +1641,16 @@ SvxXShadowPreview::SvxXShadowPreview( vcl::Window* pParent )
// create RectangleObject
const tools::Rectangle aObjectSize( Point( aSize.Width(), aSize.Height() ), aSize );
- mpRectangleObject = new SdrRectObj(aObjectSize);
+ mpRectangleObject = new SdrRectObj(
+ getModel(),
+ aObjectSize);
mpRectangleObject->SetModel(&getModel());
// create ShadowObject
const tools::Rectangle aShadowSize( Point( aSize.Width(), aSize.Height() ), aSize );
- mpRectangleShadow = new SdrRectObj(aShadowSize);
+ mpRectangleShadow = new SdrRectObj(
+ getModel(),
+ aShadowSize);
mpRectangleShadow->SetModel(&getModel());
}
diff --git a/svx/source/dialog/graphctl.cxx b/svx/source/dialog/graphctl.cxx
index 481c55ccd418..07ff51e01fd9 100644
--- a/svx/source/dialog/graphctl.cxx
+++ b/svx/source/dialog/graphctl.cxx
@@ -142,7 +142,7 @@ void GraphCtrl::InitSdrModel()
pModel->SetChanged( false );
// Creating a View
- pView = new GraphCtrlView( pModel, this );
+ pView = new GraphCtrlView(*pModel, this);
pView->SetWorkArea( tools::Rectangle( Point(), aGraphSize ) );
pView->EnableExtendedMouseEventDispatcher( true );
pView->ShowSdrPage(pView->GetModel()->GetPage(0));
diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx
index da1a22a37ed9..f1624b184f92 100644
--- a/svx/source/dialog/imapwnd.cxx
+++ b/svx/source/dialog/imapwnd.cxx
@@ -195,7 +195,10 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// clipped on CanvasPane
aDrawRect.Intersection( aClipRect );
- pSdrObj = static_cast<SdrObject*>(new SdrRectObj( aDrawRect ));
+ pSdrObj = static_cast<SdrObject*>(
+ new SdrRectObj(
+ *pModel,
+ aDrawRect));
pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapRectangleObject( *pIMapRectObj )));
}
break;
@@ -211,7 +214,13 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// limited to CanvasPane
aCircle.Intersection( aClipRect );
- pSdrObj = static_cast<SdrObject*>(new SdrCircObj( OBJ_CIRC, aCircle, 0, 36000 ));
+ pSdrObj = static_cast<SdrObject*>(
+ new SdrCircObj(
+ *pModel,
+ OBJ_CIRC,
+ aCircle,
+ 0,
+ 36000));
pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapCircleObject( *pIMapCircleObj )));
}
break;
@@ -228,7 +237,13 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
// clipped on CanvasPane
aDrawRect.Intersection( aClipRect );
- pSdrObj = static_cast<SdrObject*>(new SdrCircObj( OBJ_CIRC, aDrawRect, 0, 36000 ));
+ pSdrObj = static_cast<SdrObject*>(
+ new SdrCircObj(
+ *pModel,
+ OBJ_CIRC,
+ aDrawRect,
+ 0,
+ 36000));
}
else
{
@@ -240,7 +255,11 @@ SdrObject* IMapWindow::CreateObj( const IMapObject* pIMapObj )
basegfx::B2DPolygon aPolygon;
aPolygon.append(aDrawPoly.getB2DPolygon());
- pSdrObj = static_cast<SdrObject*>(new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aPolygon)));
+ pSdrObj = static_cast<SdrObject*>(
+ new SdrPathObj(
+ *pModel,
+ OBJ_POLY,
+ basegfx::B2DPolyPolygon(aPolygon)));
}
pCloneIMapObj.reset(static_cast<IMapObject*>(new IMapPolygonObject( *pIMapPolyObj )));
@@ -745,7 +764,12 @@ void IMapWindow::CreateDefaultObject()
aPagePos.AdjustY((aPageSize.Height() / 2) - (nDefaultObjectSizeHeight / 2) );
tools::Rectangle aNewObjectRectangle(aPagePos, Size(nDefaultObjectSizeWidth, nDefaultObjectSizeHeight));
- SdrObject* pObj = SdrObjFactory::MakeNewObject( pView->GetCurrentObjInventor(), pView->GetCurrentObjIdentifier(), nullptr, pModel);
+ SdrObject* pObj = SdrObjFactory::MakeNewObject(
+ *pModel,
+ pView->GetCurrentObjInventor(),
+ pView->GetCurrentObjIdentifier(),
+ nullptr,
+ pModel);
pObj->SetLogicRect(aNewObjectRectangle);
switch( pObj->GetObjIdentifier() )
diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx
index ddca770b766d..29a1d4948ac5 100644
--- a/svx/source/dialog/measctrl.cxx
+++ b/svx/source/dialog/measctrl.cxx
@@ -42,8 +42,11 @@ SvxXMeasurePreview::SvxXMeasurePreview(vcl::Window* pParent, WinBits nStyle)
Point aPt1 = Point(aSize.Width() / 5, static_cast<long>(aSize.Height() / 2));
Point aPt2 = Point(aSize.Width() * 4 / 5, static_cast<long>(aSize.Height() / 2));
- pMeasureObj = new SdrMeasureObj(aPt1, aPt2);
pModel = new SdrModel();
+ pMeasureObj = new SdrMeasureObj(
+ *pModel,
+ aPt1,
+ aPt2);
pMeasureObj->SetModel(pModel);
bool bHighContrast = GetSettings().GetStyleSettings().GetHighContrastMode();
diff --git a/svx/source/engine3d/cube3d.cxx b/svx/source/engine3d/cube3d.cxx
index 6583969bb771..b2dac7462808 100644
--- a/svx/source/engine3d/cube3d.cxx
+++ b/svx/source/engine3d/cube3d.cxx
@@ -35,25 +35,31 @@ sdr::contact::ViewContact* E3dCubeObj::CreateObjectSpecificViewContact()
}
-E3dCubeObj::E3dCubeObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& aPos, const basegfx::B3DVector& r3DSize)
-: E3dCompoundObject()
+E3dCubeObj::E3dCubeObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint& aPos,
+ const basegfx::B3DVector& r3DSize)
+: E3dCompoundObject(rSdrModel)
{
// Set Defaults
SetDefaultAttributes(rDefault);
- aCubePos = aPos; // position centre or left, bottom, back (dependent on bPosIsCenter)
+ // position centre or left, bottom, back (dependent on bPosIsCenter)
+ aCubePos = aPos;
aCubeSize = r3DSize;
}
-E3dCubeObj::E3dCubeObj()
-: E3dCompoundObject()
+E3dCubeObj::E3dCubeObj(SdrModel& rSdrModel)
+: E3dCompoundObject(rSdrModel)
{
// Set Defaults
- E3dDefaultAttributes aDefault;
+ const E3dDefaultAttributes aDefault;
+
SetDefaultAttributes(aDefault);
}
-void E3dCubeObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dCubeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
aCubePos = rDefault.GetDefaultCubePos();
aCubeSize = rDefault.GetDefaultCubeSize();
diff --git a/svx/source/engine3d/extrud3d.cxx b/svx/source/engine3d/extrud3d.cxx
index 3b3bb93956c3..b79954629114 100644
--- a/svx/source/engine3d/extrud3d.cxx
+++ b/svx/source/engine3d/extrud3d.cxx
@@ -39,24 +39,24 @@
// DrawContact section
-
sdr::contact::ViewContact* E3dExtrudeObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfE3dExtrude(*this);
}
-
sdr::properties::BaseProperties* E3dExtrudeObj::CreateObjectSpecificProperties()
{
return new sdr::properties::E3dExtrudeProperties(*this);
}
-
// Constructor creates a two cover surface tools::PolyPolygon and (point-count 1) side
// surfaces rectangles from the passed PolyPolygon
-
-E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes const & rDefault, const basegfx::B2DPolyPolygon& rPP, double fDepth)
-: E3dCompoundObject(),
+E3dExtrudeObj::E3dExtrudeObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes const& rDefault,
+ const basegfx::B2DPolyPolygon& rPP,
+ double fDepth)
+: E3dCompoundObject(rSdrModel),
maExtrudePolygon(rPP)
{
// since the old class PolyPolygon3D did mirror the given PolyPolygons in Y, do the same here
@@ -71,15 +71,16 @@ E3dExtrudeObj::E3dExtrudeObj(E3dDefaultAttributes const & rDefault, const basegf
GetProperties().SetObjectItemDirect(makeSvx3DDepthItem(static_cast<sal_uInt32>(fDepth + 0.5)));
}
-E3dExtrudeObj::E3dExtrudeObj()
-: E3dCompoundObject()
+E3dExtrudeObj::E3dExtrudeObj(SdrModel& rSdrModel)
+: E3dCompoundObject(rSdrModel)
{
// Set Defaults
- E3dDefaultAttributes aDefault;
+ const E3dDefaultAttributes aDefault;
+
SetDefaultAttributes(aDefault);
}
-void E3dExtrudeObj::SetDefaultAttributes(E3dDefaultAttributes const & rDefault)
+void E3dExtrudeObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(rDefault.GetDefaultExtrudeSmoothed()));
GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(rDefault.GetDefaultExtrudeSmoothFrontBack()));
@@ -194,7 +195,7 @@ SdrAttrObj* E3dExtrudeObj::GetBreakObj()
{
// create PathObj
basegfx::B2DPolyPolygon aPoly = TransformToScreenCoor(aBackSide);
- SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aPoly);
+ SdrPathObj* pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aPoly);
SfxItemSet aSet(GetObjectItemSet());
aSet.Put(XLineStyleItem(css::drawing::LineStyle_SOLID));
diff --git a/svx/source/engine3d/lathe3d.cxx b/svx/source/engine3d/lathe3d.cxx
index 99268c6d5ff8..0bc772ec1670 100644
--- a/svx/source/engine3d/lathe3d.cxx
+++ b/svx/source/engine3d/lathe3d.cxx
@@ -37,23 +37,22 @@
// DrawContact section
-
sdr::contact::ViewContact* E3dLatheObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfE3dLathe(*this);
}
-
sdr::properties::BaseProperties* E3dLatheObj::CreateObjectSpecificProperties()
{
return new sdr::properties::E3dLatheProperties(*this);
}
-
// Constructor from 3D polygon, scale is the conversion factor for the coordinates
-
-E3dLatheObj::E3dLatheObj(E3dDefaultAttributes const & rDefault, const basegfx::B2DPolyPolygon& rPoly2D)
-: E3dCompoundObject(),
+E3dLatheObj::E3dLatheObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B2DPolyPolygon& rPoly2D)
+: E3dCompoundObject(rSdrModel),
maPolyPoly2D(rPoly2D)
{
// since the old class PolyPolygon3D did mirror the given PolyPolygons in Y, do the same here
@@ -82,15 +81,16 @@ E3dLatheObj::E3dLatheObj(E3dDefaultAttributes const & rDefault, const basegfx::B
}
}
-E3dLatheObj::E3dLatheObj()
-: E3dCompoundObject()
+E3dLatheObj::E3dLatheObj(SdrModel& rSdrModel)
+: E3dCompoundObject(rSdrModel)
{
// Set Defaults
- E3dDefaultAttributes aDefault;
+ const E3dDefaultAttributes aDefault;
+
SetDefaultAttributes(aDefault);
}
-void E3dLatheObj::SetDefaultAttributes(E3dDefaultAttributes const & rDefault)
+void E3dLatheObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
GetProperties().SetObjectItemDirect(Svx3DSmoothNormalsItem(rDefault.GetDefaultLatheSmoothed()));
GetProperties().SetObjectItemDirect(Svx3DSmoothLidsItem(rDefault.GetDefaultLatheSmoothFrontBack()));
@@ -176,7 +176,7 @@ SdrAttrObj* E3dLatheObj::GetBreakObj()
// create PathObj
basegfx::B3DPolyPolygon aLathePoly3D(basegfx::utils::createB3DPolyPolygonFromB2DPolyPolygon(maPolyPoly2D));
basegfx::B2DPolyPolygon aTransPoly(TransformToScreenCoor(aLathePoly3D));
- SdrPathObj* pPathObj = new SdrPathObj(OBJ_PLIN, aTransPoly);
+ SdrPathObj* pPathObj = new SdrPathObj(getSdrModelFromSdrObject(), OBJ_PLIN, aTransPoly);
// Set Attribute
SfxItemSet aSet(GetObjectItemSet());
diff --git a/svx/source/engine3d/obj3d.cxx b/svx/source/engine3d/obj3d.cxx
index 73a0675efdb4..18c2bb382536 100644
--- a/svx/source/engine3d/obj3d.cxx
+++ b/svx/source/engine3d/obj3d.cxx
@@ -83,13 +83,13 @@ using namespace com::sun::star;
// List for 3D-Objects
-E3dObjList::E3dObjList()
-: SdrObjList(nullptr, nullptr)
+E3dObjList::E3dObjList(SdrModel& rSdrModel)
+: SdrObjList(rSdrModel, nullptr)
{
}
-E3dObjList::E3dObjList(const E3dObjList&)
-: SdrObjList()
+E3dObjList::E3dObjList(const E3dObjList& rSrcList)
+: SdrObjList(rSrcList.getSdrModelFromSdrObjList())
{
}
@@ -169,8 +169,9 @@ sdr::properties::BaseProperties* E3dObject::CreateObjectSpecificProperties()
}
-E3dObject::E3dObject()
-: maSubList(),
+E3dObject::E3dObject(SdrModel& rSdrModel)
+: SdrAttrObj(rSdrModel),
+ maSubList(rSdrModel),
maLocalBoundVol(),
maTransformation(),
maFullTransform(),
@@ -736,9 +737,8 @@ sdr::properties::BaseProperties* E3dCompoundObject::CreateObjectSpecificProperti
return new sdr::properties::E3dCompoundProperties(*this);
}
-
-E3dCompoundObject::E3dCompoundObject()
-: E3dObject(),
+E3dCompoundObject::E3dCompoundObject(SdrModel& rSdrModel)
+: E3dObject(rSdrModel),
aMaterialAmbientColor()
{
// Set defaults
diff --git a/svx/source/engine3d/objfac3d.cxx b/svx/source/engine3d/objfac3d.cxx
index b704cf2b848d..58e1479e413b 100644
--- a/svx/source/engine3d/objfac3d.cxx
+++ b/svx/source/engine3d/objfac3d.cxx
@@ -52,24 +52,19 @@ IMPL_STATIC_LINK( E3dObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrOb
switch ( aParams.nObjIdentifier )
{
case E3D_SCENE_ID:
- return new E3dScene();
+ return new E3dScene(aParams.rSdrModel);
case E3D_POLYGONOBJ_ID :
- return new E3dPolygonObj();
+ return new E3dPolygonObj(aParams.rSdrModel);
case E3D_CUBEOBJ_ID :
- return new E3dCubeObj();
+ return new E3dCubeObj(aParams.rSdrModel);
case E3D_SPHEREOBJ_ID:
- // Gets the dummy constructor, as this is only called when
- // loading documents. The actual number of segments is however
- // determined only after loading the members. This will result
- // in that the first sphere will be immediately destroyed,
- // although it was never used.
- return new E3dSphereObj(E3dSphereObj::DUMMY);
+ return new E3dSphereObj(aParams.rSdrModel);
case E3D_EXTRUDEOBJ_ID:
- return new E3dExtrudeObj();
+ return new E3dExtrudeObj(aParams.rSdrModel);
case E3D_LATHEOBJ_ID:
- return new E3dLatheObj();
+ return new E3dLatheObj(aParams.rSdrModel);
case E3D_COMPOUNDOBJ_ID:
- return new E3dCompoundObject();
+ return new E3dCompoundObject(aParams.rSdrModel);
}
}
return nullptr;
diff --git a/svx/source/engine3d/polygn3d.cxx b/svx/source/engine3d/polygn3d.cxx
index 190c0ca89ee5..9c5db2c26d28 100644
--- a/svx/source/engine3d/polygn3d.cxx
+++ b/svx/source/engine3d/polygn3d.cxx
@@ -25,17 +25,16 @@
#include <basegfx/polygon/b3dpolygon.hxx>
#include <basegfx/polygon/b3dpolygontools.hxx>
-
// DrawContact section
-
sdr::contact::ViewContact* E3dPolygonObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfE3dPolygon(*this);
}
E3dPolygonObj::E3dPolygonObj(
+ SdrModel& rSdrModel,
const basegfx::B3DPolyPolygon& rPolyPoly3D)
-: E3dCompoundObject(),
+: E3dCompoundObject(rSdrModel),
bLineOnly(true)
{
// Set geometry
@@ -48,9 +47,9 @@ E3dPolygonObj::E3dPolygonObj(
CreateDefaultTexture();
}
-E3dPolygonObj::E3dPolygonObj()
-: E3dCompoundObject(),
- bLineOnly(false) // added missing initialisation
+E3dPolygonObj::E3dPolygonObj(SdrModel& rSdrModel)
+: E3dCompoundObject(rSdrModel),
+ bLineOnly(false)
{
// Create no geometry
}
diff --git a/svx/source/engine3d/scene3d.cxx b/svx/source/engine3d/scene3d.cxx
index 444331de3472..007d5db413b2 100644
--- a/svx/source/engine3d/scene3d.cxx
+++ b/svx/source/engine3d/scene3d.cxx
@@ -170,8 +170,8 @@ sdr::contact::ViewContact* E3dScene::CreateObjectSpecificViewContact()
}
-E3dScene::E3dScene()
-: E3dObject(),
+E3dScene::E3dScene(SdrModel& rSdrModel)
+: E3dObject(rSdrModel),
aCamera(basegfx::B3DPoint(0.0, 0.0, 4.0), basegfx::B3DPoint()),
mp3DDepthRemapper(nullptr),
bDrawOnlySelected(false),
diff --git a/svx/source/engine3d/sphere3d.cxx b/svx/source/engine3d/sphere3d.cxx
index ecac05170094..805ce06c48dd 100644
--- a/svx/source/engine3d/sphere3d.cxx
+++ b/svx/source/engine3d/sphere3d.cxx
@@ -33,25 +33,24 @@
#include <sdr/contact/viewcontactofe3dsphere.hxx>
#include <basegfx/polygon/b3dpolygon.hxx>
-
// DrawContact section
-
sdr::contact::ViewContact* E3dSphereObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfE3dSphere(*this);
}
-
sdr::properties::BaseProperties* E3dSphereObj::CreateObjectSpecificProperties()
{
return new sdr::properties::E3dSphereProperties(*this);
}
-
// Build Sphere from polygon facets in latitude and longitude
-
-E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoint& rCenter, const basegfx::B3DVector& r3DSize)
-: E3dCompoundObject()
+E3dSphereObj::E3dSphereObj(
+ SdrModel& rSdrModel,
+ const E3dDefaultAttributes& rDefault,
+ const basegfx::B3DPoint& rCenter,
+ const basegfx::B3DVector& r3DSize)
+: E3dCompoundObject(rSdrModel)
{
// Set defaults
SetDefaultAttributes(rDefault);
@@ -60,23 +59,16 @@ E3dSphereObj::E3dSphereObj(E3dDefaultAttributes& rDefault, const basegfx::B3DPoi
aSize = r3DSize;
}
-// Create Sphere without creating the Polygons within
-
-// This call is from the 3D Object Factory (objfac3d.cxx) and only when loading
-// of documents. Here you do not need CreateSphere call, since the real number
-// of segments is not even known yet. This was until 10.02.1997 a (small)
-// memory leak.
-
-E3dSphereObj::E3dSphereObj(Dummy /*dummy*/)
-// the parameters it needs to be able to distinguish which
-// constructors of the two is meant. The above is the default.
+E3dSphereObj::E3dSphereObj(SdrModel& rSdrModel)
+: E3dCompoundObject(rSdrModel)
{
// Set defaults
- E3dDefaultAttributes aDefault;
+ const E3dDefaultAttributes aDefault;
+
SetDefaultAttributes(aDefault);
}
-void E3dSphereObj::SetDefaultAttributes(E3dDefaultAttributes& rDefault)
+void E3dSphereObj::SetDefaultAttributes(const E3dDefaultAttributes& rDefault)
{
// Set defaults
aCenter = rDefault.GetDefaultSphereCenter();
diff --git a/svx/source/engine3d/view3d.cxx b/svx/source/engine3d/view3d.cxx
index 33d051f23309..831c029edff5 100644
--- a/svx/source/engine3d/view3d.cxx
+++ b/svx/source/engine3d/view3d.cxx
@@ -224,10 +224,12 @@ void Impl3DMirrorConstructOverlay::SetMirrorAxis(Point aMirrorAxisA, Point aMirr
}
}
-E3dView::E3dView(SdrModel* pModel, OutputDevice* pOut) :
- SdrView(pModel, pOut)
+E3dView::E3dView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrView(rSdrModel, pOut)
{
- InitView ();
+ InitView();
}
// DrawMarkedObj override, since possibly only a single 3D object is to be
@@ -700,10 +702,15 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, boo
if(pPath)
{
E3dDefaultAttributes aDefault = Get3DDefaultAttributes();
+
if(bExtrude)
+ {
aDefault.SetDefaultExtrudeCharacterMode(true);
+ }
else
+ {
aDefault.SetDefaultLatheCharacterMode(true);
+ }
// Get Itemset of the original object
SfxItemSet aSet(pObj->GetMergedItemSet());
@@ -736,13 +743,13 @@ void E3dView::ImpCreateSingle3DObjectFlat(E3dScene* pScene, SdrObject* pObj, boo
E3dObject* p3DObj = nullptr;
if(bExtrude)
{
- p3DObj = new E3dExtrudeObj(aDefault, pPath->GetPathPoly(), fDepth);
+ p3DObj = new E3dExtrudeObj(pObj->getSdrModelFromSdrObject(), aDefault, pPath->GetPathPoly(), fDepth);
}
else
{
basegfx::B2DPolyPolygon aPolyPoly2D(pPath->GetPathPoly());
aPolyPoly2D.transform(rLatheMat);
- p3DObj = new E3dLatheObj(aDefault, aPolyPoly2D);
+ p3DObj = new E3dLatheObj(pObj->getSdrModelFromSdrObject(), aDefault, aPolyPoly2D);
}
// Set attribute
@@ -836,8 +843,10 @@ void E3dView::ConvertMarkedObjTo3D(bool bExtrude, const basegfx::B2DPoint& rPnt1
else
BegUndo(SvxResId(RID_SVX_3D_UNDO_LATHE));
+ SdrModel& rSdrModel(GetSdrMarkByIndex(0)->GetMarkedSdrObj()->getSdrModelFromSdrObject());
+
// Create a new scene for the created 3D object
- E3dScene* pScene = new E3dScene;
+ E3dScene* pScene = new E3dScene(rSdrModel);
// Determine rectangle and possibly correct it
tools::Rectangle aRect = GetAllMarkedRect();
@@ -1262,7 +1271,6 @@ bool E3dView::BegDragObj(const Point& rPnt, OutputDevice* pOut,
}
// Set current 3D drawing object, create the scene for this
-
E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj)
{
DBG_ASSERT(p3DObj != nullptr, "Who puts in a NULL-pointer here");
@@ -1275,7 +1283,7 @@ E3dScene* E3dView::SetCurrent3DObj(E3dObject* p3DObj)
tools::Rectangle aRect(0,0, static_cast<long>(fW), static_cast<long>(fH));
- E3dScene* pScene = new E3dScene;
+ E3dScene* pScene = new E3dScene(p3DObj->getSdrModelFromSdrObject());
InitScene(pScene, fW, fH, aVolume.getMaxZ() + ((fW + fH) / 4.0));
diff --git a/svx/source/form/fmdmod.cxx b/svx/source/form/fmdmod.cxx
index d487399fedf9..ac197b2ff419 100644
--- a/svx/source/form/fmdmod.cxx
+++ b/svx/source/form/fmdmod.cxx
@@ -31,6 +31,7 @@ using namespace ::svxform;
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > SAL_CALL SvxFmMSFactory::createInstance(const OUString& rServiceSpecifier)
{
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > xRet;
+
if ( rServiceSpecifier.startsWith( "com.sun.star.form.component." ) )
{
css::uno::Reference<css::uno::XComponentContext> xContext = comphelper::getProcessComponentContext();
@@ -38,11 +39,17 @@ using namespace ::svxform;
}
else if ( rServiceSpecifier == "com.sun.star.drawing.ControlShape" )
{
- SdrObject* pObj = new FmFormObj();
+ SdrModel* pTargetModel = getSdrModelFromUnoModel();
+ OSL_ENSURE(pTargetModel, "Got no SdrModel for SdrShape construction (!)");
+ SdrObject* pObj = new FmFormObj(*pTargetModel);
xRet = static_cast<cppu::OWeakObject*>(static_cast<SvxShape_UnoImplHelper*>(new SvxShapeControl(pObj)));
}
+
if (!xRet.is())
+ {
xRet = SvxUnoDrawMSFactory::createInstance(rServiceSpecifier);
+ }
+
return xRet;
}
diff --git a/svx/source/form/fmdpage.cxx b/svx/source/form/fmdpage.cxx
index 1e81e8fe08e8..a9a67ece6f08 100644
--- a/svx/source/form/fmdpage.cxx
+++ b/svx/source/form/fmdpage.cxx
@@ -73,10 +73,13 @@ SdrObject *SvxFmDrawPage::CreateSdrObject_( const css::uno::Reference< css::draw
if ( aShapeType == "com.sun.star.drawing.ShapeControl" // compatibility
|| aShapeType == "com.sun.star.drawing.ControlShape"
)
- return new FmFormObj();
+ {
+ return new FmFormObj(GetSdrPage()->getSdrModelFromSdrObjList());
+ }
else
+ {
return SvxDrawPage::CreateSdrObject_( xDescr );
-
+ }
}
css::uno::Reference< css::drawing::XShape > SvxFmDrawPage::CreateShape( SdrObject *pObj ) const
diff --git a/svx/source/form/fmobj.cxx b/svx/source/form/fmobj.cxx
index 5863ec9f38f6..0c580ac77ae6 100644
--- a/svx/source/form/fmobj.cxx
+++ b/svx/source/form/fmobj.cxx
@@ -55,26 +55,25 @@ using namespace ::com::sun::star::container;
using namespace ::svxform;
-FmFormObj::FmFormObj(const OUString& rModelName)
- :SdrUnoObj ( rModelName )
- ,m_nPos ( -1 )
- ,m_pLastKnownRefDevice ( nullptr )
+FmFormObj::FmFormObj(
+ SdrModel& rSdrModel,
+ const OUString& rModelName)
+: SdrUnoObj(rSdrModel, rModelName)
+ ,m_nPos(-1)
+ ,m_pLastKnownRefDevice(nullptr)
{
-
// normally, this is done in SetUnoControlModel, but if the call happened in the base class ctor,
// then our incarnation of it was not called (since we were not constructed at this time).
impl_checkRefDevice_nothrow( true );
}
-
-FmFormObj::FmFormObj()
- :SdrUnoObj ( "" )
- ,m_nPos ( -1 )
- ,m_pLastKnownRefDevice ( nullptr )
+FmFormObj::FmFormObj(SdrModel& rSdrModel)
+: SdrUnoObj(rSdrModel, "")
+ ,m_nPos(-1)
+ ,m_pLastKnownRefDevice(nullptr)
{
}
-
FmFormObj::~FmFormObj()
{
diff --git a/svx/source/form/fmobjfac.cxx b/svx/source/form/fmobjfac.cxx
index bfc834e9cd1a..a640caac7c0c 100644
--- a/svx/source/form/fmobjfac.cxx
+++ b/svx/source/form/fmobjfac.cxx
@@ -106,10 +106,10 @@ namespace
}
}
-IMPL_STATIC_LINK(
- FmFormObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject*)
+IMPL_STATIC_LINK(FmFormObjFactory, MakeObject, SdrObjCreatorParams, aParams, SdrObject*)
{
SdrObject* pNewObj = nullptr;
+
if (aParams.nInventor == SdrInventor::FmForm)
{
OUString sServiceSpecifier;
@@ -213,9 +213,9 @@ IMPL_STATIC_LINK(
// create the actual object
if ( !sServiceSpecifier.isEmpty() )
- pNewObj = new FmFormObj(sServiceSpecifier);
+ pNewObj = new FmFormObj(aParams.rSdrModel, sServiceSpecifier);
else
- pNewObj = new FmFormObj();
+ pNewObj = new FmFormObj(aParams.rSdrModel);
// initialize some properties which we want to differ from the defaults
for ( PropertyValueArray::const_iterator aInitProp = aInitialProperties.begin();
diff --git a/svx/source/form/fmpage.cxx b/svx/source/form/fmpage.cxx
index 7f267cbbcf03..ae6c45b1d980 100644
--- a/svx/source/form/fmpage.cxx
+++ b/svx/source/form/fmpage.cxx
@@ -49,15 +49,15 @@ using com::sun::star::uno::UNO_QUERY;
FmFormPage::FmFormPage(FmFormModel& rModel, bool bMasterPage)
- :SdrPage(rModel, bMasterPage)
- ,m_pImpl( new FmFormPageImpl( *this ) )
+: SdrPage(rModel, bMasterPage)
+ ,m_pImpl( new FmFormPageImpl( *this ) )
{
}
FmFormPage::FmFormPage(const FmFormPage& rPage)
- :SdrPage(rPage)
- ,m_pImpl(new FmFormPageImpl( *this ) )
+: SdrPage(rPage)
+ ,m_pImpl(new FmFormPageImpl( *this ) )
{
}
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index 2adad0dc524f..6acd8b890e2d 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -77,14 +77,14 @@ using namespace ::com::sun::star::util;
using namespace ::svxform;
using namespace ::svx;
-
-FmFormView::FmFormView( FmFormModel* pModel, OutputDevice* pOut )
- :E3dView(pModel,pOut)
+FmFormView::FmFormView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: E3dView(rSdrModel, pOut)
{
Init();
}
-
void FmFormView::Init()
{
pFormShell = nullptr;
diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index cbf975fe0a2d..c2d7b2471d15 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1350,7 +1350,7 @@ SdrObject* FmXFormView::implCreateFieldControl( const svx::ODataAccessDescriptor
if ( bCheckbox )
return pControl;
- SdrObjGroup* pGroup = new SdrObjGroup();
+ SdrObjGroup* pGroup = new SdrObjGroup(getView()->getSdrModelFromSdrView());
SdrObjList* pObjList = pGroup->GetSubList();
pObjList->InsertObject( pLabel );
pObjList->InsertObject( pControl );
@@ -1462,7 +1462,7 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_
// group objects
- SdrObjGroup* pGroup = new SdrObjGroup();
+ SdrObjGroup* pGroup = new SdrObjGroup(getView()->getSdrModelFromSdrView());
SdrObjList* pObjList = pGroup->GetSubList();
pObjList->InsertObject(pLabel);
pObjList->InsertObject(pControl);
@@ -1476,7 +1476,12 @@ SdrObject* FmXFormView::implCreateXFormsControl( const svx::OXFormsDescriptor &_
const MapMode eSourceMode(MapUnit::Map100thMM);
const sal_uInt16 nObjID = OBJ_FM_BUTTON;
::Size controlSize(4000, 500);
- FmFormObj *pControl = static_cast<FmFormObj*>(SdrObjFactory::MakeNewObject( SdrInventor::FmForm, nObjID, nullptr ));
+ FmFormObj *pControl = static_cast<FmFormObj*>(
+ SdrObjFactory::MakeNewObject(
+ getView()->getSdrModelFromSdrView(),
+ SdrInventor::FmForm,
+ nObjID,
+ nullptr));
controlSize.setWidth( long(controlSize.Width() * eTargetMode.GetScaleX()) );
controlSize.setHeight( long(controlSize.Height() * eTargetMode.GetScaleY()) );
::Point controlPos( OutputDevice::LogicToLogic( ::Point( controlSize.Width(), 0 ), eSourceMode, eTargetMode ) );
@@ -1576,11 +1581,19 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int
// the label
::std::unique_ptr< SdrUnoObj > pLabel;
Reference< XPropertySet > xLabelModel;
+
if ( bNeedLabel )
{
pLabel.reset( dynamic_cast< SdrUnoObj* >(
- SdrObjFactory::MakeNewObject( _nInventor, _nLabelObjectID, _pLabelPage, _pModel ) ) );
+ SdrObjFactory::MakeNewObject(
+ *_pModel,
+ _nInventor,
+ _nLabelObjectID,
+ _pLabelPage,
+ _pModel)));
+
OSL_ENSURE( pLabel.get(), "FmXFormView::createControlLabelPair: could not create the label!" );
+
if ( !pLabel.get() )
return false;
@@ -1606,8 +1619,15 @@ bool FmXFormView::createControlLabelPair( OutputDevice const & _rOutDev, sal_Int
// the control
::std::unique_ptr< SdrUnoObj > pControl( dynamic_cast< SdrUnoObj* >(
- SdrObjFactory::MakeNewObject( _nInventor, _nControlObjectID, _pControlPage, _pModel ) ) );
+ SdrObjFactory::MakeNewObject(
+ *_pModel,
+ _nInventor,
+ _nControlObjectID,
+ _pControlPage,
+ _pModel)));
+
OSL_ENSURE( pControl.get(), "FmXFormView::createControlLabelPair: could not create the control!" );
+
if ( !pControl.get() )
return false;
diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx
index d9e6a205cbfe..a91fabd1c527 100644
--- a/svx/source/gallery2/galobj.cxx
+++ b/svx/source/gallery2/galobj.cxx
@@ -458,7 +458,7 @@ bool SgaObjectSvDraw::CreateThumb( const FmFormModel& rModel )
if(aObjRect.GetWidth() && aObjRect.GetHeight())
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
- FmFormView aView(const_cast< FmFormModel* >(&rModel), pVDev);
+ FmFormView aView(const_cast< FmFormModel& >(rModel), pVDev);
aView.ShowSdrPage(const_cast< FmFormPage* >(pPage));
aView.MarkAllObj();
diff --git a/svx/source/gallery2/galtheme.cxx b/svx/source/gallery2/galtheme.cxx
index de21ba0307bb..9c8b27bef7d5 100644
--- a/svx/source/gallery2/galtheme.cxx
+++ b/svx/source/gallery2/galtheme.cxx
@@ -801,7 +801,7 @@ bool GalleryTheme::GetGraphic(sal_uInt32 nPos, Graphic& rGraphic)
{
ScopedVclPtrInstance< VirtualDevice > pVDev;
pVDev->SetMapMode( MapMode( MapUnit::Map100thMM ) );
- FmFormView aView( aModel.GetModel(), pVDev );
+ FmFormView aView(*aModel.GetModel(), pVDev);
aView.hideMarkHandles();
aView.ShowSdrPage(aView.GetModel()->GetPage(0));
@@ -1244,7 +1244,7 @@ bool GalleryTheme::InsertTransferable(const uno::Reference< datatransfer::XTrans
if( aModel.GetModel() )
{
SdrPage* pPage = aModel.GetModel()->GetPage(0);
- SdrGrafObj* pGrafObj = new SdrGrafObj( *pGraphic );
+ SdrGrafObj* pGrafObj = new SdrGrafObj(*aModel.GetModel(), *pGraphic );
pGrafObj->AppendUserData( new SgaIMapInfo( aImageMap ) );
pPage->InsertObject( pGrafObj );
diff --git a/svx/source/inc/fmobj.hxx b/svx/source/inc/fmobj.hxx
index 6b9adf61c548..5cc7050f3fb6 100644
--- a/svx/source/inc/fmobj.hxx
+++ b/svx/source/inc/fmobj.hxx
@@ -47,9 +47,10 @@ class SVX_DLLPUBLIC FmFormObj: public SdrUnoObj
// only to be used for comparison with the current ref device!
public:
- FmFormObj(const OUString& rModelName);
- FmFormObj();
-
+ FmFormObj(
+ SdrModel& rSdrModel,
+ const OUString& rModelName);
+ FmFormObj(SdrModel& rSdrModel);
SAL_DLLPRIVATE const css::uno::Reference< css::container::XIndexContainer>&
GetOriginalParent() const { return m_xParent; }
diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx
index b7c3086fe735..b629d0c39b9c 100644
--- a/svx/source/sdr/contact/viewcontactofgraphic.cxx
+++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx
@@ -253,7 +253,7 @@ namespace sdr
// needed and can be deleted.
// create temp RectObj as TextObj and set needed attributes
- SdrRectObj aRectObj(OBJ_TEXT);
+ SdrRectObj aRectObj(GetGrafObject().getSdrModelFromSdrObject(), OBJ_TEXT);
aRectObj.SetModel(GetGrafObject().GetModel());
aRectObj.NbcSetText(aDraftText);
aRectObj.SetMergedItem(SvxColorItem(COL_LIGHTRED, EE_CHAR_COLOR));
diff --git a/svx/source/svdraw/svdcrtv.cxx b/svx/source/svdraw/svdcrtv.cxx
index 33cf4eb9b3c2..dfbbf0b60f33 100644
--- a/svx/source/svdraw/svdcrtv.cxx
+++ b/svx/source/svdraw/svdcrtv.cxx
@@ -197,8 +197,10 @@ void SdrCreateView::ImpClearVars()
ImpClearConnectMarker();
}
-SdrCreateView::SdrCreateView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrDragView(pModel1,pOut),
+SdrCreateView::SdrCreateView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrDragView(rSdrModel, pOut),
mpCoMaOverlay(nullptr),
mpCreateViewExtraData(new ImpSdrCreateViewExtraData())
{
@@ -348,7 +350,7 @@ void SdrCreateView::SetCurrentObj(sal_uInt16 nIdent, SdrInventor nInvent)
nCurrentInvent=nInvent;
nCurrentIdent=nIdent;
SdrObject * pObj = (nIdent == OBJ_NONE) ? nullptr :
- SdrObjFactory::MakeNewObject(nInvent, nIdent, nullptr);
+ SdrObjFactory::MakeNewObject(*GetModel(), nInvent, nIdent, nullptr);
if(pObj)
{
@@ -414,7 +416,7 @@ bool SdrCreateView::ImpBegCreateObj(SdrInventor nInvent, sal_uInt16 nIdent, cons
}
else
{
- pCurrentCreate = SdrObjFactory::MakeNewObject(nInvent, nIdent, pCreatePV->GetPage(), mpModel);
+ pCurrentCreate = SdrObjFactory::MakeNewObject(*mpModel, nInvent, nIdent, pCreatePV->GetPage(), mpModel);
}
Point aPnt(rPnt);
diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx
index b13383b27a32..5d18d6840d27 100644
--- a/svx/source/svdraw/svddrgv.cxx
+++ b/svx/source/svdraw/svddrgv.cxx
@@ -71,8 +71,10 @@ void SdrDragView::ImpClearVars()
mbSolidDragging = getOptionsDrawinglayer().IsSolidDragCreate();
}
-SdrDragView::SdrDragView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrExchangeView(pModel1,pOut)
+SdrDragView::SdrDragView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrExchangeView(rSdrModel, pOut)
{
ImpClearVars();
}
diff --git a/svx/source/svdraw/svdedtv.cxx b/svx/source/svdraw/svdedtv.cxx
index c373caac480f..ce620ae67e41 100644
--- a/svx/source/svdraw/svdedtv.cxx
+++ b/svx/source/svdraw/svdedtv.cxx
@@ -88,8 +88,10 @@ void SdrEditView::ImpClearVars()
bPossibilitiesDirty=true; // << Purify didn't like this
}
-SdrEditView::SdrEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrMarkView(pModel1,pOut)
+SdrEditView::SdrEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrMarkView(rSdrModel, pOut)
{
ImpClearVars();
}
@@ -98,7 +100,6 @@ SdrEditView::~SdrEditView()
{
}
-
void SdrEditView::InsertNewLayer(const OUString& rName, sal_uInt16 nPos)
{
SdrLayerAdmin& rLA=mpModel->GetLayerAdmin();
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 01820c63bc34..ab33efc23860 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1126,7 +1126,7 @@ void SdrEditView::MergeMarkedObjects(SdrMergeMode eMode)
// #i73441# check insert list before taking actions
if(pInsOL)
{
- SdrPathObj* pPath = new SdrPathObj(OBJ_PATHFILL, aMergePolyPolygonA);
+ SdrPathObj* pPath = new SdrPathObj(pAttrObj->getSdrModelFromSdrObject(), OBJ_PATHFILL, aMergePolyPolygonA);
ImpCopyAttributes(pAttrObj, pPath);
pInsOL->InsertObject(pPath, nInsPos);
if( bUndo )
@@ -1355,7 +1355,7 @@ void SdrEditView::CombineMarkedObjects(bool bNoPolyPoly)
}
}
- SdrPathObj* pPath = new SdrPathObj(eKind,aPolyPolygon);
+ SdrPathObj* pPath = new SdrPathObj(pAttrObj->getSdrModelFromSdrObject(), eKind, aPolyPolygon);
// attributes of the lowest object
ImpCopyAttributes(pAttrObj, pPath);
@@ -1522,7 +1522,10 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
if(!bMakeLines || nPointCount < 2)
{
- SdrPathObj* pPath = new SdrPathObj(static_cast<SdrObjKind>(pSrcPath->GetObjIdentifier()), basegfx::B2DPolyPolygon(rCandidate));
+ SdrPathObj* pPath = new SdrPathObj(
+ pSrcPath->getSdrModelFromSdrObject(),
+ static_cast<SdrObjKind>(pSrcPath->GetObjIdentifier()),
+ basegfx::B2DPolyPolygon(rCandidate));
ImpCopyAttributes(pSrcPath, pPath);
pLast = pPath;
rOL.InsertObject(pPath, rPos);
@@ -1556,7 +1559,10 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
aNewPolygon.append(rCandidate.getB2DPoint(nNextIndex));
}
- SdrPathObj* pPath = new SdrPathObj(eKind, basegfx::B2DPolyPolygon(aNewPolygon));
+ SdrPathObj* pPath = new SdrPathObj(
+ pSrcPath->getSdrModelFromSdrObject(),
+ eKind,
+ basegfx::B2DPolyPolygon(aNewPolygon));
ImpCopyAttributes(pSrcPath, pPath);
pLast = pPath;
rOL.InsertObject(pPath, rPos);
@@ -1603,7 +1609,11 @@ void SdrEditView::ImpDismantleOneObject(const SdrObject* pObj, SdrObjList& rOL,
{
// #i37011# also create a text object and add at rPos + 1
SdrObject* pTextObj = SdrObjFactory::MakeNewObject(
- pCustomShape->GetObjInventor(), OBJ_TEXT, nullptr, pCustomShape->GetModel());
+ pCustomShape->getSdrModelFromSdrObject(),
+ pCustomShape->GetObjInventor(),
+ OBJ_TEXT,
+ nullptr,
+ pCustomShape->GetModel());
// Copy text content
OutlinerParaObject* pParaObj = pCustomShape->GetOutlinerParaObject();
@@ -1756,8 +1766,11 @@ void SdrEditView::GroupMarked()
{
if (pGrp==nullptr)
{
- if (pGrp==nullptr)
- pGrp=new SdrObjGroup;
+ if(nullptr == pGrp)
+ {
+ pGrp = new SdrObjGroup(pSrcLst->getSdrModelFromSdrObjList());
+ }
+
pDstLst=pGrp->GetSubList();
DBG_ASSERT(pDstLst!=nullptr,"Alleged group object doesn't return object list.");
}
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 5b33f7ff6b4c..da5ed7ab6df5 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -88,8 +88,10 @@ void SdrObjEditView::ImpClearVars()
bTextEditOnlyOneView=false;
}
-SdrObjEditView::SdrObjEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrGlueEditView(pModel1,pOut),
+SdrObjEditView::SdrObjEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrGlueEditView(rSdrModel, pOut),
mpOldTextEditUndoManager(nullptr)
{
ImpClearVars();
diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx
index f3806362aba6..f63e11dec371 100644
--- a/svx/source/svdraw/svdfmtf.cxx
+++ b/svx/source/svdraw/svdfmtf.cxx
@@ -557,6 +557,7 @@ void ImpSdrGDIMetaFileImport::InsertObj(SdrObject* pObj, bool bScale)
if(!aNewRange.isEmpty())
{
pObj = new SdrPathObj(
+ *mpModel,
aNewPoly.isClosed() ? OBJ_POLY : OBJ_PLIN,
aNewPoly);
@@ -686,7 +687,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction const & rAct)
if(bCreateLineObject)
{
- SdrPathObj* pPath = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aLine));
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_LINE,
+ basegfx::B2DPolyPolygon(aLine));
mnLineWidth = nNewLineWidth;
maLineJoin = rLineInfo.GetLineJoin();
maLineCap = rLineInfo.GetLineCap();
@@ -705,14 +709,18 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaLineAction const & rAct)
void ImpSdrGDIMetaFileImport::DoAction(MetaRectAction const & rAct)
{
- SdrRectObj* pRect=new SdrRectObj(rAct.GetRect());
+ SdrRectObj* pRect = new SdrRectObj(
+ *mpModel,
+ rAct.GetRect());
SetAttributes(pRect);
InsertObj(pRect);
}
void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction const & rAct)
{
- SdrRectObj* pRect=new SdrRectObj(rAct.GetRect());
+ SdrRectObj* pRect = new SdrRectObj(
+ *mpModel,
+ rAct.GetRect());
SetAttributes(pRect);
long nRad=(rAct.GetHorzRound()+rAct.GetVertRound())/2;
if (nRad!=0) {
@@ -725,7 +733,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaRoundRectAction const & rAct)
void ImpSdrGDIMetaFileImport::DoAction(MetaEllipseAction const & rAct)
{
- SdrCircObj* pCirc=new SdrCircObj(OBJ_CIRC,rAct.GetRect());
+ SdrCircObj* pCirc=new SdrCircObj(
+ *mpModel,
+ OBJ_CIRC,
+ rAct.GetRect());
SetAttributes(pCirc);
InsertObj(pCirc);
}
@@ -735,7 +746,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaArcAction const & rAct)
Point aCenter(rAct.GetRect().Center());
long nStart=GetAngle(rAct.GetStartPoint()-aCenter);
long nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
- SdrCircObj* pCirc=new SdrCircObj(OBJ_CARC,rAct.GetRect(),nStart,nEnd);
+ SdrCircObj* pCirc = new SdrCircObj(
+ *mpModel,
+ OBJ_CARC,
+ rAct.GetRect(),nStart,nEnd);
SetAttributes(pCirc);
InsertObj(pCirc);
}
@@ -745,7 +759,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaPieAction const & rAct)
Point aCenter(rAct.GetRect().Center());
long nStart=GetAngle(rAct.GetStartPoint()-aCenter);
long nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
- SdrCircObj* pCirc=new SdrCircObj(OBJ_SECT,rAct.GetRect(),nStart,nEnd);
+ SdrCircObj* pCirc = new SdrCircObj(
+ *mpModel,
+ OBJ_SECT,
+ rAct.GetRect(),
+ nStart,
+ nEnd);
SetAttributes(pCirc);
InsertObj(pCirc);
}
@@ -755,7 +774,12 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaChordAction const & rAct)
Point aCenter(rAct.GetRect().Center());
long nStart=GetAngle(rAct.GetStartPoint()-aCenter);
long nEnd=GetAngle(rAct.GetEndPoint()-aCenter);
- SdrCircObj* pCirc=new SdrCircObj(OBJ_CCUT,rAct.GetRect(),nStart,nEnd);
+ SdrCircObj* pCirc = new SdrCircObj(
+ *mpModel,
+ OBJ_CCUT,
+ rAct.GetRect(),
+ nStart,
+ nEnd);
SetAttributes(pCirc);
InsertObj(pCirc);
}
@@ -911,6 +935,7 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolyLineAction const & rAct )
if(bCreateLineObject)
{
SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
aSource.isClosed() ? OBJ_POLY : OBJ_PLIN,
basegfx::B2DPolyPolygon(aSource));
mnLineWidth = nNewLineWidth;
@@ -942,7 +967,10 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaPolygonAction const & rAct )
{
// #i73407# make sure polygon is closed, it's a filled primitive
aSource.setClosed(true);
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, basegfx::B2DPolyPolygon(aSource));
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_POLY,
+ basegfx::B2DPolyPolygon(aSource));
SetAttributes(pPath);
InsertObj(pPath, false);
}
@@ -963,7 +991,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaPolyPolygonAction const & rAct)
{
// #i73407# make sure polygon is closed, it's a filled primitive
aSource.setClosed(true);
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_POLY,
+ aSource);
SetAttributes(pPath);
InsertObj(pPath, false);
}
@@ -990,7 +1021,10 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt
aPos.AdjustY( -nTextHeight );
tools::Rectangle aTextRect( aPos, aSize );
- SdrRectObj* pText =new SdrRectObj( OBJ_TEXT, aTextRect );
+ SdrRectObj* pText =new SdrRectObj(
+ *mpModel,
+ OBJ_TEXT,
+ aTextRect);
pText->SetMergedItem ( makeSdrTextUpperDistItem (0));
pText->SetMergedItem ( makeSdrTextLowerDistItem (0));
@@ -1059,7 +1093,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmap().GetSizePixel());
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
- SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ Graphic(rAct.GetBitmap()),
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1071,7 +1108,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScaleAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
- SdrGrafObj* pGraf=new SdrGrafObj(Graphic(rAct.GetBitmap()),aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ Graphic(rAct.GetBitmap()),
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1083,7 +1123,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetBitmapEx().GetSizePixel());
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
- SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect );
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ rAct.GetBitmapEx(),
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1095,7 +1138,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScaleAction const & rAct)
{
tools::Rectangle aRect(rAct.GetPoint(),rAct.GetSize());
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
- SdrGrafObj* pGraf=new SdrGrafObj( rAct.GetBitmapEx(), aRect );
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ rAct.GetBitmapEx(),
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1117,7 +1163,10 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaHatchAction const & rAct )
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
const Hatch& rHatch = rAct.GetHatch();
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_POLY,
+ aSource);
// #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
SfxItemSet aHatchAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
css::drawing::HatchStyle eStyle;
@@ -1207,7 +1256,10 @@ void ImpSdrGDIMetaFileImport::DoAction( MetaCommentAction const & rAct, GDIMetaF
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
const Gradient& rGrad = pAct->GetGradient();
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_POLY,
+ aSource);
// #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
SfxItemSet aGradAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
XGradient aXGradient;
@@ -1275,7 +1327,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpScalePartAction const & rAct)
aRect.AdjustRight( 1 );
aRect.AdjustBottom( 1 );
aBitmap.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmap, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ aBitmap,
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1291,7 +1346,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaBmpExScalePartAction const & rAct)
aRect.AdjustRight( 1 );
aRect.AdjustBottom( 1 );
aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ aBitmapEx,
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1305,7 +1363,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskAction const & rAct)
BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ aBitmapEx,
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1319,7 +1380,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskScaleAction const & rAct)
BitmapEx aBitmapEx(rAct.GetBitmap(), rAct.GetColor());
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ aBitmapEx,
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1334,7 +1398,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaMaskScalePartAction const & rAct)
aRect.AdjustRight( 1 ); aRect.AdjustBottom( 1 );
aBitmapEx.Crop(tools::Rectangle(rAct.GetSrcPoint(), rAct.GetSrcSize()));
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ aBitmapEx,
+ aRect);
// This action is not creating line and fill, set directly, do not use SetAttributes(..)
pGraf->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
@@ -1381,6 +1448,7 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientAction const & rAct)
aRange.transform(aTransform);
const Gradient& rGradient = rAct.GetGradient();
SdrRectObj* pRect = new SdrRectObj(
+ *mpModel,
tools::Rectangle(
floor(aRange.getMinX()),
floor(aRange.getMinY()),
@@ -1420,7 +1488,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaTransparentAction const & rAct)
aSource.transform(aTransform);
aSource.setClosed(true);
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_POLY,
+ aSource);
SetAttributes(pPath);
pPath->SetMergedItem(XFillTransparenceItem(rAct.GetTransparence()));
InsertObj(pPath, false);
@@ -1439,7 +1510,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaGradientExAction const & rAct)
if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(aSource))
{
const Gradient& rGradient = rAct.GetGradient();
- SdrPathObj* pPath = new SdrPathObj(OBJ_POLY, aSource);
+ SdrPathObj* pPath = new SdrPathObj(
+ *mpModel,
+ OBJ_POLY,
+ aSource);
// #i125211# Use the ranges from the SdrObject to create a new empty SfxItemSet
SfxItemSet aGradientAttr(mpModel->GetItemPool(), pPath->GetMergedItemSet().GetRanges());
const css::awt::GradientStyle aXGradientStyle(getXGradientStyleFromGradientStyle(rGradient.GetStyle()));
@@ -1563,7 +1637,10 @@ void ImpSdrGDIMetaFileImport::DoAction(MetaFloatTransparentAction const & rAct)
}
// create and add object
- SdrGrafObj* pGraf = new SdrGrafObj(aBitmapEx, aRect);
+ SdrGrafObj* pGraf = new SdrGrafObj(
+ *mpModel,
+ aBitmapEx,
+ aRect);
// for MetaFloatTransparentAction, do not use SetAttributes(...)
// since these metafile content is not used to draw line/fill
diff --git a/svx/source/svdraw/svdglev.cxx b/svx/source/svdraw/svdglev.cxx
index 64da87b646ab..3bbd461923fd 100644
--- a/svx/source/svdraw/svdglev.cxx
+++ b/svx/source/svdraw/svdglev.cxx
@@ -29,9 +29,10 @@
#include <svx/svdtrans.hxx>
#include <svx/svdobj.hxx>
-
-SdrGlueEditView::SdrGlueEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrPolyEditView(pModel1,pOut)
+SdrGlueEditView::SdrGlueEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrPolyEditView(rSdrModel, pOut)
{
}
@@ -39,7 +40,6 @@ SdrGlueEditView::~SdrGlueEditView()
{
}
-
void SdrGlueEditView::ImpDoMarkedGluePoints(PGlueDoFunc pDoFunc, bool bConst, const void* p1, const void* p2, const void* p3, const void* p4)
{
const size_t nMarkCount=GetMarkedObjectCount();
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index 985b415ca3b6..07a5b2876361 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -144,15 +144,17 @@ void SdrMarkView::ImpClearVars()
BrkMarkGluePoints();
}
-SdrMarkView::SdrMarkView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrSnapView(pModel1,pOut),
+SdrMarkView::SdrMarkView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrSnapView(rSdrModel, pOut),
mpMarkObjOverlay(nullptr),
mpMarkPointsOverlay(nullptr),
mpMarkGluePointsOverlay(nullptr),
maHdlList(this)
{
ImpClearVars();
- StartListening(*pModel1);
+ StartListening(rSdrModel);
}
SdrMarkView::~SdrMarkView()
diff --git a/svx/source/svdraw/svdoashp.cxx b/svx/source/svdraw/svdoashp.cxx
index 70c9faf7978b..ab82cf1343e0 100644
--- a/svx/source/svdraw/svdoashp.cxx
+++ b/svx/source/svdraw/svdoashp.cxx
@@ -810,8 +810,8 @@ sdr::properties::BaseProperties* SdrObjCustomShape::CreateObjectSpecificProperti
return new sdr::properties::CustomShapeProperties(*this);
}
-SdrObjCustomShape::SdrObjCustomShape()
- : SdrTextObj()
+SdrObjCustomShape::SdrObjCustomShape(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel)
, fObjectRotation(0.0)
, mbAdjustingTextFrameWidthAndHeight(false)
, mpLastShadowGeometry(nullptr)
diff --git a/svx/source/svdraw/svdoattr.cxx b/svx/source/svdraw/svdoattr.cxx
index 1f118f838f84..38fd4d2e14ca 100644
--- a/svx/source/svdraw/svdoattr.cxx
+++ b/svx/source/svdraw/svdoattr.cxx
@@ -80,7 +80,8 @@ sdr::properties::BaseProperties* SdrAttrObj::CreateObjectSpecificProperties()
}
-SdrAttrObj::SdrAttrObj()
+SdrAttrObj::SdrAttrObj(SdrModel& rSdrModel)
+: SdrObject(rSdrModel)
{
}
diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx
index 6726c2eafda3..51567a4b38ef 100644
--- a/svx/source/svdraw/svdobj.cxx
+++ b/svx/source/svdraw/svdobj.cxx
@@ -284,8 +284,9 @@ void SdrObject::SetBoundRectDirty()
}
-SdrObject::SdrObject() :
- mpFillGeometryDefiningShape(nullptr)
+SdrObject::SdrObject(SdrModel& rSdrModel)
+: mpFillGeometryDefiningShape(nullptr)
+ ,mrSdrModelFromSdrObject(rSdrModel)
,pPage(nullptr)
,pModel(nullptr)
,pUserCall(nullptr)
@@ -2309,15 +2310,15 @@ void extractLineContourFromPrimitive2DSequence(
}
-SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDash)
+SdrObject* SdrObject::ImpConvertToContourObj(bool bForceLineDash)
{
- bool bNoChange(true);
+ SdrObject* pRetval(nullptr);
- if(pRet->LineGeometryUsageIsNecessary())
+ if(LineGeometryUsageIsNecessary())
{
basegfx::B2DPolyPolygon aMergedLineFillPolyPolygon;
basegfx::B2DPolyPolygon aMergedHairlinePolyPolygon;
- const drawinglayer::primitive2d::Primitive2DContainer xSequence(pRet->GetViewContact().getViewIndependentPrimitive2DContainer());
+ const drawinglayer::primitive2d::Primitive2DContainer xSequence(GetViewContact().getViewIndependentPrimitive2DContainer());
if(!xSequence.empty())
{
@@ -2345,7 +2346,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
if(aMergedLineFillPolyPolygon.count() || (bForceLineDash && aMergedHairlinePolyPolygon.count()))
{
- SfxItemSet aSet(pRet->GetMergedItemSet());
+ SfxItemSet aSet(GetMergedItemSet());
drawing::FillStyle eOldFillStyle = aSet.Get(XATTR_FILLSTYLE).GetValue();
SdrPathObj* aLinePolygonPart = nullptr;
SdrPathObj* aLineHairlinePart = nullptr;
@@ -2354,8 +2355,11 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
if(aMergedLineFillPolyPolygon.count())
{
// create SdrObject for filled line geometry
- aLinePolygonPart = new SdrPathObj(OBJ_PATHFILL, aMergedLineFillPolyPolygon);
- aLinePolygonPart->SetModel(pRet->GetModel());
+ aLinePolygonPart = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHFILL,
+ aMergedLineFillPolyPolygon);
+ aLinePolygonPart->SetModel(GetModel());
// correct item properties
aSet.Put(XLineWidthItem(0));
@@ -2375,8 +2379,11 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
// OBJ_PATHLINE is necessary here, not OBJ_PATHFILL. This is intended
// to get a non-filled object. If the poly is closed, the PathObj takes care for
// the correct closed state.
- aLineHairlinePart = new SdrPathObj(OBJ_PATHLINE, aMergedHairlinePolyPolygon);
- aLineHairlinePart->SetModel(pRet->GetModel());
+ aLineHairlinePart = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aMergedHairlinePolyPolygon);
+ aLineHairlinePart->SetModel(GetModel());
aSet.Put(XLineWidthItem(0));
aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
@@ -2396,7 +2403,7 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
// check if original geometry should be added (e.g. filled and closed)
bool bAddOriginalGeometry(false);
- SdrPathObj* pPath = dynamic_cast<SdrPathObj*>( pRet );
+ SdrPathObj* pPath = dynamic_cast<SdrPathObj*>(this);
if(pPath && pPath->IsClosed())
{
@@ -2409,20 +2416,20 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
// do we need a group?
if(bBuildGroup || bAddOriginalGeometry)
{
- SdrObject* pGroup = new SdrObjGroup;
- pGroup->SetModel(pRet->GetModel());
+ SdrObject* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
+ pGroup->SetModel(GetModel());
if(bAddOriginalGeometry)
{
// Add a clone of the original geometry.
aSet.ClearItem();
- aSet.Put(pRet->GetMergedItemSet());
+ aSet.Put(GetMergedItemSet());
aSet.Put(XLineStyleItem(drawing::LineStyle_NONE));
aSet.Put(XLineWidthItem(0));
- SdrObject* pClone = pRet->Clone();
+ SdrObject* pClone = Clone();
- pClone->SetModel(pRet->GetModel());
+ pClone->SetModel(GetModel());
pClone->SetMergedItemSet(aSet);
pGroup->GetSubList()->NbcInsertObject(pClone);
@@ -2438,38 +2445,31 @@ SdrObject* SdrObject::ImpConvertToContourObj(SdrObject* pRet, bool bForceLineDas
pGroup->GetSubList()->NbcInsertObject(aLineHairlinePart);
}
- pRet = pGroup;
-
- // be more careful with the state describing bool
- bNoChange = false;
+ pRetval = pGroup;
}
else
{
if(aLinePolygonPart)
{
- pRet = aLinePolygonPart;
- // be more careful with the state describing bool
- bNoChange = false;
+ pRetval = aLinePolygonPart;
}
else if(aLineHairlinePart)
{
- pRet = aLineHairlinePart;
- // be more careful with the state describing bool
- bNoChange = false;
+ pRetval = aLineHairlinePart;
}
}
}
}
- if(bNoChange)
+ if(nullptr == pRetval)
{
// due to current method usage, create and return a clone when nothing has changed
- SdrObject* pClone = pRet->Clone();
- pClone->SetModel(pRet->GetModel());
- pRet = pClone;
+ SdrObject* pClone = Clone();
+ pClone->SetModel(GetModel());
+ pRetval = pClone;
}
- return pRet;
+ return pRetval;
}
@@ -2497,7 +2497,7 @@ SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, bool bForceLineDash)
if(dynamic_cast<const SdrObjGroup*>( pRet) != nullptr)
{
SdrObjList* pObjList2 = pRet->GetSubList();
- SdrObject* pGroup = new SdrObjGroup;
+ SdrObject* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
pGroup->SetModel(pRet->GetModel());
for(size_t a=0; a<pObjList2->GetObjCount(); ++a)
@@ -2518,7 +2518,7 @@ SdrObject* SdrObject::ConvertToContourObj(SdrObject* pRet, bool bForceLineDash)
pPathObj->SetPathPoly(basegfx::utils::simplifyCurveSegments(pPathObj->GetPathPoly()));
}
- pRet = ImpConvertToContourObj(pRet, bForceLineDash);
+ pRet = pRet->ImpConvertToContourObj(bForceLineDash);
}
// #i73441# preserve LayerID
@@ -3056,9 +3056,9 @@ SdrDelayBroadcastObjectChange::~SdrDelayBroadcastObjectChange()
}
-SdrObject* SdrObjFactory::CreateObjectFromFactory( SdrInventor nInventor, sal_uInt16 nObjIdentifier )
+SdrObject* SdrObjFactory::CreateObjectFromFactory(SdrModel& rSdrModel, SdrInventor nInventor, sal_uInt16 nObjIdentifier)
{
- SdrObjCreatorParams aParams { nInventor, nObjIdentifier };
+ SdrObjCreatorParams aParams { nInventor, nObjIdentifier, rSdrModel };
for (const auto & i : ImpGetUserMakeObjHdl()) {
SdrObject* pObj = i.Call(aParams);
if (pObj) {
@@ -3068,7 +3068,12 @@ SdrObject* SdrObjFactory::CreateObjectFromFactory( SdrInventor nInventor, sal_uI
return nullptr;
}
-SdrObject* SdrObjFactory::MakeNewObject(SdrInventor nInvent, sal_uInt16 nIdent, SdrPage* pPage, SdrModel* pModel)
+SdrObject* SdrObjFactory::MakeNewObject(
+ SdrModel& rSdrModel,
+ SdrInventor nInvent,
+ sal_uInt16 nIdent,
+ SdrPage* pPage,
+ SdrModel* pModel)
{
if (!pModel && pPage)
pModel = pPage->GetModel();
@@ -3079,44 +3084,46 @@ SdrObject* SdrObjFactory::MakeNewObject(SdrInventor nInvent, sal_uInt16 nIdent,
{
switch (nIdent)
{
- case sal_uInt16(OBJ_NONE ): pObj=new SdrObject; break;
- case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup; break;
- case sal_uInt16(OBJ_LINE ): pObj=new SdrPathObj(OBJ_LINE ); break;
- case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(OBJ_POLY ); break;
- case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break;
- case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(OBJ_PATHLINE ); break;
- case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(OBJ_PATHFILL ); break;
- case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(OBJ_FREELINE ); break;
- case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(OBJ_FREEFILL ); break;
- case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(OBJ_POLY ); break;
- case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break;
- case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj; break;
- case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj; break;
- case sal_uInt16(OBJ_CIRC ): pObj=new SdrCircObj(OBJ_CIRC ); break;
- case sal_uInt16(OBJ_SECT ): pObj=new SdrCircObj(OBJ_SECT ); break;
- case sal_uInt16(OBJ_CARC ): pObj=new SdrCircObj(OBJ_CARC ); break;
- case sal_uInt16(OBJ_CCUT ): pObj=new SdrCircObj(OBJ_CCUT ); break;
- case sal_uInt16(OBJ_TEXT ): pObj=new SdrRectObj(OBJ_TEXT ); break;
- case sal_uInt16(OBJ_TEXTEXT ): pObj=new SdrRectObj(OBJ_TEXTEXT ); break;
- case sal_uInt16(OBJ_TITLETEXT ): pObj=new SdrRectObj(OBJ_TITLETEXT ); break;
- case sal_uInt16(OBJ_OUTLINETEXT): pObj=new SdrRectObj(OBJ_OUTLINETEXT); break;
- case sal_uInt16(OBJ_MEASURE ): pObj=new SdrMeasureObj; break;
- case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj; break;
- case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj; break;
- case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(true); break;
- case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj; break;
- case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj; break;
- case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(OUString()); break;
- case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(); break;
+ case sal_uInt16(OBJ_NONE ): pObj=new SdrObject(rSdrModel); break;
+ case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup(rSdrModel); break;
+ case sal_uInt16(OBJ_LINE ): pObj=new SdrPathObj(rSdrModel, OBJ_LINE ); break;
+ case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break;
+ case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break;
+ case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(rSdrModel, OBJ_PATHLINE ); break;
+ case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(rSdrModel, OBJ_PATHFILL ); break;
+ case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(rSdrModel, OBJ_FREELINE ); break;
+ case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(rSdrModel, OBJ_FREEFILL ); break;
+ case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break;
+ case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break;
+ case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj(rSdrModel); break;
+ case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj(rSdrModel); break;
+ case sal_uInt16(OBJ_CIRC ): pObj=new SdrCircObj(rSdrModel, OBJ_CIRC ); break;
+ case sal_uInt16(OBJ_SECT ): pObj=new SdrCircObj(rSdrModel, OBJ_SECT ); break;
+ case sal_uInt16(OBJ_CARC ): pObj=new SdrCircObj(rSdrModel, OBJ_CARC ); break;
+ case sal_uInt16(OBJ_CCUT ): pObj=new SdrCircObj(rSdrModel, OBJ_CCUT ); break;
+ case sal_uInt16(OBJ_TEXT ): pObj=new SdrRectObj(rSdrModel, OBJ_TEXT ); break;
+ case sal_uInt16(OBJ_TEXTEXT ): pObj=new SdrRectObj(rSdrModel, OBJ_TEXTEXT ); break;
+ case sal_uInt16(OBJ_TITLETEXT ): pObj=new SdrRectObj(rSdrModel, OBJ_TITLETEXT ); break;
+ case sal_uInt16(OBJ_OUTLINETEXT): pObj=new SdrRectObj(rSdrModel, OBJ_OUTLINETEXT); break;
+ case sal_uInt16(OBJ_MEASURE ): pObj=new SdrMeasureObj(rSdrModel); break;
+ case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj(rSdrModel); break;
+ case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj(rSdrModel); break;
+ case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(rSdrModel, true); break;
+ case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj(rSdrModel); break;
+ case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj(rSdrModel); break;
+ case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(rSdrModel, OUString()); break;
+ case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(rSdrModel); break;
#if HAVE_FEATURE_AVMEDIA
- case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(); break;
+ case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(rSdrModel); break;
#endif
- case sal_uInt16(OBJ_TABLE ): pObj=new sdr::table::SdrTableObj(pModel); break;
+ case sal_uInt16(OBJ_TABLE ): pObj=new sdr::table::SdrTableObj(rSdrModel); break;
}
}
if (!pObj)
- pObj = CreateObjectFromFactory(nInvent, nIdent);
+ {
+ pObj = CreateObjectFromFactory(rSdrModel, nInvent, nIdent);
+ }
if (!pObj)
{
@@ -3133,12 +3140,14 @@ SdrObject* SdrObjFactory::MakeNewObject(SdrInventor nInvent, sal_uInt16 nIdent,
}
SdrObject* SdrObjFactory::MakeNewObject(
- SdrInventor nInventor, sal_uInt16 nIdentifier, const tools::Rectangle& rSnapRect, SdrPage* pPage )
+ SdrModel& rSdrModel,
+ SdrInventor nInventor,
+ sal_uInt16 nIdentifier,
+ const tools::Rectangle& rSnapRect,
+ SdrPage* pPage)
{
SdrModel* pModel = pPage ? pPage->GetModel() : nullptr;
-
SdrObject* pObj = nullptr;
-
bool bSetSnapRect = true;
if (nInventor == SdrInventor::Default)
@@ -3147,7 +3156,7 @@ SdrObject* SdrObjFactory::MakeNewObject(
{
case OBJ_MEASURE:
{
- pObj = new SdrMeasureObj(rSnapRect.TopLeft(), rSnapRect.BottomRight());
+ pObj = new SdrMeasureObj(rSdrModel, rSnapRect.TopLeft(), rSnapRect.BottomRight());
}
break;
case OBJ_LINE:
@@ -3155,7 +3164,7 @@ SdrObject* SdrObjFactory::MakeNewObject(
basegfx::B2DPolygon aPoly;
aPoly.append(basegfx::B2DPoint(rSnapRect.Left(), rSnapRect.Top()));
aPoly.append(basegfx::B2DPoint(rSnapRect.Right(), rSnapRect.Bottom()));
- pObj = new SdrPathObj(OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
+ pObj = new SdrPathObj(rSdrModel, OBJ_LINE, basegfx::B2DPolyPolygon(aPoly));
}
break;
case OBJ_TEXT:
@@ -3163,7 +3172,7 @@ SdrObject* SdrObjFactory::MakeNewObject(
case OBJ_TITLETEXT:
case OBJ_OUTLINETEXT:
{
- pObj = new SdrRectObj(static_cast<SdrObjKind>(nIdentifier), rSnapRect);
+ pObj = new SdrRectObj(rSdrModel, static_cast<SdrObjKind>(nIdentifier), rSnapRect);
bSetSnapRect = false;
}
break;
@@ -3172,38 +3181,40 @@ SdrObject* SdrObjFactory::MakeNewObject(
case OBJ_CARC:
case OBJ_CCUT:
{
- pObj = new SdrCircObj(static_cast<SdrObjKind>(nIdentifier), rSnapRect);
+ pObj = new SdrCircObj(rSdrModel, static_cast<SdrObjKind>(nIdentifier), rSnapRect);
bSetSnapRect = false;
}
break;
- case sal_uInt16(OBJ_NONE ): pObj=new SdrObject; break;
- case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup; break;
- case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(OBJ_POLY ); break;
- case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break;
- case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(OBJ_PATHLINE ); break;
- case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(OBJ_PATHFILL ); break;
- case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(OBJ_FREELINE ); break;
- case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(OBJ_FREEFILL ); break;
- case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(OBJ_POLY ); break;
- case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(OBJ_PLIN ); break;
- case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj; break;
- case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj; break;
- case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj; break;
- case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj; break;
- case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(true); break;
- case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj; break;
- case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj; break;
- case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(OUString()); break;
- case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(); break;
+ case sal_uInt16(OBJ_NONE ): pObj=new SdrObject(rSdrModel); break;
+ case sal_uInt16(OBJ_GRUP ): pObj=new SdrObjGroup(rSdrModel); break;
+ case sal_uInt16(OBJ_POLY ): pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break;
+ case sal_uInt16(OBJ_PLIN ): pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break;
+ case sal_uInt16(OBJ_PATHLINE ): pObj=new SdrPathObj(rSdrModel, OBJ_PATHLINE ); break;
+ case sal_uInt16(OBJ_PATHFILL ): pObj=new SdrPathObj(rSdrModel, OBJ_PATHFILL ); break;
+ case sal_uInt16(OBJ_FREELINE ): pObj=new SdrPathObj(rSdrModel, OBJ_FREELINE ); break;
+ case sal_uInt16(OBJ_FREEFILL ): pObj=new SdrPathObj(rSdrModel, OBJ_FREEFILL ); break;
+ case sal_uInt16(OBJ_PATHPOLY ): pObj=new SdrPathObj(rSdrModel, OBJ_POLY ); break;
+ case sal_uInt16(OBJ_PATHPLIN ): pObj=new SdrPathObj(rSdrModel, OBJ_PLIN ); break;
+ case sal_uInt16(OBJ_EDGE ): pObj=new SdrEdgeObj(rSdrModel); break;
+ case sal_uInt16(OBJ_RECT ): pObj=new SdrRectObj(rSdrModel); break;
+ case sal_uInt16(OBJ_GRAF ): pObj=new SdrGrafObj(rSdrModel); break;
+ case sal_uInt16(OBJ_OLE2 ): pObj=new SdrOle2Obj(rSdrModel); break;
+ case sal_uInt16(OBJ_FRAME ): pObj=new SdrOle2Obj(rSdrModel, true); break;
+ case sal_uInt16(OBJ_CAPTION ): pObj=new SdrCaptionObj(rSdrModel); break;
+ case sal_uInt16(OBJ_PAGE ): pObj=new SdrPageObj(rSdrModel); break;
+ case sal_uInt16(OBJ_UNO ): pObj=new SdrUnoObj(rSdrModel, OUString()); break;
+ case sal_uInt16(OBJ_CUSTOMSHAPE ): pObj=new SdrObjCustomShape(rSdrModel); break;
#if HAVE_FEATURE_AVMEDIA
- case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(); break;
+ case sal_uInt16(OBJ_MEDIA ): pObj=new SdrMediaObj(rSdrModel); break;
#endif
- case sal_uInt16(OBJ_TABLE ): pObj=new sdr::table::SdrTableObj(pModel); break;
+ case sal_uInt16(OBJ_TABLE ): pObj=new sdr::table::SdrTableObj(rSdrModel); break;
}
}
if (!pObj)
- pObj = CreateObjectFromFactory(nInventor, nIdentifier);
+ {
+ pObj = CreateObjectFromFactory(rSdrModel, nInventor, nIdentifier);
+ }
if (!pObj)
{
diff --git a/svx/source/svdraw/svdocapt.cxx b/svx/source/svdraw/svdocapt.cxx
index 00cb7ded37ab..e72333f6062c 100644
--- a/svx/source/svdraw/svdocapt.cxx
+++ b/svx/source/svdraw/svdocapt.cxx
@@ -189,16 +189,19 @@ sdr::contact::ViewContact* SdrCaptionObj::CreateObjectSpecificViewContact()
}
-SdrCaptionObj::SdrCaptionObj():
- SdrRectObj(OBJ_TEXT),
+SdrCaptionObj::SdrCaptionObj(SdrModel& rSdrModel)
+: SdrRectObj(rSdrModel, OBJ_TEXT),
aTailPoly(3), // default size: 3 points = 2 lines
mbSpecialTextBoxShadow(false),
mbFixedTail(false)
{
}
-SdrCaptionObj::SdrCaptionObj(const tools::Rectangle& rRect, const Point& rTail):
- SdrRectObj(OBJ_TEXT,rRect),
+SdrCaptionObj::SdrCaptionObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect,
+ const Point& rTail)
+: SdrRectObj(rSdrModel, OBJ_TEXT,rRect),
aTailPoly(3), // default size: 3 points = 2 lines
mbSpecialTextBoxShadow(false),
mbFixedTail(false)
@@ -706,8 +709,9 @@ SdrObject* SdrCaptionObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
if (pOL!=nullptr) { pRet=pRect; bInsTail = false; }
if (pOL==nullptr) pOL=pRect->GetSubList();
if (pOL!=nullptr) { pRet=pRect; bInsRect = false; }
- if (pOL==nullptr) {
- SdrObjGroup* pGrp=new SdrObjGroup;
+ if (pOL==nullptr)
+ {
+ SdrObjGroup* pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
pOL=pGrp->GetSubList();
pRet=pGrp;
}
diff --git a/svx/source/svdraw/svdocirc.cxx b/svx/source/svdraw/svdocirc.cxx
index dc87f9a5de9a..90cecb978232 100644
--- a/svx/source/svdraw/svdocirc.cxx
+++ b/svx/source/svdraw/svdocirc.cxx
@@ -104,8 +104,10 @@ sdr::contact::ViewContact* SdrCircObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfSdrCircObj(*this);
}
-
-SdrCircObj::SdrCircObj(SdrObjKind eNewKind)
+SdrCircObj::SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind)
+: SdrRectObj(rSdrModel)
{
nStartAngle=0;
nEndAngle=36000;
@@ -113,8 +115,11 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind)
bClosedObj=eNewKind!=OBJ_CARC;
}
-SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const tools::Rectangle& rRect):
- SdrRectObj(rRect)
+SdrCircObj::SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind,
+ const tools::Rectangle& rRect)
+: SdrRectObj(rSdrModel, rRect)
{
nStartAngle=0;
nEndAngle=36000;
@@ -122,8 +127,13 @@ SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const tools::Rectangle& rRect):
bClosedObj=eNewKind!=OBJ_CARC;
}
-SdrCircObj::SdrCircObj(SdrObjKind eNewKind, const tools::Rectangle& rRect, long nNewStartWink, long nNewEndWink):
- SdrRectObj(rRect)
+SdrCircObj::SdrCircObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind,
+ const tools::Rectangle& rRect,
+ long nNewStartWink,
+ long nNewEndWink)
+: SdrRectObj(rSdrModel, rRect)
{
long nAngleDif=nNewEndWink-nNewStartWink;
nStartAngle=NormAngle360(nNewStartWink);
diff --git a/svx/source/svdraw/svdoedge.cxx b/svx/source/svdraw/svdoedge.cxx
index 45203c3d63cf..e6f7a048db50 100644
--- a/svx/source/svdraw/svdoedge.cxx
+++ b/svx/source/svdraw/svdoedge.cxx
@@ -161,8 +161,8 @@ sdr::contact::ViewContact* SdrEdgeObj::CreateObjectSpecificViewContact()
}
-SdrEdgeObj::SdrEdgeObj()
-: SdrTextObj(),
+SdrEdgeObj::SdrEdgeObj(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel),
nNotifyingCount(0),
bEdgeTrackDirty(false),
bEdgeTrackUserDefined(false),
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 1a00716fa088..2307b8e029fa 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -325,15 +325,14 @@ void SdrGrafObj::onGraphicChanged()
}
}
-
-SdrGrafObj::SdrGrafObj()
- : SdrRectObj()
- , mpGraphicObject(new GraphicObject)
- , pGraphicLink(nullptr)
- , bMirrored(false)
- , mbIsSignatureLine(false)
- , mbIsSignatureLineShowSignDate(true)
- , mbIsSignatureLineCanAddComment(false)
+SdrGrafObj::SdrGrafObj(SdrModel& rSdrModel)
+: SdrRectObj(rSdrModel)
+ ,mpGraphicObject(new GraphicObject)
+ ,pGraphicLink(nullptr)
+ ,bMirrored(false)
+ ,mbIsSignatureLine(false)
+ ,mbIsSignatureLineShowSignDate(true)
+ ,mbIsSignatureLineCanAddComment(false)
{
mpGraphicObject->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
onGraphicChanged();
@@ -352,14 +351,17 @@ SdrGrafObj::SdrGrafObj()
mbSupportTextIndentingOnLineWidthChange = false;
}
-SdrGrafObj::SdrGrafObj(const Graphic& rGraphic, const tools::Rectangle& rRect)
- : SdrRectObj(rRect)
- , mpGraphicObject(new GraphicObject(rGraphic))
- , pGraphicLink(nullptr)
- , bMirrored(false)
- , mbIsSignatureLine(false)
- , mbIsSignatureLineShowSignDate(true)
- , mbIsSignatureLineCanAddComment(false)
+SdrGrafObj::SdrGrafObj(
+ SdrModel& rSdrModel,
+ const Graphic& rGraphic,
+ const tools::Rectangle& rRect)
+: SdrRectObj(rSdrModel, rRect)
+ ,mpGraphicObject(new GraphicObject(rGraphic))
+ ,pGraphicLink(nullptr)
+ ,bMirrored(false)
+ ,mbIsSignatureLine(false)
+ ,mbIsSignatureLineShowSignDate(true)
+ ,mbIsSignatureLineCanAddComment(false)
{
mpGraphicObject->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
onGraphicChanged();
@@ -378,14 +380,16 @@ SdrGrafObj::SdrGrafObj(const Graphic& rGraphic, const tools::Rectangle& rRect)
mbSupportTextIndentingOnLineWidthChange = false;
}
-SdrGrafObj::SdrGrafObj(const Graphic& rGraphic)
- : SdrRectObj()
- , mpGraphicObject(new GraphicObject(rGraphic))
- , pGraphicLink(nullptr)
- , bMirrored(false)
- , mbIsSignatureLine(false)
- , mbIsSignatureLineShowSignDate(true)
- , mbIsSignatureLineCanAddComment(false)
+SdrGrafObj::SdrGrafObj(
+ SdrModel& rSdrModel,
+ const Graphic& rGraphic)
+: SdrRectObj(rSdrModel)
+ ,mpGraphicObject(new GraphicObject(rGraphic))
+ ,pGraphicLink(nullptr)
+ ,bMirrored(false)
+ ,mbIsSignatureLine(false)
+ ,mbIsSignatureLineShowSignDate(true)
+ ,mbIsSignatureLineCanAddComment(false)
{
mpGraphicObject->SetSwapStreamHdl( LINK(this, SdrGrafObj, ImpSwapHdl) );
onGraphicChanged();
@@ -1133,7 +1137,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
{
// Sort into group and return ONLY those objects that can be created from the MetaFile.
ImpSdrGDIMetaFileImport aFilter(*GetModel(), GetLayer(), maRect);
- SdrObjGroup* pGrp = new SdrObjGroup();
+ SdrObjGroup* pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
if(aFilter.DoImport(aMtf, *pGrp->GetSubList(), 0))
{
@@ -1198,8 +1202,7 @@ SdrObject* SdrGrafObj::DoConvertToPolyObj(bool bBezier, bool bAddText ) const
if(!pGrp)
{
- pGrp = new SdrObjGroup();
-
+ pGrp = new SdrObjGroup(getSdrModelFromSdrObject());
pGrp->NbcSetLayer(GetLayer());
pGrp->SetModel(GetModel());
pGrp->GetSubList()->NbcInsertObject(pRetval);
diff --git a/svx/source/svdraw/svdogrp.cxx b/svx/source/svdraw/svdogrp.cxx
index d2151f14f4e4..24c452213686 100644
--- a/svx/source/svdraw/svdogrp.cxx
+++ b/svx/source/svdraw/svdogrp.cxx
@@ -50,32 +50,27 @@
#include <basegfx/polygon/b2dpolygon.hxx>
#include <libxml/xmlwriter.h>
-
// BaseProperties section
-
sdr::properties::BaseProperties* SdrObjGroup::CreateObjectSpecificProperties()
{
return new sdr::properties::GroupProperties(*this);
}
-
// DrawContact section
-
sdr::contact::ViewContact* SdrObjGroup::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfGroup(*this);
}
-
-SdrObjGroup::SdrObjGroup()
+SdrObjGroup::SdrObjGroup(SdrModel& rSdrModel)
+: SdrObject(rSdrModel)
{
- pSub.reset( new SdrObjList(nullptr,nullptr) );
+ pSub.reset(new SdrObjList(rSdrModel, nullptr));
pSub->SetOwnerObj(this);
pSub->SetListKind(SdrObjListKind::GroupObj);
bClosedObj=false;
}
-
SdrObjGroup::~SdrObjGroup()
{
}
@@ -736,7 +731,7 @@ void SdrObjGroup::ReformatText()
SdrObject* SdrObjGroup::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
- SdrObject* pGroup = new SdrObjGroup;
+ SdrObject* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
pGroup->SetModel(GetModel());
for(size_t a=0; a<pSub->GetObjCount(); ++a)
diff --git a/svx/source/svdraw/svdomeas.cxx b/svx/source/svdraw/svdomeas.cxx
index 63f33c6cbbce..38c14d176e13 100644
--- a/svx/source/svdraw/svdomeas.cxx
+++ b/svx/source/svdraw/svdomeas.cxx
@@ -211,14 +211,19 @@ sdr::contact::ViewContact* SdrMeasureObj::CreateObjectSpecificViewContact()
}
-SdrMeasureObj::SdrMeasureObj():
+SdrMeasureObj::SdrMeasureObj(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel),
bTextDirty(false)
{
// #i25616#
mbSupportTextIndentingOnLineWidthChange = false;
}
-SdrMeasureObj::SdrMeasureObj(const Point& rPt1, const Point& rPt2):
+SdrMeasureObj::SdrMeasureObj(
+ SdrModel& rSdrModel,
+ const Point& rPt1,
+ const Point& rPt2)
+: SdrTextObj(rSdrModel),
aPt1(rPt1),
aPt2(rPt2),
bTextDirty(false)
@@ -1138,7 +1143,7 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
SfxStyleSheet* pStyleSheet = GetStyleSheet();
// prepare group
- SdrObjGroup* pGroup = new SdrObjGroup;
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
pGroup->SetModel(GetModel());
// prepare parameters
@@ -1153,7 +1158,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
+ pPath = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPoly);
pPath->SetModel(GetModel());
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
@@ -1171,7 +1179,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
+ pPath = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPoly);
pPath->SetModel(GetModel());
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
@@ -1183,7 +1194,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[1].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
+ pPath = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPoly);
pPath->SetModel(GetModel());
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
@@ -1202,7 +1216,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[0].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
+ pPath = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPoly);
pPath->SetModel(GetModel());
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
@@ -1214,7 +1231,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[1].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
+ pPath = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPoly);
pPath->SetModel(GetModel());
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
@@ -1229,7 +1249,10 @@ SdrObject* SdrMeasureObj::DoConvertToPolyObj(bool bBezier, bool bAddText) const
{
aPolyPoly.clear();
aPolyPoly.append(aTmpPolyPolygon[nLoopStart].getB2DPolygon());
- pPath = new SdrPathObj(OBJ_PATHLINE, aPolyPoly);
+ pPath = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPoly);
pPath->SetModel(GetModel());
pPath->SetMergedItemSet(aSet);
pPath->SetStyleSheet(pStyleSheet, true);
diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx
index 4c41e76e6dc3..453893455f62 100644
--- a/svx/source/svdraw/svdomedia.cxx
+++ b/svx/source/svdraw/svdomedia.cxx
@@ -65,16 +65,17 @@ struct SdrMediaObj::Impl
OUString m_LastFailedPkgURL;
};
-
-SdrMediaObj::SdrMediaObj()
- : SdrRectObj()
- , m_xImpl( new Impl )
+SdrMediaObj::SdrMediaObj(SdrModel& rSdrModel)
+: SdrRectObj(rSdrModel)
+ ,m_xImpl( new Impl )
{
}
-SdrMediaObj::SdrMediaObj( const tools::Rectangle& rRect )
- : SdrRectObj( rRect )
- , m_xImpl( new Impl )
+SdrMediaObj::SdrMediaObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect)
+: SdrRectObj(rSdrModel, rRect)
+ ,m_xImpl( new Impl )
{
}
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index 8a264270bddf..49b3c4526bdb 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -663,13 +663,20 @@ sdr::contact::ViewContact* SdrOle2Obj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfSdrOle2Obj(*this);
}
-SdrOle2Obj::SdrOle2Obj( bool bFrame_ ) :
+SdrOle2Obj::SdrOle2Obj(
+ SdrModel& rSdrModel,
+ bool bFrame_)
+: SdrRectObj(rSdrModel),
mpImpl(new SdrOle2ObjImpl(bFrame_))
{
}
-SdrOle2Obj::SdrOle2Obj( const svt::EmbeddedObjectRef& rNewObjRef, const OUString& rNewObjName, const tools::Rectangle& rNewRect) :
- SdrRectObj(rNewRect),
+SdrOle2Obj::SdrOle2Obj(
+ SdrModel& rSdrModel,
+ const svt::EmbeddedObjectRef& rNewObjRef,
+ const OUString& rNewObjName,
+ const tools::Rectangle& rNewRect)
+: SdrRectObj(rSdrModel, rNewRect),
mpImpl(new SdrOle2ObjImpl(false/*bFrame_*/, rNewObjRef))
{
mpImpl->aPersistName = rNewObjName;
@@ -1122,7 +1129,9 @@ SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText) const
if(pOLEGraphic)
{
// #i118485# allow creating a SdrGrafObj representation
- SdrGrafObj* pClone = new SdrGrafObj(*pOLEGraphic);
+ SdrGrafObj* pClone = new SdrGrafObj(
+ getSdrModelFromSdrObject(),
+ *pOLEGraphic);
pClone->SetModel(GetModel());
// copy transformation
@@ -1153,7 +1162,9 @@ SdrObject* SdrOle2Obj::createSdrGrafObjReplacement(bool bAddText) const
{
// #i100710# pOLEGraphic may be zero (no visualisation available),
// so we need to use the OLE replacement graphic
- SdrRectObj* pClone = new SdrRectObj(GetSnapRect());
+ SdrRectObj* pClone = new SdrRectObj(
+ getSdrModelFromSdrObject(),
+ GetSnapRect());
pClone->SetModel(GetModel());
// gray outline
diff --git a/svx/source/svdraw/svdopage.cxx b/svx/source/svdraw/svdopage.cxx
index a2a6592037ee..a5c169c8424a 100644
--- a/svx/source/svdraw/svdopage.cxx
+++ b/svx/source/svdraw/svdopage.cxx
@@ -64,9 +64,11 @@ void SdrPageObj::PageInDestruction(const SdrPage& rPage)
}
}
-
-SdrPageObj::SdrPageObj(SdrPage* pNewPage)
-: mpShownPage(pNewPage)
+SdrPageObj::SdrPageObj(
+ SdrModel& rSdrModel,
+ SdrPage* pNewPage)
+: SdrObject(rSdrModel),
+ mpShownPage(pNewPage)
{
if(mpShownPage)
{
@@ -74,8 +76,12 @@ SdrPageObj::SdrPageObj(SdrPage* pNewPage)
}
}
-SdrPageObj::SdrPageObj(const tools::Rectangle& rRect, SdrPage* pNewPage)
-: mpShownPage(pNewPage)
+SdrPageObj::SdrPageObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect,
+ SdrPage* pNewPage)
+: SdrObject(rSdrModel),
+ mpShownPage(pNewPage)
{
if(mpShownPage)
{
diff --git a/svx/source/svdraw/svdopath.cxx b/svx/source/svdraw/svdopath.cxx
index 5cf8dd58c115..b48651f0532d 100644
--- a/svx/source/svdraw/svdopath.cxx
+++ b/svx/source/svdraw/svdopath.cxx
@@ -1628,14 +1628,21 @@ sdr::contact::ViewContact* SdrPathObj::CreateObjectSpecificViewContact()
}
-SdrPathObj::SdrPathObj(SdrObjKind eNewKind)
-: meKind(eNewKind)
+SdrPathObj::SdrPathObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind)
+: SdrTextObj(rSdrModel),
+ meKind(eNewKind)
{
bClosedObj = IsClosed();
}
-SdrPathObj::SdrPathObj(SdrObjKind eNewKind, const basegfx::B2DPolyPolygon& rPathPoly)
-: maPathPolygon(rPathPoly),
+SdrPathObj::SdrPathObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewKind,
+ const basegfx::B2DPolyPolygon& rPathPoly)
+: SdrTextObj(rSdrModel),
+ maPathPolygon(rPathPoly),
meKind(eNewKind)
{
bClosedObj = IsClosed();
diff --git a/svx/source/svdraw/svdorect.cxx b/svx/source/svdraw/svdorect.cxx
index 7f85da4b71a8..ce3f6d2c2418 100644
--- a/svx/source/svdraw/svdorect.cxx
+++ b/svx/source/svdraw/svdorect.cxx
@@ -62,21 +62,26 @@ sdr::contact::ViewContact* SdrRectObj::CreateObjectSpecificViewContact()
}
-SdrRectObj::SdrRectObj()
-: mpXPoly(nullptr)
+SdrRectObj::SdrRectObj(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel),
+ mpXPoly(nullptr)
{
bClosedObj=true;
}
-SdrRectObj::SdrRectObj(const tools::Rectangle& rRect)
-: SdrTextObj(rRect),
+SdrRectObj::SdrRectObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rRect)
+: SdrTextObj(rSdrModel, rRect),
mpXPoly(nullptr)
{
bClosedObj=true;
}
-SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind)
-: SdrTextObj(eNewTextKind),
+SdrRectObj::SdrRectObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind)
+: SdrTextObj(rSdrModel, eNewTextKind),
mpXPoly(nullptr)
{
DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT ||
@@ -85,8 +90,11 @@ SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind)
bClosedObj=true;
}
-SdrRectObj::SdrRectObj(SdrObjKind eNewTextKind, const tools::Rectangle& rRect)
-: SdrTextObj(eNewTextKind,rRect),
+SdrRectObj::SdrRectObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind,
+ const tools::Rectangle& rRect)
+: SdrTextObj(rSdrModel, eNewTextKind, rRect),
mpXPoly(nullptr)
{
DBG_ASSERT(eTextKind==OBJ_TEXT || eTextKind==OBJ_TEXTEXT ||
diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx
index cf4448fac249..6bab4d8f6bc2 100644
--- a/svx/source/svdraw/svdotext.cxx
+++ b/svx/source/svdraw/svdotext.cxx
@@ -64,25 +64,20 @@
using namespace com::sun::star;
-
// BaseProperties section
-
sdr::properties::BaseProperties* SdrTextObj::CreateObjectSpecificProperties()
{
return new sdr::properties::TextProperties(*this);
}
-
// DrawContact section
-
sdr::contact::ViewContact* SdrTextObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::ViewContactOfTextObj(*this);
}
-
-SdrTextObj::SdrTextObj()
-: SdrAttrObj(),
+SdrTextObj::SdrTextObj(SdrModel& rSdrModel)
+: SdrAttrObj(rSdrModel),
mpText(nullptr),
pEdtOutl(nullptr),
eTextKind(OBJ_TEXT)
@@ -102,8 +97,10 @@ SdrTextObj::SdrTextObj()
mbInDownScale = false;
}
-SdrTextObj::SdrTextObj(const tools::Rectangle& rNewRect)
-: SdrAttrObj(),
+SdrTextObj::SdrTextObj(
+ SdrModel& rSdrModel,
+ const tools::Rectangle& rNewRect)
+: SdrAttrObj(rSdrModel),
maRect(rNewRect),
mpText(nullptr),
pEdtOutl(nullptr),
@@ -125,8 +122,10 @@ SdrTextObj::SdrTextObj(const tools::Rectangle& rNewRect)
mbSupportTextIndentingOnLineWidthChange = true;
}
-SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind)
-: SdrAttrObj(),
+SdrTextObj::SdrTextObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind)
+: SdrAttrObj(rSdrModel),
mpText(nullptr),
pEdtOutl(nullptr),
eTextKind(eNewTextKind)
@@ -146,8 +145,11 @@ SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind)
mbSupportTextIndentingOnLineWidthChange = true;
}
-SdrTextObj::SdrTextObj(SdrObjKind eNewTextKind, const tools::Rectangle& rNewRect)
-: SdrAttrObj(),
+SdrTextObj::SdrTextObj(
+ SdrModel& rSdrModel,
+ SdrObjKind eNewTextKind,
+ const tools::Rectangle& rNewRect)
+: SdrAttrObj(rSdrModel),
maRect(rNewRect),
mpText(nullptr),
pEdtOutl(nullptr),
diff --git a/svx/source/svdraw/svdotxtr.cxx b/svx/source/svdraw/svdotxtr.cxx
index 40eca1077e38..298a832983fb 100644
--- a/svx/source/svdraw/svdotxtr.cxx
+++ b/svx/source/svdraw/svdotxtr.cxx
@@ -313,7 +313,7 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
if(nResultCount)
{
// prepare own target
- SdrObjGroup* pGroup = new SdrObjGroup();
+ SdrObjGroup* pGroup = new SdrObjGroup(getSdrModelFromSdrObject());
SdrObjList* pObjectList = pGroup->GetSubList();
// process results
@@ -355,7 +355,10 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
aAttributeSet.Put(XFillStyleItem(drawing::FillStyle_SOLID));
// create filled SdrPathObj
- pPathObj = new SdrPathObj(OBJ_PATHFILL, aPolyPolygon);
+ pPathObj = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHFILL,
+ aPolyPolygon);
}
else
{
@@ -366,7 +369,10 @@ SdrObject* SdrTextObj::ImpConvertContainedTextToSdrPathObjs(bool bToPoly) const
aAttributeSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
// create line SdrPathObj
- pPathObj = new SdrPathObj(OBJ_PATHLINE, aPolyPolygon);
+ pPathObj = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ OBJ_PATHLINE,
+ aPolyPolygon);
}
// copy basic information from original
@@ -433,7 +439,10 @@ SdrObject* SdrTextObj::ImpConvertMakeObj(const basegfx::B2DPolyPolygon& rPolyPol
ePathKind = bClosed ? OBJ_POLY : OBJ_PLIN;
}
- SdrPathObj* pPathObj = new SdrPathObj(ePathKind, aB2DPolyPolygon);
+ SdrPathObj* pPathObj = new SdrPathObj(
+ getSdrModelFromSdrObject(),
+ ePathKind,
+ aB2DPolyPolygon);
if(bBezier)
{
@@ -489,7 +498,7 @@ SdrObject* SdrTextObj::ImpConvertAddText(SdrObject* pObj, bool bBezier) const
else
{
// not yet a group, create one and add partial and new shapes
- SdrObjGroup* pGrp=new SdrObjGroup;
+ SdrObjGroup* pGrp=new SdrObjGroup(getSdrModelFromSdrObject());
SdrObjList* pOL=pGrp->GetSubList();
pOL->InsertObject(pObj);
pOL->InsertObject(pText);
diff --git a/svx/source/svdraw/svdouno.cxx b/svx/source/svdraw/svdouno.cxx
index 6e364c33ade1..504682dea454 100644
--- a/svx/source/svdraw/svdouno.cxx
+++ b/svx/source/svdraw/svdouno.cxx
@@ -145,9 +145,11 @@ namespace
}
}
-
-SdrUnoObj::SdrUnoObj(const OUString& rModelName)
-: m_pImpl( new SdrUnoObjDataHolder )
+SdrUnoObj::SdrUnoObj(
+ SdrModel& rSdrModel,
+ const OUString& rModelName)
+: SdrRectObj(rSdrModel),
+ m_pImpl( new SdrUnoObjDataHolder )
{
bIsUnoObj = true;
@@ -158,9 +160,12 @@ SdrUnoObj::SdrUnoObj(const OUString& rModelName)
CreateUnoControlModel(rModelName);
}
-SdrUnoObj::SdrUnoObj(const OUString& rModelName,
- const uno::Reference< lang::XMultiServiceFactory >& rxSFac)
-: m_pImpl( new SdrUnoObjDataHolder )
+SdrUnoObj::SdrUnoObj(
+ SdrModel& rSdrModel,
+ const OUString& rModelName,
+ const uno::Reference< lang::XMultiServiceFactory >& rxSFac)
+: SdrRectObj(rSdrModel),
+ m_pImpl( new SdrUnoObjDataHolder )
{
bIsUnoObj = true;
@@ -328,38 +333,6 @@ bool SdrUnoObj::hasSpecialDrag() const
return false;
}
-bool SdrUnoObj::supportsFullDrag() const
-{
- // override to have the possibility to enable/disable in debug and
- // to check some things out. Current solution is working, so default is
- // enabled
- static bool bDoSupportFullDrag(true);
-
- return bDoSupportFullDrag;
-}
-
-SdrObject* SdrUnoObj::getFullDragClone() const
-{
- SdrObject* pRetval = nullptr;
- static bool bHandleSpecial(false);
-
- if(bHandleSpecial)
- {
- // special handling for SdrUnoObj (FormControl). Create a SdrGrafObj
- // for drag containing the graphical representation. This does not work too
- // well, so the default is to simply clone
- pRetval = new SdrGrafObj(SdrDragView::GetObjGraphic(GetModel(), this), GetLogicRect());
- }
- else
- {
- // call parent (simply clone)
- pRetval = SdrRectObj::getFullDragClone();
- }
-
- return pRetval;
-}
-
-
void SdrUnoObj::NbcSetLayer( SdrLayerID _nLayer )
{
if ( GetLayer() == _nLayer )
diff --git a/svx/source/svdraw/svdovirt.cxx b/svx/source/svdraw/svdovirt.cxx
index 2ffcdc313473..11fd73c99974 100644
--- a/svx/source/svdraw/svdovirt.cxx
+++ b/svx/source/svdraw/svdovirt.cxx
@@ -42,8 +42,10 @@ sdr::contact::ViewContact* SdrVirtObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfVirtObj(*this);
}
-
-SdrVirtObj::SdrVirtObj(SdrObject& rNewObj):
+SdrVirtObj::SdrVirtObj(
+ SdrModel& rSdrModel,
+ SdrObject& rNewObj)
+: SdrObject(rSdrModel),
rRefObj(rNewObj)
{
bVirtObj=true; // this is only a virtual object
@@ -56,7 +58,6 @@ SdrVirtObj::~SdrVirtObj()
rRefObj.DelReference(*this);
}
-
const SdrObject& SdrVirtObj::GetReferencedObj() const
{
return rRefObj;
@@ -130,7 +131,9 @@ void SdrVirtObj::RecalcBoundRect()
SdrVirtObj* SdrVirtObj::Clone() const
{
- return new SdrVirtObj(rRefObj); // only a further reference
+ return new SdrVirtObj(
+ getSdrModelFromSdrObject(),
+ rRefObj); // only a further reference
}
SdrVirtObj& SdrVirtObj::operator=(const SdrVirtObj& rObj)
@@ -266,24 +269,11 @@ bool SdrVirtObj::supportsFullDrag() const
SdrObject* SdrVirtObj::getFullDragClone() const
{
- static bool bSpecialHandling(false);
- SdrObject* pRetval = nullptr;
-
- if(bSpecialHandling)
- {
- // special handling for VirtObj. Do not create another
- // reference to rRefObj, this would allow to change that
- // one on drag. Instead, create a SdrGrafObj for drag containing
- // the graphical representation
- pRetval = new SdrGrafObj(SdrDragView::GetObjGraphic(GetModel(), this), GetLogicRect());
- }
- else
- {
- SdrObject& rReferencedObject = const_cast<SdrVirtObj*>(this)->ReferencedObj();
- pRetval = new SdrGrafObj(SdrDragView::GetObjGraphic(GetModel(), &rReferencedObject), GetLogicRect());
- }
-
- return pRetval;
+ SdrObject& rReferencedObject = const_cast<SdrVirtObj*>(this)->ReferencedObj();
+ return new SdrGrafObj(
+ getSdrModelFromSdrObject(),
+ SdrDragView::GetObjGraphic(GetModel(), &rReferencedObject),
+ GetLogicRect());
}
bool SdrVirtObj::beginSpecialDrag(SdrDragStat& rDrag) const
diff --git a/svx/source/svdraw/svdpage.cxx b/svx/source/svdraw/svdpage.cxx
index 7ff4129691ff..1d660b24d851 100644
--- a/svx/source/svdraw/svdpage.cxx
+++ b/svx/source/svdraw/svdpage.cxx
@@ -70,13 +70,14 @@ public:
static const sal_Int32 InitialObjectContainerCapacity (64);
-SdrObjList::SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage):
+SdrObjList::SdrObjList(SdrModel& rSdrModel, SdrPage* pNewPage)
+: mrSdrModelFromSdrObjList(rSdrModel),
maList(),
mxNavigationOrder(),
mbIsNavigationOrderDirty(false)
{
maList.reserve(InitialObjectContainerCapacity);
- pModel=pNewModel;
+ pModel=&rSdrModel;
pPage=pNewPage;
pUpList=nullptr;
bObjOrdNumsDirty=false;
@@ -85,7 +86,8 @@ SdrObjList::SdrObjList(SdrModel* pNewModel, SdrPage* pNewPage):
eListKind=SdrObjListKind::Unknown;
}
-SdrObjList::SdrObjList():
+SdrObjList::SdrObjList(SdrModel& rSdrModel)
+: mrSdrModelFromSdrObjList(rSdrModel),
maList(),
mxNavigationOrder(),
mbIsNavigationOrderDirty(false)
@@ -111,6 +113,13 @@ SdrObjList::~SdrObjList()
Clear(); // delete contents of container
}
+SdrObjList* SdrObjList::Clone() const
+{
+ SdrObjList* const pObjList = new SdrObjList(getSdrModelFromSdrObjList());
+ pObjList->lateInit(*this);
+ return pObjList;
+}
+
void SdrObjList::lateInit(const SdrObjList& rSrcList)
{
// this function is only supposed to be called once, right after construction
@@ -1137,7 +1146,7 @@ void SdrPageProperties::SetStyleSheet(SfxStyleSheet* pStyleSheet)
SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
-: SdrObjList(&rNewModel, this),
+: SdrObjList(rNewModel, this),
mpViewContact(nullptr),
mnWidth(10),
mnHeight(10),
@@ -1161,7 +1170,7 @@ SdrPage::SdrPage(SdrModel& rNewModel, bool bMasterPage)
}
SdrPage::SdrPage(const SdrPage& rSrcPage)
-: SdrObjList(rSrcPage.pModel, this),
+: SdrObjList(rSrcPage.getSdrModelFromSdrObjList(), this),
mpViewContact(nullptr),
mnWidth(rSrcPage.mnWidth),
mnHeight(rSrcPage.mnHeight),
diff --git a/svx/source/svdraw/svdpntv.cxx b/svx/source/svdraw/svdpntv.cxx
index 48c971d61792..ba0e252da346 100644
--- a/svx/source/svdraw/svdpntv.cxx
+++ b/svx/source/svdraw/svdpntv.cxx
@@ -181,9 +181,12 @@ void SdrPaintView::ImpClearVars()
maGridColor = COL_BLACK;
}
-SdrPaintView::SdrPaintView(SdrModel* pModel, OutputDevice* pOut)
-: mpPageView(nullptr),
- maDefaultAttr(pModel->GetItemPool()),
+SdrPaintView::SdrPaintView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: mrSdrModelFromSdrView(rSdrModel),
+ mpPageView(nullptr),
+ maDefaultAttr(rSdrModel.GetItemPool()),
mbBufferedOutputAllowed(false),
mbBufferedOverlayAllowed(false),
mbPagePaintingAllowed(true),
@@ -192,7 +195,7 @@ SdrPaintView::SdrPaintView(SdrModel* pModel, OutputDevice* pOut)
mbHideDraw(false),
mbHideFormControl(false)
{
- mpModel=pModel;
+ mpModel=&rSdrModel;
ImpClearVars();
if(pOut)
diff --git a/svx/source/svdraw/svdpoev.cxx b/svx/source/svdraw/svdpoev.cxx
index 509eb112dd96..56e32865e012 100644
--- a/svx/source/svdraw/svdpoev.cxx
+++ b/svx/source/svdraw/svdpoev.cxx
@@ -44,8 +44,10 @@ void SdrPolyEditView::ImpResetPolyPossibilityFlags()
bSetMarkedSegmentsKindPossible=false;
}
-SdrPolyEditView::SdrPolyEditView(SdrModel* pModel1, OutputDevice* pOut):
- SdrEditView(pModel1,pOut)
+SdrPolyEditView::SdrPolyEditView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrEditView(rSdrModel, pOut)
{
ImpResetPolyPossibilityFlags();
}
diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx
index 94f1f5affc00..10aacc3f87fd 100644
--- a/svx/source/svdraw/svdsnpv.cxx
+++ b/svx/source/svdraw/svdsnpv.cxx
@@ -165,30 +165,31 @@ void ImplHelpLineOverlay::SetPosition(const basegfx::B2DPoint& rNewPosition)
}
}
-
-SdrSnapView::SdrSnapView(SdrModel* pModel1, OutputDevice* pOut)
- : SdrPaintView(pModel1,pOut)
- , mpPageOriginOverlay(nullptr)
- , mpHelpLineOverlay(nullptr)
- , nMagnSizPix(4)
- , nSnapAngle(1500)
- , nEliminatePolyPointLimitAngle(0)
- , eCrookMode(SdrCrookMode::Rotate)
- , bSnapEnab(true)
- , bGridSnap(true)
- , bBordSnap(true)
- , bHlplSnap(true)
- , bOFrmSnap(true)
- , bOPntSnap(false)
- , bOConSnap(true)
- , bMoveSnapOnlyTopLeft(false)
- , bOrtho(false)
- , bBigOrtho(true)
- , bAngleSnapEnab(false)
- , bMoveOnlyDragging(false)
- , bSlantButShear(false)
- , bCrookNoContortion(false)
- , bEliminatePolyPoints(false)
+SdrSnapView::SdrSnapView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrPaintView(rSdrModel, pOut)
+ ,mpPageOriginOverlay(nullptr)
+ ,mpHelpLineOverlay(nullptr)
+ ,nMagnSizPix(4)
+ ,nSnapAngle(1500)
+ ,nEliminatePolyPointLimitAngle(0)
+ ,eCrookMode(SdrCrookMode::Rotate)
+ ,bSnapEnab(true)
+ ,bGridSnap(true)
+ ,bBordSnap(true)
+ ,bHlplSnap(true)
+ ,bOFrmSnap(true)
+ ,bOPntSnap(false)
+ ,bOConSnap(true)
+ ,bMoveSnapOnlyTopLeft(false)
+ ,bOrtho(false)
+ ,bBigOrtho(true)
+ ,bAngleSnapEnab(false)
+ ,bMoveOnlyDragging(false)
+ ,bSlantButShear(false)
+ ,bCrookNoContortion(false)
+ ,bEliminatePolyPoints(false)
{
}
diff --git a/svx/source/svdraw/svdview.cxx b/svx/source/svdraw/svdview.cxx
index db460ea89d45..d9eb52432957 100644
--- a/svx/source/svdraw/svdview.cxx
+++ b/svx/source/svdraw/svdview.cxx
@@ -146,15 +146,15 @@ SdrDropMarkerOverlay::~SdrDropMarkerOverlay()
// OverlayManager and deletes them.
}
-
-SdrView::SdrView(SdrModel* pModel1, OutputDevice* pOut)
-: SdrCreateView(pModel1,pOut),
+SdrView::SdrView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrCreateView(rSdrModel, pOut),
bNoExtendedMouseDispatcher(false),
bNoExtendedKeyDispatcher(false),
mbMasterPagePaintCaching(false)
{
maAccessibilityOptions.AddListener(this);
-
onAccessibilityOptionsChanged();
}
diff --git a/svx/source/svdraw/svdxcgv.cxx b/svx/source/svdraw/svdxcgv.cxx
index 1011c8a11e87..569e0554024d 100644
--- a/svx/source/svdraw/svdxcgv.cxx
+++ b/svx/source/svdraw/svdxcgv.cxx
@@ -57,8 +57,10 @@
using namespace com::sun::star;
-SdrExchangeView::SdrExchangeView(SdrModel* pModel1, OutputDevice* pOut):
- SdrObjEditView(pModel1,pOut)
+SdrExchangeView::SdrExchangeView(
+ SdrModel& rSdrModel,
+ OutputDevice* pOut)
+: SdrObjEditView(rSdrModel, pOut)
{
}
@@ -143,7 +145,10 @@ bool SdrExchangeView::Paste(const OUString& rStr, const Point& rPos, SdrObjList*
if (pPage!=nullptr) {
aTextRect.SetSize(pPage->GetSize());
}
- SdrRectObj* pObj=new SdrRectObj(OBJ_TEXT,aTextRect);
+ SdrRectObj* pObj = new SdrRectObj(
+ getSdrModelFromSdrView(),
+ OBJ_TEXT,
+ aTextRect);
pObj->SetModel(mpModel);
pObj->SetLayer(nLayer);
pObj->NbcSetText(rStr); // SetText before SetAttr, else SetAttr doesn't work!
@@ -180,7 +185,10 @@ bool SdrExchangeView::Paste(SvStream& rInput, EETextFormat eFormat, const Point&
if (pPage!=nullptr) {
aTextRect.SetSize(pPage->GetSize());
}
- SdrRectObj* pObj=new SdrRectObj(OBJ_TEXT,aTextRect);
+ SdrRectObj* pObj = new SdrRectObj(
+ getSdrModelFromSdrView(),
+ OBJ_TEXT,
+ aTextRect);
pObj->SetModel(mpModel);
pObj->SetLayer(nLayer);
if (mpDefaultStyleSheet!=nullptr) pObj->NbcSetStyleSheet(mpDefaultStyleSheet, false);
@@ -703,7 +711,6 @@ void SdrExchangeView::DrawMarkedObj(OutputDevice& rOut) const
}
}
-
SdrModel* SdrExchangeView::GetMarkedObjModel() const
{
// Sorting the MarkList here might be problematic in the future, so
@@ -729,7 +736,10 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
{
// convert SdrPageObj's to a graphic representation, because
// virtual connection to referenced page gets lost in new model
- pNewObj = new SdrGrafObj( GetObjGraphic( mpModel, pObj ), pObj->GetLogicRect() );
+ pNewObj = new SdrGrafObj(
+ *pNeuMod,
+ GetObjGraphic(mpModel, pObj),
+ pObj->GetLogicRect());
pNewObj->SetPage( pNeuPag );
pNewObj->SetModel( pNeuMod );
}
@@ -750,8 +760,8 @@ SdrModel* SdrExchangeView::GetMarkedObjModel() const
// New mechanism to re-create the connections of cloned connectors
aCloneList.CopyConnections();
}
+
return pNeuMod;
}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/table/svdotable.cxx b/svx/source/table/svdotable.cxx
index dab61a948e33..d6079b26c023 100644
--- a/svx/source/table/svdotable.cxx
+++ b/svx/source/table/svdotable.cxx
@@ -749,20 +749,20 @@ sdr::contact::ViewContact* SdrTableObj::CreateObjectSpecificViewContact()
return new sdr::contact::ViewContactOfTableObj(*this);
}
-
-SdrTableObj::SdrTableObj(SdrModel* _pModel)
+SdrTableObj::SdrTableObj(SdrModel& rSdrModel)
+: SdrTextObj(rSdrModel)
{
- pModel = _pModel;
init( 1, 1 );
}
-
-SdrTableObj::SdrTableObj(SdrModel* _pModel, const ::tools::Rectangle& rNewRect, sal_Int32 nColumns, sal_Int32 nRows)
-: SdrTextObj( rNewRect )
-, maLogicRect( rNewRect )
+SdrTableObj::SdrTableObj(
+ SdrModel& rSdrModel,
+ const ::tools::Rectangle& rNewRect,
+ sal_Int32 nColumns,
+ sal_Int32 nRows)
+: SdrTextObj(rSdrModel, rNewRect)
+ ,maLogicRect(rNewRect)
{
- pModel = _pModel;
-
if( nColumns <= 0 )
nColumns = 1;
@@ -2346,7 +2346,11 @@ SdrTableObj* SdrTableObj::CloneRange( const CellPos& rStart, const CellPos& rEnd
const sal_Int32 nColumns = rEnd.mnCol - rStart.mnCol + 1;
const sal_Int32 nRows = rEnd.mnRow - rStart.mnRow + 1;
- SdrTableObj* pNewTableObj = new SdrTableObj( GetModel(), GetCurrentBoundRect(), nColumns, nRows);
+ SdrTableObj* pNewTableObj = new SdrTableObj(
+ getSdrModelFromSdrObject(),
+ GetCurrentBoundRect(),
+ nColumns,
+ nRows);
pNewTableObj->setTableStyleSettings( getTableStyleSettings() );
pNewTableObj->setTableStyle( getTableStyle() );
diff --git a/svx/source/unodraw/UnoGraphicExporter.cxx b/svx/source/unodraw/UnoGraphicExporter.cxx
index 9fb0d021930a..40a4307c0425 100644
--- a/svx/source/unodraw/UnoGraphicExporter.cxx
+++ b/svx/source/unodraw/UnoGraphicExporter.cxx
@@ -421,13 +421,15 @@ VclPtr<VirtualDevice> GraphicExporter::CreatePageVDev( SdrPage* pPage, sal_uIntP
if(bSuccess)
{
- std::unique_ptr<SdrView> pView(new SdrView(mpDoc, pVDev));
+ std::unique_ptr<SdrView> pView(new SdrView(*mpDoc, pVDev));
+
pView->SetPageVisible( false );
pView->SetBordVisible( false );
pView->SetGridVisible( false );
pView->SetHlplVisible( false );
pView->SetGlueVisible( false );
pView->ShowSdrPage(pPage);
+
vcl::Region aRegion (tools::Rectangle( aPoint, aPageSize ) );
ImplExportCheckVisisbilityRedirector aRedirector( mpCurrentPage );
@@ -631,7 +633,9 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
if(pCorrectProperties)
{
- pTempBackgroundShape = new SdrRectObj(tools::Rectangle(Point(0,0), pPage->GetSize()));
+ pTempBackgroundShape = new SdrRectObj(
+ *mpDoc,
+ tools::Rectangle(Point(0,0), pPage->GetSize()));
pTempBackgroundShape->SetMergedItemSet(pCorrectProperties->GetItemSet());
pTempBackgroundShape->SetMergedItem(XLineStyleItem(drawing::LineStyle_NONE));
pTempBackgroundShape->NbcSetStyleSheet(pCorrectProperties->GetStyleSheet(), true);
@@ -683,13 +687,14 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
}
std::unique_ptr<SdrView> xLocalView;
+
if (FmFormModel* pFormModel = dynamic_cast<FmFormModel*>(mpDoc))
{
- xLocalView.reset(new FmFormView(pFormModel, aVDev) );
+ xLocalView.reset(new FmFormView(*pFormModel, aVDev));
}
else
{
- xLocalView.reset(new SdrView(mpDoc, aVDev));
+ xLocalView.reset(new SdrView(*mpDoc, aVDev));
}
ScopedVclPtr<VirtualDevice> pVDev(CreatePageVDev( pPage, nWidthPix, nHeightPix ));
@@ -715,13 +720,14 @@ bool GraphicExporter::GetGraphic( ExportSettings const & rSettings, Graphic& aGr
// create a view
std::unique_ptr< SdrView > pView;
+
if (FmFormModel *pFormModel = dynamic_cast<FmFormModel*>(mpDoc))
{
- pView.reset(new FmFormView(pFormModel, aVDev));
+ pView.reset(new FmFormView(*pFormModel, aVDev));
}
else
{
- pView.reset(new SdrView( mpDoc, aVDev ));
+ pView.reset(new SdrView(*mpDoc, aVDev));
}
pView->SetBordVisible( false );
diff --git a/svx/source/unodraw/unomod.cxx b/svx/source/unodraw/unomod.cxx
index 4f0ea1fcddab..dd1d1317f7a6 100644
--- a/svx/source/unodraw/unomod.cxx
+++ b/svx/source/unodraw/unomod.cxx
@@ -246,8 +246,26 @@ uno::Sequence< OUString > SvxUnoDrawMSFactory::concatServiceNames( uno::Sequence
return aSeq;
}
-SvxUnoDrawingModel::SvxUnoDrawingModel( SdrModel* pDoc ) throw()
-: SfxBaseModel(nullptr), mpDoc( pDoc )
+SdrModel* SvxUnoDrawingModel::getSdrModelFromUnoModel() const
+{
+ return mpDoc;
+}
+
+SvxUnoDrawingModel::SvxUnoDrawingModel(SdrModel* pDoc) throw()
+: SfxBaseModel(nullptr),
+ SvxFmMSFactory(),
+ css::drawing::XDrawPagesSupplier(),
+ css::lang::XServiceInfo(),
+ css::ucb::XAnyCompareFactory(),
+ mpDoc(pDoc),
+ mxDrawPagesAccess(),
+ mxDashTable(),
+ mxGradientTable(),
+ mxHatchTable(),
+ mxBitmapTable(),
+ mxTransGradientTable(),
+ mxMarkerTable(),
+ maTypeSequence()
{
}
diff --git a/svx/source/unodraw/unopage.cxx b/svx/source/unodraw/unopage.cxx
index d7f14d3676c5..b8e266835239 100644
--- a/svx/source/unodraw/unopage.cxx
+++ b/svx/source/unodraw/unopage.cxx
@@ -61,12 +61,11 @@ using namespace ::com::sun::star::drawing;
UNO3_GETIMPLEMENTATION_IMPL( SvxDrawPage );
-SvxDrawPage::SvxDrawPage(SdrPage* pInPage)
- : mrBHelper(getMutex())
- , mpPage(pInPage)
- , mpModel(mpPage->GetModel()) // register at broadcaster
- , mpView(new SdrView(mpModel)) // create (hidden) view
-
+SvxDrawPage::SvxDrawPage(SdrPage* pInPage) // TTTT shbe ref
+: mrBHelper(getMutex())
+ ,mpPage(pInPage)
+ ,mpModel(&pInPage->getSdrModelFromSdrObjList()) // register at broadcaster
+ ,mpView(new SdrView(pInPage->getSdrModelFromSdrObjList())) // create (hidden) view
{
mpView->SetDesignMode();
}
@@ -465,7 +464,7 @@ void SAL_CALL SvxDrawPage::ungroup( const Reference< drawing::XShapeGroup >& aGr
mpModel->SetChanged();
}
-SdrObject *SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xShape)
+SdrObject* SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xShape)
{
sal_uInt16 nType = 0;
SdrInventor nInventor;
@@ -480,7 +479,13 @@ SdrObject *SvxDrawPage::CreateSdrObject_(const Reference< drawing::XShape > & xS
awt::Point aPos = xShape->getPosition();
tools::Rectangle aRect( Point( aPos.X, aPos.Y ), Size( aSize.Width, aSize.Height ) );
- SdrObject* pNewObj = SdrObjFactory::MakeNewObject(nInventor, nType, aRect, mpPage);
+ SdrObject* pNewObj = SdrObjFactory::MakeNewObject(
+ *mpModel,
+ nInventor,
+ nType,
+ aRect,
+ mpPage);
+
if (!pNewObj)
return nullptr;
@@ -856,7 +861,7 @@ void SvxDrawPage::ChangeModel( SdrModel* pNewModel )
if( mpView )
{
delete mpView;
- mpView = new SdrView( mpModel );
+ mpView = new SdrView(*mpModel);
mpView->SetDesignMode();
}
}
diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx
index 572b31c44313..790fee07c352 100644
--- a/svx/source/unodraw/unoshape.cxx
+++ b/svx/source/unodraw/unoshape.cxx
@@ -677,7 +677,10 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const
SdrModel* pModel = mpObj->GetModel();
SdrPage* pPage = mpObj->GetPage();
- std::unique_ptr<E3dView> pView(new E3dView( pModel, pVDev.get() ));
+ std::unique_ptr<E3dView> pView(
+ new E3dView(
+ mpObj->getSdrModelFromSdrObject(),
+ pVDev.get()));
pView->hideMarkHandles();
SdrPageView* pPageView = pView->ShowSdrPage(pPage);
diff --git a/sw/inc/dcontact.hxx b/sw/inc/dcontact.hxx
index 87c18ff8dfa0..af9f298f2bd2 100644
--- a/sw/inc/dcontact.hxx
+++ b/sw/inc/dcontact.hxx
@@ -196,7 +196,7 @@ private:
public:
/// Creates DrawObject and registers it with the Model.
- SwFlyDrawContact( SwFlyFrameFormat* pToRegisterIn );
+ SwFlyDrawContact(SwFlyFrameFormat* pToRegisterIn, SdrModel& rTargetModel);
static SwVirtFlyDrawObj* CreateNewRef(SwFlyFrame* pFly, SwFlyFrameFormat* pFormat);
virtual ~SwFlyDrawContact() override;
@@ -240,9 +240,11 @@ class SwDrawVirtObj : public SdrVirtObj
virtual sdr::contact::ViewContact* CreateObjectSpecificViewContact() override;
public:
+ SwDrawVirtObj(
+ SdrModel& rSdrModel,
+ SdrObject& _rNewObj,
+ SwDrawContact& _rDrawContact);
- SwDrawVirtObj( SdrObject& _rNewObj,
- SwDrawContact& _rDrawContact );
virtual ~SwDrawVirtObj() override;
/// access to offset
diff --git a/sw/inc/frmfmt.hxx b/sw/inc/frmfmt.hxx
index e90b808df8dd..01cf869b8e10 100644
--- a/sw/inc/frmfmt.hxx
+++ b/sw/inc/frmfmt.hxx
@@ -38,6 +38,8 @@ class SwContact;
class SdrObject;
class SwRootFrame;
class SwFlyDrawContact;
+class SdrModel;
+
namespace sw
{
class DocumentLayoutManager;
diff --git a/sw/inc/unotxdoc.hxx b/sw/inc/unotxdoc.hxx
index eebd5d27474f..51dee53c47da 100644
--- a/sw/inc/unotxdoc.hxx
+++ b/sw/inc/unotxdoc.hxx
@@ -200,6 +200,9 @@ private:
using SfxBaseModel::removeEventListener;
protected:
+ /** abstract SdrModel provider */
+ virtual SdrModel* getSdrModelFromUnoModel() const;
+
virtual ~SwXTextDocument() override;
public:
SwXTextDocument(SwDocShell* pShell);
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 2cc3235b8846..5709971c57a7 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -460,9 +460,11 @@ void SwContact::SwClientNotify(const SwModify& rMod, const SfxHint& rHint)
}
-SwFlyDrawContact::SwFlyDrawContact( SwFlyFrameFormat *pToRegisterIn )
- : SwContact( pToRegisterIn )
- , mpMasterObj(new SwFlyDrawObj)
+SwFlyDrawContact::SwFlyDrawContact(
+ SwFlyFrameFormat *pToRegisterIn,
+ SdrModel& rTargetModel)
+: SwContact(pToRegisterIn),
+ mpMasterObj(new SwFlyDrawObj(rTargetModel))
{
// #i26791# - class <SwFlyDrawContact> contains the 'master'
// drawing object of type <SwFlyDrawObj> on its own.
@@ -510,7 +512,11 @@ SwVirtFlyDrawObj* SwFlyDrawContact::CreateNewRef(SwFlyFrame* pFly, SwFlyFrameFor
IDocumentDrawModelAccess& rIDDMA = pFormat->getIDocumentDrawModelAccess();
SwFlyDrawContact* pContact = pFormat->GetOrCreateContact();
- SwVirtFlyDrawObj* pDrawObj(new SwVirtFlyDrawObj(*pContact->GetMaster(), pFly));
+ SwVirtFlyDrawObj* pDrawObj(
+ new SwVirtFlyDrawObj(
+ pContact->GetMaster()->getSdrModelFromSdrObject(),
+ *pContact->GetMaster(),
+ pFly));
pDrawObj->SetModel(pContact->GetMaster()->GetModel());
pDrawObj->SetUserCall(pContact);
@@ -807,7 +813,12 @@ SwFrame* SwDrawContact::GetAnchorFrame(SdrObject const *const pDrawObj)
*/
SwDrawVirtObj* SwDrawContact::AddVirtObj()
{
- maDrawVirtObjs.push_back(std::unique_ptr<SwDrawVirtObj>(new SwDrawVirtObj(*GetMaster(), *this)));
+ maDrawVirtObjs.push_back(
+ std::unique_ptr<SwDrawVirtObj>(
+ new SwDrawVirtObj(
+ GetMaster()->getSdrModelFromSdrObject(),
+ *GetMaster(),
+ *this)));
maDrawVirtObjs.back()->AddToDrawingPage();
return maDrawVirtObjs.back().get();
}
@@ -2138,27 +2149,29 @@ namespace sdr
} // end of namespace sdr
/// implementation of class <SwDrawVirtObj>
-
sdr::contact::ViewContact* SwDrawVirtObj::CreateObjectSpecificViewContact()
{
return new sdr::contact::VCOfDrawVirtObj(*this);
}
-SwDrawVirtObj::SwDrawVirtObj( SdrObject& _rNewObj,
- SwDrawContact& _rDrawContact )
- : SdrVirtObj( _rNewObj ),
- // #i26791# - init new member <maAnchoredDrawObj>
- maAnchoredDrawObj(),
- mrDrawContact( _rDrawContact )
+SwDrawVirtObj::SwDrawVirtObj(
+ SdrModel& rSdrModel,
+ SdrObject& _rNewObj,
+ SwDrawContact& _rDrawContact)
+: SdrVirtObj(rSdrModel, _rNewObj ),
+ maAnchoredDrawObj(),
+ mrDrawContact(_rDrawContact)
{
// #i26791#
maAnchoredDrawObj.SetDrawObj( *this );
+
// #i35635# - set initial position out of sight
NbcMove( Size( -16000, -16000 ) );
}
SwDrawVirtObj::~SwDrawVirtObj()
-{}
+{
+}
SwDrawVirtObj& SwDrawVirtObj::operator=( const SwDrawVirtObj& rObj )
{
@@ -2170,7 +2183,10 @@ SwDrawVirtObj& SwDrawVirtObj::operator=( const SwDrawVirtObj& rObj )
SwDrawVirtObj* SwDrawVirtObj::Clone() const
{
- SwDrawVirtObj* pObj = new SwDrawVirtObj( rRefObj, mrDrawContact );
+ SwDrawVirtObj* pObj = new SwDrawVirtObj(
+ getSdrModelFromSdrObject(),
+ rRefObj,
+ mrDrawContact);
pObj->operator=( *this );
// Note: Member <maAnchoredDrawObj> hasn't to be considered.
diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 93a58d2a4fb1..cd74e92fa23c 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -121,7 +121,8 @@ sdr::contact::ViewContact* SwFlyDrawObj::CreateObjectSpecificViewContact()
return new sdr::contact::VCOfSwFlyDrawObj(*this);
}
-SwFlyDrawObj::SwFlyDrawObj()
+SwFlyDrawObj::SwFlyDrawObj(SdrModel& rSdrModel)
+: SdrObject(rSdrModel)
{
}
@@ -130,7 +131,6 @@ SwFlyDrawObj::~SwFlyDrawObj()
}
// SwFlyDrawObj - Factory-Methods
-
SdrInventor SwFlyDrawObj::GetObjInventor() const
{
return SdrInventor::Swg;
@@ -142,7 +142,6 @@ sal_uInt16 SwFlyDrawObj::GetObjIdentifier() const
}
// TODO: Need own primitive to get the FlyFrame paint working
-
namespace drawinglayer
{
namespace primitive2d
@@ -421,9 +420,12 @@ sdr::contact::ViewContact* SwVirtFlyDrawObj::CreateObjectSpecificViewContact()
return new sdr::contact::VCOfSwVirtFlyDrawObj(*this);
}
-SwVirtFlyDrawObj::SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrame* pFly) :
- SdrVirtObj( rNew ),
- m_pFlyFrame( pFly )
+SwVirtFlyDrawObj::SwVirtFlyDrawObj(
+ SdrModel& rSdrModel,
+ SdrObject& rNew,
+ SwFlyFrame* pFly)
+: SdrVirtObj(rSdrModel, rNew),
+ m_pFlyFrame(pFly)
{
const SvxProtectItem &rP = m_pFlyFrame->GetFormat()->GetProtect();
bMovProt = rP.IsPosProtected();
diff --git a/sw/source/core/draw/dobjfac.cxx b/sw/source/core/draw/dobjfac.cxx
index e3587646202d..e11e375aa30b 100644
--- a/sw/source/core/draw/dobjfac.cxx
+++ b/sw/source/core/draw/dobjfac.cxx
@@ -31,7 +31,7 @@ IMPL_STATIC_LINK(
// No switch, there's only one at the moment
OSL_ENSURE( aParams.nObjIdentifier == SwFlyDrawObjIdentifier,
"Wrong inventor or identifier" );
- return new SwFlyDrawObj;
+ return new SwFlyDrawObj(aParams.rSdrModel);
}
return nullptr;
}
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index 716e41c433a6..081a96cfc28a 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -49,15 +49,15 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::drawing;
using namespace ::com::sun::star::frame;
-SwDPage::SwDPage(SwDrawModel& rNewModel, bool bMasterPage) :
- FmFormPage(rNewModel, bMasterPage),
+SwDPage::SwDPage(SwDrawModel& rNewModel, bool bMasterPage)
+: FmFormPage(rNewModel, bMasterPage),
pGridLst( nullptr ),
pDoc(&rNewModel.GetDoc())
{
}
-SwDPage::SwDPage(const SwDPage& rSrcPage) :
- FmFormPage( rSrcPage ),
+SwDPage::SwDPage(const SwDPage& rSrcPage)
+: FmFormPage(rSrcPage),
pDoc( nullptr )
{
if ( rSrcPage.pGridLst )
diff --git a/sw/source/core/draw/dview.cxx b/sw/source/core/draw/dview.cxx
index ef557e8ecd9e..255163443a96 100644
--- a/sw/source/core/draw/dview.cxx
+++ b/sw/source/core/draw/dview.cxx
@@ -94,8 +94,11 @@ static const SwFrame *lcl_FindAnchor( const SdrObject *pObj, bool bAll )
return nullptr;
}
-SwDrawView::SwDrawView( SwViewShellImp &rI, SdrModel *pMd, OutputDevice *pOutDev) :
- FmFormView( static_cast<FmFormModel*>(pMd), pOutDev ),
+SwDrawView::SwDrawView(
+ SwViewShellImp& rI,
+ FmFormModel& rFmFormModel,
+ OutputDevice* pOutDev)
+: FmFormView(rFmFormModel, pOutDev),
m_rImp( rI )
{
SetPageVisible( false );
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index fd44d6ea09e7..ece29f920435 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -1287,7 +1287,10 @@ static void lcl_ConvertSdrOle2ObjsToSdrGrafObjs( SdrModel* _pModel )
pOle2Obj->Disconnect();
// create new graphic shape with the ole graphic and shape size
- SdrGrafObj* pGraphicObj = new SdrGrafObj( aGraphic, pOle2Obj->GetCurrentBoundRect() );
+ SdrGrafObj* pGraphicObj = new SdrGrafObj(
+ *_pModel, // TTTT why ptr?
+ aGraphic,
+ pOle2Obj->GetCurrentBoundRect());
// apply layer of ole2 shape at graphic shape
pGraphicObj->SetLayer( pOle2Obj->GetLayer() );
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index a47aa962f9bd..d2771def0e7f 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -2919,8 +2919,11 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
SdrView* pDrawView = GetDrawView();
SdrModel* pDrawModel = pDrawView->GetModel();
SdrObject* pObj = SdrObjFactory::MakeNewObject(
- SdrInventor::Default, eSdrObjectKind,
- nullptr, pDrawModel);
+ *pDrawModel,
+ SdrInventor::Default,
+ eSdrObjectKind,
+ nullptr,
+ pDrawModel);
if(pObj)
{
diff --git a/sw/source/core/inc/dflyobj.hxx b/sw/source/core/inc/dflyobj.hxx
index a0cf7fd28d3a..6e157b1ed3db 100644
--- a/sw/source/core/inc/dflyobj.hxx
+++ b/sw/source/core/inc/dflyobj.hxx
@@ -42,7 +42,7 @@ protected:
public:
- SwFlyDrawObj();
+ SwFlyDrawObj(SdrModel& rSdrModel);
virtual ~SwFlyDrawObj() override;
// for instantiation of this class while loading (via factory)
@@ -80,7 +80,10 @@ public:
// RotGrfFlyFrame: Check if this is a SwGrfNode
bool ContainsSwGrfNode() const;
- SwVirtFlyDrawObj(SdrObject& rNew, SwFlyFrame* pFly);
+ SwVirtFlyDrawObj(
+ SdrModel& rSdrModel,
+ SdrObject& rNew,
+ SwFlyFrame* pFly);
virtual ~SwVirtFlyDrawObj() override;
// override method of base class SdrVirtObj
diff --git a/sw/source/core/inc/dview.hxx b/sw/source/core/inc/dview.hxx
index aeb1e864fc4f..66b51fd4ade8 100644
--- a/sw/source/core/inc/dview.hxx
+++ b/sw/source/core/inc/dview.hxx
@@ -79,7 +79,10 @@ protected:
virtual SdrUndoManager* getSdrUndoManagerForEnhancedTextEdit() const override;
public:
- SwDrawView( SwViewShellImp &rI, SdrModel *pMd, OutputDevice* pOutDev );
+ SwDrawView(
+ SwViewShellImp &rI,
+ FmFormModel& rFmFormModel,
+ OutputDevice* pOutDev);
// from base class
virtual SdrObject* GetMaxToTopObj(SdrObject* pObj) const override;
diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx
index 91d8e155869e..d7b84212e52a 100644
--- a/sw/source/core/layout/atrfrm.cxx
+++ b/sw/source/core/layout/atrfrm.cxx
@@ -2886,7 +2886,11 @@ SwFlyFrameFormat::~SwFlyFrameFormat()
SwFlyDrawContact* SwFlyFrameFormat::GetOrCreateContact()
{
if(!m_pContact)
- m_pContact.reset(new SwFlyDrawContact(this));
+ {
+ SwDrawModel* pDrawModel(GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel());
+ m_pContact.reset(new SwFlyDrawContact(this, *pDrawModel));
+ }
+
return m_pContact.get();
}
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index ffc09406425a..592a8a7a9cb2 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -7384,7 +7384,7 @@ Graphic SwDrawFrameFormat::MakeGraphic( ImageMap* )
if ( pMod )
{
SdrObject *pObj = FindSdrObject();
- std::unique_ptr<SdrView> pView( new SdrView( pMod ) );
+ std::unique_ptr<SdrView> pView( new SdrView( *pMod ) );
SdrPageView *pPgView = pView->ShowSdrPage(pView->GetModel()->GetPage(0));
pView->MarkObj( pObj, pPgView );
aRet = pView->GetMarkedObjBitmapEx();
diff --git a/sw/source/core/view/viewimp.cxx b/sw/source/core/view/viewimp.cxx
index ee204d12fb9b..2146529c8ccd 100644
--- a/sw/source/core/view/viewimp.cxx
+++ b/sw/source/core/view/viewimp.cxx
@@ -228,7 +228,10 @@ void SwViewShellImp::MakeDrawView()
pOutDevForDrawView = GetShell()->GetOut();
}
- m_pDrawView = new SwDrawView( *this, rIDDMA.GetDrawModel(), pOutDevForDrawView);
+ m_pDrawView = new SwDrawView(
+ *this,
+ *rIDDMA.GetOrCreateDrawModel(),
+ pOutDevForDrawView);
}
GetDrawView()->SetActiveLayer("Heaven");
diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx
index 7d746579f361..8508cbe1c668 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -355,8 +355,13 @@ void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
// #i52858# - method name changed
SwDrawModel* pModel = m_xDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel();
SdrPage* pPg = pModel->GetPage( 0 );
- m_pMarquee = SdrObjFactory::MakeNewObject( SdrInventor::Default,
- OBJ_TEXT, pPg, pModel );
+ m_pMarquee = SdrObjFactory::MakeNewObject(
+ *pModel,
+ SdrInventor::Default,
+ OBJ_TEXT,
+ pPg,
+ pModel);
+
if( !m_pMarquee )
return;
diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx
index 7406f153a67f..4d15b6b02742 100644
--- a/sw/source/filter/ww8/wrtw8esh.cxx
+++ b/sw/source/filter/ww8/wrtw8esh.cxx
@@ -2966,7 +2966,7 @@ void SwEscherEx::WriteOCXControl( const SwFrameFormat& rFormat, sal_uInt32 nShap
// #i71538# use complete SdrViews
// SdrExchangeView aExchange(pModel, pDevice);
- SdrView aExchange(pModel, pDevice);
+ SdrView aExchange(*pModel, pDevice);
Graphic aGraphic(SdrExchangeView::GetObjGraphic(pModel, pSdrObj));
diff --git a/sw/source/filter/ww8/wrtww8gr.cxx b/sw/source/filter/ww8/wrtww8gr.cxx
index 4d9ceaa9c00f..6d75e36da0a2 100644
--- a/sw/source/filter/ww8/wrtww8gr.cxx
+++ b/sw/source/filter/ww8/wrtww8gr.cxx
@@ -139,7 +139,18 @@ bool WW8Export::TestOleNeedsGraphic(const SwAttrSet& rSet,
if ( pOLENd )
nAspect = pOLENd->GetAspect();
SdrOle2Obj *pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
- rStorageName,xObjStg,m_pDoc->GetDocStorage(),aGraph,aRect,tools::Rectangle(),nullptr,nErr,0,nAspect, m_pWriter->GetBaseURL());
+ *m_pDoc->getIDocumentDrawModelAccess().GetOrCreateDrawModel(),
+ rStorageName,
+ xObjStg,
+ m_pDoc->GetDocStorage(),
+ aGraph,
+ aRect,
+ tools::Rectangle(),
+ nullptr,
+ nErr,
+ 0,
+ nAspect,
+ m_pWriter->GetBaseURL());
if (pRet)
{
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index ed673656a093..4eb0af6602b7 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -326,7 +326,10 @@ SdrObject* SwWW8ImplReader::ReadLine(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet
::basegfx::B2DPolygon aPolygon;
aPolygon.append(::basegfx::B2DPoint(aP[0].X(), aP[0].Y()));
aPolygon.append(::basegfx::B2DPoint(aP[1].X(), aP[1].Y()));
- SdrObject* pObj = new SdrPathObj(OBJ_LINE, ::basegfx::B2DPolyPolygon(aPolygon));
+ SdrObject* pObj = new SdrPathObj(
+ *m_pDrawModel,
+ OBJ_LINE,
+ ::basegfx::B2DPolyPolygon(aPolygon));
SetStdAttr( rSet, aLine.aLnt, aLine.aShd );
SetLineEndAttr( rSet, aLine.aEpp, aLine.aLnt );
@@ -347,7 +350,9 @@ SdrObject* SwWW8ImplReader::ReadRect(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet
aP1.AdjustX(static_cast<sal_Int16>(SVBT16ToShort( pHd->dxa )) );
aP1.AdjustY(static_cast<sal_Int16>(SVBT16ToShort( pHd->dya )) );
- SdrObject* pObj = new SdrRectObj( tools::Rectangle( aP0, aP1 ) );
+ SdrObject* pObj = new SdrRectObj(
+ *m_pDrawModel,
+ tools::Rectangle(aP0, aP1));
SetStdAttr( rSet, aRect.aLnt, aRect.aShd );
SetFill( rSet, aRect.aFill );
@@ -368,7 +373,10 @@ SdrObject* SwWW8ImplReader::ReadElipse(WW8_DPHEAD const * pHd, SfxAllItemSet &rS
aP1.AdjustX(static_cast<sal_Int16>(SVBT16ToShort( pHd->dxa )) );
aP1.AdjustY(static_cast<sal_Int16>(SVBT16ToShort( pHd->dya )) );
- SdrObject* pObj = new SdrCircObj( OBJ_CIRC, tools::Rectangle( aP0, aP1 ) );
+ SdrObject* pObj = new SdrCircObj(
+ *m_pDrawModel,
+ OBJ_CIRC,
+ tools::Rectangle(aP0, aP1));
SetStdAttr( rSet, aElipse.aLnt, aElipse.aShd );
SetFill( rSet, aElipse.aFill );
@@ -400,8 +408,12 @@ SdrObject* SwWW8ImplReader::ReadArc(WW8_DPHEAD const * pHd, SfxAllItemSet &rSet)
aP1.AdjustX( -static_cast<sal_Int16>(SVBT16ToShort( pHd->dxa )) );
}
- SdrObject* pObj = new SdrCircObj( OBJ_SECT, tools::Rectangle( aP0, aP1 ),
- nW * 9000, ( ( nW + 1 ) & 3 ) * 9000 );
+ SdrObject* pObj = new SdrCircObj(
+ *m_pDrawModel,
+ OBJ_SECT,
+ tools::Rectangle(aP0, aP1),
+ nW * 9000,
+ ( ( nW + 1 ) & 3 ) * 9000);
SetStdAttr( rSet, aArc.aLnt, aArc.aShd );
SetFill( rSet, aArc.aFill );
@@ -436,7 +448,11 @@ SdrObject* SwWW8ImplReader::ReadPolyLine(WW8_DPHEAD const * pHd, SfxAllItemSet &
}
xP.reset();
- SdrObject* pObj = new SdrPathObj(( SVBT16ToShort( aPoly.aBits1 ) & 0x1 ) ? OBJ_POLY : OBJ_PLIN, ::basegfx::B2DPolyPolygon(aP.getB2DPolygon()));
+ SdrObject* pObj = new SdrPathObj(
+ *m_pDrawModel,
+ (SVBT16ToShort(aPoly.aBits1) & 0x1) ? OBJ_POLY : OBJ_PLIN,
+ ::basegfx::B2DPolyPolygon(aP.getB2DPolygon()));
+
SetStdAttr( rSet, aPoly.aLnt, aPoly.aShd );
SetFill( rSet, aPoly.aFill );
@@ -1096,7 +1112,7 @@ void SwWW8ImplReader::InsertTxbxText(SdrTextObj* pTextObj,
if( !pNew )
{
- pNew = new SdrGrafObj;
+ pNew = new SdrGrafObj(*m_pDrawModel);
static_cast<SdrGrafObj*>(pNew)->SetGraphic(aGraph);
}
@@ -1225,7 +1241,11 @@ SdrObject* SwWW8ImplReader::ReadTextBox(WW8_DPHEAD const * pHd, SfxAllItemSet &r
aP1.AdjustX(static_cast<sal_Int16>(SVBT16ToShort( pHd->dxa )) );
aP1.AdjustY(static_cast<sal_Int16>(SVBT16ToShort( pHd->dya )) );
- SdrRectObj* pObj = new SdrRectObj( OBJ_TEXT, tools::Rectangle( aP0, aP1 ) );
+ SdrRectObj* pObj = new SdrRectObj(
+ *m_pDrawModel,
+ OBJ_TEXT,
+ tools::Rectangle(aP0, aP1));
+
pObj->SetModel( m_pDrawModel );
pObj->NbcSetSnapRect(tools::Rectangle(aP0, aP1));
Size aSize( static_cast<sal_Int16>(SVBT16ToShort( pHd->dxa )) ,
@@ -1295,7 +1315,11 @@ SdrObject* SwWW8ImplReader::ReadCaptionBox(WW8_DPHEAD const * pHd, SfxAllItemSet
+ m_nDrawYOfs2 + static_cast<sal_Int16>(SVBT16ToShort( xP[1] )) );
xP.reset();
- SdrCaptionObj* pObj = new SdrCaptionObj( tools::Rectangle( aP0, aP1 ), aP2 );
+ SdrCaptionObj* pObj = new SdrCaptionObj(
+ *m_pDrawModel,
+ tools::Rectangle(aP0, aP1),
+ aP2);
+
pObj->SetModel( m_pDrawModel );
pObj->NbcSetSnapRect(tools::Rectangle(aP0, aP1));
Size aSize( static_cast<sal_Int16>(SVBT16ToShort( aCallB.dpheadTxbx.dxa )),
@@ -1328,7 +1352,7 @@ SdrObject *SwWW8ImplReader::ReadGroup(WW8_DPHEAD const * pHd, SfxAllItemSet &rSe
m_nDrawXOfs = m_nDrawXOfs + static_cast<sal_Int16>(SVBT16ToShort( pHd->xa ));
m_nDrawYOfs = m_nDrawYOfs + static_cast<sal_Int16>(SVBT16ToShort( pHd->ya ));
- SdrObject* pObj = new SdrObjGroup;
+ SdrObject* pObj = new SdrObjGroup(*m_pDrawModel);
short nLeft = static_cast<sal_Int16>(SVBT16ToShort( pHd->cb )) - sizeof( WW8_DPHEAD );
for (int i = 0; i < nGrouped && nLeft >= static_cast<short>(sizeof(WW8_DPHEAD)); ++i)
@@ -2794,7 +2818,10 @@ SwFrameFormat* SwWW8ImplReader::MungeTextIntoDrawBox(SdrObject* pTrueObject,
{
// Group objects don't have text. Insert a text object into
// the group for holding the text.
- pSdrTextObj = new SdrRectObj( OBJ_TEXT, pThisGroup->GetCurrentBoundRect());
+ pSdrTextObj = new SdrRectObj(
+ *m_pDrawModel,
+ OBJ_TEXT,
+ pThisGroup->GetCurrentBoundRect());
SfxItemSet aSet(m_pDrawModel->GetItemPool());
aSet.Put(XFillStyleItem(drawing::FillStyle_NONE));
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 33ff69accc43..50e4eeae4d8a 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -497,9 +497,19 @@ SdrObject* SwMSDffManager::ImportOLE( sal_uInt32 nOLEId,
else
{
ErrCode nError = ERRCODE_NONE;
- pRet = CreateSdrOLEFromStorage( sStorageName, xSrcStg, xDstStg,
- rGrf, rBoundRect, rVisArea, pStData, nError,
- nSvxMSDffOLEConvFlags, css::embed::Aspects::MSOLE_CONTENT, rReader.GetBaseURL());
+ pRet = CreateSdrOLEFromStorage(
+ *pSdrModel,
+ sStorageName,
+ xSrcStg,
+ xDstStg,
+ rGrf,
+ rBoundRect,
+ rVisArea,
+ pStData,
+ nError,
+ nSvxMSDffOLEConvFlags,
+ css::embed::Aspects::MSOLE_CONTENT,
+ rReader.GetBaseURL());
}
}
return pRet;
@@ -733,7 +743,10 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
if (bIsSimpleDrawingTextBox)
{
SdrObject::Free( pObj );
- pObj = new SdrRectObj(OBJ_TEXT, rTextRect);
+ pObj = new SdrRectObj(
+ *pSdrModel,
+ OBJ_TEXT,
+ rTextRect);
}
// The vertical paragraph justification are contained within the
@@ -923,7 +936,9 @@ SdrObject* SwMSDffManager::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);
pObj->SetModel( pSdrModel );
SfxItemSet aSet( pSdrModel->GetItemPool() );
ApplyAttributes( rSt, aSet, rObjData );
diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx
index fd82c91222b7..d2a63a93234f 100644
--- a/sw/source/filter/ww8/ww8par4.cxx
+++ b/sw/source/filter/ww8/ww8par4.cxx
@@ -436,9 +436,21 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph,
}
ErrCode nError = ERRCODE_NONE;
+ GrafikCtor();
+
pRet = SvxMSDffManager::CreateSdrOLEFromStorage(
- aSrcStgName, xSrc0, m_pDocShell->GetStorage(), rGraph, aRect, aVisArea, pTmpData, nError,
- SwMSDffManager::GetFilterFlags(), nAspect, GetBaseURL());
+ *m_pDrawModel,
+ aSrcStgName,
+ xSrc0,
+ m_pDocShell->GetStorage(),
+ rGraph,
+ aRect,
+ aVisArea,
+ pTmpData,
+ nError,
+ SwMSDffManager::GetFilterFlags(),
+ nAspect,
+ GetBaseURL());
m_pDataStream->Seek( nOldPos );
}
}
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index d64f3c2ccd18..e0244ca88a32 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -458,7 +458,11 @@ static void lcl_ConvertSdrOle2ObjsToSdrGrafObjs(SwDoc& _rDoc)
pOle2Obj->Disconnect();
// create new graphic shape with the ole graphic and shape size
- SdrGrafObj* pGraphicObj = new SdrGrafObj( aGraphic, pOle2Obj->GetCurrentBoundRect() );
+ SdrGrafObj* pGraphicObj = new SdrGrafObj(
+ pOle2Obj->getSdrModelFromSdrObject(),
+ aGraphic,
+ pOle2Obj->GetCurrentBoundRect());
+
// apply layer of ole2 shape at graphic shape
pGraphicObj->SetLayer( pOle2Obj->GetLayer() );
diff --git a/sw/source/uibase/shells/grfshex.cxx b/sw/source/uibase/shells/grfshex.cxx
index 7b2562b0ee99..6e9a2d4ffa1b 100644
--- a/sw/source/uibase/shells/grfshex.cxx
+++ b/sw/source/uibase/shells/grfshex.cxx
@@ -130,7 +130,9 @@ bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq )
if (!bRet) { return bRet; }
}
- SdrMediaObj* pObj = new SdrMediaObj( tools::Rectangle( aPos, aSize ) );
+ SdrMediaObj* pObj = new SdrMediaObj(
+ *rSh.GetDoc()->getIDocumentDrawModelAccess().GetDrawModel(),
+ tools::Rectangle(aPos, aSize));
pObj->SetModel(rSh.GetDoc()->getIDocumentDrawModelAccess().GetDrawModel()); // set before setURL
pObj->setURL( realURL, "" );
diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx
index 2fd36e885ddc..3aa9a3cfa688 100644
--- a/sw/source/uibase/uno/unotxdoc.cxx
+++ b/sw/source/uibase/uno/unotxdoc.cxx
@@ -450,6 +450,12 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell)
{
}
+SdrModel* SwXTextDocument::getSdrModelFromUnoModel() const
+{
+ OSL_ENSURE(pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetOrCreateDrawModel(), "No SdrModel in SwDoc, should not happen");
+ return pDocShell->GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
+}
+
SwXTextDocument::~SwXTextDocument()
{
InitNewDoc();