tdf#120703 PVS: Let ScConflictsFinder::GetEntry return reference

V560 A part of conditional expression is always true: pEntry.

V560 A part of conditional expression is always true: pConflictEntry.

Change-Id: I54fad2b0236c8c686f470a50ce45b096a842d56a
Reviewed-on: https://gerrit.libreoffice.org/63519
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx
index 5e1b742..818023d75 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -83,7 +83,7 @@

    static bool             DoActionsIntersect( const ScChangeAction* pAction1, const ScChangeAction* pAction2 );
    ScConflictsListEntry*   GetIntersectingEntry( const ScChangeAction* pAction ) const;
    ScConflictsListEntry*   GetEntry( sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions );
    ScConflictsListEntry&   GetEntry(sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions);

public:
                            ScConflictsFinder( ScChangeTrack* pTrack, sal_uLong nStartShared, sal_uLong nEndShared,
diff --git a/sc/source/ui/miscdlgs/conflictsdlg.cxx b/sc/source/ui/miscdlgs/conflictsdlg.cxx
index ee81047..82270b5 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -155,13 +155,13 @@
    return nullptr;
}

ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions )
ScConflictsListEntry& ScConflictsFinder::GetEntry( sal_uLong nSharedAction, const std::vector<sal_uLong>& rOwnActions )
{
    // try to get a list entry which already contains the shared action
    ScConflictsListEntry* pEntry = ScConflictsListHelper::GetSharedActionEntry( mrConflictsList, nSharedAction );
    if ( pEntry )
    {
        return pEntry;
        return *pEntry;
    }

    // try to get a list entry for which the shared action intersects with any
@@ -170,7 +170,7 @@
    if ( pEntry )
    {
        pEntry->maSharedActions.push_back( nSharedAction );
        return pEntry;
        return *pEntry;
    }

    // try to get a list entry for which any of the own actions intersects with
@@ -181,7 +181,7 @@
        if ( pEntry )
        {
            pEntry->maSharedActions.push_back( nSharedAction );
            return pEntry;
            return *pEntry;
        }
    }

@@ -190,7 +190,7 @@
    aEntry.meConflictAction = SC_CONFLICT_ACTION_NONE;
    aEntry.maSharedActions.push_back( nSharedAction );
    mrConflictsList.push_back( aEntry );
    return &(mrConflictsList.back());
    return mrConflictsList.back();
}

bool ScConflictsFinder::Find()
@@ -217,12 +217,12 @@

        if ( !aOwnActions.empty() )
        {
            ScConflictsListEntry* pEntry = GetEntry( pSharedAction->GetActionNumber(), aOwnActions );
            ScConflictsListEntry& rEntry = GetEntry(pSharedAction->GetActionNumber(), aOwnActions);
            for ( auto& aOwnAction : aOwnActions )
            {
                if ( pEntry && !ScConflictsListHelper::HasOwnAction( mrConflictsList, aOwnAction ) )
                if (!ScConflictsListHelper::HasOwnAction(mrConflictsList, aOwnAction))
                {
                    pEntry->maOwnActions.push_back( aOwnAction );
                    rEntry.maOwnActions.push_back(aOwnAction);
                }
            }
            bReturn = true;
@@ -631,11 +631,11 @@
    ScConflictsList::iterator aEndItr = mrConflictsList.end();
    for ( ScConflictsList::iterator aItr = mrConflictsList.begin(); aItr != aEndItr; ++aItr )
    {
        ScConflictsListEntry* pConflictEntry = &(*aItr);
        if ( pConflictEntry && pConflictEntry->meConflictAction == SC_CONFLICT_ACTION_NONE )
        ScConflictsListEntry& rConflictEntry = *aItr;
        if (rConflictEntry.meConflictAction == SC_CONFLICT_ACTION_NONE)
        {
            RedlinData* pRootUserData = new RedlinData();
            pRootUserData->pData = static_cast< void* >( pConflictEntry );
            pRootUserData->pData = static_cast<void*>(&rConflictEntry);
            SvTreeListEntry* pRootEntry = m_pLbConflicts->InsertEntry( GetConflictString( *aItr ), pRootUserData );

            for ( auto& aSharedAction : aItr->maSharedActions )