summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-24 10:22:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-24 16:35:56 +0000
commitb162a663a3e9c0fba1e638bd52920957f011630d (patch)
treeb89acb3a4d88c6bfda7eb519f4ebbc1fdf313728 /sc
parente882ff8c160a7341071746bd0d73a020bb423dbc (diff)
coverity#1255908 Resource leak
Change-Id: I90b8e89eba915e46cc2288f4ff5bee725fc8a1fc
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/optdlg/calcoptionsdlg.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx
index 0b0d160d05dd..f65697011628 100644
--- a/sc/source/ui/optdlg/calcoptionsdlg.cxx
+++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx
@@ -1275,27 +1275,27 @@ IMPL_LINK( ScCalcOptionsDialog, TestClickHdl, PushButton*, )
// Automatically test the current implementation of OpenCL. If it
// seems good, whitelist it. If it seems bad, blacklist it.
- auto pTestDocument = new OpenCLTester();
+ std::unique_ptr<OpenCLTester> xTestDocument(new OpenCLTester());
- pTestDocument->addTest(BinOp("Plus", "+", -1000, 1000, 3e-10,
+ xTestDocument->addTest(BinOp("Plus", "+", -1000, 1000, 3e-10,
[] (double nLhs, double nRhs)
{
return nLhs + nRhs;
}));
- pTestDocument->addTest(BinOp("Minus", "-", -1000, 1000, 3e-10,
+ xTestDocument->addTest(BinOp("Minus", "-", -1000, 1000, 3e-10,
[] (double nLhs, double nRhs)
{
return nLhs - nRhs;
}));
- pTestDocument->addTest(BinOp("Times", "*", -1000, 1000, 3e-10,
+ xTestDocument->addTest(BinOp("Times", "*", -1000, 1000, 3e-10,
[] (double nLhs, double nRhs)
{
return nLhs * nRhs;
}));
- pTestDocument->addTest(BinOp("Divided", "/", -1000, 1000, 3e-10,
+ xTestDocument->addTest(BinOp("Divided", "/", -1000, 1000, 3e-10,
[] (double nLhs, double nRhs)
{
return nLhs / nRhs;
@@ -1305,19 +1305,19 @@ IMPL_LINK( ScCalcOptionsDialog, TestClickHdl, PushButton*, )
return (nRhs == 0);
}));
- pTestDocument->addTest(UnOp("Sin", "SIN", -10, 10, 3e-10,
+ xTestDocument->addTest(UnOp("Sin", "SIN", -10, 10, 3e-10,
[] (double nArg)
{
return sin(nArg);
}));
- pTestDocument->addTest(UnOp("Cos", "COS", -10, 10, 3e-10,
+ xTestDocument->addTest(UnOp("Cos", "COS", -10, 10, 3e-10,
[] (double nArg)
{
return cos(nArg);
}));
- pTestDocument->addTest(UnOp("Tan", "TAN", 0, 10, -3e-10,
+ xTestDocument->addTest(UnOp("Tan", "TAN", 0, 10, -3e-10,
[] (double nArg)
{
return tan(nArg);
@@ -1327,25 +1327,25 @@ IMPL_LINK( ScCalcOptionsDialog, TestClickHdl, PushButton*, )
return (std::fmod(nArg, M_PI) == M_PI/2);
}));
- pTestDocument->addTest(UnOp("Atan", "ATAN", -10, 10, 3e-10,
+ xTestDocument->addTest(UnOp("Atan", "ATAN", -10, 10, 3e-10,
[] (double nArg)
{
return atan(nArg);
}));
- pTestDocument->addTest(UnOp("Sqrt", "SQRT", 0, 1000, 3e-10,
+ xTestDocument->addTest(UnOp("Sqrt", "SQRT", 0, 1000, 3e-10,
[] (double nArg)
{
return sqrt(nArg);
}));
- pTestDocument->addTest(UnOp("Exp", "EXP", 0, 10, 3e-10,
+ xTestDocument->addTest(UnOp("Exp", "EXP", 0, 10, 3e-10,
[] (double nArg)
{
return exp(nArg);
}));
- pTestDocument->addTest(UnOp("Ln", "LN", 0, 1000, 3e-10,
+ xTestDocument->addTest(UnOp("Ln", "LN", 0, 1000, 3e-10,
[] (double nArg)
{
return log(nArg);
@@ -1355,31 +1355,31 @@ IMPL_LINK( ScCalcOptionsDialog, TestClickHdl, PushButton*, )
return (nArg == 0);
}));
- pTestDocument->addTest(Reduction("Sum", "SUM", 100, 0, -1000, 1000, 3e-10,
+ xTestDocument->addTest(Reduction("Sum", "SUM", 100, 0, -1000, 1000, 3e-10,
[] (double nAccum, double nArg)
{
return (nAccum + nArg);
}));
- pTestDocument->addTest(Reduction("Average", "AVERAGE", 100, 0, -1000, 1000, 3e-10,
+ xTestDocument->addTest(Reduction("Average", "AVERAGE", 100, 0, -1000, 1000, 3e-10,
[] (double nAccum, double nArg)
{
return (nAccum + nArg/100.);
}));
- pTestDocument->addTest(Reduction("Product", "PRODUCT", 100, 1, 0.1, 2.5, 3e-10,
+ xTestDocument->addTest(Reduction("Product", "PRODUCT", 100, 1, 0.1, 2.5, 3e-10,
[] (double nAccum, double nArg)
{
return (nAccum * nArg);
}));
- pTestDocument->addTest(Reduction("Min", "MIN", 100, DBL_MAX, -1000, 1000, 0,
+ xTestDocument->addTest(Reduction("Min", "MIN", 100, DBL_MAX, -1000, 1000, 0,
[] (double nAccum, double nArg)
{
return std::min(nAccum, nArg);
}));
- pTestDocument->addTest(Reduction("Max", "MAX", 100, -DBL_MAX, -1000, 1000, 0,
+ xTestDocument->addTest(Reduction("Max", "MAX", 100, -DBL_MAX, -1000, 1000, 0,
[] (double nAccum, double nArg)
{
return std::max(nAccum, nArg);