diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-06-10 21:32:54 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-06-10 22:11:33 +0100 |
commit | 88b104f44acff8087dfe3833bb91c63604ced98b (patch) | |
tree | 6c7aee2f8cf919d994e1b9640ab8c1dd921837f8 /sd | |
parent | dc4d9481f36a18db1dfe3b931780edbe32266e5f (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 'sd')
-rw-r--r-- | sd/source/ui/animations/CustomAnimationList.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 90735cd40a6f..ff249d6a5f45 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -210,7 +210,7 @@ public: void Clone(SvLBoxItem* pSource) SAL_OVERRIDE; virtual void Paint(const Point&, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView,const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView,const SvTreeListEntry& rEntry) SAL_OVERRIDE; private: VclPtr<CustomAnimationList> mpParent; OUString maDescription; @@ -241,10 +241,10 @@ void CustomAnimationListEntryItem::InitViewData( SvTreeListBox* pView, SvTreeLis } void CustomAnimationListEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* pEntry) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& rEntry) { - const SvViewDataItem* pViewData = mpParent->GetViewDataItem(pEntry, this); + const SvViewDataItem* pViewData = mpParent->GetViewDataItem(&rEntry, this); Point aPos(rPos); Size aSize(pViewData->maSize); @@ -348,7 +348,7 @@ public: SvLBoxItem* Create() const SAL_OVERRIDE; void Clone( SvLBoxItem* pSource ) SAL_OVERRIDE; virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) SAL_OVERRIDE; private: OUString maDescription; @@ -375,7 +375,7 @@ void CustomAnimationTriggerEntryItem::InitViewData( SvTreeListBox* pView, SvTree } void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rDev, vcl::RenderContext& rRenderContext, - const SvViewDataEntry* /*pView*/, const SvTreeListEntry* /*pEntry*/) + const SvViewDataEntry* /*pView*/, const SvTreeListEntry& /*rEntry*/) { Size aSize(rRenderContext.GetOutputSizePixel().Width(), static_cast<SvTreeListBox*>(&rDev)->GetEntryHeight()); |