[Libreoffice-commits] .: 2 commits - accessibility/source chart2/source cui/source extensions/source reportdesign/source sc/inc sc/sdi sc/source sd/inc sd/sdi sd/source stoc/source svx/inc svx/sdi svx/source sw/sdi sw/source
Michael Meeks
michael at kemper.freedesktop.org
Sat Sep 24 00:33:22 PDT 2011
accessibility/source/extended/makefile.mk | 3
chart2/source/controller/dialogs/dlg_ObjectProperties.cxx | 4
chart2/source/controller/dialogs/dlg_View3D.cxx | 2
chart2/source/controller/dialogs/tp_3D_SceneIllumination.cxx | 4
chart2/source/controller/dialogs/tp_3D_SceneIllumination.hxx | 2
chart2/source/controller/drawinglayer/ViewElementListProvider.cxx | 29 -
chart2/source/controller/inc/ViewElementListProvider.hxx | 12
chart2/source/controller/inc/dlg_View3D.hxx | 2
chart2/source/controller/main/ChartController_Properties.cxx | 2
chart2/source/controller/main/DrawCommandDispatch.cxx | 4
chart2/source/controller/main/ShapeController.cxx | 6
chart2/source/inc/chartview/DrawModelWrapper.hxx | 12
chart2/source/view/main/DrawModelWrapper.cxx | 14
cui/source/dialogs/sdrcelldlg.cxx | 4
cui/source/factory/dlgfact.cxx | 5
cui/source/factory/dlgfact.hxx | 7
cui/source/inc/cuitabarea.hxx | 98 +--
cui/source/inc/cuitabline.hxx | 57 --
cui/source/inc/sdrcelldlg.hxx | 14
cui/source/inc/treeopt.hxx | 7
cui/source/options/cfgchart.cxx | 6
cui/source/options/cfgchart.hxx | 4
cui/source/options/optchart.cxx | 53 -
cui/source/options/optchart.hxx | 2
cui/source/options/treeopt.cxx | 30 -
cui/source/tabpages/backgrnd.cxx | 17
cui/source/tabpages/border.cxx | 6
cui/source/tabpages/chardlg.cxx | 32 -
cui/source/tabpages/numpages.cxx | 17
cui/source/tabpages/tabarea.cxx | 51 -
cui/source/tabpages/tabline.cxx | 29 -
cui/source/tabpages/tparea.cxx | 6
cui/source/tabpages/tpbitmap.cxx | 9
cui/source/tabpages/tpcolor.cxx | 90 +--
cui/source/tabpages/tpgradnt.cxx | 10
cui/source/tabpages/tphatch.cxx | 10
cui/source/tabpages/tpline.cxx | 6
cui/source/tabpages/tplnedef.cxx | 10
cui/source/tabpages/tplneend.cxx | 10
cui/source/tabpages/tpshadow.cxx | 6
extensions/source/propctrlr/standardcontrol.cxx | 18
reportdesign/source/ui/dlg/Condition.cxx | 6
reportdesign/source/ui/misc/UITools.cxx | 15
sc/inc/document.hxx | 7
sc/sdi/docsh.sdi | 2
sc/source/core/data/documen2.cxx | 3
sc/source/core/data/documen9.cxx | 21
sc/source/core/data/drwlayer.cxx | 10
sc/source/ui/dbgui/scendlg.cxx | 8
sc/source/ui/docshell/docsh2.cxx | 4
sc/source/ui/docshell/docsh4.cxx | 9
sc/source/ui/drawfunc/drawsh.cxx | 16
sc/source/ui/drawfunc/drawsh4.cxx | 10
sc/source/ui/drawfunc/drtxtob2.cxx | 10
sc/source/ui/miscdlgs/tabbgcolordlg.cxx | 19
sc/source/ui/optdlg/opredlin.cxx | 6
sc/source/ui/optdlg/tpview.cxx | 14
sd/inc/sdabstdlg.hxx | 3
sd/sdi/_docsh.sdi | 2
sd/source/ui/animations/CustomAnimationDialog.cxx | 39 -
sd/source/ui/dlg/celltempl.cxx | 4
sd/source/ui/dlg/copydlg.cxx | 12
sd/source/ui/dlg/dlgpage.cxx | 6
sd/source/ui/dlg/prltempl.cxx | 10
sd/source/ui/dlg/sddlgfact.cxx | 3
sd/source/ui/dlg/sddlgfact.hxx | 2
sd/source/ui/dlg/tabtempl.cxx | 8
sd/source/ui/dlg/tpaction.cxx | 6
sd/source/ui/docshell/docshel3.cxx | 9
sd/source/ui/docshell/docshell.cxx | 2
sd/source/ui/func/fuconrec.cxx | 4
sd/source/ui/func/fucopy.cxx | 2
sd/source/ui/func/fulinend.cxx | 2
sd/source/ui/inc/celltempl.hxx | 8
sd/source/ui/inc/copydlg.hxx | 4
sd/source/ui/inc/dlgpage.hxx | 8
sd/source/ui/inc/prltempl.hxx | 12
sd/source/ui/inc/tabtempl.hxx | 12
sd/source/ui/inc/tpaction.hxx | 2
sd/source/ui/unoidl/UnoDocumentSettings.cxx | 51 -
sd/source/ui/view/drviews6.cxx | 8
sd/source/ui/view/drviews9.cxx | 14
stoc/source/corereflection/makefile.mk | 6
svx/inc/svx/bmpmask.hxx | 6
svx/inc/svx/colrctrl.hxx | 6
svx/inc/svx/dlgctrl.hxx | 136 +---
svx/inc/svx/drawitem.hxx | 79 +-
svx/inc/svx/fontwork.hxx | 4
svx/inc/svx/linectrl.hxx | 6
svx/inc/svx/ofaitem.hxx | 33 +
svx/inc/svx/svdmodel.hxx | 32 -
svx/inc/svx/svxdlg.hxx | 2
svx/inc/svx/svxids.hrc | 2
svx/inc/svx/xattr.hxx | 1
svx/inc/svx/xit.hxx | 4
svx/inc/svx/xtable.hxx | 67 +-
svx/sdi/svx.sdi | 4
svx/sdi/svxitems.sdi | 3
svx/source/dialog/_bmpmask.cxx | 19
svx/source/dialog/dlgctrl.cxx | 38 -
svx/source/dialog/fontwork.cxx | 12
svx/source/engine3d/float3d.cxx | 2
svx/source/items/drawitem.cxx | 278 +---------
svx/source/items/ofaitem.cxx | 40 -
svx/source/svdraw/svdmodel.cxx | 30 -
svx/source/tbxctrls/colrctrl.cxx | 15
svx/source/tbxctrls/fillctrl.cxx | 8
svx/source/tbxctrls/itemwin.cxx | 10
svx/source/tbxctrls/linectrl.cxx | 8
svx/source/tbxctrls/tbcontrl.cxx | 33 -
svx/source/unodraw/unoctabl.cxx | 49 -
svx/source/unodraw/unoshape.cxx | 30 -
svx/source/xoutdev/xattr.cxx | 48 -
svx/source/xoutdev/xattrbmp.cxx | 14
svx/source/xoutdev/xtabcolr.cxx | 11
svx/source/xoutdev/xtable.cxx | 34 -
sw/sdi/_docsh.sdi | 2
sw/source/core/draw/drawdoc.cxx | 12
sw/source/ui/app/docsh2.cxx | 8
sw/source/ui/app/docshdrw.cxx | 2
sw/source/ui/app/docshini.cxx | 9
sw/source/ui/config/optpage.cxx | 6
sw/source/ui/frmdlg/column.cxx | 10
sw/source/ui/misc/pgfnote.cxx | 12
sw/source/ui/misc/pggrid.cxx | 6
sw/source/ui/shells/drawdlg.cxx | 6
sw/source/ui/shells/drawsh.cxx | 2
sw/source/ui/shells/drwtxtsh.cxx | 2
128 files changed, 871 insertions(+), 1379 deletions(-)
New commits:
commit c8dc73720883333a13187865cd0d69b64af6b4b5
Author: Michael Meeks <michael.meeks at novell.com>
Date: Fri Sep 23 14:05:07 2011 +0100
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
diff --git a/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx b/chart2/source/controller/dialogs/dlg_ObjectProperties.cxx
index 54e0a60..b6704e1 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 0ddb6c1..6cb32f8 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 0621e18..d23ce48 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 990ece9..56b04cc 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 0f209a8..0be5cc4 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 ef1ced6..cdede16 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 699916f..fd5fb02 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 6de3c53..ba16343 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 b4d2516..e8ee2e0 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 9f67c4b..c4db4bb 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 f2ae17d..57ef747 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 44f2f37..0a009b4 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();
}
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 99596c1..1f45fc8 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -39,7 +39,7 @@
SvxFormatCellsDialog::SvxFormatCellsDialog( Window* pParent, const SfxItemSet* pAttr, SdrModel* pModel )
: SfxTabDialog ( pParent, CUI_RES( RID_SVX_FORMAT_CELLS_DLG ), pAttr )
, mrOutAttrs ( *pAttr )
-, mpColorTab ( pModel->GetColorTable() )
+, mpColorTab ( pModel->GetColorList() )
, mpGradientList ( pModel->GetGradientList() )
, mpHatchingList ( pModel->GetHatchList() )
, mpBitmapList ( pModel->GetBitmapList() )
@@ -62,7 +62,7 @@ void SvxFormatCellsDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
switch( nId )
{
case RID_SVXPAGE_AREA:
- ( (SvxAreaTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxAreaTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxAreaTabPage&) rPage ).SetGradientList( mpGradientList );
( (SvxAreaTabPage&) rPage ).SetHatchingList( mpHatchingList );
( (SvxAreaTabPage&) rPage ).SetBitmapList( mpBitmapList );
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index 08a1068..e7c4574 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -905,11 +905,6 @@ String AbstractSvxAreaTabDialog_Impl::GetText() const
return pDlg->GetText();
}
-void AbstractSvxAreaTabDialog_Impl::DontDeleteColorTable()
-{
- return pDlg->DontDeleteColorTable();
-}
-
void AbstractSvxPostItDialog_Impl::SetText( const XubString& rStr )
{
pDlg->SetText( rStr );
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 79cdbe7..a5a5433 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -503,7 +503,7 @@ class AbstractGraphicFilterDialog_Impl :public AbstractGraphicFilterDialog
};
//for GraphicFilterDialog end
-//add for SvxAreaTabDialog begin
+// add for SvxAreaTabDialog begin
class SvxAreaTabDialog;
class AbstractSvxAreaTabDialog_Impl :public AbstractSvxAreaTabDialog
{
@@ -512,12 +512,11 @@ class AbstractSvxAreaTabDialog_Impl :public AbstractSvxAreaTabDialog
virtual const SfxItemSet* GetOutputItemSet() const;
virtual const sal_uInt16* GetInputRanges( const SfxItemPool& pItem );
virtual void SetInputSet( const SfxItemSet* pInSet );
- //From class Window.
+ // From class Window.
virtual void SetText( const XubString& rStr );
virtual String GetText() const;
- virtual void DontDeleteColorTable() ;
};
-//add for SvxAreaTabDialog end
+// add for SvxAreaTabDialog end
class AbstractInsertObjectDialog_Impl : public SfxAbstractInsertObjectDialog
{
diff --git a/cui/source/inc/cuitabarea.hxx b/cui/source/inc/cuitabarea.hxx
index a7ce897..6bec35f 100644
--- a/cui/source/inc/cuitabarea.hxx
+++ b/cui/source/inc/cuitabarea.hxx
@@ -39,14 +39,14 @@ class SvxAreaTabDialog : public SfxTabDialog
private:
SdrModel* mpDrawModel;
- XColorList* mpColorTab;
- XColorList* mpNewColorTab;
- XGradientList* mpGradientList;
- XGradientList* mpNewGradientList;
- XHatchList* mpHatchingList;
- XHatchList* mpNewHatchingList;
- XBitmapList* mpBitmapList;
- XBitmapList* mpNewBitmapList;
+ XColorListRef mpColorTab;
+ XColorListRef mpNewColorTab;
+ XGradientListRef mpGradientList;
+ XGradientListRef mpNewGradientList;
+ XHatchListRef mpHatchingList;
+ XHatchListRef mpNewHatchingList;
+ XBitmapListRef mpBitmapList;
+ XBitmapListRef mpNewBitmapList;
const SfxItemSet& mrOutAttrs;
@@ -59,7 +59,6 @@ private:
sal_uInt16 mnDlgType;
sal_uInt16 mnPos;
sal_Bool mbAreaTP;
- sal_Bool mbDeleteColorTable;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
@@ -76,29 +75,27 @@ public:
const SdrView* pSdrView = NULL );
~SvxAreaTabDialog();
- void SetNewColorTable( XColorList* pColTab )
+ void SetNewColorTable( XColorListRef pColTab )
{ mpNewColorTab = pColTab; }
- XColorList* GetNewColorTable() const { return mpNewColorTab; }
- const XColorList* GetColorTable() const { return mpColorTab; }
+ XColorListRef GetNewColorTable() const { return mpNewColorTab; }
+ const XColorListRef GetColorList() const { return mpColorTab; }
- void SetNewGradientList( XGradientList* pGrdLst)
+ void SetNewGradientList( XGradientListRef pGrdLst)
{ mpNewGradientList = pGrdLst; }
- XGradientList* GetNewGradientList() const
+ XGradientListRef GetNewGradientList() const
{ return mpNewGradientList; }
- const XGradientList* GetGradientList() const { return mpGradientList; }
+ const XGradientListRef GetGradientList() const { return mpGradientList; }
- void SetNewHatchingList( XHatchList* pHtchLst)
+ void SetNewHatchingList( XHatchListRef pHtchLst)
{ mpNewHatchingList = pHtchLst; }
- XHatchList* GetNewHatchingList() const
+ XHatchListRef GetNewHatchingList() const
{ return mpNewHatchingList; }
- const XHatchList* GetHatchingList() const { return mpHatchingList; }
+ const XHatchListRef GetHatchingList() const { return mpHatchingList; }
- void SetNewBitmapList( XBitmapList* pBmpLst)
+ void SetNewBitmapList( XBitmapListRef pBmpLst)
{ mpNewBitmapList = pBmpLst; }
- XBitmapList* GetNewBitmapList() const { return mpNewBitmapList; }
- const XBitmapList* GetBitmapList() const { return mpBitmapList; }
-
- void DontDeleteColorTable() { mbDeleteColorTable = sal_False; }
+ XBitmapListRef GetNewBitmapList() const { return mpNewBitmapList; }
+ const XBitmapListRef GetBitmapList() const { return mpBitmapList; }
};
/************************************************************************/
@@ -231,10 +228,10 @@ private:
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
- XColorList* pColorTab;
- XGradientList* pGradientList;
- XHatchList* pHatchingList;
- XBitmapList* pBitmapList;
+ XColorListRef pColorTab;
+ XGradientListRef pGradientList;
+ XHatchListRef pHatchingList;
+ XBitmapListRef pBitmapList;
ChangeType* pnColorTableState;
ChangeType* pnBitmapListState;
@@ -286,12 +283,12 @@ public:
virtual int DeactivatePage( SfxItemSet* pSet );
virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
- void SetGradientList( XGradientList* pGrdLst)
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
+ void SetGradientList( XGradientListRef pGrdLst)
{ pGradientList = pGrdLst; }
- void SetHatchingList( XHatchList* pHtchLst)
+ void SetHatchingList( XHatchListRef pHtchLst)
{ pHatchingList = pHtchLst; }
- void SetBitmapList( XBitmapList* pBmpLst) { pBitmapList = pBmpLst; }
+ void SetBitmapList( XBitmapListRef pBmpLst) { pBitmapList = pBmpLst; }
void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
@@ -326,7 +323,7 @@ private:
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
- XColorList* pColorTab;
+ XColorListRef pColorTab;
ChangeType* pnColorTableState;
sal_uInt16 nPageType;
sal_uInt16 nDlgType;
@@ -358,7 +355,7 @@ public:
virtual int DeactivatePage( SfxItemSet* pSet );
virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }
void SetAreaTP( sal_Bool* pIn ) { pbAreaTP = pIn; }
@@ -402,8 +399,8 @@ private:
const SfxItemSet& rOutAttrs;
- XColorList* pColorTab;
- XGradientList* pGradientList;
+ XColorListRef pColorTab;
+ XGradientListRef pGradientList;
ChangeType* pnGradientListState;
ChangeType* pnColorTableState;
@@ -443,8 +440,8 @@ public:
virtual void ActivatePage( const SfxItemSet& rSet );
virtual int DeactivatePage( SfxItemSet* pSet );
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
- void SetGradientList( XGradientList* pGrdLst)
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
+ void SetGradientList( XGradientListRef pGrdLst)
{ pGradientList = pGrdLst; }
void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
@@ -485,8 +482,8 @@ private:
const SfxItemSet& rOutAttrs;
RECT_POINT eRP;
- XColorList* pColorTab;
- XHatchList* pHatchingList;
+ XColorListRef pColorTab;
+ XHatchListRef pHatchingList;
ChangeType* pnHatchingListState;
ChangeType* pnColorTableState;
@@ -529,8 +526,8 @@ public:
virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
- void SetHatchingList( XHatchList* pHtchLst)
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
+ void SetHatchingList( XHatchListRef pHtchLst)
{ pHatchingList = pHtchLst; }
void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
@@ -573,8 +570,8 @@ private:
const SfxItemSet& rOutAttrs;
- XColorList* pColorTab;
- XBitmapList* pBitmapList;
+ XColorListRef pColorTab;
+ XBitmapListRef pBitmapList;
ChangeType* pnBitmapListState;
ChangeType* pnColorTableState;
@@ -619,8 +616,8 @@ public:
virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
- void SetBitmapList( XBitmapList* pBmpLst) { pBitmapList = pBmpLst; }
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
+ void SetBitmapList( XBitmapListRef pBmpLst) { pBitmapList = pBmpLst; }
void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
@@ -651,7 +648,7 @@ public: // FIXME: privatise these members ...
ImageButton aBtnSave;
SvxLoadSaveEmbed( Window *pParent, const ResId &aLoad,
const ResId &aSave, const ResId &aEmbed );
- XPropertyList *GetList();
+ XPropertyListRef GetList();
void HideLoadSaveEmbed();
bool GetEmbed();
void SetEmbed( bool bEmbed );
@@ -672,7 +669,7 @@ private:
ColorLB aLbColor;
FixedText aTableNameFT;
- ValueSet aValSetColorTable;
+ ValueSet aValSetColorList;
SvxXRectPreview aCtlPreviewOld;
SvxXRectPreview aCtlPreviewNew;
@@ -695,14 +692,13 @@ private:
const SfxItemSet& rOutAttrs;
- XColorList* pColorTab;
+ XColorListRef pColorTab;
ChangeType* pnColorTableState;
sal_uInt16* pPageType;
sal_uInt16* pDlgType;
sal_uInt16* pPos;
sal_Bool* pbAreaTP;
- sal_Bool bDeleteColorTable;
XOutdevItemPool* pXPool;
XFillStyleItem aXFStyleItem;
@@ -751,7 +747,7 @@ public:
virtual void ActivatePage( const SfxItemSet& rSet );
virtual int DeactivatePage( SfxItemSet* pSet );
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
@@ -760,8 +756,6 @@ public:
void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
- void SetDeleteColorTable( sal_Bool bIn ) { bDeleteColorTable = bIn; }
-
virtual void FillUserData();
};
diff --git a/cui/source/inc/cuitabline.hxx b/cui/source/inc/cuitabline.hxx
index 31481a5..8d8d456 100644
--- a/cui/source/inc/cuitabline.hxx
+++ b/cui/source/inc/cuitabline.hxx
@@ -30,13 +30,7 @@
// include ---------------------------------------------------------------
#include <vector>
-
#include <svx/tabline.hxx>
-/*************************************************************************
-|*
-|* Transform-Tab-Dialog
-|*
-\************************************************************************/
class SvxLineTabDialog : public SfxTabDialog
{
@@ -46,12 +40,12 @@ private:
const SfxItemSet& rOutAttrs;
- XColorList* pColorTab;
- XColorList* mpNewColorTab;
- XDashList* pDashList;
- XDashList* pNewDashList;
- XLineEndList* pLineEndList;
- XLineEndList* pNewLineEndList;
+ XColorListRef pColorTab;
+ XColorListRef mpNewColorTab;
+ XDashListRef pDashList;
+ XDashListRef pNewDashList;
+ XLineEndListRef pLineEndList;
+ XLineEndListRef pNewLineEndList;
sal_Bool bObjSelected;
ChangeType nLineEndListState;
@@ -64,7 +58,6 @@ private:
sal_uInt16 nPosLineEndLb;
sal_uInt16 mnPos;
sal_Bool mbAreaTP;
- sal_Bool mbDeleteColorTable;
virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
@@ -81,19 +74,19 @@ public:
sal_Bool bHasObj = sal_True );
~SvxLineTabDialog();
- void SetNewDashList( XDashList* pInLst)
+ void SetNewDashList( XDashListRef pInLst)
{ pNewDashList = pInLst; }
- XDashList* GetNewDashList() const { return pNewDashList; }
- const XDashList* GetDashList() const { return pDashList; }
+ XDashListRef GetNewDashList() const { return pNewDashList; }
+ XDashListRef GetDashList() const { return pDashList; }
- void SetNewLineEndList( XLineEndList* pInLst)
+ void SetNewLineEndList( XLineEndListRef pInLst)
{ pNewLineEndList = pInLst; }
- XLineEndList* GetNewLineEndList() const { return pNewLineEndList; }
- const XLineEndList* GetLineEndList() const { return pLineEndList; }
+ XLineEndListRef GetNewLineEndList() const { return pNewLineEndList; }
+ XLineEndListRef GetLineEndList() const { return pLineEndList; }
- void SetNewColorTable( XColorList* pColTab ) { mpNewColorTab = pColTab; }
- XColorList* GetNewColorTable() const { return mpNewColorTab; }
- const XColorList* GetColorTable() const { return pColorTab; }
+ void SetNewColorTable( XColorListRef pColTab ) { mpNewColorTab = pColTab; }
+ XColorListRef GetNewColorTable() const { return mpNewColorTab; }
+ XColorListRef GetColorList() const { return pColorTab; }
};
/*************************************************************************
@@ -172,9 +165,9 @@ private:
XLineAttrSetItem aXLineAttr;
SfxItemSet& rXLSet;
- XColorList* pColorTab;
- XDashList* pDashList;
- XLineEndList* pLineEndList;
+ XColorListRef pColorTab;
+ XDashListRef pDashList;
+ XLineEndListRef pLineEndList;
ChangeType* pnLineEndListState;
ChangeType* pnDashListState;
@@ -232,9 +225,9 @@ public:
virtual void FillUserData();
- void SetColorTable( XColorList* pColTab ) { pColorTab = pColTab; }
- void SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
- void SetLineEndList( XLineEndList* pLneEndLst) { pLineEndList = pLneEndLst; }
+ void SetColorList( XColorListRef pColTab ) { pColorTab = pColTab; }
+ void SetDashList( XDashListRef pDshLst ) { pDashList = pDshLst; }
+ void SetLineEndList( XLineEndListRef pLneEndLst) { pLineEndList = pLneEndLst; }
void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }
@@ -295,7 +288,7 @@ private:
XLineAttrSetItem aXLineAttr;
SfxItemSet& rXLSet;
- XDashList* pDashList;
+ XDashListRef pDashList;
ChangeType* pnDashListState;
sal_uInt16* pPageType;
@@ -336,7 +329,7 @@ public:
virtual void ActivatePage( const SfxItemSet& rSet );
virtual int DeactivatePage( SfxItemSet* pSet );
- void SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
+ void SetDashList( XDashListRef pDshLst ) { pDashList = pDshLst; }
void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
@@ -384,7 +377,7 @@ private:
XLineAttrSetItem aXLineAttr;
SfxItemSet& rXLSet;
- XLineEndList* pLineEndList;
+ XLineEndListRef pLineEndList;
ChangeType* pnLineEndListState;
sal_uInt16* pPageType;
@@ -416,7 +409,7 @@ public:
virtual void ActivatePage( const SfxItemSet& rSet );
virtual int DeactivatePage( SfxItemSet* pSet );
- void SetLineEndList( XLineEndList* pInList ) { pLineEndList = pInList; }
+ void SetLineEndList( XLineEndListRef pInList ) { pLineEndList = pInList; }
void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
diff --git a/cui/source/inc/sdrcelldlg.hxx b/cui/source/inc/sdrcelldlg.hxx
index 5760c58..3714d3c 100644
--- a/cui/source/inc/sdrcelldlg.hxx
+++ b/cui/source/inc/sdrcelldlg.hxx
@@ -31,22 +31,18 @@
#include <sfx2/tabdlg.hxx>
+#include <svx/xtable.hxx>
-class XColorList;
-class XGradientList;
-class XHatchList;
-class XBitmapList;
class SdrModel;
-
class SvxFormatCellsDialog : public SfxTabDialog
{
private:
const SfxItemSet& mrOutAttrs;
- XColorList* mpColorTab;
- XGradientList* mpGradientList;
- XHatchList* mpHatchingList;
- XBitmapList* mpBitmapList;
+ XColorListRef mpColorTab;
+ XGradientListRef mpGradientList;
+ XHatchListRef mpHatchingList;
+ XBitmapListRef mpBitmapList;
protected:
virtual void Apply();
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index 178786e..a5b7fd3 100644
--- a/cui/source/inc/treeopt.hxx
+++ b/cui/source/inc/treeopt.hxx
@@ -34,6 +34,7 @@
#include <vcl/image.hxx>
#include <vcl/fixbrd.hxx>
#include <vcl/fixed.hxx>
+#include <svx/xtable.hxx>
#include <vector>
@@ -200,7 +201,7 @@ private:
// for the ColorTabPage
SfxItemSet* pColorPageItemSet;
- XColorList* pColorTab;
+ XColorListRef pColorList;
sal_uInt16 nChangeType;
sal_uInt16 nUnknownType;
sal_uInt16 nUnknownPos;
@@ -271,8 +272,8 @@ public:
void ActivatePage( const String& rPageURL );
void ApplyItemSets();
- sal_uInt16 GetColorChanged() const { return nChangeType; }
- XColorList* GetColorTable() { return pColorTab; }
+ sal_uInt16 GetColorChanged() const { return nChangeType; }
+ XColorListRef GetColorList() { return pColorList; }
// helper functions to call the language settings TabPage from the SpellDialog
static void ApplyLanguageOptions(const SfxItemSet& rSet);
diff --git a/cui/source/options/cfgchart.cxx b/cui/source/options/cfgchart.cxx
index 969eae0..bac4fb4 100644
--- a/cui/source/options/cfgchart.cxx
+++ b/cui/source/options/cfgchart.cxx
@@ -310,7 +310,7 @@ int SvxChartColorTableItem::operator==( const SfxPoolItem& rAttr ) const
const SvxChartColorTableItem * rCTItem( dynamic_cast< const SvxChartColorTableItem * >( & rAttr ));
if( rCTItem )
{
- return (this->m_aColorTable == rCTItem->GetColorTable());
+ return (this->m_aColorTable == rCTItem->GetColorList());
}
return 0;
@@ -323,12 +323,12 @@ void SvxChartColorTableItem::SetOptions( SvxChartOptions* pOpts ) const
}
-SvxChartColorTable & SvxChartColorTableItem::GetColorTable()
+SvxChartColorTable & SvxChartColorTableItem::GetColorList()
{
return m_aColorTable;
}
-const SvxChartColorTable & SvxChartColorTableItem::GetColorTable() const
+const SvxChartColorTable & SvxChartColorTableItem::GetColorList() const
{
return m_aColorTable;
}
diff --git a/cui/source/options/cfgchart.hxx b/cui/source/options/cfgchart.hxx
index 95e0385..7fcf8e2 100644
--- a/cui/source/options/cfgchart.hxx
+++ b/cui/source/options/cfgchart.hxx
@@ -110,8 +110,8 @@ public:
virtual int operator==( const SfxPoolItem& ) const;
void SetOptions( SvxChartOptions* pOpts ) const;
- const SvxChartColorTable & GetColorTable() const ;
- SvxChartColorTable & GetColorTable();
+ const SvxChartColorTable & GetColorList() const ;
+ SvxChartColorTable & GetColorList();
void ReplaceColorByIndex( size_t _nIndex, const XColorEntry & _rEntry );
private:
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 0279a35..9200d64 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -81,7 +81,7 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage( Window* pParent, const SfxItemSe
aValSetColorBox.Show();
pChartOptions = new SvxChartOptions;
- pColorTab = new XColorList( SvtPathOptions().GetPalettePath() );
+ pColorList = XColorList::CreateStdColorList();
const SfxPoolItem* pItem = NULL;
if ( rInAttrs.GetItemState( SID_SCH_EDITOPTIONS, sal_False, &pItem ) == SFX_ITEM_SET )
@@ -102,18 +102,17 @@ SvxDefaultColorOptPage::SvxDefaultColorOptPage( Window* pParent, const SfxItemSe
SvxDefaultColorOptPage::~SvxDefaultColorOptPage()
{
// save changes
- pChartOptions->SetDefaultColors( pColorConfig->GetColorTable() );
+ pChartOptions->SetDefaultColors( pColorConfig->GetColorList() );
pChartOptions->Commit();
delete pColorConfig;
- delete pColorTab;
delete pChartOptions;
}
void SvxDefaultColorOptPage::Construct()
{
if( pColorConfig )
- aLbChartColors.FillBox( pColorConfig->GetColorTable() );
+ aLbChartColors.FillBox( pColorConfig->GetColorList() );
FillColorBox();
@@ -143,9 +142,9 @@ void SvxDefaultColorOptPage::Reset( const SfxItemSet& )
void SvxDefaultColorOptPage::FillColorBox()
{
- if( !pColorTab ) return;
+ if( !pColorList.is() ) return;
- long nCount = pColorTab->Count();
+ long nCount = pColorList->Count();
XColorEntry* pColorEntry;
if( nCount > 104 )
@@ -153,7 +152,7 @@ void SvxDefaultColorOptPage::FillColorBox()
for( long i = 0; i < nCount; i++ )
{
- pColorEntry = pColorTab->GetColor( i );
+ pColorEntry = pColorList->GetColor( i );
aValSetColorBox.InsertItem( (sal_uInt16) i + 1, pColorEntry->GetColor(), pColorEntry->GetName() );
}
}
@@ -161,16 +160,16 @@ void SvxDefaultColorOptPage::FillColorBox()
long SvxDefaultColorOptPage::GetColorIndex( const Color& rCol )
{
- if( pColorTab )
+ if( pColorList.is() )
{
- long nCount = pColorTab->Count();
+ long nCount = pColorList->Count();
XColorEntry* pColorEntry;
for( long i = nCount - 1; i >= 0; i-- ) // default chart colors are at the end of the table
{
- pColorEntry = pColorTab->GetColor( i );
+ pColorEntry = pColorList->GetColor( i );
if( pColorEntry && pColorEntry->GetColor() == rCol )
- return SAL_STATIC_CAST( XPropertyList*, pColorTab )->Get( pColorEntry->GetName() );
+ return pColorList->Get( pColorEntry->GetName() );
}
}
return -1L;
@@ -189,10 +188,10 @@ IMPL_LINK( SvxDefaultColorOptPage, ResetToDefaults, void *, EMPTYARG )
{
if( pColorConfig )
{
- pColorConfig->GetColorTable().useDefault();
+ pColorConfig->GetColorList().useDefault();
aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorTable() );
+ aLbChartColors.FillBox( pColorConfig->GetColorList() );
aLbChartColors.GetFocus();
aLbChartColors.SelectEntryPos( 0 );
@@ -211,13 +210,13 @@ IMPL_LINK( SvxDefaultColorOptPage, AddChartColor, void *, EMPTYARG )
{
ColorData black = RGB_COLORDATA( 0x00, 0x00, 0x00 );
- pColorConfig->GetColorTable().append (XColorEntry ( black, pColorConfig->GetColorTable().getDefaultName(pColorConfig->GetColorTable().size())));
+ pColorConfig->GetColorList().append (XColorEntry ( black, pColorConfig->GetColorList().getDefaultName(pColorConfig->GetColorList().size())));
aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorTable() );
+ aLbChartColors.FillBox( pColorConfig->GetColorList() );
aLbChartColors.GetFocus();
- aLbChartColors.SelectEntryPos( pColorConfig->GetColorTable().size() - 1 );
+ aLbChartColors.SelectEntryPos( pColorConfig->GetColorList().size() - 1 );
aPBRemove.Enable( sal_True );
}
@@ -236,21 +235,21 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
if( pColorConfig )
{
- OSL_ENSURE(pColorConfig->GetColorTable().size() > 1, "don't delete the last chart color");
+ OSL_ENSURE(pColorConfig->GetColorList().size() > 1, "don't delete the last chart color");
QueryBox aQuery(pButton, CUI_RES(RID_OPTQB_COLOR_CHART_DELETE));
aQuery.SetText(String(CUI_RES(RID_OPTSTR_COLOR_CHART_DELETE)));
if(RET_YES == aQuery.Execute())
{
- pColorConfig->GetColorTable().remove( nIndex );
+ pColorConfig->GetColorList().remove( nIndex );
aLbChartColors.Clear();
- aLbChartColors.FillBox( pColorConfig->GetColorTable() );
+ aLbChartColors.FillBox( pColorConfig->GetColorList() );
aLbChartColors.GetFocus();
if (nIndex == aLbChartColors.GetEntryCount() && aLbChartColors.GetEntryCount() > 0)
- aLbChartColors.SelectEntryPos( pColorConfig->GetColorTable().size() - 1 );
+ aLbChartColors.SelectEntryPos( pColorConfig->GetColorList().size() - 1 );
else if (aLbChartColors.GetEntryCount() > 0)
aLbChartColors.SelectEntryPos( nIndex );
else
@@ -261,30 +260,20 @@ IMPL_LINK( SvxDefaultColorOptPage, RemoveChartColor, PushButton*, pButton )
return 0L;
}
-// ListClickedHdl
-// --------------
-
-IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ChartColorLB*, pColorList )
+IMPL_LINK( SvxDefaultColorOptPage, ListClickedHdl, ChartColorLB*, _pColorList )
{
- Color aCol = pColorList->GetSelectEntryColor();
+ Color aCol = _pColorList->GetSelectEntryColor();
long nIndex = GetColorIndex( aCol );
if( nIndex == -1 ) // not found
- {
aValSetColorBox.SetNoSelection();
- }
else
- {
aValSetColorBox.SelectItem( (sal_uInt16)nIndex + 1 ); // ValueSet is 1-based
- }
return 0L;
}
-// BoxClickedHdl
-// -------------
-
IMPL_LINK( SvxDefaultColorOptPage, BoxClickedHdl, ValueSet*, EMPTYARG )
{
sal_uInt16 nIdx = aLbChartColors.GetSelectEntryPos();
diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx
index 1b2d528..3d9bd77 100644
--- a/cui/source/options/optchart.hxx
+++ b/cui/source/options/optchart.hxx
@@ -67,7 +67,7 @@ private:
SvxChartOptions* pChartOptions;
SvxChartColorTableItem* pColorConfig;
- XColorList* pColorTab;
+ XColorListRef pColorList;
DECL_LINK( ResetToDefaults, void * );
DECL_LINK( AddChartColor, void * );
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index de22b1f..76dca3b 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -553,7 +553,6 @@ sal_Bool OfaOptionsTreeListBox::Collapse( SvLBoxEntry* pParent )
sNotLoadedError ( CUI_RES( ST_LOAD_ERROR ) ),\
pCurrentPageEntry ( NULL ),\
pColorPageItemSet ( NULL ),\
- pColorTab ( NULL ),\
nChangeType ( CT_NONE ),\
nUnknownType ( COLORPAGE_UNKNOWN ),\
nUnknownPos ( COLORPAGE_UNKNOWN ),\
@@ -591,7 +590,6 @@ OfaTreeOptionsDialog::OfaTreeOptionsDialog(
OfaTreeOptionsDialog::OfaTreeOptionsDialog( Window* pParent, const rtl::OUString& rExtensionId ) :
SfxModalDialog( pParent, CUI_RES( RID_OFADLG_OPTIONS_TREE ) ),
-
INI_LIST()
{
@@ -1162,13 +1160,13 @@ IMPL_LINK( OfaTreeOptionsDialog, SelectHdl_Impl, Timer*, EMPTYARG )
pPageInfo->m_pPage = ::CreateGeneralTabPage(
pPageInfo->m_nPageId, this, *pColorPageItemSet );
SvxColorTabPage& rColPage = *(SvxColorTabPage*)pPageInfo->m_pPage;
- const OfaPtrItem* pPtr = NULL;
+ const OfaRefItem<XColorList> *pPtr = NULL;
if ( SfxViewFrame::Current() && SfxViewFrame::Current()->GetDispatcher() )
- pPtr = (const OfaPtrItem*)SfxViewFrame::Current()->
- GetDispatcher()->Execute( SID_GET_COLORTABLE, SFX_CALLMODE_SYNCHRON );
- pColorTab = pPtr ? (XColorList*)pPtr->GetValue() : &XColorList::GetStdColorTable();
+ pPtr = (const OfaRefItem<XColorList> *)SfxViewFrame::Current()->
+ GetDispatcher()->Execute( SID_GET_COLORLIST, SFX_CALLMODE_SYNCHRON );
+ pColorList = pPtr ? pPtr->GetValue() : XColorList::GetStdColorList();
- rColPage.SetColorTable( pColorTab );
+ rColPage.SetColorList( pColorList );
rColPage.SetPageType( &nUnknownType );
rColPage.SetDlgType( &nUnknownType );
rColPage.SetPos( &nUnknownPos );
@@ -2607,22 +2605,22 @@ short OfaTreeOptionsDialog::Execute()
if( RET_OK == nRet )
{
ApplyItemSets();
- if( GetColorTable() )
+ if( GetColorList().is() )
{
- GetColorTable()->Save();
+ GetColorList()->Save();
- // notify current viewframe it it uses the same color table
+ // notify current viewframe that it uses the same color table
if ( SfxViewFrame::Current() && SfxViewFrame::Current()->GetDispatcher() )
{
- const OfaPtrItem* pPtr = (const OfaPtrItem*)SfxViewFrame::Current()->GetDispatcher()->Execute( SID_GET_COLORTABLE, SFX_CALLMODE_SYNCHRON );
+ const OfaRefItem<XColorList> * pPtr = (const OfaRefItem<XColorList>*)SfxViewFrame::Current()->GetDispatcher()->Execute( SID_GET_COLORLIST, SFX_CALLMODE_SYNCHRON );
if( pPtr )
{
- XColorList* _pColorTab = (XColorList*)pPtr->GetValue();
+ XColorListRef _pColorList = pPtr->GetValue();
- if( _pColorTab &&
- _pColorTab->GetPath() == GetColorTable()->GetPath() &&
- _pColorTab->GetName() == GetColorTable()->GetName() )
- SfxObjectShell::Current()->PutItem( SvxColorTableItem( GetColorTable(), SID_COLOR_TABLE ) );
+ if( _pColorList.is() &&
+ _pColorList->GetPath() == GetColorList()->GetPath() &&
+ _pColorList->GetName() == GetColorList()->GetName() )
+ SfxObjectShell::Current()->PutItem( SvxColorListItem( GetColorList(), SID_COLOR_TABLE ) );
}
}
}
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index 86eb222..8d27b17 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -1133,20 +1133,16 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
{
SfxObjectShell* pDocSh = SfxObjectShell::Current();
const SfxPoolItem* pItem = NULL;
- XColorList* pColorTable = NULL;
+ XColorListRef pColorTable = NULL;
const Size aSize15x15 = Size( 15, 15 );
- bool bOwn = false;
if ( pDocSh && ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
- if ( !pColorTable )
- {
- bOwn = true;
- pColorTable = new XColorList( SvtPathOptions().GetPalettePath() );
- }
+ if ( !pColorTable.is() )
+ pColorTable = XColorList::CreateStdColorList();
- if ( pColorTable )
+ if ( pColorTable.is() )
{
short i = 0;
long nCount = pColorTable->Count();
@@ -1175,9 +1171,6 @@ void SvxBackgroundTabPage::FillColorValueSets_Impl()
}
}
- if ( bOwn )
- delete pColorTable;
-
aBackgroundColorSet.SetColCount( 8 );
aBackgroundColorSet.SetLineCount( 13 );
aBackgroundColorSet.CalcWindowSizePixel( aSize15x15 );
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index aa6466e..d663ffc 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -277,7 +277,7 @@ SvxBorderTabPage::SvxBorderTabPage( Window* pParent,
// ColorBox aus der XColorList fuellen.
SfxObjectShell* pDocSh = SfxObjectShell::Current();
const SfxPoolItem* pItem = NULL;
- XColorList* pColorTable = NULL;
+ XColorListRef pColorTable;
DBG_ASSERT( pDocSh, "DocShell not found!" );
@@ -285,12 +285,12 @@ SvxBorderTabPage::SvxBorderTabPage( Window* pParent,
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
DBG_ASSERT( pColorTable, "ColorTable not found!" );
- if ( pColorTable )
+ if ( pColorTable.is() )
{
// fuellen der Linienfarben-Box
aLbLineColor.SetUpdateMode( sal_False );
diff --git a/cui/source/tabpages/chardlg.cxx b/cui/source/tabpages/chardlg.cxx
index 33309de..782af95 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 );
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 4a47004..dd5d346 100644
--- a/cui/source/tabpages/numpages.cxx
+++ b/cui/source/tabpages/numpages.cxx
@@ -1342,31 +1342,24 @@ void SvxNumOptionsTabPage::Reset( const SfxItemSet& rSet )
{
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 )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
- if ( !pColorTable )
- {
- pColorTable = new XColorList( SvtPathOptions().GetPalettePath() );
- bKillTable = true;
- }
+ if ( !pColorTable.is() )
+ pColorTable = XColorList::CreateStdColorList();
- aBulColLB.InsertEntry( Color( COL_AUTO ), SVX_RESSTR( RID_SVXSTR_AUTOMATIC ));
+ aBulColLB.InsertEntry( Color( COL_AUTO ), SVX_RESSTR( RID_SVXSTR_AUTOMATIC ));
for ( long i = 0; i < pColorTable->Count(); i++ )
{
XColorEntry* pEntry = pColorTable->GetColor(i);
aBulColLB.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
-
- if ( bKillTable )
- delete pColorTable;
}
SfxObjectShell* pShell;
diff --git a/cui/source/tabpages/tabarea.cxx b/cui/source/tabpages/tabarea.cxx
index 95491d5..e7e4d97 100644
--- a/cui/source/tabpages/tabarea.cxx
+++ b/cui/source/tabpages/tabarea.cxx
@@ -67,8 +67,8 @@ SvxAreaTabDialog::SvxAreaTabDialog
SfxTabDialog( pParent, CUI_RES( RID_SVXDLG_AREA ), pAttr ),
mpDrawModel ( pModel ),
- mpColorTab ( pModel->GetColorTable() ),
- mpNewColorTab ( pModel->GetColorTable() ),
+ mpColorTab ( pModel->GetColorList() ),
+ mpNewColorTab ( pModel->GetColorList() ),
mpGradientList ( pModel->GetGradientList() ),
mpNewGradientList ( pModel->GetGradientList() ),
mpHatchingList ( pModel->GetHatchList() ),
@@ -83,8 +83,7 @@ SvxAreaTabDialog::SvxAreaTabDialog
mnPageType( PT_AREA ),
mnDlgType( 0 ),
mnPos( 0 ),
- mbAreaTP( sal_False ),
- mbDeleteColorTable( sal_True )
+ mbAreaTP( sal_False )
{
FreeResource();
@@ -115,57 +114,44 @@ SvxAreaTabDialog::~SvxAreaTabDialog()
void SvxAreaTabDialog::SavePalettes()
{
SfxObjectShell* pShell = SfxObjectShell::Current();
- if( mpNewColorTab != mpDrawModel->GetColorTable() )
+ if( mpNewColorTab != mpDrawModel->GetColorList() )
{
- if(mbDeleteColorTable)
- delete mpDrawModel->GetColorTable();
- mpDrawModel->SetColorTable( mpNewColorTab );
- SvxColorTableItem aColorTableItem( mpNewColorTab, SID_COLOR_TABLE );
+ mpDrawModel->SetPropertyList( static_cast<XPropertyList *>(mpNewColorTab.get()) );
+ SvxColorListItem aColorTableItem( mpNewColorTab, SID_COLOR_TABLE );
if ( pShell )
pShell->PutItem( aColorTableItem );
else
- {
mpDrawModel->GetItemPool().Put(aColorTableItem,SID_COLOR_TABLE);
- }
- mpColorTab = mpDrawModel->GetColorTable();
+ mpColorTab = mpDrawModel->GetColorList();
}
if( mpNewGradientList != mpDrawModel->GetGradientList() )
{
- delete mpDrawModel->GetGradientList();
- mpDrawModel->SetGradientList( mpNewGradientList );
+ mpDrawModel->SetPropertyList( static_cast<XPropertyList *>(mpNewGradientList.get()) );
SvxGradientListItem aItem( mpNewGradientList, SID_GRADIENT_LIST );
if ( pShell )
pShell->PutItem( aItem );
else
- {
mpDrawModel->GetItemPool().Put(aItem,SID_GRADIENT_LIST);
- }
mpGradientList = mpDrawModel->GetGradientList();
}
if( mpNewHatchingList != mpDrawModel->GetHatchList() )
{
- delete mpDrawModel->GetHatchList();
- mpDrawModel->SetHatchList( mpNewHatchingList );
+ mpDrawModel->SetPropertyList( static_cast<XPropertyList *>(mpNewHatchingList.get()) );
SvxHatchListItem aItem( mpNewHatchingList, SID_HATCH_LIST );
if ( pShell )
pShell->PutItem( aItem );
else
- {
mpDrawModel->GetItemPool().Put(aItem,SID_HATCH_LIST);
- }
mpHatchingList = mpDrawModel->GetHatchList();
}
if( mpNewBitmapList != mpDrawModel->GetBitmapList() )
{
- delete mpDrawModel->GetBitmapList();
- mpDrawModel->SetBitmapList( mpNewBitmapList );
+ mpDrawModel->SetPropertyList( static_cast<XPropertyList *>(mpNewBitmapList.get()) );
SvxBitmapListItem aItem( mpNewBitmapList, SID_BITMAP_LIST );
if ( pShell )
pShell->PutItem( aItem );
else
- {
mpDrawModel->GetItemPool().Put(aItem,SID_BITMAP_LIST);
- }
mpBitmapList = mpDrawModel->GetBitmapList();
}
@@ -183,9 +169,7 @@ void SvxAreaTabDialog::SavePalettes()
if ( pShell )
pShell->PutItem( aItem );
else
- {
mpDrawModel->GetItemPool().Put(aItem);
- }
}
if( mnBitmapListState & CT_MODIFIED )
@@ -223,7 +207,7 @@ void SvxAreaTabDialog::SavePalettes()
mpColorTab->SetPath( aPath );
mpColorTab->Save();
- SvxColorTableItem aItem( mpColorTab, SID_COLOR_TABLE );
+ SvxColorListItem aItem( mpColorTab, SID_COLOR_TABLE );
// ToolBoxControls werden benachrichtigt:
if ( pShell )
pShell->PutItem( aItem );
@@ -263,7 +247,7 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
switch( nId )
{
case RID_SVXPAGE_AREA:
- ( (SvxAreaTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxAreaTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxAreaTabPage&) rPage ).SetGradientList( mpGradientList );
( (SvxAreaTabPage&) rPage ).SetHatchingList( mpHatchingList );
( (SvxAreaTabPage&) rPage ).SetBitmapList( mpBitmapList );
@@ -283,7 +267,7 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
case RID_SVXPAGE_SHADOW:
{
- ( (SvxShadowTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxShadowTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxShadowTabPage&) rPage ).SetPageType( mnPageType );
( (SvxShadowTabPage&) rPage ).SetDlgType( mnDlgType );
( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
@@ -293,7 +277,7 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
break;
case RID_SVXPAGE_GRADIENT:
- ( (SvxGradientTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxGradientTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxGradientTabPage&) rPage ).SetGradientList( mpGradientList );
( (SvxGradientTabPage&) rPage ).SetPageType( &mnPageType );
( (SvxGradientTabPage&) rPage ).SetDlgType( &mnDlgType );
@@ -305,7 +289,7 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
break;
case RID_SVXPAGE_HATCH:
- ( (SvxHatchTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxHatchTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxHatchTabPage&) rPage ).SetHatchingList( mpHatchingList );
( (SvxHatchTabPage&) rPage ).SetPageType( &mnPageType );
( (SvxHatchTabPage&) rPage ).SetDlgType( &mnDlgType );
@@ -317,7 +301,7 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
break;
case RID_SVXPAGE_BITMAP:
- ( (SvxBitmapTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxBitmapTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxBitmapTabPage&) rPage ).SetBitmapList( mpBitmapList );
( (SvxBitmapTabPage&) rPage ).SetPageType( &mnPageType );
( (SvxBitmapTabPage&) rPage ).SetDlgType( &mnDlgType );
@@ -329,13 +313,12 @@ void SvxAreaTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
break;
case RID_SVXPAGE_COLOR:
- ( (SvxColorTabPage&) rPage ).SetColorTable( mpColorTab );
+ ( (SvxColorTabPage&) rPage ).SetColorList( mpColorTab );
( (SvxColorTabPage&) rPage ).SetPageType( &mnPageType );
( (SvxColorTabPage&) rPage ).SetDlgType( &mnDlgType );
( (SvxColorTabPage&) rPage ).SetPos( &mnPos );
( (SvxColorTabPage&) rPage ).SetAreaTP( &mbAreaTP );
( (SvxColorTabPage&) rPage ).SetColorChgd( &mnColorTableState );
- ( (SvxColorTabPage&) rPage ).SetDeleteColorTable( mbDeleteColorTable );
( (SvxColorTabPage&) rPage ).Construct();
break;
diff --git a/cui/source/tabpages/tabline.cxx b/cui/source/tabpages/tabline.cxx
index edd5d33..46f26b4 100644
--- a/cui/source/tabpages/tabline.cxx
+++ b/cui/source/tabpages/tabline.cxx
@@ -70,8 +70,8 @@ SvxLineTabDialog::SvxLineTabDialog
pDrawModel ( pModel ),
pObj ( pSdrObj ),
rOutAttrs ( *pAttr ),
- pColorTab ( pModel->GetColorTable() ),
- mpNewColorTab ( pModel->GetColorTable() ),
+ pColorTab ( pModel->GetColorList() ),
+ mpNewColorTab ( pModel->GetColorList() ),
pDashList ( pModel->GetDashList() ),
pNewDashList ( pModel->GetDashList() ),
pLineEndList ( pModel->GetLineEndList() ),
@@ -86,8 +86,7 @@ SvxLineTabDialog::SvxLineTabDialog
nPosDashLb( 0 ),
nPosLineEndLb( 0 ),
mnPos( 0 ),
- mbAreaTP( sal_False ),
- mbDeleteColorTable( sal_True )
+ mbAreaTP( sal_False )
{
FreeResource();
@@ -136,27 +135,23 @@ SvxLineTabDialog::~SvxLineTabDialog()
void SvxLineTabDialog::SavePalettes()
{
SfxObjectShell* pShell = SfxObjectShell::Current();
- if( mpNewColorTab != pDrawModel->GetColorTable() )
+ if( mpNewColorTab != pDrawModel->GetColorList() )
{
- if(mbDeleteColorTable)
- delete pDrawModel->GetColorTable();
- pDrawModel->SetColorTable( mpNewColorTab );
+ pDrawModel->SetPropertyList( static_cast<XPropertyList *>(mpNewColorTab.get()) );
if ( pShell )
- pShell->PutItem( SvxColorTableItem( mpNewColorTab, SID_COLOR_TABLE ) );
- pColorTab = pDrawModel->GetColorTable();
+ pShell->PutItem( SvxColorListItem( mpNewColorTab, SID_COLOR_TABLE ) );
+ pColorTab = pDrawModel->GetColorList();
}
if( pNewDashList != pDrawModel->GetDashList() )
{
- delete pDrawModel->GetDashList();
- pDrawModel->SetDashList( pNewDashList );
+ pDrawModel->SetPropertyList( static_cast<XPropertyList *>(pNewDashList.get()) );
if ( pShell )
pShell->PutItem( SvxDashListItem( pNewDashList, SID_DASH_LIST ) );
pDashList = pDrawModel->GetDashList();
}
if( pNewLineEndList != pDrawModel->GetLineEndList() )
{
- delete pDrawModel->GetLineEndList();
- pDrawModel->SetLineEndList( pNewLineEndList );
+ pDrawModel->SetPropertyList( static_cast<XPropertyList *>(pNewLineEndList.get()) );
if ( pShell )
pShell->PutItem( SvxLineEndListItem( pNewLineEndList, SID_LINEEND_LIST ) );
pLineEndList = pDrawModel->GetLineEndList();
@@ -193,7 +188,7 @@ void SvxLineTabDialog::SavePalettes()
// ToolBoxControls werden benachrichtigt:
if ( pShell )
- pShell->PutItem( SvxColorTableItem( pColorTab, SID_COLOR_TABLE ) );
+ pShell->PutItem( SvxColorListItem( pColorTab, SID_COLOR_TABLE ) );
}
}
@@ -227,7 +222,7 @@ void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
switch( nId )
{
case RID_SVXPAGE_LINE:
- ( (SvxLineTabPage&) rPage ).SetColorTable( pColorTab );
+ ( (SvxLineTabPage&) rPage ).SetColorList( pColorTab );
( (SvxLineTabPage&) rPage ).SetDashList( pDashList );
( (SvxLineTabPage&) rPage ).SetLineEndList( pLineEndList );
( (SvxLineTabPage&) rPage ).SetDlgType( nDlgType );
@@ -266,7 +261,7 @@ void SvxLineTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
case RID_SVXPAGE_SHADOW:
{
- ( (SvxShadowTabPage&) rPage ).SetColorTable( pColorTab );
+ ( (SvxShadowTabPage&) rPage ).SetColorList( pColorTab );
( (SvxShadowTabPage&) rPage ).SetPageType( nPageType );
( (SvxShadowTabPage&) rPage ).SetDlgType( nDlgType );
( (SvxShadowTabPage&) rPage ).SetAreaTP( &mbAreaTP );
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index a177e92..85e2ee9 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -805,7 +805,7 @@ void SvxAreaTabPage::ActivatePage( const SfxItemSet& rSet )
{
*pbAreaTP = sal_True;
- if( pColorTab )
+ if( pColorTab.is() )
{
sal_uInt16 _nPos = 0;
// Bitmapliste
@@ -2518,7 +2518,7 @@ void SvxAreaTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorListItem,SID_COLOR_TABLE,sal_False);
SFX_ITEMSET_ARG (&aSet,pGradientListItem,SvxGradientListItem,SID_GRADIENT_LIST,sal_False);
SFX_ITEMSET_ARG (&aSet,pHatchingListItem,SvxHatchListItem,SID_HATCH_LIST,sal_False);
SFX_ITEMSET_ARG (&aSet,pBitmapListItem,SvxBitmapListItem,SID_BITMAP_LIST,sal_False);
@@ -2527,7 +2527,7 @@ void SvxAreaTabPage::PageCreated (SfxAllItemSet aSet)
SFX_ITEMSET_ARG (&aSet,pPosItem,SfxUInt16Item,SID_TABPAGE_POS,sal_False);
if (pColorTabItem)
- SetColorTable(pColorTabItem->GetColorTable());
+ SetColorList(pColorTabItem->GetColorList());
if (pGradientListItem)
SetGradientList(pGradientListItem->GetGradientList());
if (pHatchingListItem)
diff --git a/cui/source/tabpages/tpbitmap.cxx b/cui/source/tabpages/tpbitmap.cxx
index 3deed69..4d4ea33 100644
--- a/cui/source/tabpages/tpbitmap.cxx
+++ b/cui/source/tabpages/tpbitmap.cxx
@@ -176,7 +176,7 @@ void SvxBitmapTabPage::ActivatePage( const SfxItemSet& )
{
*pbAreaTP = sal_False;
- if( pColorTab )
+ if( pColorTab.is() )
{
// ColorTable
if( *pnColorTableState & CT_CHANGED ||
@@ -958,14 +958,11 @@ IMPL_LINK( SvxBitmapTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
aPathURL.removeFinalSlash();
// Tabelle speichern
- XBitmapList* pBmpList = new XBitmapList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
+ XBitmapListRef pBmpList = XPropertyList::CreatePropertyList(
+ XBITMAP_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool )->AsBitmapList();
pBmpList->SetName( aURL.getName() );
if( pBmpList->Load() )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pBitmapList != ( (SvxAreaTabDialog*) DLGWIN )->GetBitmapList() )
- delete pBitmapList;
-
pBitmapList = pBmpList;
( (SvxAreaTabDialog*) DLGWIN )->SetNewBitmapList( pBitmapList );
diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx
index 89bc296..d49e86e 100644
--- a/cui/source/tabpages/tpcolor.cxx
+++ b/cui/source/tabpages/tpcolor.cxx
@@ -80,39 +80,39 @@ SvxLoadSaveEmbed::SvxLoadSaveEmbed( Window *pParent, const ResId &rLoad,
SetEmbed( GetEmbed() );
}
-XPropertyList *SvxLoadSaveEmbed::GetList()
+XPropertyListRef SvxLoadSaveEmbed::GetList()
{
SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( pTopDlg );
SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( pTopDlg );
- const XPropertyList *pList = NULL;
+ XColorListRef pList;
if( pArea )
pList = pArea->GetNewColorTable();
if( pLine )
pList = pLine->GetNewColorTable();
- if( !pList ) {
+ if( !pList.is() ) {
if( pArea )
- pList = pArea->GetColorTable();
+ pList = pArea->GetColorList();
if( pLine )
- pList = pLine->GetColorTable();
+ pList = pLine->GetColorList();
}
- return const_cast<XPropertyList *>(pList);
+ return XPropertyListRef( static_cast< XPropertyList * >( pList.get() ) );
}
void SvxLoadSaveEmbed::SetEmbed( bool bEmbed )
{
- XPropertyList *pList = GetList();
- if( pList)
+ XPropertyListRef pList = GetList();
+ if( pList.is() )
pList->SetEmbedInDocument( bEmbed );
aBoxEmbed.Check( bEmbed );
}
bool SvxLoadSaveEmbed::GetEmbed()
{
- XPropertyList *pList = GetList();
- return pList ? pList->IsEmbedInDocument() : 0;
+ XPropertyListRef pList = GetList();
+ return pList.is() ? pList->IsEmbedInDocument() : 0;
}
IMPL_LINK( SvxLoadSaveEmbed, EmbedToggleHdl_Impl, void *, EMPTYARG )
@@ -145,7 +145,7 @@ SvxColorTabPage::SvxColorTabPage
aLbColor ( this, CUI_RES( LB_COLOR ) ),
aTableNameFT ( this, CUI_RES( FT_TABLE_NAME ) ),
- aValSetColorTable ( this, CUI_RES( CTL_COLORTABLE ) ),
+ aValSetColorList ( this, CUI_RES( CTL_COLORTABLE ) ),
aCtlPreviewOld ( this, CUI_RES( CTL_PREVIEW_OLD ) ),
aCtlPreviewNew ( this, CUI_RES( CTL_PREVIEW_NEW ) ),
@@ -167,8 +167,6 @@ SvxColorTabPage::SvxColorTabPage
rOutAttrs ( rInAttrs ),
pColorTab( NULL ),
- bDeleteColorTable ( sal_True ),
-
pXPool ( (XOutdevItemPool*) rInAttrs.GetPool() ),
aXFStyleItem ( XFILL_SOLID ),
aXFillColorItem ( String(), Color( COL_BLACK ) ),
@@ -192,7 +190,7 @@ SvxColorTabPage::SvxColorTabPage
// Handler ueberladen
aLbColor.SetSelectHdl(
LINK( this, SvxColorTabPage, SelectColorLBHdl_Impl ) );
- aValSetColorTable.SetSelectHdl(
+ aValSetColorList.SetSelectHdl(
LINK( this, SvxColorTabPage, SelectValSetHdl_Impl ) );
aLbColorModel.SetSelectHdl(
LINK( this, SvxColorTabPage, SelectColorModelHdl_Impl ) );
@@ -214,11 +212,11 @@ SvxColorTabPage::SvxColorTabPage
aBtnSave.SetClickHdl( LINK( this, SvxColorTabPage, ClickSaveHdl_Impl ) );
// ValueSet
- aValSetColorTable.SetStyle( aValSetColorTable.GetStyle() | WB_VSCROLL | WB_ITEMBORDER );
- aValSetColorTable.SetColCount( 8 );
- aValSetColorTable.SetLineCount( 13 );
- aValSetColorTable.SetExtraSpacing( 0 );
- aValSetColorTable.Show();
+ aValSetColorList.SetStyle( aValSetColorList.GetStyle() | WB_VSCROLL | WB_ITEMBORDER );
+ aValSetColorList.SetColCount( 8 );
+ aValSetColorList.SetLineCount( 13 );
+ aValSetColorList.SetExtraSpacing( 0 );
+ aValSetColorList.Show();
aLbColorModel.SetAccessibleName( String( CUI_RES(STR_CUI_COLORMODEL) ) );
aBtnAdd.SetAccessibleRelationMemberOf( &aFlProp );
@@ -232,7 +230,7 @@ SvxColorTabPage::SvxColorTabPage
void SvxColorTabPage::Construct()
{
aLbColor.Fill( pColorTab );
- FillValueSet_Impl( aValSetColorTable );
+ FillValueSet_Impl( aValSetColorList );
}
// -----------------------------------------------------------------------
@@ -243,12 +241,12 @@ void SvxColorTabPage::ActivatePage( const SfxItemSet& )
{
*pbAreaTP = sal_False;
- if( pColorTab )
+ if( pColorTab.is() )
{
if( *pPageType == PT_COLOR && *pPos != LISTBOX_ENTRY_NOTFOUND )
{
aLbColor.SelectEntryPos( *pPos );
- aValSetColorTable.SelectItem( aLbColor.GetSelectEntryPos() + 1 );
+ aValSetColorList.SelectItem( aLbColor.GetSelectEntryPos() + 1 );
aEdtName.SetText( aLbColor.GetSelectEntry() );
ChangeColorHdl_Impl( this );
@@ -433,7 +431,7 @@ void SvxColorTabPage::Reset( const SfxItemSet& rSet )
{
XFillColorItem aColorItem( (const XFillColorItem&)rSet.Get( XATTR_FILLCOLOR ) );
aLbColor.SelectEntry( aColorItem.GetColorValue() );
- aValSetColorTable.SelectItem( aLbColor.GetSelectEntryPos() + 1 );
+ aValSetColorList.SelectItem( aLbColor.GetSelectEntryPos() + 1 );
aEdtName.SetText( aLbColor.GetSelectEntry() );
}
@@ -564,7 +562,7 @@ IMPL_LINK( SvxColorTabPage, ClickAddHdl_Impl, void *, EMPTYARG )
pColorTab->Insert( pEntry, pColorTab->Count() );
aLbColor.Append( pEntry );
- aValSetColorTable.InsertItem( aValSetColorTable.GetItemCount() + 1,
+ aValSetColorList.InsertItem( aValSetColorList.GetItemCount() + 1,
pEntry->GetColor(), pEntry->GetName() );
aLbColor.SelectEntryPos( aLbColor.GetEntryCount() - 1 );
@@ -653,8 +651,8 @@ IMPL_LINK( SvxColorTabPage, ClickModifyHdl_Impl, void *, EMPTYARG )
aLbColor.Modify( pEntry, nPos );
aLbColor.SelectEntryPos( nPos );
/////
- aValSetColorTable.SetItemColor( nPos + 1, pEntry->GetColor() );
- aValSetColorTable.SetItemText( nPos + 1, pEntry->GetName() );
+ aValSetColorList.SetItemColor( nPos + 1, pEntry->GetColor() );
+ aValSetColorList.SetItemText( nPos + 1, pEntry->GetName() );
aEdtName.SetText( aName );
aCtlPreviewOld.Invalidate();
@@ -740,8 +738,8 @@ IMPL_LINK( SvxColorTabPage, ClickDeleteHdl_Impl, void *, EMPTYARG )
// Listbox und ValueSet aktualisieren
aLbColor.RemoveEntry( nPos );
- aValSetColorTable.Clear();
- FillValueSet_Impl( aValSetColorTable );
+ aValSetColorList.Clear();
+ FillValueSet_Impl( aValSetColorList );
// Positionieren
aLbColor.SelectEntryPos( nPos );
@@ -802,43 +800,23 @@ IMPL_LINK( SvxColorTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
aPathURL.removeFinalSlash();
// Tabelle speichern
- XColorList* pColTab = new XColorList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
- pColTab->SetName( aURL.getName() ); // XXX
- if( pColTab->Load() )
+ XColorListRef pColList = XPropertyList::CreatePropertyList(
+ XCOLOR_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool )->AsColorList();
+ pColList->SetName( aURL.getName() ); // XXX
+ if( pColList->Load() )
{
// Pruefen, ob Tabelle geloescht werden darf:
- const XColorList *pTempList = 0;
SvxAreaTabDialog* pArea = dynamic_cast< SvxAreaTabDialog* >( DLGWIN );
SvxLineTabDialog* pLine = dynamic_cast< SvxLineTabDialog* >( DLGWIN );
- if( pArea )
- {
- pTempList = pArea->GetColorTable();
- }
- else if( pLine )
- {
- pTempList = pLine->GetColorTable();
- }
- if( pColorTab != pTempList )
- {
- if( bDeleteColorTable )
- delete pColorTab;
- else
- bDeleteColorTable = sal_True;
- }
-
- pColorTab = pColTab;
+ pColorTab = pColList;
if( pArea )
- {
pArea->SetNewColorTable( pColorTab );
- }
else if( pLine )
- {
pLine->SetNewColorTable( pColorTab );
- }
aLbColor.Clear();
- aValSetColorTable.Clear();
+ aValSetColorList.Clear();
Construct();
Reset( rOutAttrs );
@@ -973,7 +951,7 @@ IMPL_LINK( SvxColorTabPage, SelectColorLBHdl_Impl, void *, EMPTYARG )
sal_uInt16 nPos = aLbColor.GetSelectEntryPos();
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
- aValSetColorTable.SelectItem( nPos + 1 );
+ aValSetColorList.SelectItem( nPos + 1 );
aEdtName.SetText( aLbColor.GetSelectEntry() );
rXFSet.Put( XFillColorItem( String(),
@@ -993,7 +971,7 @@ IMPL_LINK( SvxColorTabPage, SelectColorLBHdl_Impl, void *, EMPTYARG )
IMPL_LINK( SvxColorTabPage, SelectValSetHdl_Impl, void *, EMPTYARG )
{
- sal_uInt16 nPos = aValSetColorTable.GetSelectItemId();
+ sal_uInt16 nPos = aValSetColorList.GetSelectItemId();
if( nPos != LISTBOX_ENTRY_NOTFOUND )
{
aLbColor.SelectEntryPos( nPos - 1 );
diff --git a/cui/source/tabpages/tpgradnt.cxx b/cui/source/tabpages/tpgradnt.cxx
index d762f74..b2b6c36 100644
--- a/cui/source/tabpages/tpgradnt.cxx
+++ b/cui/source/tabpages/tpgradnt.cxx
@@ -182,7 +182,7 @@ void SvxGradientTabPage::ActivatePage( const SfxItemSet& )
{
*pbAreaTP = sal_False;
- if( pColorTab )
+ if( pColorTab.is() )
{
// ColorTable
if( *pnColorTableState & CT_CHANGED ||
@@ -678,16 +678,12 @@ IMPL_LINK( SvxGradientTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
aPathURL.removeFinalSlash();
// Liste speichern
- XGradientList* pGrdList = new XGradientList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
+ XGradientListRef pGrdList = XPropertyList::CreatePropertyList(
+ XGRADIENT_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool )->AsGradientList();
pGrdList->SetName( aURL.getName() );
if ( pGrdList->Load() )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- if ( pGradientList !=
- ( (SvxAreaTabDialog*) DLGWIN )->GetGradientList() )
- delete pGradientList;
-
pGradientList = pGrdList;
( (SvxAreaTabDialog*) DLGWIN )->
SetNewGradientList( pGradientList );
diff --git a/cui/source/tabpages/tphatch.cxx b/cui/source/tabpages/tphatch.cxx
index de7365e..556b5c4 100644
--- a/cui/source/tabpages/tphatch.cxx
+++ b/cui/source/tabpages/tphatch.cxx
@@ -180,7 +180,7 @@ void SvxHatchTabPage::ActivatePage( const SfxItemSet& rSet )
{
*pbAreaTP = sal_False;
- if( pColorTab )
+ if( pColorTab.is() )
{
// ColorTable
if( *pnColorTableState & CT_CHANGED ||
@@ -722,15 +722,11 @@ IMPL_LINK( SvxHatchTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- // Liste speichern
- XHatchList* pHatchList = new XHatchList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
+ XHatchListRef pHatchList = XPropertyList::CreatePropertyList(
+ XHATCH_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool )->AsHatchList();
pHatchList->SetName( aURL.getName() );
if( pHatchList->Load() )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pHatchingList != ( (SvxAreaTabDialog*) DLGWIN )->GetHatchingList() )
- delete pHatchingList;
-
pHatchingList = pHatchList;
( (SvxAreaTabDialog*) DLGWIN )->SetNewHatchingList( pHatchingList );
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index ac170a2..e952445 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -309,7 +309,7 @@ void SvxLineTabPage::ActivatePage( const SfxItemSet& rSet )
SFX_ITEMSET_ARG (&rSet,pPageTypeItem,CntUInt16Item,SID_PAGE_TYPE,sal_False);
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue());
- if( nDlgType == 0 && pDashList )
+ if( nDlgType == 0 && pDashList.is() )
{
sal_uInt16 nPos;
sal_uInt16 nCount;
@@ -1833,7 +1833,7 @@ void SvxLineTabPage::DataChanged( const DataChangedEvent& rDCEvt )
void SvxLineTabPage::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorListItem,SID_COLOR_TABLE,sal_False);
SFX_ITEMSET_ARG (&aSet,pDashListItem,SvxDashListItem,SID_DASH_LIST,sal_False);
SFX_ITEMSET_ARG (&aSet,pLineEndListItem,SvxLineEndListItem,SID_LINEEND_LIST,sal_False);
SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
@@ -1843,7 +1843,7 @@ void SvxLineTabPage::PageCreated (SfxAllItemSet aSet)
SFX_ITEMSET_ARG (&aSet,pGraphicItem,SvxGraphicItem,SID_GRAPHIC,sal_False);
if (pColorTabItem)
- SetColorTable(pColorTabItem->GetColorTable());
+ SetColorList(pColorTabItem->GetColorList());
if (pDashListItem)
SetDashList(pDashListItem->GetDashList());
if (pLineEndListItem)
diff --git a/cui/source/tabpages/tplnedef.cxx b/cui/source/tabpages/tplnedef.cxx
index 41f7085..6dfe68a 100644
--- a/cui/source/tabpages/tplnedef.cxx
+++ b/cui/source/tabpages/tplnedef.cxx
@@ -199,7 +199,7 @@ void SvxLineDefTabPage::ActivatePage( const SfxItemSet& )
if( *pDlgType == 0 ) // Flaechen-Dialog
{
// ActivatePage() wird aufgerufen bevor der Dialog PageCreated() erhaelt !!!
- if( pDashList )
+ if( pDashList.is() )
{
if( *pPageType == 1 &&
*pPosDashLb != LISTBOX_ENTRY_NOTFOUND )
@@ -790,16 +790,12 @@ IMPL_LINK( SvxLineDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- // Liste speichern
- XDashList* pDshLst = new XDashList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
+ XDashListRef pDshLst = XPropertyList::CreatePropertyList(
+ XGRADIENT_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool )->AsDashList();
pDshLst->SetName( aURL.getName() );
if( pDshLst->Load() )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pDashList != ( (SvxLineTabDialog*) DLGWIN )->GetDashList() )
- delete pDashList;
-
pDashList = pDshLst;
( (SvxLineTabDialog*) DLGWIN )->SetNewDashList( pDashList );
diff --git a/cui/source/tabpages/tplneend.cxx b/cui/source/tabpages/tplneend.cxx
index 30b94a0..572b0af 100644
--- a/cui/source/tabpages/tplneend.cxx
+++ b/cui/source/tabpages/tplneend.cxx
@@ -176,7 +176,7 @@ void SvxLineEndDefTabPage::ActivatePage( const SfxItemSet& )
if( *pDlgType == 0 ) // Flaechen-Dialog
{
// ActivatePage() wird aufgerufen bevor der Dialog PageCreated() erhaelt !!!
- if( pLineEndList )
+ if( pLineEndList.is() )
{
if( *pPosLineEndLb != LISTBOX_ENTRY_NOTFOUND )
{
@@ -593,15 +593,11 @@ IMPL_LINK( SvxLineEndDefTabPage, ClickLoadHdl_Impl, void *, EMPTYARG )
aPathURL.removeSegment();
aPathURL.removeFinalSlash();
- // Liste speichern
- XLineEndList* pLeList = new XLineEndList( aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool );
+ XLineEndListRef pLeList = XPropertyList::CreatePropertyList(
+ XLINE_END_LIST, aPathURL.GetMainURL( INetURLObject::NO_DECODE ), pXPool )->AsLineEndList();
pLeList->SetName( aURL.getName() );
if( pLeList->Load() )
{
- // Pruefen, ob Tabelle geloescht werden darf:
- if( pLineEndList != ( (SvxLineTabDialog*) DLGWIN )->GetLineEndList() )
- delete pLineEndList;
-
pLineEndList = pLeList;
( (SvxLineTabDialog*) DLGWIN )->SetNewLineEndList( pLineEndList );
aLbLineEnds.Clear();
diff --git a/cui/source/tabpages/tpshadow.cxx b/cui/source/tabpages/tpshadow.cxx
index 086f4f4..dd5e4e7 100644
--- a/cui/source/tabpages/tpshadow.cxx
+++ b/cui/source/tabpages/tpshadow.cxx
@@ -224,7 +224,7 @@ void SvxShadowTabPage::ActivatePage( const SfxItemSet& rSet )
if( nDlgType == 0 )
{
- if( pColorTab )
+ if( pColorTab.is() )
{
// ColorTable
if( *pnColorTableState & CT_CHANGED ||
@@ -596,13 +596,13 @@ void SvxShadowTabPage::PointChanged( Window* pWindow, RECT_POINT eRcPt )
void SvxShadowTabPage::PageCreated (SfxAllItemSet aSet)
{
- SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorTableItem,SID_COLOR_TABLE,sal_False);
+ SFX_ITEMSET_ARG (&aSet,pColorTabItem,SvxColorListItem,SID_COLOR_TABLE,sal_False);
SFX_ITEMSET_ARG (&aSet,pPageTypeItem,SfxUInt16Item,SID_PAGE_TYPE,sal_False);
SFX_ITEMSET_ARG (&aSet,pDlgTypeItem,SfxUInt16Item,SID_DLG_TYPE,sal_False);
if (pColorTabItem)
- SetColorTable(pColorTabItem->GetColorTable());
+ SetColorList(pColorTabItem->GetColorList());
if (pPageTypeItem)
SetPageType(pPageTypeItem->GetValue());
if (pDlgTypeItem)
diff --git a/extensions/source/propctrlr/standardcontrol.cxx b/extensions/source/propctrlr/standardcontrol.cxx
index ee55c3d..83d694d 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() );
}
}
diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx
index aad4c9b..a5d55fb 100644
--- a/reportdesign/source/ui/dlg/Condition.cxx
+++ b/reportdesign/source/ui/dlg/Condition.cxx
@@ -151,9 +151,9 @@ OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition)
m_aColorSet.SetHelpId( HID_RPT_POPUP_COLOR_CTRL );
SetHelpId( HID_RPT_POPUP_COLOR );
const Size aSize12( 13, 13 );
- ::std::auto_ptr<XColorList> pColorTable(new XColorList( SvtPathOptions().GetPalettePath() ));
short i = 0;
- long nCount = pColorTable->Count();
+ XColorListRef pColorList( XColorList::CreateStdColorList() );
+ long nCount = pColorList->Count();
XColorEntry* pEntry = NULL;
Color aColWhite( COL_WHITE );
String aStrWhite( ModuleRes(STR_COLOR_WHITE) );
@@ -164,7 +164,7 @@ OColorPopup::OColorPopup(Window* _pParent,Condition* _pCondition)
for ( i = 0; i < nCount; i++ )
{
- pEntry = pColorTable->GetColor(i);
+ pEntry = pColorList->GetColor(i);
m_aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() );
}
diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx
index 4904169..e8e815e 100644
--- a/reportdesign/source/ui/misc/UITools.cxx
+++ b/reportdesign/source/ui/misc/UITools.cxx
@@ -660,7 +660,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
Window* pParent = VCLUnoHelper::GetWindow( _rxParentWindow );
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<FontList> pFontList(new FontList( pParent ));
- ::std::auto_ptr<XColorList> pColorTable( new XColorList( SvtPathOptions().GetPalettePath() ));
+ XColorListRef pColorList( XColorList::CreateStdColorList() );
SAL_WNODEPRECATED_DECLARATIONS_POP
SfxPoolItem* pDefaults[] =
{
@@ -682,7 +682,7 @@ bool openCharDialog( const uno::Reference<report::XReportControlFormat >& _rxRep
new SvxEscapementItem(ITEMID_ESCAPEMENT),
new SvxFontListItem(pFontList.get(),ITEMID_FONTLIST),
new SvxAutoKernItem(sal_False,ITEMID_AUTOKERN),
- new SvxColorTableItem(pColorTable.get(),ITEMID_COLOR_TABLE),
+ new SvxColorListItem(pColorList.get(),ITEMID_COLOR_TABLE),
new SvxBlinkItem(sal_False,ITEMID_BLINK),
new SvxEmphasisMarkItem(EMPHASISMARK_NONE,ITEMID_EMPHASISMARK),
new SvxTwoLinesItem(sal_True,0,0,ITEMID_TWOLINES),
@@ -777,18 +777,9 @@ bool openAreaDialog( const uno::Reference<report::XShape >& _xShape,const uno::R
SAL_WNODEPRECATED_DECLARATIONS_PUSH
::std::auto_ptr<AbstractSvxAreaTabDialog> pDialog(pFact->CreateSvxAreaTabDialog( pParent,pDescriptor.get(),pModel.get() ));
SAL_WNODEPRECATED_DECLARATIONS_POP
- // #i74099# by default, the dialog deletes the current color table if a different one is loaded
- // (see SwDrawShell::ExecDrawDlg)
- const SvxColorTableItem* pColorItem = static_cast<const SvxColorTableItem*>( pDescriptor->GetItem(SID_COLOR_TABLE) );
- if (pColorItem && pColorItem->GetColorTable() == &XColorList::GetStdColorTable())
- pDialog->DontDeleteColorTable();
- bSuccess = ( RET_OK == pDialog->Execute() );
- if ( bSuccess )
- {
+ if ( ( bSuccess = ( RET_OK == pDialog->Execute() ) ) )
lcl_fillItemsToShape(_xShape,*pDialog->GetOutputItemSet());
- }
}
-
}
catch(uno::Exception&)
{
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 30a3639..0d1e13d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -235,7 +235,7 @@ private:
SfxPrinter* pPrinter;
VirtualDevice* pVirtualDevice_100th_mm;
ScDrawLayer* pDrawLayer; // SdrModel
- XColorList* pColorTable;
+ rtl::Reference<XColorList> pColorList;
ScConditionalFormatList* pCondFormList; // conditional formats
ScValidationDataList* pValidationList; // validity
SvNumberFormatterIndexTable* pFormatExchangeList; // for application of number formats
@@ -433,8 +433,8 @@ public:
void GetDocStat( ScDocStat& rDocStat );
- SC_DLLPUBLIC void InitDrawLayer( SfxObjectShell* pDocShell = NULL );
- XColorList* GetColorTable();
+ SC_DLLPUBLIC void InitDrawLayer( SfxObjectShell* pDocShell = NULL );
+ rtl::Reference<XColorList> GetColorList();
SC_DLLPUBLIC sfx2::LinkManager* GetLinkManager() const;
@@ -1837,7 +1837,6 @@ private: // CLOOK-Impl-methods
void ImplDeleteOptions();
void DeleteDrawLayer();
- void DeleteColorTable();
SC_DLLPUBLIC sal_Bool DrawGetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const;
void DrawMovePage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
void DrawCopyPage( sal_uInt16 nOldPos, sal_uInt16 nNewPos );
diff --git a/sc/sdi/docsh.sdi b/sc/sdi/docsh.sdi
index edf00e8..3cc5609 100644
--- a/sc/sdi/docsh.sdi
+++ b/sc/sdi/docsh.sdi
@@ -100,7 +100,7 @@ interface TableDocument
SID_REIMPORT_AFTER_LOAD [ ExecMethod = Execute; ]
SID_AUTO_STYLE [ ExecMethod = Execute; ]
- SID_GET_COLORTABLE [ ExecMethod = Execute; ]
+ SID_GET_COLORLIST [ ExecMethod = Execute; ]
FID_CHG_RECORD [ ExecMethod = Execute; StateMethod = GetState; ]
SID_DOCUMENT_COMPARE [ ExecMethod = Execute; StateMethod = GetState; ]
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 2c6cee5..97d8344 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -37,6 +37,7 @@
#include <editeng/editeng.hxx>
#include <editeng/forbiddencharacterstable.hxx>
+#include <svx/xtable.hxx>
#include <sfx2/linkmgr.hxx>
#include <svx/svdpool.hxx>
#include <svx/svdobj.hxx>
@@ -135,7 +136,6 @@ ScDocument::ScDocument( ScDocumentMode eMode,
pPrinter( NULL ),
pVirtualDevice_100th_mm( NULL ),
pDrawLayer( NULL ),
- pColorTable( NULL ),
pCondFormList( NULL ),
pValidationList( NULL ),
pFormatExchangeList( NULL ),
@@ -451,7 +451,6 @@ ScDocument::~ScDocument()
xPoolHelper->SourceDocumentGone();
xPoolHelper.clear();
- DeleteColorTable();
delete pScriptTypeData;
delete pOtherObjects;
delete pRecursionHelper;
diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx
index f756160..87115e4 100644
--- a/sc/source/core/data/documen9.cxx
+++ b/sc/source/core/data/documen9.cxx
@@ -83,19 +83,15 @@ void ScDocument::BeginDrawUndo()
pDrawLayer->BeginCalcUndo();
}
-XColorList* ScDocument::GetColorTable()
+rtl::Reference<XColorList> ScDocument::GetColorList()
{
if (pDrawLayer)
- return pDrawLayer->GetColorTable();
+ return pDrawLayer->GetColorList();
else
{
- if (!pColorTable)
- {
- SvtPathOptions aPathOpt;
- pColorTable = new XColorList( aPathOpt.GetPalettePath() );
- }
-
- return pColorTable;
+ if (!pColorList.is())
+ pColorList = XColorList::CreateStdColorList();
+ return pColorList;
}
}
@@ -239,7 +235,7 @@ sal_Bool ScDocument::IsChart( const SdrObject* pObject )
IMPL_LINK_INLINE_START( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex )
{
- return (long) &((GetColorTable()->GetColor(*pColorIndex))->GetColor());
+ return (long) &((GetColorList()->GetColor(*pColorIndex))->GetColor());
}
IMPL_LINK_INLINE_END( ScDocument, GetUserDefinedColor, sal_uInt16 *, pColorIndex )
@@ -248,11 +244,6 @@ void ScDocument::DeleteDrawLayer()
delete pDrawLayer;
}
-void ScDocument::DeleteColorTable()
-{
- delete pColorTable;
-}
-
sal_Bool ScDocument::DrawGetPrintArea( ScRange& rRange, sal_Bool bSetHor, sal_Bool bSetVer ) const
{
return pDrawLayer->GetPrintArea( rRange, bSetHor, bSetVer );
diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 9ef0e33..6e22a8c 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -236,17 +236,17 @@ ScDrawLayer::ScDrawLayer( ScDocument* pDocument, const String& rName ) :
pGlobalDrawPersist = NULL; // nur einmal benutzen
SfxObjectShell* pObjSh = pDocument ? pDocument->GetDocumentShell() : NULL;
+ XColorListRef pXCol = XColorList::GetStdColorList();
if ( pObjSh )
{
SetObjectShell( pObjSh );
// set color table
- SvxColorTableItem* pColItem = (SvxColorTableItem*) pObjSh->GetItem( SID_COLOR_TABLE );
- XColorList* pXCol = pColItem ? pColItem->GetColorTable() : &XColorList::GetStdColorTable();
- SetColorTable( pXCol );
+ SvxColorListItem* pColItem = (SvxColorListItem*) pObjSh->GetItem( SID_COLOR_TABLE );
+ if ( pColItem )
+ pXCol = pColItem->GetColorList();
}
- else
- SetColorTable( &XColorList::GetStdColorTable() );
+ SetPropertyList( static_cast<XPropertyList *> (pXCol.get()) );
SetSwapGraphics(sal_True);
diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx
index 5e1cbc3..91e0c01 100644
--- a/sc/source/ui/dbgui/scendlg.cxx
+++ b/sc/source/ui/dbgui/scendlg.cxx
@@ -83,14 +83,14 @@ ScNewScenarioDlg::ScNewScenarioDlg( Window* pParent, const String& rName, sal_Bo
const SfxPoolItem* pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem )
{
- XColorList* pColorTable = ((SvxColorTableItem*)pItem)->GetColorTable();
- if (pColorTable)
+ XColorListRef pColorList = ((SvxColorListItem*)pItem)->GetColorList();
+ if (pColorList.is())
{
aLbColor.SetUpdateMode( false );
- long nCount = pColorTable->Count();
+ long nCount = pColorList->Count();
for ( long n=0; n<nCount; n++ )
{
- XColorEntry* pEntry = pColorTable->GetColor(n);
+ XColorEntry* pEntry = pColorList->GetColor(n);
aLbColor.InsertEntry( pEntry->GetColor(), pEntry->GetName() );
}
aLbColor.SetUpdateMode( sal_True );
diff --git a/sc/source/ui/docshell/docsh2.cxx b/sc/source/ui/docshell/docsh2.cxx
index f94bc36..b3ccd39 100644
--- a/sc/source/ui/docshell/docsh2.cxx
+++ b/sc/source/ui/docshell/docsh2.cxx
@@ -128,7 +128,7 @@ void ScDocShell::InitItems()
ScDrawLayer* pDrawLayer = aDocument.GetDrawLayer();
if (pDrawLayer)
{
- PutItem( SvxColorTableItem ( pDrawLayer->GetColorTable(), SID_COLOR_TABLE ) );
+ PutItem( SvxColorListItem ( pDrawLayer->GetColorList(), SID_COLOR_TABLE ) );
PutItem( SvxGradientListItem( pDrawLayer->GetGradientList(), SID_GRADIENT_LIST ) );
PutItem( SvxHatchListItem ( pDrawLayer->GetHatchList(), SID_HATCH_LIST ) );
PutItem( SvxBitmapListItem ( pDrawLayer->GetBitmapList(), SID_BITMAP_LIST ) );
@@ -144,7 +144,7 @@ void ScDocShell::InitItems()
else
{
// always use global color table instead of local copy
- PutItem( SvxColorTableItem( &XColorList::GetStdColorTable(), SID_COLOR_TABLE ) );
+ PutItem( SvxColorListItem( XColorList::GetStdColorList(), SID_COLOR_TABLE ) );
}
if ( !aDocument.GetForbiddenCharacters().is() ||
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 80034f0..f887589 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -587,12 +587,11 @@ void ScDocShell::Execute( SfxRequest& rReq )
OSL_FAIL("use ScAutoStyleHint instead of SID_AUTO_STYLE");
break;
- case SID_GET_COLORTABLE:
+ case SID_GET_COLORLIST:
{
- // passende ColorTable ist per PutItem gesetzt worden
- SvxColorTableItem* pColItem = (SvxColorTableItem*)GetItem(SID_COLOR_TABLE);
- XColorList* pTable = pColItem->GetColorTable();
- rReq.SetReturnValue(OfaPtrItem(SID_GET_COLORTABLE, pTable));
+ SvxColorListItem* pColItem = (SvxColorListItem*)GetItem(SID_COLOR_TABLE);
+ XColorListRef pList = pColItem->GetColorList();
+ rReq.SetReturnValue(OfaRefItem<XColorList>(SID_GET_COLORLIST, pList));
}
break;
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 836d472..9eaf8bd 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -411,19 +411,9 @@ void ScDrawShell::ExecuteAreaDlg( SfxRequest& rReq, sal_uInt16 nTabPage )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list