summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2016-08-15 09:19:35 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-08-15 07:49:37 +0000
commit2b68e03348b3b4009e8bb2af7979de36bd3450c5 (patch)
treeea337632ae63bc8c19cdb1b72feedbce8302433a /sd
parent3093732c17d14b0e6eb67868c514448f13bc66d0 (diff)
tdf#100782 have XPropertyList hold unique_ptr
Change-Id: I928f297e1be76b965898d83cb3dd2e79b23b7974 Reviewed-on: https://gerrit.libreoffice.org/28095 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/animations/CustomAnimationDialog.cxx4
-rw-r--r--sd/source/ui/func/fuconrec.cxx2
-rw-r--r--sd/source/ui/func/fulinend.cxx4
-rw-r--r--sd/source/ui/view/drviews9.cxx27
4 files changed, 19 insertions, 18 deletions
diff --git a/sd/source/ui/animations/CustomAnimationDialog.cxx b/sd/source/ui/animations/CustomAnimationDialog.cxx
index a02af081e527..18c409531440 100644
--- a/sd/source/ui/animations/CustomAnimationDialog.cxx
+++ b/sd/source/ui/animations/CustomAnimationDialog.cxx
@@ -220,7 +220,7 @@ ColorPropertyBox::ColorPropertyBox( sal_Int32 nControlType, vcl::Window* pParent
for ( long i = 0; i < pColorList->Count(); i++ )
{
- XColorEntry* pEntry = pColorList->GetColor(i);
+ const XColorEntry* pEntry = pColorList->GetColor(i);
sal_Int32 nPos = mpControl->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
if( pEntry->GetColor().GetRGBColor() == (sal_uInt32)nColor )
mpControl->SelectEntryPos( nPos );
@@ -1093,7 +1093,7 @@ CustomAnimationEffectTabPage::CustomAnimationEffectTabPage( vcl::Window* pParent
for ( long i = 0; i < pColorList->Count(); i++ )
{
- XColorEntry* pEntry = pColorList->GetColor(i);
+ const XColorEntry* pEntry = pColorList->GetColor(i);
mpCLBDimColor->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
diff --git a/sd/source/ui/func/fuconrec.cxx b/sd/source/ui/func/fuconrec.cxx
index d7fe22933962..74be18f01548 100644
--- a/sd/source/ui/func/fuconrec.cxx
+++ b/sd/source/ui/func/fuconrec.cxx
@@ -511,7 +511,7 @@ void FuConstructRectangle::SetAttributes(SfxItemSet& rAttr, SdrObject* pObj)
long nIndex;
for( nIndex = 0L; nIndex < nCount; nIndex++ )
{
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
+ const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
if( pEntry->GetName() == aArrowName )
{
aRetval = pEntry->GetLineEnd();
diff --git a/sd/source/ui/func/fulinend.cxx b/sd/source/ui/func/fulinend.cxx
index a92a97c65f44..6025641dfd48 100644
--- a/sd/source/ui/func/fulinend.cxx
+++ b/sd/source/ui/func/fulinend.cxx
@@ -33,6 +33,7 @@
#include "View.hxx"
#include "Window.hxx"
#include <memory>
+#include <o3tl/make_unique.hxx>
namespace sd {
@@ -132,8 +133,7 @@ void FuLineEnd::DoExecute( SfxRequest& )
if( bDifferent )
{
- XLineEndEntry* pEntry = new XLineEndEntry( aPolyPolygon, aName );
- pLineEndList->Insert( pEntry);
+ pLineEndList->Insert(o3tl::make_unique<XLineEndEntry>(aPolyPolygon, aName));
}
else
{
diff --git a/sd/source/ui/view/drviews9.cxx b/sd/source/ui/view/drviews9.cxx
index 2e0b5dbb7a6b..6b3b0606b5ca 100644
--- a/sd/source/ui/view/drviews9.cxx
+++ b/sd/source/ui/view/drviews9.cxx
@@ -61,6 +61,7 @@
#include <com/sun/star/gallery/GalleryItemType.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
#include <memory>
+#include <o3tl/make_unique.hxx>
using namespace com::sun::star;
@@ -347,7 +348,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
for ( i = 0; i < nCounts; i ++)
{
- XGradientEntry *pEntry = pGradientList->GetGradient (i);
+ const XGradientEntry* pEntry = pGradientList->GetGradient(i);
if (pEntry->GetName () == pName->GetValue ())
{
@@ -376,7 +377,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
? aColor
: aBlack);
- GetDoc()->GetGradientList ()->Insert (new XGradientEntry (aGradient, pName->GetValue ()));
+ GetDoc()->GetGradientList()->Insert(o3tl::make_unique<XGradientEntry>(aGradient, pName->GetValue()));
XFillStyleItem aStyleItem(drawing::FillStyle_GRADIENT);
aStyleItem.SetWhich(XATTR_FILLSTYLE);
@@ -418,7 +419,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
for ( i = 0; i < nCounts; i ++)
{
- XHatchEntry *pEntry = pHatchList->GetHatch (i);
+ const XHatchEntry* pEntry = pHatchList->GetHatch(i);
if (pEntry->GetName () == pName->GetValue ())
{
@@ -440,7 +441,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
{
XHatch aHatch (aColor);
- GetDoc()->GetHatchList ()->Insert (new XHatchEntry (aHatch, pName->GetValue ()));
+ GetDoc()->GetHatchList()->Insert(o3tl::make_unique<XHatchEntry>(aHatch, pName->GetValue()));
XFillStyleItem aStyleItem(drawing::FillStyle_HATCH);
aStyleItem.SetWhich(XATTR_FILLSTYLE);
@@ -484,7 +485,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
XDashListRef pDashList = GetDoc()->GetDashList();
long nCounts = pDashList->Count ();
- XDashEntry *pEntry = new XDashEntry (aNewDash, pName->GetValue ());
+ std::unique_ptr<XDashEntry> pEntry = o3tl::make_unique<XDashEntry>(aNewDash, pName->GetValue());
long i;
for ( i = 0; i < nCounts; i++ )
@@ -492,9 +493,9 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
break;
if (i < nCounts)
- pDashList->Replace (pEntry, i);
+ pDashList->Replace(std::move(pEntry), i);
else
- pDashList->Insert (pEntry);
+ pDashList->Insert(std::move(pEntry));
XLineDashItem aDashItem(pName->GetValue(), aNewDash);
aDashItem.SetWhich(XATTR_LINEDASH);
@@ -546,7 +547,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
for ( i = 0; i < nCounts; i++ )
{
- XGradientEntry *pEntry = pGradientList->GetGradient (i);
+ const XGradientEntry* pEntry = pGradientList->GetGradient(i);
if (pEntry->GetName () == pName->GetValue ())
{
@@ -578,7 +579,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
(short) pCenterY->GetValue (), (short) pBorder->GetValue (),
(short) pStart->GetValue (), (short) pEnd->GetValue ());
- pGradientList->Insert (new XGradientEntry (aGradient, pName->GetValue ()));
+ pGradientList->Insert(o3tl::make_unique<XGradientEntry>(aGradient, pName->GetValue()));
XFillStyleItem aStyleItem(drawing::FillStyle_GRADIENT);
aStyleItem.SetWhich(XATTR_FILLSTYLE);
pAttr->Put(aStyleItem);
@@ -624,7 +625,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
for ( i = 0; i < nCounts; i++ )
{
- XHatchEntry *pEntry = pHatchList->GetHatch (i);
+ const XHatchEntry* pEntry = pHatchList->GetHatch(i);
if (pEntry->GetName () == pName->GetValue ())
{
@@ -650,7 +651,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
XHatch aHatch (aBlack, (css::drawing::HatchStyle) pStyle->GetValue (), pDistance->GetValue (),
pAngle->GetValue () * 10);
- pHatchList->Insert (new XHatchEntry (aHatch, pName->GetValue ()));
+ pHatchList->Insert(o3tl::make_unique<XHatchEntry>(aHatch, pName->GetValue()));
XFillStyleItem aStyleItem(drawing::FillStyle_HATCH);
aStyleItem.SetWhich(XATTR_FILLSTYLE);
pAttr->Put(aStyleItem);
@@ -685,7 +686,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
i < nCounts;
i ++)
{
- XGradientEntry *pEntry = pGradientList->GetGradient (i);
+ const XGradientEntry* pEntry = pGradientList->GetGradient(i);
if (pEntry->GetName () == pName->GetValue ())
{
@@ -725,7 +726,7 @@ void DrawViewShell::AttrExec (SfxRequest &rReq)
i < nCounts;
i ++)
{
- XHatchEntry *pEntry = pHatchList->GetHatch (i);
+ const XHatchEntry* pEntry = pHatchList->GetHatch(i);
if (pEntry->GetName () == pName->GetValue ())
{