diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-12-08 18:57:32 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-12-09 07:16:34 +0000 |
commit | 4754afddc3030347ef49b401a9b798cea8fe523c (patch) | |
tree | a7505da2dae9b8eae70ed463309521c11780d4c4 /sd/source/ui/view/outlnvsh.cxx | |
parent | 6fd3f3caad1a559165dc9332249cbd0d84930775 (diff) |
Use unique_ptr out-arg to in SfxBindings::QueryState to avoid mem leaks
Change-Id: I35df02de675068478a36ef05266ffc2d3054b07f
Reviewed-on: https://gerrit.libreoffice.org/20477
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sd/source/ui/view/outlnvsh.cxx')
-rw-r--r-- | sd/source/ui/view/outlnvsh.cxx | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sd/source/ui/view/outlnvsh.cxx b/sd/source/ui/view/outlnvsh.cxx index 8acacd4459ca..c81906ba648e 100644 --- a/sd/source/ui/view/outlnvsh.cxx +++ b/sd/source/ui/view/outlnvsh.cxx @@ -1481,9 +1481,9 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) case SID_STYLE_EDIT: { - SfxPoolItem* pItem = nullptr; + std::unique_ptr<SfxPoolItem> pItem; GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pItem); - SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem); + SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get()); if (pFamilyItem && SfxTemplate::NIdToSfxFamilyId(pFamilyItem->GetValue()) == SD_STYLE_FAMILY_PSEUDO) { SfxItemSet aSet(*rSet.GetPool(), SID_STATUS_LAYOUT, SID_STATUS_LAYOUT); @@ -1495,7 +1495,6 @@ void OutlineViewShell::GetAttrState( SfxItemSet& rSet ) rSet.DisableItem(nWhich); } } - delete pItem; } break; |