summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorLuboš Luňák <l.lunak@collabora.com>2022-05-18 11:08:30 +0200
committerLuboš Luňák <l.lunak@collabora.com>2022-05-18 15:17:29 +0200
commit11a626139a4a44422bb9eebe1cc7ef6f36b75276 (patch)
treefe045a11bc0c52c38b91a3140c65b39a464b4acb /sc
parent198381eb32edcc3e82d0f23df65f0804a08b44e6 (diff)
silence coverity warnings
Those fields are meant to be uninitialized by the ctor. And if they get used by mistake, I'd prefer to hear that from e.g. Valgrind rather than cover it up with some dummy default value. Change-Id: Ide57f84e9dc0fcc8c7395af99e216c7626d50913 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134512 Tested-by: Jenkins Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/queryiter.cxx3
-rw-r--r--sc/source/core/tool/rangecache.cxx1
2 files changed, 4 insertions, 0 deletions
diff --git a/sc/source/core/data/queryiter.cxx b/sc/source/core/data/queryiter.cxx
index aeb310c706b5..f1f41857fc4c 100644
--- a/sc/source/core/data/queryiter.cxx
+++ b/sc/source/core/data/queryiter.cxx
@@ -856,6 +856,7 @@ ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::Direct >
, rDoc( rDocument )
, mrContext( rContext )
{
+ // coverity[uninit_member] - this just contains data, subclass will initialize some of it
}
void ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::Direct >::InitPos()
@@ -1067,6 +1068,7 @@ ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::SortedCache >
, rDoc( rDocument )
, mrContext( rContext )
{
+ // coverity[uninit_member] - this just contains data, subclass will initialize some of it
}
void ScQueryCellIteratorAccessSpecific< ScQueryCellIteratorAccess::SortedCache >::SetSortedRangeCache(
@@ -1174,6 +1176,7 @@ public:
{
if(mSortedRows.empty())
return;
+ // coverity[uninit_member] - these are initialized only if valid
mLowIndex = 0;
mHighIndex = mSortedRows.size() - 1;
mValid = true;
diff --git a/sc/source/core/tool/rangecache.cxx b/sc/source/core/tool/rangecache.cxx
index f188342871c3..434ba2e6de1b 100644
--- a/sc/source/core/tool/rangecache.cxx
+++ b/sc/source/core/tool/rangecache.cxx
@@ -109,6 +109,7 @@ ScSortedRangeCache::ScSortedRangeCache(ScDocument* pDoc, const ScRange& rRange,
std::vector<RowData> rowData;
// Try to reuse as much ScQueryEvaluator code as possible, this should
// basically do the same comparisons.
+ assert(pDoc->FetchTable(nTab) != nullptr);
ScQueryEvaluator evaluator(*pDoc, *pDoc->FetchTable(nTab), param, context);
for (SCROW nRow = startRow; nRow <= endRow; ++nRow)
{