[Libreoffice-commits] .: 6 commits - cui/source
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Nov 24 02:52:26 PST 2010
cui/source/tabpages/tpbitmap.cxx | 51 +++++++---------
cui/source/tabpages/tpcolor.cxx | 119 +++++++++++++++++++--------------------
cui/source/tabpages/tpgradnt.cxx | 63 +++++++++-----------
cui/source/tabpages/tphatch.cxx | 59 +++++++++----------
cui/source/tabpages/tplnedef.cxx | 37 +++++-------
cui/source/tabpages/tplneend.cxx | 35 +++++------
6 files changed, 173 insertions(+), 191 deletions(-)
New commits:
commit a04814e45e3c074cadaf480e216817e8195f08c3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 24 10:04:22 2010 +0000
cppcheck: Redundant null pointer check
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index 8e90d61..2ac03bf 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -738,39 +738,36 @@ IMPL_LINK( SvxHatchTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
pHatchList->SetName( aURL.getName() );
if( pHatchList->Load() )
{
- if( pHatchList )
+ // Pruefen, ob Tabelle geloescht werden darf:
+ if( pHatchingList != ( (SvxAreaTabDialog*) DLGWIN )->GetHatchingList() )
+ delete pHatchingList;
+
+ pHatchingList = pHatchList;
+ ( (SvxAreaTabDialog*) DLGWIN )->SetNewHatchingList( pHatchingList );
+
+ aLbHatchings.Clear();
+ aLbHatchings.Fill( pHatchingList );
+ Reset( rOutAttrs );
+
+ pHatchingList->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( pHatchingList != ( (SvxAreaTabDialog*) DLGWIN )->GetHatchingList() )
- delete pHatchingList;
-
- pHatchingList = pHatchList;
- ( (SvxAreaTabDialog*) DLGWIN )->SetNewHatchingList( pHatchingList );
-
- aLbHatchings.Clear();
- aLbHatchings.Fill( pHatchingList );
- Reset( rOutAttrs );
-
- pHatchingList->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
- *pnHatchingListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnHatchingListState &= ~CT_MODIFIED;
+ aString += String(aURL.getBase()).Copy( 0, 15 );
+ aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
}
+ else
+ aString += String(aURL.getBase());
+
+ // Flag fuer gewechselt setzen
+ *pnHatchingListState |= CT_CHANGED;
+ // Flag fuer modifiziert entfernen
+ *pnHatchingListState &= ~CT_MODIFIED;
}
else
ErrorBox( DLGWIN, WinBits( WB_OK ),
commit 2a12b730800cf59978c9222b4498ded42faea911
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 24 10:03:11 2010 +0000
cppcheck: Redundant null pointer check
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 9bf4526..7987339 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -786,26 +786,23 @@ IMPL_LINK( SvxLineDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
if( pDshLst->Load() )
{
- if( pDshLst )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pDashList != ( (SvxLineTabDialog*) DLGWIN )->GetDashList() )
- delete pDashList;
-
- pDashList = pDshLst;
- ( (SvxLineTabDialog*) DLGWIN )->SetNewDashList( pDashList );
-
- aLbLineStyles.Clear();
- aLbLineStyles.Fill( pDashList );
- Reset( rOutAttrs );
-
- pDashList->SetName( aURL.getName() );
-
- // Flag fuer gewechselt setzen
- *pnDashListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnDashListState &= ~CT_MODIFIED;
- }
+ // Pruefen, ob Tabelle geloescht werden darf:
+ if( pDashList != ( (SvxLineTabDialog*) DLGWIN )->GetDashList() )
+ delete pDashList;
+
+ pDashList = pDshLst;
+ ( (SvxLineTabDialog*) DLGWIN )->SetNewDashList( pDashList );
+
+ aLbLineStyles.Clear();
+ aLbLineStyles.Fill( pDashList );
+ Reset( rOutAttrs );
+
+ pDashList->SetName( aURL.getName() );
+
+ // Flag fuer gewechselt setzen
+ *pnDashListState |= CT_CHANGED;
+ // Flag fuer modifiziert entfernen
+ *pnDashListState &= ~CT_MODIFIED;
}
else
//aIStream.Close();
commit eefa4af6cd549ab18547ebd07e660818bdf42356
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 24 10:02:29 2010 +0000
cppcheck: Redundant null pointer check
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index fdf4da0..671e12c 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -598,25 +598,22 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
pLeList->SetName( aURL.getName() );
if( pLeList->Load() )
{
- if( pLeList )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pLineEndList != ( (SvxLineTabDialog*) DLGWIN )->GetLineEndList() )
- delete pLineEndList;
-
- pLineEndList = pLeList;
- ( (SvxLineTabDialog*) DLGWIN )->SetNewLineEndList( pLineEndList );
- aLbLineEnds.Clear();
- aLbLineEnds.Fill( pLineEndList );
- Reset( rOutAttrs );
-
- pLineEndList->SetName( aURL.getName() );
-
- // Flag fuer gewechselt setzen
- *pnLineEndListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnLineEndListState &= ~CT_MODIFIED;
- }
+ // Pruefen, ob Tabelle geloescht werden darf:
+ if( pLineEndList != ( (SvxLineTabDialog*) DLGWIN )->GetLineEndList() )
+ delete pLineEndList;
+
+ pLineEndList = pLeList;
+ ( (SvxLineTabDialog*) DLGWIN )->SetNewLineEndList( pLineEndList );
+ aLbLineEnds.Clear();
+ aLbLineEnds.Fill( pLineEndList );
+ Reset( rOutAttrs );
+
+ pLineEndList->SetName( aURL.getName() );
+
+ // Flag fuer gewechselt setzen
+ *pnLineEndListState |= CT_CHANGED;
+ // Flag fuer modifiziert entfernen
+ *pnLineEndListState &= ~CT_MODIFIED;
}
else
ErrorBox( DLGWIN, WinBits( WB_OK ),
commit b9207a4215e53e81a8ba95b19e1eec336055e714
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 24 09:55:28 2010 +0000
cppcheck: Redundant null pointer check
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 5897c2d..bbc0ddf 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -759,74 +759,71 @@ IMPL_LINK( SvxColorTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
pColTab->SetName( aURL.getName() ); // XXX
if( pColTab->Load() )
{
- if( pColTab )
+ // Pruefen, ob Tabelle geloescht werden darf:
+ const XColorTable *pTempTable = 0;
+ SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN );
+ SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN );
+ if( pArea )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- const XColorTable *pTempTable = 0;
- SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN );
- SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN );
- if( pArea )
- {
- pTempTable = pArea->GetColorTable();
- }
- else if( pLine )
- {
- pTempTable = pLine->GetColorTable();
- }
-
- if( pColorTab != pTempTable )
- {
- if( bDeleteColorTable )
- delete pColorTab;
- else
- bDeleteColorTable = TRUE;
- }
-
- pColorTab = pColTab;
- if( pArea )
- {
- pArea->SetNewColorTable( pColorTab );
- }
- else if( pLine )
- {
- pLine->SetNewColorTable( pColorTab );
- }
-
- aLbColor.Clear();
- aValSetColorTable.Clear();
- Construct();
- Reset( rOutAttrs );
-
- pColorTab->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( "..." ) );
- }
+ pTempTable = pArea->GetColorTable();
+ }
+ else if( pLine )
+ {
+ pTempTable = pLine->GetColorTable();
+ }
+
+ if( pColorTab != pTempTable )
+ {
+ if( bDeleteColorTable )
+ delete pColorTab;
else
- aString += String(aURL.getBase());
+ bDeleteColorTable = TRUE;
+ }
+
+ pColorTab = pColTab;
+ if( pArea )
+ {
+ pArea->SetNewColorTable( pColorTab );
+ }
+ else if( pLine )
+ {
+ pLine->SetNewColorTable( pColorTab );
+ }
- aTableNameFT.SetText( aString );
+ aLbColor.Clear();
+ aValSetColorTable.Clear();
+ Construct();
+ Reset( rOutAttrs );
- // Flag fuer gewechselt setzen
- *pnColorTableState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnColorTableState &= ~CT_MODIFIED;
+ pColorTab->SetName( aURL.getName() );
- if( aLbColor.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
- aLbColor.SelectEntryPos( 0 );
- else
- aLbColor.SelectEntryPos( aLbColor.GetSelectEntryPos() );
+ // Ermitteln (evtl. abschneiden) des Namens und in
+ // der GroupBox darstellen
+ String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
+ aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- ChangeColorHdl_Impl( this );
- SelectColorLBHdl_Impl( this );
+ if ( aURL.getBase().getLength() > 18 )
+ {
+ aString += String(aURL.getBase()).Copy( 0, 15 );
+ aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
}
+ else
+ aString += String(aURL.getBase());
+
+ aTableNameFT.SetText( aString );
+
+ // Flag fuer gewechselt setzen
+ *pnColorTableState |= CT_CHANGED;
+ // Flag fuer modifiziert entfernen
+ *pnColorTableState &= ~CT_MODIFIED;
+
+ if( aLbColor.GetSelectEntryPos() == LISTBOX_ENTRY_NOTFOUND )
+ aLbColor.SelectEntryPos( 0 );
+ else
+ aLbColor.SelectEntryPos( aLbColor.GetSelectEntryPos() );
+
+ ChangeColorHdl_Impl( this );
+ SelectColorLBHdl_Impl( this );
}
else
{
commit a446987352a7b1c952d7425f5930e6c24fd7291a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 24 09:53:21 2010 +0000
cppcheck: Redundant null pointer check
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 4ee8cea..5c01a27 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -968,39 +968,36 @@ IMPL_LINK( SvxBitmapTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
pBmpList->SetName( aURL.getName() );
if( pBmpList->Load() )
{
- if( pBmpList )
- {
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pBitmapList != ( (SvxAreaTabDialog*) DLGWIN )->GetBitmapList() )
- delete pBitmapList;
-
- pBitmapList = pBmpList;
- ( (SvxAreaTabDialog*) DLGWIN )->SetNewBitmapList( pBitmapList );
+ // Pruefen, ob Tabelle geloescht werden darf:
+ if( pBitmapList != ( (SvxAreaTabDialog*) DLGWIN )->GetBitmapList() )
+ delete pBitmapList;
- aLbBitmaps.Clear();
- aLbBitmaps.Fill( pBitmapList );
- Reset( rOutAttrs );
+ pBitmapList = pBmpList;
+ ( (SvxAreaTabDialog*) DLGWIN )->SetNewBitmapList( pBitmapList );
- pBitmapList->SetName( aURL.getName() );
+ aLbBitmaps.Clear();
+ aLbBitmaps.Fill( pBitmapList );
+ Reset( rOutAttrs );
- // Ermitteln (evtl. abschneiden) des Namens und in
- // der GroupBox darstellen
- String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
+ pBitmapList->SetName( aURL.getName() );
- if ( aURL.getBase().getLength() > 18 )
- {
- aString += String(aURL.getBase()).Copy( 0, 15 );
- aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( "..." ) );
- }
- else
- aString += String(aURL.getBase());
+ // Ermitteln (evtl. abschneiden) des Namens und in
+ // der GroupBox darstellen
+ String aString( ResId( RID_SVXSTR_TABLE, rMgr ) );
+ aString.AppendAscii( RTL_CONSTASCII_STRINGPARAM( ": " ) );
- // Flag fuer gewechselt setzen
- *pnBitmapListState |= CT_CHANGED;
- // Flag fuer modifiziert entfernen
- *pnBitmapListState &= ~CT_MODIFIED;
+ 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
+ *pnBitmapListState |= CT_CHANGED;
+ // Flag fuer modifiziert entfernen
+ *pnBitmapListState &= ~CT_MODIFIED;
LeaveWait();
}
else
commit 2a8d5bddcf6258885ddf3f077079929fcc5ae45c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Nov 24 09:38:02 2010 +0000
cppcheck: Redundant null pointer dereference
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index cc16a05..4fe6ee4 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
More information about the Libreoffice-commits
mailing list