From ad0e7d5734b3b759b1ef4aa794e2a31d79a2ecd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 5 Jul 2017 11:12:58 +0100 Subject: [PATCH] silence coverity#1414485 Uninitialized pointer field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If62f528b1118aee702f364aa448e36230512fac6 Reviewed-on: https://gerrit.libreoffice.org/39572 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- sw/inc/bparr.hxx | 5 +---- sw/source/core/bastyp/bparr.cxx | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx index 90f00231fa3d..04b77eb16dee 100644 --- a/sw/inc/bparr.hxx +++ b/sw/inc/bparr.hxx @@ -54,14 +54,11 @@ public: struct BlockInfo final { - BigPtrArray* const - pBigArr; ///< in this array the block is located + BigPtrArray* pBigArr; ///< in this array the block is located std::array mvData; ///< data block sal_uLong nStart, nEnd; ///< start- and end index sal_uInt16 nElem; ///< number of elements - - BlockInfo(BigPtrArray* b) : pBigArr(b) {} }; class SW_DLLPUBLIC BigPtrArray diff --git a/sw/source/core/bastyp/bparr.cxx b/sw/source/core/bastyp/bparr.cxx index 2cb854a402b0..8d7124a470ac 100644 --- a/sw/source/core/bastyp/bparr.cxx +++ b/sw/source/core/bastyp/bparr.cxx @@ -156,7 +156,7 @@ void BigPtrArray::UpdIndex( sal_uInt16 pos ) */ BlockInfo* BigPtrArray::InsBlock( sal_uInt16 pos ) { - BlockInfo* p = new BlockInfo(this); + BlockInfo* p = new BlockInfo; m_vpInf.insert( m_vpInf.begin() + pos, p ); if( pos ) @@ -166,6 +166,7 @@ BlockInfo* BigPtrArray::InsBlock( sal_uInt16 pos ) p->nEnd--; // no elements p->nElem = 0; + p->pBigArr = this; return p; }