summaryrefslogtreecommitdiff
path: root/starmath/source/dialog.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-03-15 11:57:18 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-03-16 08:24:49 +0100
commita47baea83f761937f5b8b5ed0ee142d3e04386d4 (patch)
treed73cc352deef9a6f41c1a41026f38d61b20f59e8 /starmath/source/dialog.cxx
parentb4b2d7dd3eb210eb77c8f53e604a5d308282ee99 (diff)
loplugin:useuniqueptr in SmCategoryDesc
Change-Id: I4a6be3c84fb7c64b5f72499e5393e44f02514201 Reviewed-on: https://gerrit.libreoffice.org/51334 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'starmath/source/dialog.cxx')
-rw-r--r--starmath/source/dialog.cxx15
1 files changed, 5 insertions, 10 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index beb269afdc62..7c9024596cff 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -650,14 +650,14 @@ SmCategoryDesc::SmCategoryDesc(VclBuilderContainer& rBuilder, sal_uInt16 nCatego
if (pLabel)
{
- Strings [i] = new OUString(pLabel->GetText());
+ Strings[i] = pLabel->GetText();
FixedImage* pImage = rBuilder.get<FixedImage>(OString::number(nCategoryIdx)+"image"+OString::number(i+1));
- Graphics [i] = new Image(pImage->GetImage());
+ Graphics[i].reset(new Image(pImage->GetImage()));
}
else
{
- Strings [i] = nullptr;
- Graphics [i] = nullptr;
+ Strings[i].clear();
+ Graphics[i].reset();
}
const FieldMinMax& rMinMax = pMinMaxData[ nCategoryIdx-1 ][i];
@@ -668,11 +668,6 @@ SmCategoryDesc::SmCategoryDesc(VclBuilderContainer& rBuilder, sal_uInt16 nCatego
SmCategoryDesc::~SmCategoryDesc()
{
- for (int i = 0; i < 4; ++i)
- {
- delete Strings [i];
- delete Graphics [i];
- }
}
/**************************************************************************/
@@ -829,7 +824,7 @@ void SmDistanceDialog::SetCategory(sal_uInt16 nCategory)
if (bActive)
{
pCat = Categories[nCategory];
- pFT->SetText(*pCat->GetString(i));
+ pFT->SetText(pCat->GetString(i));
pMF->SetMin(pCat->GetMinimum(i));
pMF->SetMax(pCat->GetMaximum(i));