Kaydet (Commit) 7cdbf12f authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#982292 Logically dead code

Change-Id: I7862ffc1ba51b1083e7cd1fe428fd9a0e134bc38
üst 28d202cd
...@@ -2130,11 +2130,11 @@ void SvxConfigPage::MoveEntry( bool bMoveUp ) ...@@ -2130,11 +2130,11 @@ void SvxConfigPage::MoveEntry( bool bMoveUp )
bool SvxConfigPage::MoveEntryData( bool SvxConfigPage::MoveEntryData(
SvTreeListEntry* pSourceEntry, SvTreeListEntry* pTargetEntry ) SvTreeListEntry* pSourceEntry, SvTreeListEntry* pTargetEntry )
{ {
//modified by shizhoubo for issue53677 //#i53677#
if ( NULL == pSourceEntry || NULL == pTargetEntry ) if (NULL == pSourceEntry || NULL == pTargetEntry)
{ {
return false; return false;
} }
// Grab the entries list for the currently selected menu // Grab the entries list for the currently selected menu
SvxEntries* pEntries = GetTopLevelSelection()->GetEntries(); SvxEntries* pEntries = GetTopLevelSelection()->GetEntries();
...@@ -2142,39 +2142,26 @@ bool SvxConfigPage::MoveEntryData( ...@@ -2142,39 +2142,26 @@ bool SvxConfigPage::MoveEntryData(
SvxConfigEntry* pSourceData = SvxConfigEntry* pSourceData =
(SvxConfigEntry*) pSourceEntry->GetUserData(); (SvxConfigEntry*) pSourceEntry->GetUserData();
if ( pTargetEntry == NULL ) SvxConfigEntry* pTargetData =
{ (SvxConfigEntry*) pTargetEntry->GetUserData();
RemoveEntry( pEntries, pSourceData );
pEntries->insert(
pEntries->begin(), pSourceData );
GetSaveInData()->SetModified( true ); if ( pSourceData != NULL && pTargetData != NULL )
return true;
}
else
{ {
SvxConfigEntry* pTargetData = // remove the source entry from our list
(SvxConfigEntry*) pTargetEntry->GetUserData(); RemoveEntry( pEntries, pSourceData );
if ( pSourceData != NULL && pTargetData != NULL )
{
// remove the source entry from our list
RemoveEntry( pEntries, pSourceData );
SvxEntries::iterator iter = pEntries->begin(); SvxEntries::iterator iter = pEntries->begin();
SvxEntries::const_iterator end = pEntries->end(); SvxEntries::const_iterator end = pEntries->end();
// advance the iterator to the position of the target entry // advance the iterator to the position of the target entry
while (*iter != pTargetData && ++iter != end) ; while (*iter != pTargetData && ++iter != end) ;
// insert the source entry at the position after the target // insert the source entry at the position after the target
pEntries->insert( ++iter, pSourceData ); pEntries->insert( ++iter, pSourceData );
GetSaveInData()->SetModified( true ); GetSaveInData()->SetModified( true );
return true; return true;
}
} }
return false; return false;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment