summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui/content.cxx
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-10-21 09:53:37 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-21 11:31:00 +0200
commit3f8a890dceb38427774abdcb0803d1f56f621c9d (patch)
tree6172692ec9c8025ee42e9144a800a4b9a99e301a /sw/source/uibase/utlui/content.cxx
parent52d68e39c749de45cbec4c9114c8d10d65d45936 (diff)
tdf#120703 (PVS): redundant nullptr checks, redundant assign
V668 There is no sense in testing the 'pMember' pointer against null, as the memory was allocated using the 'new' operator. The exception will be generated in the case of memory allocation error. V519 The 'pObject' variable is assigned values twice successively. Perhaps this is a mistake. Check lines: 2876, 2877. Change-Id: I0c801c97e75da99bf39f7a14306e67abfb8a3d85 Reviewed-on: https://gerrit.libreoffice.org/62123 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/source/uibase/utlui/content.cxx')
-rw-r--r--sw/source/uibase/utlui/content.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index a12b334dddc9..65e5d0395c40 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -740,10 +740,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
case ContentTypeId::POSTIT:
{
nMemberCount = 0;
- if(!pMember)
- pMember.reset( new SwContentArr );
- else
- pMember->clear();
+ pMember->clear();
SwPostItMgr* aMgr = pWrtShell->GetView().GetPostItMgr();
if (aMgr)
{
@@ -772,10 +769,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
case ContentTypeId::DRAWOBJECT:
{
nMemberCount = 0;
- if(!pMember)
- pMember.reset( new SwContentArr );
- else
- pMember->clear();
+ pMember->clear();
IDocumentDrawModelAccess& rIDDMA = pWrtShell->getIDocumentDrawModelAccess();
SwDrawModel* pModel = rIDDMA.GetDrawModel();
@@ -2865,9 +2859,7 @@ void SwContentTree::KeyInput(const KeyEvent& rEvent)
const size_t nCount = pPage->GetObjCount();
bool hasObjectMarked = false;
- SdrObject* pObject = nullptr;
- pObject = GetDrawingObjectsByContent( pCnt );
- if( pObject )
+ if (SdrObject* pObject = GetDrawingObjectsByContent(pCnt))
{
SdrPageView* pPV = pDrawView->GetSdrPageView/*GetPageViewPvNum*/(/*0*/);
if( pPV )