Kaydet (Commit) 816bfa20 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in ExtConditionalFormattingContext

Change-Id: I3816fda10378852e06290e358b2bf18d48bee13d
Reviewed-on: https://gerrit.libreoffice.org/57302
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 65c5a18e
......@@ -52,7 +52,7 @@ public:
private:
OUString aChars;
std::vector<std::unique_ptr<ScFormatEntry> > maEntries;
IconSetRule* mpCurrentRule;
std::unique_ptr<IconSetRule> mpCurrentRule;
};
/**
......
......@@ -91,8 +91,7 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
SCTAB nTab = getSheetIndex();
ScAddress aPos(0, 0, nTab);
mpCurrentRule->SetData(&rIconSet, pDoc, aPos);
delete mpCurrentRule;
mpCurrentRule = nullptr;
mpCurrentRule.reset();
}
if (nElement == XLS14_TOKEN(cfRule))
{
......@@ -115,9 +114,9 @@ ContextHandlerRef ExtConditionalFormattingContext::onCreateContext(sal_Int32 nEl
else if (aType == "iconSet")
{
ScDocument* pDoc = &getScDocument();
mpCurrentRule = new IconSetRule(*this);
mpCurrentRule.reset(new IconSetRule(*this));
maEntries.push_back(o3tl::make_unique<ScIconSetFormat>(pDoc));
return new IconSetContext(*this, mpCurrentRule);
return new IconSetContext(*this, mpCurrentRule.get());
}
else
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment