summaryrefslogtreecommitdiff
path: root/cui/source/customize/cfg.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-03-29 17:28:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-03-29 18:12:09 +0000
commit7cdbf12f20c51353d90010e06203407586284843 (patch)
tree34ba5c234356acbfa322a41f003c2d8eee337d15 /cui/source/customize/cfg.cxx
parent28d202cdc471585a7c7fba366b6247a561c8a5f7 (diff)
coverity#982292 Logically dead code
Change-Id: I7862ffc1ba51b1083e7cd1fe428fd9a0e134bc38
Diffstat (limited to 'cui/source/customize/cfg.cxx')
-rw-r--r--cui/source/customize/cfg.cxx49
1 files changed, 18 insertions, 31 deletions
diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx
index cb0ae07c63a7..e65a4fbe019c 100644
--- a/cui/source/customize/cfg.cxx
+++ b/cui/source/customize/cfg.cxx
@@ -2130,11 +2130,11 @@ void SvxConfigPage::MoveEntry( bool bMoveUp )
bool SvxConfigPage::MoveEntryData(
SvTreeListEntry* pSourceEntry, SvTreeListEntry* pTargetEntry )
{
- //modified by shizhoubo for issue53677
- if ( NULL == pSourceEntry || NULL == pTargetEntry )
- {
- return false;
- }
+ //#i53677#
+ if (NULL == pSourceEntry || NULL == pTargetEntry)
+ {
+ return false;
+ }
// Grab the entries list for the currently selected menu
SvxEntries* pEntries = GetTopLevelSelection()->GetEntries();
@@ -2142,39 +2142,26 @@ bool SvxConfigPage::MoveEntryData(
SvxConfigEntry* pSourceData =
(SvxConfigEntry*) pSourceEntry->GetUserData();
- if ( pTargetEntry == NULL )
- {
- RemoveEntry( pEntries, pSourceData );
- pEntries->insert(
- pEntries->begin(), pSourceData );
+ SvxConfigEntry* pTargetData =
+ (SvxConfigEntry*) pTargetEntry->GetUserData();
- GetSaveInData()->SetModified( true );
-
- return true;
- }
- else
+ if ( pSourceData != NULL && pTargetData != NULL )
{
- SvxConfigEntry* pTargetData =
- (SvxConfigEntry*) pTargetEntry->GetUserData();
-
- if ( pSourceData != NULL && pTargetData != NULL )
- {
- // remove the source entry from our list
- RemoveEntry( pEntries, pSourceData );
+ // remove the source entry from our list
+ RemoveEntry( pEntries, pSourceData );
- SvxEntries::iterator iter = pEntries->begin();
- SvxEntries::const_iterator end = pEntries->end();
+ SvxEntries::iterator iter = pEntries->begin();
+ SvxEntries::const_iterator end = pEntries->end();
- // advance the iterator to the position of the target entry
- while (*iter != pTargetData && ++iter != end) ;
+ // advance the iterator to the position of the target entry
+ while (*iter != pTargetData && ++iter != end) ;
- // insert the source entry at the position after the target
- pEntries->insert( ++iter, pSourceData );
+ // insert the source entry at the position after the target
+ pEntries->insert( ++iter, pSourceData );
- GetSaveInData()->SetModified( true );
+ GetSaveInData()->SetModified( true );
- return true;
- }
+ return true;
}
return false;