[Libreoffice-commits] core.git: sc/source sd/source sw/inc sw/source
Armin Le Grand
Armin.Le.Grand at cib.de
Mon Apr 9 16:09:37 UTC 2018
sc/source/ui/app/drwtrans.cxx | 6 +++---
sc/source/ui/drawfunc/fuconrec.cxx | 8 ++++----
sc/source/ui/inc/drwtrans.hxx | 2 +-
sc/source/ui/inc/fuconrec.hxx | 2 +-
sc/source/ui/navipi/content.cxx | 2 +-
sd/source/ui/func/fuconrec.cxx | 10 +++++-----
sd/source/ui/inc/fuconrec.hxx | 2 +-
sw/inc/fesh.hxx | 2 +-
sw/source/core/frmedt/feshview.cxx | 6 +++---
sw/source/uibase/ribbar/conrect.cxx | 2 +-
10 files changed, 21 insertions(+), 21 deletions(-)
New commits:
commit f54cb7cc81ba3c485e24e6d9820cf8dced12081b
Author: Armin Le Grand <Armin.Le.Grand at cib.de>
Date: Mon Apr 9 13:01:22 2018 +0200
GetLineEnds: Use SdrObject& instead of pointers
Change-Id: I154363d54139319f584d24401d47aa9374869d47
Reviewed-on: https://gerrit.libreoffice.org/52628
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Armin Le Grand <Armin.Le.Grand at cib.de>
diff --git a/sc/source/ui/app/drwtrans.cxx b/sc/source/ui/app/drwtrans.cxx
index 12cfa00f3bca..3fa00a949b55 100644
--- a/sc/source/ui/app/drwtrans.cxx
+++ b/sc/source/ui/app/drwtrans.cxx
@@ -638,13 +638,13 @@ void ScDrawTransferObj::SetDragSource( const ScDrawView* pView )
//! add as listener with document, delete pDragSourceView if document gone
}
-void ScDrawTransferObj::SetDragSourceObj( SdrObject* pObj, SCTAB nTab )
+void ScDrawTransferObj::SetDragSourceObj( SdrObject& rObj, SCTAB nTab )
{
DELETEZ( pDragSourceView );
- pDragSourceView = new SdrView(pObj->getSdrModelFromSdrObject()); // TTTT pObj should be reference
+ pDragSourceView = new SdrView(rObj.getSdrModelFromSdrObject());
pDragSourceView->ShowSdrPage(pDragSourceView->GetModel()->GetPage(nTab));
SdrPageView* pPV = pDragSourceView->GetSdrPageView();
- pDragSourceView->MarkObj(pObj, pPV);
+ pDragSourceView->MarkObj(&rObj, pPV); // TTTT MarkObj should take SdrObject&
//! add as listener with document, delete pDragSourceView if document gone
}
diff --git a/sc/source/ui/drawfunc/fuconrec.cxx b/sc/source/ui/drawfunc/fuconrec.cxx
index 6aba5faad5fc..05727fbe36f0 100644
--- a/sc/source/ui/drawfunc/fuconrec.cxx
+++ b/sc/source/ui/drawfunc/fuconrec.cxx
@@ -117,7 +117,7 @@ bool FuConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
if (pObj)
{
SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
- SetLineEnds(aAttr, pObj, aSfxRequest.GetSlot());
+ SetLineEnds(aAttr, *pObj, aSfxRequest.GetSlot());
pObj->SetMergedItemSet(aAttr);
}
@@ -214,9 +214,9 @@ void FuConstRectangle::Activate()
FuConstruct::Activate();
}
-void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal_uInt16 nSlotId)
+void FuConstRectangle::SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal_uInt16 nSlotId)
{
- SdrModel& rModel(pObj->getSdrModelFromSdrObject()); // TTTT pObj should be reference
+ SdrModel& rModel(rObj.getSdrModelFromSdrObject());
if ( nSlotId == SID_LINE_ARROW_START ||
nSlotId == SID_LINE_ARROW_END ||
@@ -448,7 +448,7 @@ SdrObject* FuConstRectangle::CreateDefaultObject(const sal_uInt16 nID, const too
}
SfxItemSet aAttr(pDrDoc->GetItemPool());
- SetLineEnds(aAttr, pObj, nID);
+ SetLineEnds(aAttr, *pObj, nID);
pObj->SetMergedItemSet(aAttr);
}
diff --git a/sc/source/ui/inc/drwtrans.hxx b/sc/source/ui/inc/drwtrans.hxx
index be1137ed37e8..cf2fdaeaeb40 100644
--- a/sc/source/ui/inc/drwtrans.hxx
+++ b/sc/source/ui/inc/drwtrans.hxx
@@ -83,7 +83,7 @@ public:
void SetDrawPersist( const SfxObjectShellRef& rRef );
void SetDragSource( const ScDrawView* pView );
- void SetDragSourceObj( SdrObject* pObj, SCTAB nTab );
+ void SetDragSourceObj( SdrObject& rObj, SCTAB nTab );
void SetDragSourceFlags( ScDragSrc nFlags );
void SetDragWasInternal();
diff --git a/sc/source/ui/inc/fuconrec.hxx b/sc/source/ui/inc/fuconrec.hxx
index b18d38029c69..ab9b77f42591 100644
--- a/sc/source/ui/inc/fuconrec.hxx
+++ b/sc/source/ui/inc/fuconrec.hxx
@@ -36,7 +36,7 @@ class FuConstRectangle : public FuConstruct
virtual void Activate() override;
virtual void Deactivate() override;
- static void SetLineEnds(SfxItemSet& rAttr, const SdrObject* pObj, sal_uInt16 nSlotId);
+ static void SetLineEnds(SfxItemSet& rAttr, const SdrObject& rObj, sal_uInt16 nSlotId);
// Create default drawing objects via keyboard
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const tools::Rectangle& rRectangle) override;
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index a414160700c7..f1c905fd3fe4 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1262,7 +1262,7 @@ static void lcl_DoDragObject( ScDocShell* pSrcShell, const OUString& rName, ScCo
rtl::Reference<ScDrawTransferObj> pTransferObj = new ScDrawTransferObj( pDragModel, pSrcShell, aObjDesc );
- pTransferObj->SetDragSourceObj( pObject, nTab );
+ pTransferObj->SetDragSourceObj( *pObject, nTab );
pTransferObj->SetDragSourceFlags(ScDragSrc::Navigator);
SC_MOD()->SetDragObject( nullptr, pTransferObj.get() );
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index d78fd866755d..50f9c1c4fae1 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -210,7 +210,7 @@ bool FuConstructRectangle::MouseButtonDown(const MouseEvent& rMEvt)
SfxItemSet aAttr(mpDoc->GetPool());
SetStyleSheet(aAttr, pObj);
SetAttributes(aAttr, pObj);
- SetLineEnds(aAttr, pObj);
+ SetLineEnds(aAttr, *pObj);
pObj->SetMergedItemSet(aAttr);
if( nSlotId == SID_DRAW_CAPTION_VERTICAL )
@@ -525,9 +525,9 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
return aRetval;
}
-void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const * pObj)
+void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject& rObj)
{
- if ( (pObj->GetObjIdentifier() == OBJ_EDGE &&
+ if ( (rObj.GetObjIdentifier() == OBJ_EDGE &&
nSlotId != SID_TOOL_CONNECTOR &&
nSlotId != SID_CONNECTOR_LINE &&
nSlotId != SID_CONNECTOR_LINES &&
@@ -541,7 +541,7 @@ void FuConstructRectangle::SetLineEnds(SfxItemSet& rAttr, SdrObject const * pObj
nSlotId == SID_LINE_SQUARE_ARROW )
{
// set attributes of line start and ends
- SdrModel& rModel(pObj->getSdrModelFromSdrObject()); // TTTT pObj should be reference
+ SdrModel& rModel(rObj.getSdrModelFromSdrObject());
// arrowhead
::basegfx::B2DPolyPolygon aArrow( getPolygon( RID_SVXSTR_ARROW, rModel ) );
@@ -920,7 +920,7 @@ SdrObject* FuConstructRectangle::CreateDefaultObject(const sal_uInt16 nID, const
SfxItemSet aAttr(mpDoc->GetPool());
SetStyleSheet(aAttr, pObj);
SetAttributes(aAttr, pObj);
- SetLineEnds(aAttr, pObj);
+ SetLineEnds(aAttr, *pObj);
pObj->SetMergedItemSet(aAttr);
}
diff --git a/sd/source/ui/inc/fuconrec.hxx b/sd/source/ui/inc/fuconrec.hxx
index 02a3478c55dd..0aeef38f5af0 100644
--- a/sd/source/ui/inc/fuconrec.hxx
+++ b/sd/source/ui/inc/fuconrec.hxx
@@ -48,7 +48,7 @@ public:
virtual void Deactivate() override;
void SetAttributes(SfxItemSet& rAttr, SdrObject* pObj);
- void SetLineEnds(SfxItemSet& rAttr, SdrObject const * pObj);
+ void SetLineEnds(SfxItemSet& rAttr, SdrObject& rObj);
virtual SdrObject* CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle& rRectangle) override;
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 43c37323f29a..0222fa709b99 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -810,7 +810,7 @@ public:
const Point& _rDocPos );
void ToggleHeaderFooterEdit( );
- static void SetLineEnds(SfxItemSet& rAttr, SdrObject const * pObj, sal_uInt16 nSlotId);
+ static void SetLineEnds(SfxItemSet& rAttr, SdrObject& rObj, sal_uInt16 nSlotId);
SAL_DLLPRIVATE void ClearColumnRowCache(SwTabFrame const*);
};
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index c96acf814448..fbe62c515ffe 100644
--- a/sw/source/core/frmedt/feshview.cxx
+++ b/sw/source/core/frmedt/feshview.cxx
@@ -892,9 +892,9 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst )
}
}
-void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject const * pObj, sal_uInt16 nSlotId)
+void SwFEShell::SetLineEnds(SfxItemSet& rAttr, SdrObject& rObj, sal_uInt16 nSlotId)
{
- SdrModel& rModel(pObj->getSdrModelFromSdrObject());
+ SdrModel& rModel(rObj.getSdrModelFromSdrObject());
if ( !(nSlotId == SID_LINE_ARROW_START ||
nSlotId == SID_LINE_ARROW_END ||
@@ -3042,7 +3042,7 @@ long SwFEShell::GetSectionWidth( SwFormat const & rFormat ) const
aPoly.append(aTempPoly);
SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
- SetLineEnds(aAttr, pObj, nSlotId);
+ SetLineEnds(aAttr, *pObj, nSlotId);
pObj->SetMergedItemSet(aAttr);
}
break;
diff --git a/sw/source/uibase/ribbar/conrect.cxx b/sw/source/uibase/ribbar/conrect.cxx
index 395bca6961fe..8c6da3502144 100644
--- a/sw/source/uibase/ribbar/conrect.cxx
+++ b/sw/source/uibase/ribbar/conrect.cxx
@@ -66,7 +66,7 @@ bool ConstRectangle::MouseButtonDown(const MouseEvent& rMEvt)
if (pObj)
{
SfxItemSet aAttr(pObj->getSdrModelFromSdrObject().GetItemPool());
- SwFEShell::SetLineEnds(aAttr, pObj, m_nSlotId);
+ SwFEShell::SetLineEnds(aAttr, *pObj, m_nSlotId);
pObj->SetMergedItemSet(aAttr);
}
}
More information about the Libreoffice-commits
mailing list