summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/chardlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'cui/source/tabpages/chardlg.cxx')
-rw-r--r--cui/source/tabpages/chardlg.cxx32
1 files changed, 8 insertions, 24 deletions
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 33309de97100..782af954b9a1 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -457,23 +457,18 @@ void SvxCharNamePage::Initialize()
// fill the color box
SfxObjectShell* pDocSh = SfxObjectShell::Current();
- //DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorList* pColorTable = NULL;
- bool bKillTable = false;
+ XColorListRef pColorTable;
const SfxPoolItem* pItem = NULL;
if ( pDocSh )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
- if ( !pColorTable )
- {
- pColorTable = new XColorList( SvtPathOptions().GetPalettePath() );
- bKillTable = true;
- }
+ if ( !pColorTable.is() )
+ pColorTable = XColorList::CreateStdColorList();
m_pColorLB->SetUpdateMode( sal_False );
@@ -492,10 +487,6 @@ void SvxCharNamePage::Initialize()
}
m_pColorLB->SetUpdateMode( sal_True );
-
- if ( bKillTable )
- delete pColorTable;
-
m_pColorLB->SetSelectHdl( LINK( this, SvxCharNamePage, ColorBoxSelectHdl_Impl ) );
Link aLink = LINK( this, SvxCharNamePage, FontModifyHdl_Impl );
@@ -1527,21 +1518,17 @@ void SvxCharEffectsPage::Initialize()
// fill the color box
SfxObjectShell* pDocSh = SfxObjectShell::Current();
DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorList* pColorTable = NULL;
- bool bKillTable = false;
+ XColorListRef pColorTable;
if ( pDocSh )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
- if ( !pColorTable )
- {
- pColorTable = new XColorList( SvtPathOptions().GetPalettePath() );
- bKillTable = true;
- }
+ if ( !pColorTable.is() )
+ pColorTable = XColorList::CreateStdColorList();
m_aUnderlineColorLB.SetUpdateMode( sal_False );
m_aOverlineColorLB.SetUpdateMode( sal_False );
@@ -1571,9 +1558,6 @@ void SvxCharEffectsPage::Initialize()
m_aFontColorLB.SetUpdateMode( sal_True );
m_aFontColorLB.SetSelectHdl( LINK( this, SvxCharEffectsPage, ColorBoxSelectHdl_Impl ) );
- if ( bKillTable )
- delete pColorTable;
-
// handler
Link aLink = LINK( this, SvxCharEffectsPage, SelectHdl_Impl );
m_aUnderlineLB.SetSelectHdl( aLink );