summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorArmin Le Grand <alg@apache.org>2013-04-28 10:57:18 +0000
committerArmin Le Grand <alg@apache.org>2013-04-28 10:57:18 +0000
commit5e5dca13097c4d23f4efce9296163ff47e26872e (patch)
tree59f7d3ffc8cfc9bb3e4a06f0d2928d6b4fc649e4 /chart2
parenteb15aa364708f091c4c59a66f9c3f43e35dafd31 (diff)
i122120 Cleanup of XPropertyList and derivates to RefCounted instances, more cleanups
Notes
Notes: prefer: c8dc73720883333a13187865cd0d69b64af6b4b5
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/controller/dialogs/dlg_View3D.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx8
-rw-r--r--chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx2
-rw-r--r--chart2/source/controller/drawinglayer/ViewElementListProvider.cxx36
-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.cxx8
-rw-r--r--chart2/source/controller/main/ShapeController.cxx5
-rw-r--r--chart2/source/inc/chartview/DrawModelWrapper.hxx12
-rw-r--r--chart2/source/view/main/DrawModelWrapper.cxx24
11 files changed, 56 insertions, 59 deletions
diff --git a/chart2/source/controller/dialogs/dlg_View3D.cxx b/chart2/source/controller/dialogs/dlg_View3D.cxx
index 5f818a6573c7..360ffb7904b4 100644
--- a/chart2/source/controller/dialogs/dlg_View3D.cxx
+++ b/chart2/source/controller/dialogs/dlg_View3D.cxx
@@ -55,7 +55,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, XColorListSharedPtr aColorTable )
: TabDialog(pParent,SchResId(DLG_3D_VIEW))
, m_aTabControl(this,SchResId(TABCTRL))
, m_aBtnOK(this,SchResId(BTN_OK))
@@ -71,7 +71,7 @@ View3DDialog::View3DDialog(Window* pParent, const uno::Reference< frame::XModel
uno::Reference< beans::XPropertySet > xSceneProperties( ChartModelHelper::findDiagram( xChartModel ), uno::UNO_QUERY );
m_pGeometry = new ThreeD_SceneGeometry_TabPage(&m_aTabControl,xSceneProperties,m_aControllerLocker);
m_pAppearance = new ThreeD_SceneAppearance_TabPage(&m_aTabControl,xChartModel,m_aControllerLocker);
- m_pIllumination = new ThreeD_SceneIllumination_TabPage(&m_aTabControl,xSceneProperties,xChartModel,pColorTable);
+ m_pIllumination = new ThreeD_SceneIllumination_TabPage(&m_aTabControl,xSceneProperties,xChartModel,aColorTable);
m_aTabControl.InsertPage( TP_3D_SCENEGEOMETRY, String(SchResId(STR_PAGE_PERSPECTIVE)) );
m_aTabControl.InsertPage( TP_3D_SCENEAPPEARANCE, String(SchResId(STR_PAGE_APPEARANCE)) );
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
index 00f9f5a64987..9532a80699cf 100644
--- a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
+++ b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx
@@ -284,7 +284,7 @@ namespace
ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWindow
, const uno::Reference< beans::XPropertySet > & xSceneProperties
, const uno::Reference< frame::XModel >& xChartModel
- , XColorList* pColorTable )
+ , XColorListSharedPtr aColorTable )
: TabPage ( pWindow, SchResId( TP_3D_SCENEILLUMINATION ) )
, m_aFT_LightSource( this, SchResId( FT_LIGHTSOURCE ) )
, m_aBtn_Light1( this, SchResId( BTN_LIGHT_1 ), 1 )
@@ -310,10 +310,10 @@ ThreeD_SceneIllumination_TabPage::ThreeD_SceneIllumination_TabPage( Window* pWin
{
FreeResource();
- if(pColorTable)
+ if(aColorTable.get())
{
- m_aLB_AmbientLight.Fill( pColorTable );
- m_aLB_LightSource.Fill( pColorTable );
+ m_aLB_AmbientLight.Fill( aColorTable );
+ m_aLB_LightSource.Fill( aColorTable );
}
m_aLB_AmbientLight.SetDropDownLineCount(10);
m_aLB_LightSource.SetDropDownLineCount(10);
diff --git a/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx b/chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx
index 3be197824985..b14bffc21f02 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 );
+ XColorListSharedPtr aColorTable );
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 39e0f22266da..bb4d560da467 100644
--- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
+++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx
@@ -89,41 +89,41 @@ ViewElementListProvider::~ViewElementListProvider()
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
-XColorList* ViewElementListProvider::GetColorTable() const
+XColorListSharedPtr ViewElementListProvider::GetColorTable() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetColorTable();
- return NULL;
+ return m_pDrawModelWrapper->GetColorTableFromSdrModel();
+ return XColorListSharedPtr();
}
-XDashList* ViewElementListProvider::GetDashList() const
+XDashListSharedPtr ViewElementListProvider::GetDashList() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetDashList();
- return NULL;
+ return m_pDrawModelWrapper->GetDashListFromSdrModel();
+ return XDashListSharedPtr();
}
-XLineEndList* ViewElementListProvider::GetLineEndList() const
+XLineEndListSharedPtr ViewElementListProvider::GetLineEndList() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetLineEndList();
- return NULL;
+ return m_pDrawModelWrapper->GetLineEndListFromSdrModel();
+ return XLineEndListSharedPtr();
}
-XGradientList* ViewElementListProvider::GetGradientList() const
+XGradientListSharedPtr ViewElementListProvider::GetGradientList() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetGradientList();
- return NULL;
+ return m_pDrawModelWrapper->GetGradientListFromSdrModel();
+ return XGradientListSharedPtr();
}
-XHatchList* ViewElementListProvider::GetHatchList() const
+XHatchListSharedPtr ViewElementListProvider::GetHatchList() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetHatchList();
- return NULL;
+ return m_pDrawModelWrapper->GetHatchListFromSdrModel();
+ return XHatchListSharedPtr();
}
-XBitmapList* ViewElementListProvider::GetBitmapList() const
+XBitmapListSharedPtr ViewElementListProvider::GetBitmapList() const
{
if(m_pDrawModelWrapper)
- return m_pDrawModelWrapper->GetBitmapList();
- return NULL;
+ return m_pDrawModelWrapper->GetBitmapListFromSdrModel();
+ return XBitmapListSharedPtr();
}
//-----------------------------------------------------------------------------
diff --git a/chart2/source/controller/inc/ViewElementListProvider.hxx b/chart2/source/controller/inc/ViewElementListProvider.hxx
index 6f9f08df0cd7..5b0b6b8ffeaa 100644
--- a/chart2/source/controller/inc/ViewElementListProvider.hxx
+++ b/chart2/source/controller/inc/ViewElementListProvider.hxx
@@ -41,12 +41,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;
+ XColorListSharedPtr GetColorTable() const;
+ XDashListSharedPtr GetDashList() const;
+ XLineEndListSharedPtr GetLineEndList() const;
+ XGradientListSharedPtr GetGradientList() const;
+ XHatchListSharedPtr GetHatchList() const;
+ XBitmapListSharedPtr 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 1414366d707e..64223799cedc 100644
--- a/chart2/source/controller/inc/dlg_View3D.hxx
+++ b/chart2/source/controller/inc/dlg_View3D.hxx
@@ -52,7 +52,7 @@ class View3DDialog : public TabDialog
public:
View3DDialog( Window* pWindow,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XModel > & xChartModel,
- XColorList* pColorTable=0 );
+ XColorListSharedPtr aColorTable );
~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 3c0335a338b8..09a6523345c5 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
::vos::OGuard aSolarGuard( Application::GetSolarMutex());
- View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorTable() );
+ View3DDialog aDlg( m_pChartWindow, getModel(), m_pDrawModelWrapper->GetColorTableFromSdrModel() );
if( aDlg.Execute() == RET_OK )
aUndoGuard.commit();
// \--
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index c560c28b9ef6..80f927a4fdfe 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -114,14 +114,14 @@ bool DrawCommandDispatch::isFeatureSupported( const ::rtl::OUString& rCommandURL
::basegfx::B2DPolyPolygon getPolygon( sal_uInt16 nResId, SdrModel& rModel )
{
::basegfx::B2DPolyPolygon aReturn;
- XLineEndList* pLineEndList = rModel.GetLineEndList();
- if ( pLineEndList )
+ XLineEndListSharedPtr aLineEndList = rModel.GetLineEndListFromSdrModel();
+ if ( aLineEndList.get() )
{
String aName( SVX_RES( nResId ) );
- long nCount = pLineEndList->Count();
+ long nCount = aLineEndList->Count();
for ( long nIndex = 0; nIndex < nCount; ++nIndex )
{
- XLineEndEntry* pEntry = pLineEndList->GetLineEnd( nIndex );
+ XLineEndEntry* pEntry = aLineEndList->GetLineEnd( nIndex );
if ( pEntry->GetName() == aName )
{
aReturn = pEntry->GetLineEnd();
diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx
index b9463e1860d0..c78527f2d09f 100644
--- a/chart2/source/controller/main/ShapeController.cxx
+++ b/chart2/source/controller/main/ShapeController.cxx
@@ -323,10 +323,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::GetStdColorList() )
- {
- pDlg->DontDeleteColorTable();
- }
+
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 a2ad838618d2..f03e0f491ae1 100644
--- a/chart2/source/inc/chartview/DrawModelWrapper.hxx
+++ b/chart2/source/inc/chartview/DrawModelWrapper.hxx
@@ -91,12 +91,12 @@ public:
getUnoModel();
SdrModel& getSdrModel();
- XColorList* GetColorTable() const;
- XDashList* GetDashList() const;
- XLineEndList* GetLineEndList() const;
- XGradientList* GetGradientList() const;
- XHatchList* GetHatchList() const;
- XBitmapList* GetBitmapList() const;
+ XColorListSharedPtr GetColorTableFromSdrModel() const;
+ XDashListSharedPtr GetDashListFromSdrModel() const;
+ XLineEndListSharedPtr GetLineEndListFromSdrModel() const;
+ XGradientListSharedPtr GetGradientListFromSdrModel() const;
+ XHatchListSharedPtr GetHatchListFromSdrModel() const;
+ XBitmapListSharedPtr GetBitmapListFromSdrModel() 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 5814ad6e5bad..98c99c44e146 100644
--- a/chart2/source/view/main/DrawModelWrapper.cxx
+++ b/chart2/source/view/main/DrawModelWrapper.cxx
@@ -334,29 +334,29 @@ const SfxItemPool& DrawModelWrapper::GetItemPool() const
{
return this->SdrModel::GetItemPool();
}
-XColorList* DrawModelWrapper::GetColorTable() const
+XColorListSharedPtr DrawModelWrapper::GetColorTableFromSdrModel() const
{
- return this->SdrModel::GetColorTable();
+ return this->SdrModel::GetColorTableFromSdrModel();
}
-XDashList* DrawModelWrapper::GetDashList() const
+XDashListSharedPtr DrawModelWrapper::GetDashListFromSdrModel() const
{
- return this->SdrModel::GetDashList();
+ return this->SdrModel::GetDashListFromSdrModel();
}
-XLineEndList* DrawModelWrapper::GetLineEndList() const
+XLineEndListSharedPtr DrawModelWrapper::GetLineEndListFromSdrModel() const
{
- return this->SdrModel::GetLineEndList();
+ return this->SdrModel::GetLineEndListFromSdrModel();
}
-XGradientList* DrawModelWrapper::GetGradientList() const
+XGradientListSharedPtr DrawModelWrapper::GetGradientListFromSdrModel() const
{
- return this->SdrModel::GetGradientList();
+ return this->SdrModel::GetGradientListFromSdrModel();
}
-XHatchList* DrawModelWrapper::GetHatchList() const
+XHatchListSharedPtr DrawModelWrapper::GetHatchListFromSdrModel() const
{
- return this->SdrModel::GetHatchList();
+ return this->SdrModel::GetHatchListFromSdrModel();
}
-XBitmapList* DrawModelWrapper::GetBitmapList() const
+XBitmapListSharedPtr DrawModelWrapper::GetBitmapListFromSdrModel() const
{
- return this->SdrModel::GetBitmapList();
+ return this->SdrModel::GetBitmapListFromSdrModel();
}
SdrObject* DrawModelWrapper::getNamedSdrObject( const rtl::OUString& rName )