summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sc/source/ui/inc/conflictsdlg.hxx2
-rw-r--r--sc/source/ui/miscdlgs/conflictsdlg.cxx22
2 files changed, 12 insertions, 12 deletions
diff --git a/sc/source/ui/inc/conflictsdlg.hxx b/sc/source/ui/inc/conflictsdlg.hxx
index 5e1b742e7a4c..818023d75269 100644
--- a/sc/source/ui/inc/conflictsdlg.hxx
+++ b/sc/source/ui/inc/conflictsdlg.hxx
@@ -83,7 +83,7 @@ private:
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 ee8104724c02..82270b55c0d2 100644
--- a/sc/source/ui/miscdlgs/conflictsdlg.cxx
+++ b/sc/source/ui/miscdlgs/conflictsdlg.cxx
@@ -155,13 +155,13 @@ ScConflictsListEntry* ScConflictsFinder::GetIntersectingEntry( const ScChangeAct
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 @@ ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, cons
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 @@ ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, cons
if ( pEntry )
{
pEntry->maSharedActions.push_back( nSharedAction );
- return pEntry;
+ return *pEntry;
}
}
@@ -190,7 +190,7 @@ ScConflictsListEntry* ScConflictsFinder::GetEntry( sal_uLong nSharedAction, cons
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 @@ bool ScConflictsFinder::Find()
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 @@ void ScConflictsDlg::UpdateView()
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 )