silence coverity#1414485 Uninitialized pointer field

Change-Id: If62f528b1118aee702f364aa448e36230512fac6
Reviewed-on: https://gerrit.libreoffice.org/39572
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2017-07-05 11:12:58 +01:00
parent 12a3f5cefe
commit ad0e7d5734
2 changed files with 3 additions and 5 deletions

View File

@@ -54,14 +54,11 @@ public:
struct BlockInfo final struct BlockInfo final
{ {
BigPtrArray* const BigPtrArray* pBigArr; ///< in this array the block is located
pBigArr; ///< in this array the block is located
std::array<BigPtrEntry*, MAXENTRY> std::array<BigPtrEntry*, MAXENTRY>
mvData; ///< data block mvData; ///< data block
sal_uLong nStart, nEnd; ///< start- and end index sal_uLong nStart, nEnd; ///< start- and end index
sal_uInt16 nElem; ///< number of elements sal_uInt16 nElem; ///< number of elements
BlockInfo(BigPtrArray* b) : pBigArr(b) {}
}; };
class SW_DLLPUBLIC BigPtrArray class SW_DLLPUBLIC BigPtrArray

View File

@@ -156,7 +156,7 @@ void BigPtrArray::UpdIndex( sal_uInt16 pos )
*/ */
BlockInfo* BigPtrArray::InsBlock( 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 ); m_vpInf.insert( m_vpInf.begin() + pos, p );
if( pos ) if( pos )
@@ -166,6 +166,7 @@ BlockInfo* BigPtrArray::InsBlock( sal_uInt16 pos )
p->nEnd--; // no elements p->nEnd--; // no elements
p->nElem = 0; p->nElem = 0;
p->pBigArr = this;
return p; return p;
} }