[Libreoffice-commits] core.git: 4 commits - sc/source sw/source
Caolán McNamara
caolanm at redhat.com
Fri Dec 12 04:22:23 PST 2014
sc/source/filter/excel/xetable.cxx | 11 +++++++----
sc/source/filter/lotus/tool.cxx | 4 ++++
sw/source/core/doc/doccomp.cxx | 2 ++
sw/source/core/draw/dpage.cxx | 2 +-
4 files changed, 14 insertions(+), 5 deletions(-)
New commits:
commit 886f962d3a0875729d02a4ba4f169f7ab9400a42
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 12 12:20:50 2014 +0000
coverity#1257108 Explicit null dereferenced
Change-Id: Ic4d9c99c8a2b994cec8828808d02a46ec6a18e2c
diff --git a/sw/source/core/draw/dpage.cxx b/sw/source/core/draw/dpage.cxx
index ac547c5..24f2d35 100644
--- a/sw/source/core/draw/dpage.cxx
+++ b/sw/source/core/draw/dpage.cxx
@@ -79,7 +79,7 @@ void SwDPage::lateInit(const SwDPage& rPage, SwDrawModel* const pNewModel)
FmFormPage::lateInit( rPage, pNewModel );
SwDrawModel* pSwDrawModel = pNewModel;
- if ( !pModel )
+ if (!pSwDrawModel)
{
pSwDrawModel = &dynamic_cast<SwDrawModel&>(*GetModel());
assert( pSwDrawModel );
commit 956de90c043ac43c21fb6043be338f50c4d7e055
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 12 12:13:39 2014 +0000
coverity#1242728 Use of untrusted scalar value
and
coverity#1242836 Use of untrusted scalar value
coverity#1242927 Use of untrusted scalar value
coverity#1242937 Use of untrusted scalar value
coverity#1242942 Use of untrusted scalar value
Change-Id: I66b602c27ee78ba80baab74dfb49ae90df45cbdc
diff --git a/sc/source/filter/lotus/tool.cxx b/sc/source/filter/lotus/tool.cxx
index 3bc635c..03751d2 100644
--- a/sc/source/filter/lotus/tool.cxx
+++ b/sc/source/filter/lotus/tool.cxx
@@ -85,6 +85,10 @@ void PutFormString(LotusContext& rContext, SCCOL nCol, SCROW nRow, SCTAB nTab, s
void SetFormat(LotusContext& rContext, SCCOL nCol, SCROW nRow, SCTAB nTab, sal_uInt8 nFormat, sal_uInt8 nSt)
{
+ nCol = SanitizeCol(nCol);
+ nRow = SanitizeRow(nRow);
+ nRow = SanitizeTab(nTab);
+
// PREC: nSt = default number of decimal places
rContext.pDoc->ApplyAttr(nCol, nRow, nTab, *(rContext.pValueFormCache->GetAttr(nFormat, nSt)));
commit 4f8029066aff39c2b0be5081bff6de79aa2f0002
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 12 12:05:48 2014 +0000
coverity#1257735 Logically dead code
Change-Id: Ia96d9b4ead01e6ba68d97e933cae7c97a75efdf1
diff --git a/sc/source/filter/excel/xetable.cxx b/sc/source/filter/excel/xetable.cxx
index 84fdaec..059d4d9 100644
--- a/sc/source/filter/excel/xetable.cxx
+++ b/sc/source/filter/excel/xetable.cxx
@@ -2065,12 +2065,15 @@ void XclExpRowBuffer::Finalize( XclExpDefaultRowData& rDefRowData, const ScfUInt
GetProgressBar().ActivateFinalRowsSegment();
+#if 0
// This is staggeringly slow, and each element operates only
// on its own data.
- size_t nRows = maRowMap.size();
- size_t nThreads = std::max( std::thread::hardware_concurrency(), 1U );
- nThreads = 1; // globally disable multi-threading for now.
- if ( nThreads == 1 || nRows < 128 )
+ const size_t nRows = maRowMap.size();
+ const size_t nThreads = nRows < 128 ? 1 : std::max(std::thread::hardware_concurrency(), 1U);
+#else
+ const size_t nThreads = 1; // globally disable multi-threading for now.
+#endif
+ if (nThreads == 1)
{
RowMap::iterator itr, itrBeg = maRowMap.begin(), itrEnd = maRowMap.end();
for (itr = itrBeg; itr != itrEnd; ++itr)
commit 11a0890b6cfeea9c3609ea454882194a2f05d943
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Dec 12 12:00:42 2014 +0000
coverity#1257736 Explicit null dereferenced
Change-Id: I2cd312255f80e22ead614d0ea12a2130fb8bbeaa
diff --git a/sw/source/core/doc/doccomp.cxx b/sw/source/core/doc/doccomp.cxx
index 1fab4e4..65073dd 100644
--- a/sw/source/core/doc/doccomp.cxx
+++ b/sw/source/core/doc/doccomp.cxx
@@ -1935,6 +1935,8 @@ sal_uInt16 SaveMergeRedline::InsertRedline(SwPaM* pLastDestRedline)
break;
case POS_OUTSIDE:
+ assert(pDestRedl && "is this actually impossible");
+ if (pDestRedl)
{
SwRangeRedline* pCpyRedl = new SwRangeRedline(
pDestRedl->GetRedlineData(), *pDStt );
More information about the Libreoffice-commits
mailing list