[Libreoffice-commits] core.git: sw/source
Caolán McNamara
caolanm at redhat.com
Fri Oct 20 11:16:11 UTC 2017
sw/source/uibase/utlui/content.cxx | 4 ++++
1 file changed, 4 insertions(+)
New commits:
commit e79d4129dc2ecbd7f1ce75eb36f743621a0480a6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Oct 20 10:26:10 2017 +0100
coverity#705523 silence Dereference null return value
Change-Id: Ic7719a543b341ca78264a24568b63cc69069c8e5
Reviewed-on: https://gerrit.libreoffice.org/43592
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 65138aac5fd3..c07efed0fd54 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -2069,6 +2069,7 @@ bool SwContentTree::HasContentChanged()
for(size_t j = 0; j < nChildCount; ++j)
{
pEntry = Next(pEntry);
+ assert(pEntry);
const SwContent* pCnt = pArrType->GetMember(j);
pEntry->SetUserData(const_cast<SwContent *>(pCnt));
OUString sEntryText = GetEntryText(pEntry);
@@ -2139,6 +2140,7 @@ bool SwContentTree::HasContentChanged()
for(size_t j = 0; j < nChildCount; ++j)
{
pEntry = Next(pEntry);
+ assert(pEntry);
bNext = false;
const SwContent* pCnt = pArrType->GetMember(j);
pEntry->SetUserData(const_cast<SwContent *>(pCnt));
@@ -2172,6 +2174,7 @@ bool SwContentTree::HasContentChanged()
for(size_t j = 0; j < nChildCount; ++j)
{
const SwContent* pCnt = pArrType->GetMember(j);
+ assert(pChild);
pChild->SetUserData(const_cast<SwContent *>(pCnt));
OUString sEntryText = GetEntryText(pChild);
if( sEntryText != pCnt->GetName() &&
@@ -2187,6 +2190,7 @@ bool SwContentTree::HasContentChanged()
for(size_t j = 0; j < nChildCount; ++j)
{
pChild = Next(pRemove);
+ assert(pRemove);
GetModel()->Remove(pRemove);
pRemove = pChild;
}
More information about the Libreoffice-commits
mailing list