Kaydet (Commit) 79fe112c authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

Simplify ScCompressedArray constructor

nobody is setting a custom delta

Change-Id: I5dd9ac691fb226697eb8cb2b6b0b673552a4f049
Reviewed-on: https://gerrit.libreoffice.org/43437Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst b8c6a348
......@@ -25,8 +25,6 @@
#include "scdllapi.h"
const size_t nScCompressedArrayDelta = 4;
/** Compressed array of row (or column) entries, e.g. heights, flags, ...
The array stores ranges of values such that equal consecutive values occupy only
......@@ -70,8 +68,7 @@ public:
/** Construct with nMaxAccess=MAXROW, for example. */
ScCompressedArray( A nMaxAccess,
const D& rValue,
size_t nDelta = nScCompressedArrayDelta );
const D& rValue );
/** Construct from a plain array of D */
ScCompressedArray( A nMaxAccess,
const D* pDataArray, size_t nDataCount );
......@@ -119,7 +116,6 @@ public:
protected:
size_t nCount;
size_t nLimit;
size_t nDelta;
DataEntry* pData;
A nMaxAccess;
};
......@@ -176,9 +172,8 @@ template< typename A, typename D > class ScBitMaskCompressedArray : public ScCom
{
public:
ScBitMaskCompressedArray( A nMaxAccessP,
const D& rValue,
size_t nDeltaP = nScCompressedArrayDelta )
: ScCompressedArray<A,D>( nMaxAccessP, rValue, nDeltaP)
const D& rValue )
: ScCompressedArray<A,D>( nMaxAccessP, rValue )
{}
ScBitMaskCompressedArray( A nMaxAccessP,
const D* pDataArray, size_t nDataCount )
......
......@@ -23,12 +23,12 @@
#include <algorithm>
static const size_t nScCompressedArrayDelta = 4;
template< typename A, typename D >
ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D& rValue,
size_t nDeltaP )
ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D& rValue )
: nCount(1)
, nLimit(1)
, nDelta( nDeltaP > 0 ? nDeltaP : 1)
, pData( new DataEntry[1])
, nMaxAccess( nMaxAccessP)
{
......@@ -41,7 +41,6 @@ ScCompressedArray<A,D>::ScCompressedArray( A nMaxAccessP, const D* pDataArray,
size_t nDataCount )
: nCount(0)
, nLimit( nDataCount)
, nDelta( nScCompressedArrayDelta)
, pData( new DataEntry[nDataCount])
, nMaxAccess( nMaxAccessP)
{
......@@ -127,7 +126,7 @@ void ScCompressedArray<A,D>::SetValue( A nStart, A nEnd, const D& rValue )
size_t nNeeded = nCount + 2;
if (nLimit < nNeeded)
{
nLimit += nDelta;
nLimit += nScCompressedArrayDelta;
if (nLimit < nNeeded)
nLimit = nNeeded;
DataEntry* pNewData = new DataEntry[nLimit];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment