[Libreoffice-commits] core.git: svl/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Sun Oct 21 19:09:49 UTC 2018
svl/source/svdde/ddesvr.cxx | 11 ++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
New commits:
commit e473d49f5666382a8d5b696a00330a55c889f56e
Author: Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Sun Oct 21 17:08:51 2018 +0200
Commit: Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Sun Oct 21 21:09:27 2018 +0200
tdf#120703 (PVS): redundant nullptr check; loop index size
V668 There is no sense in testing the 's' pointer against null, as the
memory was allocated using the 'new' operator. The exception will
be generated in the case of memory allocation error.
V1029 Numeric Truncation Error. Result of the 'size' function is written
to the 16-bit variable.
Change-Id: I8e0598e892ca160ac074bccfed87c14367a3b46a
Reviewed-on: https://gerrit.libreoffice.org/62139
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
diff --git a/svl/source/svdde/ddesvr.cxx b/svl/source/svdde/ddesvr.cxx
index 1848342b893b..b9b6bcce4660 100644
--- a/svl/source/svdde/ddesvr.cxx
+++ b/svl/source/svdde/ddesvr.cxx
@@ -577,11 +577,8 @@ DdeItem* DdeTopic::AddItem( const DdeItem& r )
else
s = new DdeItem( r );
- if ( s )
- {
- aItems.push_back( s );
- s->pMyTopic = this;
- }
+ aItems.push_back( s );
+ s->pMyTopic = this;
return s;
}
@@ -770,9 +767,9 @@ short DdeItem::GetLinks()
short nCnt = 0;
if( pImpData )
{
- for( sal_uInt16 n = pImpData->size(); n; )
+ for (const auto& rData : *pImpData)
{
- nCnt = nCnt + (*pImpData)[ --n ].nCnt;
+ nCnt += rData.nCnt;
}
}
return nCnt;
More information about the Libreoffice-commits
mailing list