summaryrefslogtreecommitdiff
path: root/cui/source/customize/acccfg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-06-10 21:32:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-06-10 22:11:33 +0100
commit88b104f44acff8087dfe3833bb91c63604ced98b (patch)
tree6c7aee2f8cf919d994e1b9640ab8c1dd921837f8 /cui/source/customize/acccfg.cxx
parentdc4d9481f36a18db1dfe3b931780edbe32266e5f (diff)
coverity#1302618 deref of NULL
on examination this PreparePaint virtual is only called from SvTreeListBox::PaintEntry1 and PaintEntry1 is only called from SvImpLBox::Paint in a for(sal_uInt16 n=0; n< nCount && pEntry; n++) { /*long nMaxRight=*/ pView->PaintEntry1 loop so pEntry always exists given that test. Re-jig things so these families of method take a reference instead of a pointer so verifying it cannot be NULL and a whole pile of else paths fall away Change-Id: Ied40acb1c2263c21b4447832f8cb86f64ed9e80d
Diffstat (limited to 'cui/source/customize/acccfg.cxx')
-rw-r--r--cui/source/customize/acccfg.cxx9
1 files changed, 3 insertions, 6 deletions
diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx
index b3511e977198..b91f0039f62a 100644
--- a/cui/source/customize/acccfg.cxx
+++ b/cui/source/customize/acccfg.cxx
@@ -625,7 +625,7 @@ public:
virtual ~SfxAccCfgLBoxString_Impl();
virtual void Paint(const Point& aPos, SvTreeListBox& rDevice, vcl::RenderContext& rRenderContext,
- const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE;
+ const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE;
};
@@ -637,12 +637,9 @@ SfxAccCfgLBoxString_Impl::~SfxAccCfgLBoxString_Impl()
{}
void SfxAccCfgLBoxString_Impl::Paint(const Point& aPos, SvTreeListBox& /*rDevice*/, vcl::RenderContext& rRenderContext,
- const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry)
+ const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry)
{
- if (!pEntry)
- return;
-
- TAccInfo* pUserData = static_cast<TAccInfo*>(pEntry->GetUserData());
+ TAccInfo* pUserData = static_cast<TAccInfo*>(rEntry.GetUserData());
if (!pUserData)
return;