diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 13:42:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-27 14:34:36 +0200 |
commit | b06657fca57b02ffb267a168bc9323780aeafbef (patch) | |
tree | df0a90322c17d3f92065bd22efec8d4ae36579c3 /sw/inc/bparr.hxx | |
parent | 2c355e3a76b7a167a61200ab749b2d88d5fbe3a7 (diff) |
use std::array in BlockInfo
Change-Id: I28a13592e5993454ae96b0a32ba328013da7856e
Reviewed-on: https://gerrit.libreoffice.org/39296
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/inc/bparr.hxx')
-rw-r--r-- | sw/inc/bparr.hxx | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/sw/inc/bparr.hxx b/sw/inc/bparr.hxx index 46260762b9d4..c51e959ada1d 100644 --- a/sw/inc/bparr.hxx +++ b/sw/inc/bparr.hxx @@ -24,6 +24,7 @@ #include <tools/solar.h> #include <swdllapi.h> +#include <array> struct BlockInfo; class BigPtrArray; @@ -31,8 +32,8 @@ class BigPtrArray; class BigPtrEntry { friend class BigPtrArray; - BlockInfo* m_pBlock; - sal_uInt16 m_nOffset; + BlockInfo* m_pBlock; + sal_uInt16 m_nOffset; public: BigPtrEntry() : m_pBlock(nullptr), m_nOffset(0) {} virtual ~BigPtrEntry() {} @@ -50,11 +51,16 @@ public: // if complete compression is desired, 100 has to be specified #define COMPRESSLVL 80 -struct BlockInfo { - BigPtrArray* pBigArr; ///< in this array the block is located - BigPtrEntry** pData; ///< data block - sal_uLong nStart, nEnd; ///< start- and end index - sal_uInt16 nElem; ///< number of elements +struct BlockInfo final +{ + BigPtrArray* const + pBigArr; ///< in this array the block is located + std::array<BigPtrEntry*, MAXENTRY> + 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 @@ -91,7 +97,7 @@ public: inline sal_uLong BigPtrEntry::GetPos() const { - assert(this == m_pBlock->pData[ m_nOffset ]); // element not in the block + assert(this == m_pBlock->mvData[ m_nOffset ]); // element not in the block return m_pBlock->nStart + m_nOffset; } |