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 /include/svtools | |
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 'include/svtools')
-rw-r--r-- | include/svtools/svlbitm.hxx | 8 | ||||
-rw-r--r-- | include/svtools/treelistbox.hxx | 6 |
2 files changed, 7 insertions, 7 deletions
diff --git a/include/svtools/svlbitm.hxx b/include/svtools/svlbitm.hxx index 479d5c02c6a4..5811b1a8a5c0 100644 --- a/include/svtools/svlbitm.hxx +++ b/include/svtools/svlbitm.hxx @@ -131,7 +131,7 @@ public: virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; virtual void Clone(SvLBoxItem* pSource) SAL_OVERRIDE; @@ -146,7 +146,7 @@ public: virtual sal_uInt16 GetType() const SAL_OVERRIDE; virtual void InitViewData( SvTreeListBox*,SvTreeListEntry*,SvViewDataItem* ) 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; virtual SvLBoxItem* Create() const SAL_OVERRIDE; virtual void Clone( SvLBoxItem* pSource ) SAL_OVERRIDE; }; @@ -182,7 +182,7 @@ public: SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; @@ -269,7 +269,7 @@ public: SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, - const SvTreeListEntry* pEntry) SAL_OVERRIDE; + const SvTreeListEntry& rEntry) SAL_OVERRIDE; virtual SvLBoxItem* Create() const SAL_OVERRIDE; virtual void Clone(SvLBoxItem* pSource) SAL_OVERRIDE; diff --git a/include/svtools/treelistbox.hxx b/include/svtools/treelistbox.hxx index aaf6997052b1..f0d112d3e07a 100644 --- a/include/svtools/treelistbox.hxx +++ b/include/svtools/treelistbox.hxx @@ -167,7 +167,7 @@ public: const Size& GetSize(const SvTreeListBox* pView, const SvTreeListEntry* pEntry) const; static const Size& GetSize(const SvViewDataEntry* pData, sal_uInt16 nItemPos); - virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, const SvTreeListEntry* pEntry) = 0; + virtual void Paint(const Point& rPos, SvTreeListBox& rOutDev, vcl::RenderContext& rRenderContext, const SvViewDataEntry* pView, const SvTreeListEntry& rEntry) = 0; virtual void InitViewData(SvTreeListBox* pView, SvTreeListEntry* pEntry, // If != 0: this Pointer must be used! @@ -576,7 +576,7 @@ protected: SVT_DLLPRIVATE void AdjustEntryHeight( const vcl::Font& rFont ); SVT_DLLPRIVATE void ImpEntryInserted( SvTreeListEntry* pEntry ); - SVT_DLLPRIVATE long PaintEntry1( SvTreeListEntry*, long nLine, vcl::RenderContext& rRenderContext, + SVT_DLLPRIVATE long PaintEntry1( SvTreeListEntry&, long nLine, vcl::RenderContext& rRenderContext, SvLBoxTabFlags nTabFlagMask = SvLBoxTabFlags::ALL, bool bHasClipRegion=false ); @@ -617,7 +617,7 @@ protected: virtual void Command( const CommandEvent& rCEvt ) SAL_OVERRIDE; virtual void RequestHelp( const HelpEvent& rHEvt ) SAL_OVERRIDE; - virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry* pEntry); + virtual void PreparePaint(vcl::RenderContext& rRenderContext, SvTreeListEntry& rEntry); virtual void DataChanged( const DataChangedEvent& rDCEvt ) SAL_OVERRIDE; void InitSettings(bool bFont, bool bForeground, bool bBackground); |