summaryrefslogtreecommitdiff
path: root/svx/source/dialog/connctrl.cxx
diff options
context:
space:
mode:
authorNoel <noel.grandin@collabora.co.uk>2021-03-05 10:47:16 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-07 13:24:51 +0100
commit1d2773807f6d2deb1181ef4b14fbdd49ca1d5c14 (patch)
tree788ef3ef220549c9785bcf1f5b35becc176300d4 /svx/source/dialog/connctrl.cxx
parente4e80ed313882f9ea1b309054e5aa3e839586516 (diff)
ref-count SdrPage
which simplifies ownership handling, particularly with regard to undo/redo Change-Id: Ie8f300ebfdae6db3c06f78a87e35a07497d6b825 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111991 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/dialog/connctrl.cxx')
-rw-r--r--svx/source/dialog/connctrl.cxx28
1 files changed, 14 insertions, 14 deletions
diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx
index ecc0cc98f0cb..ec6e64b4d07d 100644
--- a/svx/source/dialog/connctrl.cxx
+++ b/svx/source/dialog/connctrl.cxx
@@ -62,13 +62,13 @@ void SvxXConnectionPreview::Resize()
void SvxXConnectionPreview::AdaptSize()
{
// Adapt size
- if( !pSdrPage )
+ if( !mxSdrPage )
return;
SetMapMode(MapMode(MapUnit::Map100thMM));
OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 );
- tools::Rectangle aRect = pSdrPage->GetAllObjBoundRect();
+ tools::Rectangle aRect = mxSdrPage->GetAllObjBoundRect();
MapMode aMapMode = GetMapMode();
aMapMode.SetMapUnit( pOD->GetMapMode().GetMapUnit() );
@@ -146,15 +146,15 @@ void SvxXConnectionPreview::Construct()
// potential memory leak here (!). Create SdrObjList only when there is
// not yet one.
- if(!pSdrPage)
+ if(!mxSdrPage)
{
- pSdrPage.reset( new SdrPage(
+ mxSdrPage = new SdrPage(
pView->getSdrModelFromSdrView(),
- false) );
+ false);
}
const SdrEdgeObj* pTmpEdgeObj = static_cast<const SdrEdgeObj*>(pObj);
- pEdgeObj = pTmpEdgeObj->CloneSdrObject(pSdrPage->getSdrModelFromSdrPage());
+ pEdgeObj = pTmpEdgeObj->CloneSdrObject(mxSdrPage->getSdrModelFromSdrPage());
SdrObjConnection& rConn1 = pEdgeObj->GetConnection( true );
SdrObjConnection& rConn2 = pEdgeObj->GetConnection( false );
@@ -167,19 +167,19 @@ void SvxXConnectionPreview::Construct()
if( pTmpObj1 )
{
- SdrObject* pObj1 = pTmpObj1->CloneSdrObject(pSdrPage->getSdrModelFromSdrPage());
- pSdrPage->InsertObject( pObj1 );
+ SdrObject* pObj1 = pTmpObj1->CloneSdrObject(mxSdrPage->getSdrModelFromSdrPage());
+ mxSdrPage->InsertObject( pObj1 );
pEdgeObj->ConnectToNode( true, pObj1 );
}
if( pTmpObj2 )
{
- SdrObject* pObj2 = pTmpObj2->CloneSdrObject(pSdrPage->getSdrModelFromSdrPage());
- pSdrPage->InsertObject( pObj2 );
+ SdrObject* pObj2 = pTmpObj2->CloneSdrObject(mxSdrPage->getSdrModelFromSdrPage());
+ mxSdrPage->InsertObject( pObj2 );
pEdgeObj->ConnectToNode( false, pObj2 );
}
- pSdrPage->InsertObject( pEdgeObj );
+ mxSdrPage->InsertObject( pEdgeObj );
}
}
}
@@ -202,7 +202,7 @@ void SvxXConnectionPreview::Paint(vcl::RenderContext& rRenderContext, const tool
rRenderContext.SetDrawMode(rStyles.GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR);
rRenderContext.SetBackground(Wallpaper(rStyles.GetFieldColor()));
- if (pSdrPage)
+ if (mxSdrPage)
{
// This will not work anymore. To not start at Adam and Eve, i will
// ATM not try to change all this stuff to really using an own model
@@ -213,9 +213,9 @@ void SvxXConnectionPreview::Paint(vcl::RenderContext& rRenderContext, const tool
// New stuff: Use an ObjectContactOfObjListPainter.
sdr::contact::SdrObjectVector aObjectVector;
- for (size_t a = 0; a < pSdrPage->GetObjCount(); ++a)
+ for (size_t a = 0; a < mxSdrPage->GetObjCount(); ++a)
{
- SdrObject* pObject = pSdrPage->GetObj(a);
+ SdrObject* pObject = mxSdrPage->GetObj(a);
DBG_ASSERT(pObject,
"SvxXConnectionPreview::Paint: Corrupt ObjectList (!)");
aObjectVector.push_back(pObject);