diff options
author | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-14 23:19:21 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@suse.com> | 2011-11-15 00:34:56 -0500 |
commit | 10afa30240edec37a052ee87ff5b5e36c615abcd (patch) | |
tree | 8d305a302ab64565a14e31f78a25fc6b303c00a3 /sc | |
parent | 011878812eac685b76a925fa9ffb17a152c27e6a (diff) |
Used std::vector instead of C-style array.
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/core/data/dptablecache.cxx | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/sc/source/core/data/dptablecache.cxx b/sc/source/core/data/dptablecache.cxx index cbf90653afb4..ecfab69a1868 100644 --- a/sc/source/core/data/dptablecache.cxx +++ b/sc/source/core/data/dptablecache.cxx @@ -582,12 +582,8 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const return true; bool bMatchWholeCell = mpDoc->GetDocOptions().IsMatchWholeCell(); - //--------------------------------------------------------------- - - const SCSIZE nFixedBools = 32; - bool aBool[nFixedBools]; SCSIZE nEntryCount = rParam.GetEntryCount(); - bool* pPasst = ( nEntryCount <= nFixedBools ? &aBool[0] : new bool[nEntryCount] ); + std::vector<bool> aPassed(nEntryCount, false); long nPos = -1; CollatorWrapper* pCollator = (rParam.bCaseSens ? ScGlobal::GetCaseCollator() : @@ -753,31 +749,26 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam &rParam) const if (nPos == -1) { nPos++; - pPasst[nPos] = bOk; + aPassed[nPos] = bOk; } else { if (rEntry.eConnect == SC_AND) { - pPasst[nPos] = pPasst[nPos] && bOk; + aPassed[nPos] = aPassed[nPos] && bOk; } else { nPos++; - pPasst[nPos] = bOk; + aPassed[nPos] = bOk; } } } for (long j=1; j <= nPos; j++) - { - pPasst[0] = pPasst[0] || pPasst[j]; - } - - bool bRet = pPasst[0]; - if (pPasst != &aBool[0]) - delete [] pPasst; + aPassed[0] = aPassed[0] || aPassed[j]; + bool bRet = aPassed[0]; return bRet; } |