summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-11-24 09:38:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2010-11-24 10:48:41 +0000
commit2a8d5bddcf6258885ddf3f077079929fcc5ae45c (patch)
tree66eb7ce959bf07ad5b9570db2afb5c2849352167
parentd255df37862a3b72029f68b8f3b4b342caecb071 (diff)
cppcheck: Redundant null pointer dereference
-rw-r--r--cui/source/tabpages/tpgradnt.cxx63
1 files changed, 30 insertions, 33 deletions
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index cc16a0501..4fe6ee437 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -682,41 +682,38 @@ IMPL_LINK( SvxGradientTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
if ( pGrdList->Load() )
{
- if ( pGrdList )
+ // Pruefen, ob Tabelle geloescht werden darf:
+ if ( pGradientList !=
+ ( (SvxAreaTabDialog*) DLGWIN )->GetGradientList() )
+ delete pGradientList;
+
+ pGradientList = pGrdList;
+ ( (SvxAreaTabDialog*) DLGWIN )->
+ SetNewGradientList( pGradientList );
+
+ aLbGradients.Clear();
+ aLbGradients.Fill( pGradientList );
+ Reset( rOutAttrs );
+
+ pGradientList->SetName( aURL.getName() );
+
+ // Ermitteln (evtl. abschneiden) des Namens und in
+ // der GroupBox darstellen
+ String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
+ aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+
+ if ( aURL.getBase().getLength() > 18 )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- if ( pGradientList !=
- ( (SvxAreaTabDialog*) DLGWIN )->GetGradientList() )
- delete pGradientList;
-
- pGradientList = pGrdList;
- ( (SvxAreaTabDialog*) DLGWIN )->
- SetNewGradientList( pGradientList );
-
- aLbGradients.Clear();
- aLbGradients.Fill( pGradientList );
- Reset( rOutAttrs );
-
- pGradientList->SetName( aURL.getName() );
-
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
-
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
-
- // Flag fuer gewechselt setzen
- *pnGradientListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnGradientListState &= ~CT_MODIFIED;
+ aString += String(aURL.getBase()).Copy( 0, 15 );
+ aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
}
+ else
+ aString += String(aURL.getBase());
+
+ // Flag fuer gewechselt setzen
+ *pnGradientListState |= CT_CHANGED;
+ // Flag fuer modifiziert entfernen
+ *pnGradientListState &= ~CT_MODIFIED;
LeaveWait();
}
else