summaryrefslogtreecommitdiff
path: root/sc/source/ui/drawfunc
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/drawfunc')
-rw-r--r--sc/source/ui/drawfunc/fuconarc.cxx5
-rw-r--r--sc/source/ui/drawfunc/fuconcustomshape.cxx9
-rw-r--r--sc/source/ui/drawfunc/fuconpol.cxx5
-rw-r--r--sc/source/ui/drawfunc/fuconrec.cxx21
-rw-r--r--sc/source/ui/drawfunc/fuconuno.cxx5
-rw-r--r--sc/source/ui/drawfunc/fuins1.cxx12
-rw-r--r--sc/source/ui/drawfunc/fuins2.cxx18
-rw-r--r--sc/source/ui/drawfunc/futext.cxx5
8 files changed, 52 insertions, 28 deletions
diff --git a/sc/source/ui/drawfunc/fuconarc.cxx b/sc/source/ui/drawfunc/fuconarc.cxx
index 7ada2107c5b3..d167649a5086 100644
--- a/sc/source/ui/drawfunc/fuconarc.cxx
+++ b/sc/source/ui/drawfunc/fuconarc.cxx
@@ -123,8 +123,9 @@ 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());
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuconcustomshape.cxx b/sc/source/ui/drawfunc/fuconcustomshape.cxx
index f5a03392f736..e028a4d1dcd3 100644
--- a/sc/source/ui/drawfunc/fuconcustomshape.cxx
+++ b/sc/source/ui/drawfunc/fuconcustomshape.cxx
@@ -132,8 +132,10 @@ 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());
+
if( pObj )
{
tools::Rectangle aRectangle( rRectangle );
@@ -142,6 +144,7 @@ SdrObject* FuConstCustomShape::CreateDefaultObject(const sal_uInt16 /* nID */, c
ImpForceQuadratic( aRectangle );
pObj->SetLogicRect( aRectangle );
}
+
return pObj;
}
@@ -168,7 +171,7 @@ void FuConstCustomShape::SetAttributes( SdrObject* pObj )
{
const SfxItemSet& rSource = pSourceObj->GetMergedItemSet();
SfxItemSet aDest(
- pObj->GetModel()->GetItemPool(),
+ pObj->getSdrModelFromSdrObject().GetItemPool(),
svl::Items<
// Ranges from SdrAttrObj:
SDRATTR_START, SDRATTR_SHADOW_LAST,
diff --git a/sc/source/ui/drawfunc/fuconpol.cxx b/sc/source/ui/drawfunc/fuconpol.cxx
index 330ebf09a41d..cc9ec052cea2 100644
--- a/sc/source/ui/drawfunc/fuconpol.cxx
+++ b/sc/source/ui/drawfunc/fuconpol.cxx
@@ -185,8 +185,9 @@ 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());
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index d3ae4c990850..6aba5faad5fc 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -58,10 +58,10 @@ FuConstRectangle::~FuConstRectangle()
namespace {
-::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel* pDoc)
+::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel& rModel)
{
::basegfx::B2DPolyPolygon aRetval;
- XLineEndListRef pLineEndList = pDoc->GetLineEndList();
+ XLineEndListRef pLineEndList(rModel.GetLineEndList());
if( pLineEndList.is() )
{
@@ -116,7 +116,7 @@ bool FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
if (pObj)
{
- SfxItemSet aAttr(pObj->GetModel()->GetItemPool());
+ SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
SetLineEnds(aAttr, pObj, aSfxRequest.GetSlot());
pObj->SetMergedItemSet(aAttr);
}
@@ -216,7 +216,7 @@ void FuConstRectangle::Activate()
void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal_uInt16 nSlotId)
{
- SdrModel *pDoc = pObj->GetModel();
+ SdrModel& rModel(pObj->getSdrModelFromSdrObject()); // TTTT pObj should be reference
if ( nSlotId == SID_LINE_ARROW_START ||
nSlotId == SID_LINE_ARROW_END ||
@@ -230,7 +230,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal
// set attributes of line start and ends
// arrowhead
- ::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, pDoc ) );
+ ::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, rModel ) );
if( !aArrow.count() )
{
::basegfx::B2DPolygon aNewArrow;
@@ -242,7 +242,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal
}
// Circles
- ::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, pDoc ) );
+ ::basegfx::B2DPolyPolygon aCircle( getPolygon( RID_SVXSTR_CIRCLE, rModel ) );
if( !aCircle.count() )
{
::basegfx::B2DPolygon aNewCircle;
@@ -252,7 +252,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal
}
// Square
- ::basegfx::B2DPolyPolygon aSquare( getPolygon( RID_SVXSTR_SQUARE, pDoc ) );
+ ::basegfx::B2DPolyPolygon aSquare( getPolygon( RID_SVXSTR_SQUARE, rModel ) );
if( !aSquare.count() )
{
::basegfx::B2DPolygon aNewSquare;
@@ -264,7 +264,7 @@ void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal
aSquare.append(aNewSquare);
}
- SfxItemSet aSet( pDoc->GetItemPool() );
+ SfxItemSet aSet( rModel.GetItemPool() );
long nWidth = 200; // (1/100th mm)
// determine line width and calculate with it the line end width
@@ -356,8 +356,9 @@ 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());
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuconuno.cxx b/sc/source/ui/drawfunc/fuconuno.cxx
index 619ad1c4f79d..a3a141a8732e 100644
--- a/sc/source/ui/drawfunc/fuconuno.cxx
+++ b/sc/source/ui/drawfunc/fuconuno.cxx
@@ -111,8 +111,9 @@ 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());
if(pObj)
{
diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx
index 5574a6f5b6cc..d1efc9f2cd33 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
-
+ // 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,9 +247,10 @@ 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?*/ );
pView->InsertObjectAtView( pObj, *pPV, bApi ? SdrInsertFlags::DONTMARK : SdrInsertFlags::NONE );
}
diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx
index b56a1c1d7f0a..bcee011d6637 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 should be reference
+ 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 should be reference
+ 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 should be reference
+ 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..7914c87a7313 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -643,8 +643,9 @@ 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());
if(pObj)
{