summaryrefslogtreecommitdiff
path: root/extensions/source/propctrlr/standardcontrol.cxx
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-09-23 14:05:07 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-09-24 08:33:46 +0100
commitc8dc73720883333a13187865cd0d69b64af6b4b5 (patch)
treec9037bb6e79fd49507f2de1cf2b22f7159572720 /extensions/source/propctrlr/standardcontrol.cxx
parent7fc35af5fd3171cc9bf43d2c27660afcf407d3f6 (diff)
re-factor XPropertyList derivatives to use a rtl::Reference
This cleans up a lot of lifecycle nasties and cleans up some serious cut/paste code duplication issues at the same time. Cleanup the naming of ColorTable -> ColorList to match the impl. too
Diffstat (limited to 'extensions/source/propctrlr/standardcontrol.cxx')
-rw-r--r--extensions/source/propctrlr/standardcontrol.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index ee55c3d8845c..83d694da668f 100644
--- a/extensions/source/propctrlr/standardcontrol.cxx
+++ b/extensions/source/propctrlr/standardcontrol.cxx
@@ -684,26 +684,26 @@ namespace pcr
:OColorControl_Base( PropertyControlType::ColorListBox, pParent, nWinStyle )
{
// initialize the color listbox
- XColorList* pColorTable = NULL;
+ XColorListRef pColorList;
SfxObjectShell* pDocSh = SfxObjectShell::Current();
const SfxPoolItem* pItem = pDocSh ? pDocSh->GetItem( SID_COLOR_TABLE ) : NULL;
if ( pItem )
{
- DBG_ASSERT(pItem->ISA(SvxColorTableItem), "OColorControl::OColorControl: invalid color item!");
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ DBG_ASSERT(pItem->ISA(SvxColorListItem), "OColorControl::OColorControl: invalid color item!");
+ pColorList = ( (SvxColorListItem*)pItem )->GetColorList();
}
- if ( !pColorTable )
- pColorTable = &XColorList::GetStdColorTable();
+ if ( !pColorList.is() )
+ pColorList = XColorList::GetStdColorList();
- DBG_ASSERT(pColorTable, "OColorControl::OColorControl: no color table!");
+ DBG_ASSERT(pColorList, "OColorControl::OColorControl: no color table!");
- if (pColorTable)
+ if ( pColorList.is() )
{
- for (sal_uInt16 i = 0; i < pColorTable->Count(); ++i)
+ for (sal_uInt16 i = 0; i < pColorList->Count(); ++i)
{
- XColorEntry* pEntry = pColorTable->GetColor( i );
+ XColorEntry* pEntry = pColorList->GetColor( i );
getTypedControlWindow()->InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
}