summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@novell.com>2011-09-23 14:05:07 +0100
committerMichael Meeks <michael.meeks@novell.com>2011-09-24 08:33:46 +0100
commitc8dc73720883333a13187865cd0d69b64af6b4b5 (patch)
treec9037bb6e79fd49507f2de1cf2b22f7159572720 /cui
parent7fc35af5fd3171cc9bf43d2c27660afcf407d3f6 (diff)
re-factor XPropertyList derivatives to use a rtl::Reference
This cleans up a lot of lifecycle nasties and cleans up some serious cut/paste code duplication issues at the same time. Cleanup the naming of ColorTable -> ColorList to match the impl. too
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/sdrcelldlg.cxx4
-rw-r--r--cui/source/factory/dlgfact.cxx5
-rw-r--r--cui/source/factory/dlgfact.hxx7
-rw-r--r--cui/source/inc/cuitabarea.hxx98
-rw-r--r--cui/source/inc/cuitabline.hxx57
-rw-r--r--cui/source/inc/sdrcelldlg.hxx14
-rw-r--r--cui/source/inc/treeopt.hxx7
-rw-r--r--cui/source/options/cfgchart.cxx6
-rw-r--r--cui/source/options/cfgchart.hxx4
-rw-r--r--cui/source/options/optchart.cxx53
-rw-r--r--cui/source/options/optchart.hxx2
-rw-r--r--cui/source/options/treeopt.cxx30
-rw-r--r--cui/source/tabpages/backgrnd.cxx17
-rw-r--r--cui/source/tabpages/border.cxx6
-rw-r--r--cui/source/tabpages/chardlg.cxx32
-rw-r--r--cui/source/tabpages/numpages.cxx17
-rw-r--r--cui/source/tabpages/tabarea.cxx51
-rw-r--r--cui/source/tabpages/tabline.cxx29
-rw-r--r--cui/source/tabpages/tparea.cxx6
-rw-r--r--cui/source/tabpages/tpbitmap.cxx9
-rw-r--r--cui/source/tabpages/tpcolor.cxx90
-rw-r--r--cui/source/tabpages/tpgradnt.cxx10
-rw-r--r--cui/source/tabpages/tphatch.cxx10
-rw-r--r--cui/source/tabpages/tpline.cxx6
-rw-r--r--cui/source/tabpages/tplnedef.cxx10
-rw-r--r--cui/source/tabpages/tplneend.cxx10
-rw-r--r--cui/source/tabpages/tpshadow.cxx6
27 files changed, 234 insertions, 362 deletions
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index 99596c1123c7..1f45fc831a85 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 08a1068f471d..e7c4574f6aef 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 79cdbe7dad0b..a5a54335a4ea 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 a7ce897d3f06..6bec35fa33e1 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 31481a571114..8d8d456f7020 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 5760c58c8b6e..3714d3c59b51 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 178786e0be4a..a5b7fd312848 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 969eae062fb2..bac4fb45bfc8 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 95e038557779..7fcf8e2c0d94 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 0279a352b6df..9200d647cf31 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 1b2d528e59df..3d9bd772f657 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 de22b1f8cebd..76dca3bc8d7a 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 86eb2220cf1e..8d27b17701bc 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 aa6466e4fa04..d663ffc13512 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 33309de97100..782af954b9a1 100644
--- a/cui/source/tabpages/chardlg.cxx
+++ b/cui/source/tabpages/chardlg.cxx
@@ -457,23 +457,18 @@ void SvxCharNamePage::Initialize()
// fill the color box
SfxObjectShell* pDocSh = SfxObjectShell::Current();
- //DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorList* pColorTable = NULL;
- bool bKillTable = false;
+ XColorListRef pColorTable;
const SfxPoolItem* pItem = NULL;
if ( pDocSh )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
- if ( !pColorTable )
- {
- pColorTable = new XColorList( SvtPathOptions().GetPalettePath() );
- bKillTable = true;
- }
+ if ( !pColorTable.is() )
+ pColorTable = XColorList::CreateStdColorList();
m_pColorLB->SetUpdateMode( sal_False );
@@ -492,10 +487,6 @@ void SvxCharNamePage::Initialize()
}
m_pColorLB->SetUpdateMode( sal_True );
-
- if ( bKillTable )
- delete pColorTable;
-
m_pColorLB->SetSelectHdl( LINK( this, SvxCharNamePage, ColorBoxSelectHdl_Impl ) );
Link aLink = LINK( this, SvxCharNamePage, FontModifyHdl_Impl );
@@ -1527,21 +1518,17 @@ void SvxCharEffectsPage::Initialize()
// fill the color box
SfxObjectShell* pDocSh = SfxObjectShell::Current();
DBG_ASSERT( pDocSh, "DocShell not found!" );
- XColorList* pColorTable = NULL;
- bool bKillTable = false;
+ XColorListRef pColorTable;
if ( pDocSh )
{
pItem = pDocSh->GetItem( SID_COLOR_TABLE );
if ( pItem != NULL )
- pColorTable = ( (SvxColorTableItem*)pItem )->GetColorTable();
+ pColorTable = ( (SvxColorListItem*)pItem )->GetColorList();
}
- if ( !pColorTable )
- {
- pColorTable = new XColorList( SvtPathOptions().GetPalettePath() );
- bKillTable = true;
- }
+ if ( !pColorTable.is() )
+ pColorTable = XColorList::CreateStdColorList();
m_aUnderlineColorLB.SetUpdateMode( sal_False );
m_aOverlineColorLB.SetUpdateMode( sal_False );
@@ -1571,9 +1558,6 @@ void SvxCharEffectsPage::Initialize()
m_aFontColorLB.SetUpdateMode( sal_True );
m_aFontColorLB.SetSelectHdl( LINK( this, SvxCharEffectsPage, ColorBoxSelectHdl_Impl ) );
- if ( bKillTable )
- delete pColorTable;
-
// handler
Link aLink = LINK( this, SvxCharEffectsPage, SelectHdl_Impl );
m_aUnderlineLB.SetSelectHdl( aLink );
diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx
index 4a47004c8b11..dd5d346b95d6 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 95491d5382ad..e7e4d97269ff 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 edd5d339a5e3..46f26b42affc 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 a177e92ca968..85e2ee99a105 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 3deed69a50f1..4d4ea337edb9 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 89bc296c31b2..d49e86e9570a 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 d762f74c70c6..b2b6c36e5610 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 de7365e54d20..556b5c490df7 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 ac170a2994cb..e95244545b42 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 41f7085c2934..6dfe68a6cfc3 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 30b94a0759ad..572b0af82fd5 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 086f4f4a9b74..dd5e4e7caef6 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)