summaryrefslogtreecommitdiff
path: root/chart2
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 /chart2
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 'chart2')
-rw-r--r--chart2/source/controller/dialogs/dlg_ObjectProperties.cxx4
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx2
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx29
-rw-r--r--chart2/source/controller/inc/ViewElementListProvider.hxx12
-rw-r--r--chart2/source/controller/inc/dlg_View3D.hxx2
-rw-r--r--chart2/source/controller/main/ChartController_Properties.cxx2
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx4
-rw-r--r--chart2/source/controller/main/ShapeController.cxx6
-rw-r--r--chart2/source/inc/chartview/DrawModelWrapper.hxx12
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx14
12 files changed, 46 insertions, 47 deletions
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 54e0a606cd3d..b6704e17cc59 100644
--- a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
+++ b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
@@ -526,7 +526,7 @@ void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
case TP_LAYOUT:
break;
case RID_SVXPAGE_LINE:
- aSet.Put (SvxColorTableItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
+ aSet.Put (SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
aSet.Put (SvxDashListItem(m_pViewElementListProvider->GetDashList(),SID_DASH_LIST));
aSet.Put (SvxLineEndListItem(m_pViewElementListProvider->GetLineEndList(),SID_LINEEND_LIST));
aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
@@ -544,7 +544,7 @@ void SchAttribTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage &rPage)
break;
case RID_SVXPAGE_AREA:
- aSet.Put(SvxColorTableItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
+ aSet.Put(SvxColorListItem(m_pViewElementListProvider->GetColorTable(),SID_COLOR_TABLE));
aSet.Put(SvxGradientListItem(m_pViewElementListProvider->GetGradientList(),SID_GRADIENT_LIST));
aSet.Put(SvxHatchListItem(m_pViewElementListProvider->GetHatchList(),SID_HATCH_LIST));
aSet.Put(SvxBitmapListItem(m_pViewElementListProvider->GetBitmapList(),SID_BITMAP_LIST));
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 0ddb6c1b4038..6cb32f881d92 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -60,7 +60,7 @@ using namespace ::com::sun::star::chart2;
sal_uInt16 View3DDialog::m_nLastPageId = 0;
-View3DDialog::View3DDialog(Window* pParent, const uno::Reference< frame::XModel > & xChartModel, XColorList* pColorTable )
+View3DDialog::View3DDialog(Window* pParent, const uno::Reference< frame::XModel > & xChartModel, const XColorListRef &pColorTable )
: TabDialog(pParent,SchResId(DLG_3D_VIEW))
, m_aTabControl(this,SchResId(TABCTRL))
, m_aBtnOK(this,SchResId(BTN_OK))
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 0621e1883318..d23ce48fab16 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -287,7 +287,7 @@ namespace
ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWindow
, const uno::Reference< beans::XPropertySet > & xSceneProperties
, const uno::Reference< frame::XModel >& xChartModel
- , XColorList* pColorTable )
+ , const XColorListRef & pColorTable )
: TabPage ( pWindow, SchResId( TP_3D_SCENEILLUMINATION ) )
, m_aFT_LightSource( this, SchResId( FT_LIGHTSOURCE ) )
, m_aBtn_Light1( this, SchResId( BTN_LIGHT_1 ), 1 )
@@ -313,7 +313,7 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin
{
FreeResource();
- if(pColorTable)
+ if( pColorTable.is() )
{
m_aLB_AmbientLight.Fill( pColorTable );
m_aLB_LightSource.Fill( pColorTable );
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
index 990ece9af8f9..56b04ccc5a1e 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
@@ -79,7 +79,7 @@ public:
const ::com::sun::star::uno::Reference<
::com::sun::star::beans::XPropertySet > & xSceneProperties,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel >& xChartModel,
- XColorList* pColorTable=0 );
+ const XColorListRef &pColorTable );
virtual ~ThreeD_SceneIllumination_TabPage();
// has to be called in case the dialog was closed with OK
diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
index 0f209a85afb3..0be5cc4c79b4 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -94,45 +94,48 @@ ViewElementListProvider::~ViewElementListProvider()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-XColorList* ViewElementListProvider::GetColorTable() const
+XColorListRef ViewElementListProvider::GetColorTable() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetColorTable();
- return NULL;
+ return m_pDrawModelWrapper->GetColorList();
+ return XColorListRef();
}
-XDashList* ViewElementListProvider::GetDashList() const
+
+XDashListRef ViewElementListProvider::GetDashList() const
{
if(m_pDrawModelWrapper)
return m_pDrawModelWrapper->GetDashList();
- return NULL;
+ return XDashListRef();
}
-XLineEndList* ViewElementListProvider::GetLineEndList() const
+
+XLineEndListRef ViewElementListProvider::GetLineEndList() const
{
if(m_pDrawModelWrapper)
return m_pDrawModelWrapper->GetLineEndList();
- return NULL;
+ return XLineEndListRef();
}
-XGradientList* ViewElementListProvider::GetGradientList() const
+
+XGradientListRef ViewElementListProvider::GetGradientList() const
{
if(m_pDrawModelWrapper)
return m_pDrawModelWrapper->GetGradientList();
- return NULL;
+ return XGradientListRef();
}
-XHatchList* ViewElementListProvider::GetHatchList() const
+XHatchListRef ViewElementListProvider::GetHatchList() const
{
if(m_pDrawModelWrapper)
return m_pDrawModelWrapper->GetHatchList();
return NULL;
}
-XBitmapList* ViewElementListProvider::GetBitmapList() const
+
+XBitmapListRef ViewElementListProvider::GetBitmapList() const
{
if(m_pDrawModelWrapper)
return m_pDrawModelWrapper->GetBitmapList();
- return NULL;
+ return XBitmapListRef();
}
//-----------------------------------------------------------------------------
-//-----------------------------------------------------------------------------
//create chartspecific symbols for linecharts
SdrObjList* ViewElementListProvider::GetSymbolList() const
diff --git a/chart2/source/controller/inc/ViewElementListProvider.hxx b/chart2/source/controller/inc/ViewElementListProvider.hxx
index ef1ced680dda..cdede1666300 100644
--- a/chart2/source/controller/inc/ViewElementListProvider.hxx
+++ b/chart2/source/controller/inc/ViewElementListProvider.hxx
@@ -46,12 +46,12 @@ public:
ViewElementListProvider( DrawModelWrapper* pDrawModelWrapper );
virtual ~ViewElementListProvider();
- XColorList* GetColorTable() const;
- XDashList* GetDashList() const;
- XLineEndList* GetLineEndList() const;
- XGradientList* GetGradientList() const;
- XHatchList* GetHatchList() const;
- XBitmapList* GetBitmapList() const;
+ XColorListRef GetColorTable() const;
+ XDashListRef GetDashList() const;
+ XLineEndListRef GetLineEndList() const;
+ XGradientListRef GetGradientList() const;
+ XHatchListRef GetHatchList() const;
+ XBitmapListRef GetBitmapList() const;
//create chartspecific symbols for linecharts
SdrObjList* GetSymbolList() const;
diff --git a/chart2/source/controller/inc/dlg_View3D.hxx b/chart2/source/controller/inc/dlg_View3D.hxx
index 699916ff7b88..fd5fb02900b1 100644
--- a/chart2/source/controller/inc/dlg_View3D.hxx
+++ b/chart2/source/controller/inc/dlg_View3D.hxx
@@ -55,7 +55,7 @@ class View3DDialog : public TabDialog
public:
View3DDialog( Window* pWindow,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel,
- XColorList* pColorTable=0 );
+ const XColorListRef &pColorTable );
~View3DDialog();
// from Dialog (base of TabDialog)
diff --git a/chart2/source/controller/main/ChartController_Properties.cxx b/chart2/source/controller/main/ChartController_Properties.cxx
index 6de3c53bdefe..ba16343ef7ac 100644
--- a/chart2/source/controller/main/ChartController_Properties.cxx
+++ b/chart2/source/controller/main/ChartController_Properties.cxx
@@ -840,7 +840,7 @@ void SAL_CALL ChartController::executeDispatch_View3D()
//open dialog
SolarMutexGuard aSolarGuard;
- View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorTable() );
+ View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorList() );
if( aDlg.Execute() == RET_OK )
aUndoGuard.commit();
}
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index b4d25161f467..e8ee2e07dffb 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -119,8 +119,8 @@ bool DrawCommandDispatch::isFeatureSupported( const ::rtl::OUString& rCommandURL
::basegfx::B2DPolyPolygon getPolygon( sal_uInt16 nResId, SdrModel& rModel )
{
::basegfx::B2DPolyPolygon aReturn;
- XLineEndList* pLineEndList = rModel.GetLineEndList();
- if ( pLineEndList )
+ XLineEndListRef pLineEndList = rModel.GetLineEndList();
+ if ( pLineEndList.is() )
{
String aName( SVX_RES( nResId ) );
long nCount = pLineEndList->Count();
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index 9f67c4b5893d..c4db4bbd564f 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -327,11 +327,7 @@ void ShapeController::executeDispatch_FormatArea()
{
SfxItemPool& rItemPool = pDrawViewWrapper->GetModel()->GetItemPool();
SfxItemSet aSet( rItemPool, rItemPool.GetFirstWhich(), rItemPool.GetLastWhich() );
- const SvxColorTableItem* pColorItem = static_cast< const SvxColorTableItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
- if ( pColorItem && pColorItem->GetColorTable() == &XColorList::GetStdColorTable() )
- {
- pDlg->DontDeleteColorTable();
- }
+ const SvxColorListItem* pColorItem = static_cast< const SvxColorListItem* >( aSet.GetItem( SID_COLOR_TABLE ) );
if ( pDlg->Execute() == RET_OK )
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
diff --git a/chart2/source/inc/chartview/DrawModelWrapper.hxx b/chart2/source/inc/chartview/DrawModelWrapper.hxx
index f2ae17ddb2a5..57ef7477b367 100644
--- a/chart2/source/inc/chartview/DrawModelWrapper.hxx
+++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx
@@ -96,12 +96,12 @@ public:
getUnoModel();
SdrModel& getSdrModel();
- XColorList* GetColorTable() const;
- XDashList* GetDashList() const;
- XLineEndList* GetLineEndList() const;
- XGradientList* GetGradientList() const;
- XHatchList* GetHatchList() const;
- XBitmapList* GetBitmapList() const;
+ XColorListRef GetColorList() const;
+ XDashListRef GetDashList() const;
+ XLineEndListRef GetLineEndList() const;
+ XGradientListRef GetGradientList() const;
+ XHatchListRef GetHatchList() const;
+ XBitmapListRef GetBitmapList() const;
SdrObject* getNamedSdrObject( const rtl::OUString& rName );
static SdrObject* getNamedSdrObject( const String& rName, SdrObjList* pObjList );
diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx
index 44f2f37c36b7..0a009b41074e 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -339,27 +339,27 @@ const SfxItemPool& DrawModelWrapper::GetItemPool() const
{
return this->SdrModel::GetItemPool();
}
-XColorList* DrawModelWrapper::GetColorTable() const
+XColorListRef DrawModelWrapper::GetColorList() const
{
- return this->SdrModel::GetColorTable();
+ return this->SdrModel::GetColorList();
}
-XDashList* DrawModelWrapper::GetDashList() const
+XDashListRef DrawModelWrapper::GetDashList() const
{
return this->SdrModel::GetDashList();
}
-XLineEndList* DrawModelWrapper::GetLineEndList() const
+XLineEndListRef DrawModelWrapper::GetLineEndList() const
{
return this->SdrModel::GetLineEndList();
}
-XGradientList* DrawModelWrapper::GetGradientList() const
+XGradientListRef DrawModelWrapper::GetGradientList() const
{
return this->SdrModel::GetGradientList();
}
-XHatchList* DrawModelWrapper::GetHatchList() const
+XHatchListRef DrawModelWrapper::GetHatchList() const
{
return this->SdrModel::GetHatchList();
}
-XBitmapList* DrawModelWrapper::GetBitmapList() const
+XBitmapListRef DrawModelWrapper::GetBitmapList() const
{
return this->SdrModel::GetBitmapList();
}