summaryrefslogtreecommitdiff
path: root/svx/source/sidebar
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/sidebar')
-rw-r--r--svx/source/sidebar/EmptyPanel.cxx17
-rw-r--r--svx/source/sidebar/EmptyPanel.hxx3
-rw-r--r--svx/source/sidebar/PanelFactory.cxx12
-rw-r--r--svx/source/sidebar/PanelLayout.cxx7
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx41
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx37
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.cxx274
-rw-r--r--svx/source/sidebar/area/AreaTransparencyGradientControl.hxx29
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.cxx35
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.hxx34
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.cxx15
-rw-r--r--svx/source/sidebar/insert/InsertPropertyPanel.hxx5
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx39
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx46
-rw-r--r--svx/source/sidebar/line/LineWidthControl.cxx153
-rw-r--r--svx/source/sidebar/line/LineWidthControl.hxx11
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.cxx11
-rw-r--r--svx/source/sidebar/line/LineWidthValueSet.hxx3
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx25
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx19
-rw-r--r--svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx4
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx45
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx38
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx50
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx48
-rw-r--r--svx/source/sidebar/possize/SidebarDialControl.cxx4
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx235
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.hxx13
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingPopup.cxx2
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingPopup.hxx2
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx36
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx33
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.cxx178
-rw-r--r--svx/source/sidebar/text/TextUnderlineControl.hxx6
-rw-r--r--svx/source/sidebar/tools/Popup.cxx8
-rw-r--r--svx/source/sidebar/tools/PopupContainer.cxx7
-rw-r--r--svx/source/sidebar/tools/PopupControl.cxx10
-rw-r--r--svx/source/sidebar/tools/ValueSetWithTextControl.cxx6
38 files changed, 886 insertions, 655 deletions
diff --git a/svx/source/sidebar/EmptyPanel.cxx b/svx/source/sidebar/EmptyPanel.cxx
index 784949a7ea3a..c39eb4ba2355 100644
--- a/svx/source/sidebar/EmptyPanel.cxx
+++ b/svx/source/sidebar/EmptyPanel.cxx
@@ -28,10 +28,10 @@ namespace svx { namespace sidebar {
EmptyPanel::EmptyPanel (vcl::Window* pParent)
: Control(pParent, SVX_RES(RID_SIDEBAR_EMPTY_PANEL)),
- maMessageControl(this, SVX_RES(FT_MESSAGE))
+ maMessageControl(VclPtr<FixedText>::Create(this, SVX_RES(FT_MESSAGE)))
{
- maMessageControl.setPosSizePixel(5,5, 250,15);
- maMessageControl.SetStyle(WB_WORDBREAK);// | WB_NOMNEMONICS);
+ maMessageControl->setPosSizePixel(5,5, 250,15);
+ maMessageControl->SetStyle(WB_WORDBREAK);// | WB_NOMNEMONICS);
//maMessageControl.GetStyle()
// & ~(WB_NOMULTILINE | WB_PATHELLIPSIS)
// | WB_WORDBREAK | WB_NOMNEMONICS);
@@ -39,7 +39,7 @@ EmptyPanel::EmptyPanel (vcl::Window* pParent)
SetBackground(Wallpaper());
- maMessageControl.Show();
+ maMessageControl->Show();
Show();
}
@@ -48,15 +48,20 @@ EmptyPanel::EmptyPanel (vcl::Window* pParent)
EmptyPanel::~EmptyPanel()
{
+ disposeOnce();
}
-
+void EmptyPanel::dispose()
+{
+ maMessageControl.disposeAndClear();
+ Control::dispose();
+}
void EmptyPanel::Resize()
{
const Size aSize (GetSizePixel());
- maMessageControl.SetSizePixel(aSize);
+ maMessageControl->SetSizePixel(aSize);
}
diff --git a/svx/source/sidebar/EmptyPanel.hxx b/svx/source/sidebar/EmptyPanel.hxx
index 1242d13ce8b8..36e0c7b1d9e9 100644
--- a/svx/source/sidebar/EmptyPanel.hxx
+++ b/svx/source/sidebar/EmptyPanel.hxx
@@ -36,11 +36,12 @@ class EmptyPanel
public:
EmptyPanel (vcl::Window* pParent);
virtual ~EmptyPanel();
+ virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
private:
- FixedText maMessageControl;
+ VclPtr<FixedText> maMessageControl;
};
} } // end of namespace ::svx::sidebar
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index ecc22dc7a6fc..bab0a12df7be 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -137,7 +137,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
"PanelFactory::createUIElement called without SfxBindings",
NULL);
- vcl::Window* pControl = NULL;
+ VclPtr<vcl::Window> pControl;
ui::LayoutSize aLayoutSize (-1,-1,-1);
if (rsResourceURL.endsWith("/TextPropertyPanel"))
@@ -166,25 +166,25 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
}
else if (rsResourceURL.endsWith("/InsertPropertyPanel"))
{
- pControl = new InsertPropertyPanel(pParentWindow, xFrame);
+ pControl.reset(VclPtr<InsertPropertyPanel>::Create(pParentWindow, xFrame));
}
else if (rsResourceURL.endsWith("/GalleryPanel"))
{
- pControl = new GalleryControl(pBindings, pParentWindow);
+ pControl.reset(VclPtr<GalleryControl>::Create(pBindings, pParentWindow));
aLayoutSize = ui::LayoutSize(300,-1,400);
}
else if (rsResourceURL.endsWith("/StyleListPanel"))
{
- pControl = new SfxTemplatePanelControl(pBindings, pParentWindow);
+ pControl.reset(VclPtr<SfxTemplatePanelControl>::Create(pBindings, pParentWindow));
aLayoutSize = ui::LayoutSize(0,-1,-1);
}
else if (rsResourceURL.endsWith("/EmptyPanel"))
{
- pControl = new EmptyPanel(pParentWindow);
+ pControl.reset(VclPtr<EmptyPanel>::Create(pParentWindow));
aLayoutSize = ui::LayoutSize(20,-1, 50);
}
- if (pControl != NULL)
+ if (pControl)
{
return sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
diff --git a/svx/source/sidebar/PanelLayout.cxx b/svx/source/sidebar/PanelLayout.cxx
index 829fd3b8afad..9a1f11fffa54 100644
--- a/svx/source/sidebar/PanelLayout.cxx
+++ b/svx/source/sidebar/PanelLayout.cxx
@@ -26,8 +26,15 @@ PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUStrin
PanelLayout::~PanelLayout()
{
+ disposeOnce();
+}
+
+void PanelLayout::dispose()
+{
m_bInClose = true;
m_aPanelLayoutIdle.Stop();
+ disposeBuilder();
+ Control::dispose();
}
Size PanelLayout::GetOptimalSize() const
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index ab4a4ff4e516..6e2294b56e1d 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -113,12 +113,35 @@ AreaPropertyPanel::AreaPropertyPanel(
}
-
AreaPropertyPanel::~AreaPropertyPanel()
{
+ disposeOnce();
}
-
+void AreaPropertyPanel::dispose()
+{
+ mpColorTextFT.clear();
+ mpLbFillType.clear();
+ mpLbFillAttr.clear();
+ mpToolBoxColor.clear();
+ mpTrspTextFT.clear();
+ mpLBTransType.clear();
+ mpMTRTransparent.clear();
+ mpBTNGradient.clear();
+
+ maStyleControl.dispose();
+ maColorControl.dispose();
+ maGradientControl.dispose();
+ maHatchControl.dispose();
+ maBitmapControl.dispose();
+ maGradientListControl.dispose();
+ maHatchListControl.dispose();
+ maBitmapListControl.dispose();
+ maFillTransparenceController.dispose();
+ maFillFloatTransparenceController.dispose();
+
+ PanelLayout::dispose();
+}
void AreaPropertyPanel::Initialize()
{
@@ -482,9 +505,9 @@ IMPL_LINK( AreaPropertyPanel, SelectFillAttrHdl, ListBox*, pToolBox )
}
-PopupControl* AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent)
+VclPtr<PopupControl> AreaPropertyPanel::CreateTransparencyGradientControl (PopupContainer* pParent)
{
- return new AreaTransparencyGradientControl(pParent, *this);
+ return VclPtrInstance<AreaTransparencyGradientControl>(pParent, *this);
}
@@ -504,7 +527,7 @@ void AreaPropertyPanel::SetupIcons()
-AreaPropertyPanel* AreaPropertyPanel::Create (
+VclPtr<vcl::Window> AreaPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
@@ -516,10 +539,10 @@ AreaPropertyPanel* AreaPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to AreaPropertyPanel::Create", NULL, 2);
- return new AreaPropertyPanel(
- pParent,
- rxFrame,
- pBindings);
+ return VclPtr<AreaPropertyPanel>::Create(
+ pParent,
+ rxFrame,
+ pBindings);
}
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index 544b91b7b7cf..14af720d76bd 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -35,6 +35,7 @@
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
#include <vcl/fixed.hxx>
+#include <vcl/vclptr.hxx>
#include <svl/intitem.hxx>
#include <com/sun/star/ui/XUIElement.hpp>
#include <boost/scoped_ptr.hpp>
@@ -53,7 +54,10 @@ class AreaPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static AreaPropertyPanel* Create(
+ virtual ~AreaPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -80,6 +84,12 @@ public:
void SetGradient (const XGradient& rGradient);
sal_Int32 GetSelectedTransparencyTypeIndex() const;
+ // constructor/destuctor
+ AreaPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+
private:
sal_uInt16 meLastXFS;
@@ -96,14 +106,14 @@ private:
XGradient maGradientRect;
//ui controls
- FixedText* mpColorTextFT;
- SvxFillTypeBox* mpLbFillType;
- SvxFillAttrBox* mpLbFillAttr;
- ToolBox* mpToolBoxColor; // for new color picker
- FixedText* mpTrspTextFT;
- ListBox* mpLBTransType;
- MetricField* mpMTRTransparent;
- ToolBox* mpBTNGradient;
+ VclPtr<FixedText> mpColorTextFT;
+ VclPtr<SvxFillTypeBox> mpLbFillType;
+ VclPtr<SvxFillAttrBox> mpLbFillAttr;
+ VclPtr<ToolBox> mpToolBoxColor; // for new color picker
+ VclPtr<FixedText> mpTrspTextFT;
+ VclPtr<ListBox> mpLBTransType;
+ VclPtr<MetricField> mpMTRTransparent;
+ VclPtr<ToolBox> mpBTNGradient;
::boost::scoped_ptr< XFillStyleItem > mpStyleItem;
::boost::scoped_ptr< XFillColorItem > mpColorItem;
@@ -143,16 +153,9 @@ private:
DECL_LINK(ModifyTransparentHdl_Impl, void*);
// for transparency gradient
- PopupControl* CreateTransparencyGradientControl (PopupContainer* pParent);
+ VclPtr<PopupControl> CreateTransparencyGradientControl (PopupContainer* pParent);
DECL_LINK( ClickTrGrHdl_Impl, ToolBox* );
- // constructor/destuctor
- AreaPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~AreaPropertyPanel();
-
static void SetupIcons();
void Initialize();
void Update();
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
index 61bd9f120243..9d31ad746ade 100644
--- a/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
+++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.cxx
@@ -56,60 +56,78 @@ AreaTransparencyGradientControl::AreaTransparencyGradientControl (
vcl::Window* pParent,
AreaPropertyPanel& rPanel)
: PopupControl( pParent,SVX_RES(RID_POPUPPANEL_AREAPAGE_TRGR)),
- maFtTrgrCenterX(this, SVX_RES(FT_TRGR_CENTER_X)),
- maMtrTrgrCenterX(this, SVX_RES(MTR_TRGR_CENTER_X)),
- maFtTrgrCenterY(this, SVX_RES(FT_TRGR_CENTER_Y)),
- maMtrTrgrCenterY(this, SVX_RES(MTR_TRGR_CENTER_Y)),
- maFtTrgrAngle(this, SVX_RES(FT_TRGR_ANGLE)),
- maMtrTrgrAngle(this, SVX_RES(MTR_TRGR_ANGLE)),
- maBtnLeft45(this, SVX_RES(BTN_LEFT_SECOND)),
- maBtnRight45(this, SVX_RES(BTN_RIGHT_FIRST)),
- maFtTrgrStartValue(this, SVX_RES(FT_TRGR_START_VALUE)),
- maMtrTrgrStartValue(this, SVX_RES(MTR_TRGR_START_VALUE)),
- maFtTrgrEndValue(this, SVX_RES(FT_TRGR_END_VALUE)),
- maMtrTrgrEndValue(this, SVX_RES(MTR_TRGR_END_VALUE)),
- maFtTrgrBorder(this, SVX_RES(FT_TRGR_BORDER)),
- maMtrTrgrBorder(this, SVX_RES(MTR_TRGR_BORDER)),
+ maFtTrgrCenterX(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_X))),
+ maMtrTrgrCenterX(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_X))),
+ maFtTrgrCenterY(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_CENTER_Y))),
+ maMtrTrgrCenterY(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_CENTER_Y))),
+ maFtTrgrAngle(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_ANGLE))),
+ maMtrTrgrAngle(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_ANGLE))),
+ maBtnLeft45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_LEFT_SECOND))),
+ maBtnRight45(VclPtr<ToolBox>::Create(this, SVX_RES(BTN_RIGHT_FIRST))),
+ maFtTrgrStartValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_START_VALUE))),
+ maMtrTrgrStartValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_START_VALUE))),
+ maFtTrgrEndValue(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_END_VALUE))),
+ maMtrTrgrEndValue(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_END_VALUE))),
+ maFtTrgrBorder(VclPtr<FixedText>::Create(this, SVX_RES(FT_TRGR_BORDER))),
+ maMtrTrgrBorder(VclPtr<MetricField>::Create(this, SVX_RES(MTR_TRGR_BORDER))),
maRotLeft( SVX_RES(IMG_ROT_LEFT)),
maRotRight( SVX_RES(IMG_ROT_RIGHT)),
mrAreaPropertyPanel(rPanel),
mpBindings(NULL)
{
Link aLink = LINK( this, AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl);
- maMtrTrgrCenterX.SetModifyHdl( aLink );
- maMtrTrgrCenterY.SetModifyHdl( aLink );
- maMtrTrgrAngle.SetModifyHdl( aLink );
- maMtrTrgrBorder.SetModifyHdl( aLink );
- maMtrTrgrStartValue.SetModifyHdl( aLink );
- maMtrTrgrEndValue.SetModifyHdl( aLink );
+ maMtrTrgrCenterX->SetModifyHdl( aLink );
+ maMtrTrgrCenterY->SetModifyHdl( aLink );
+ maMtrTrgrAngle->SetModifyHdl( aLink );
+ maMtrTrgrBorder->SetModifyHdl( aLink );
+ maMtrTrgrStartValue->SetModifyHdl( aLink );
+ maMtrTrgrEndValue->SetModifyHdl( aLink );
aLink = LINK( this, AreaTransparencyGradientControl, Left_Click45_Impl);
- maBtnLeft45.SetSelectHdl( aLink );
+ maBtnLeft45->SetSelectHdl( aLink );
aLink = LINK( this, AreaTransparencyGradientControl, Right_Click45_Impl);
- maBtnRight45.SetSelectHdl( aLink );
- maBtnLeft45.SetItemImage(1,maRotLeft);
- Size aTbxSize = maBtnLeft45.CalcWindowSizePixel();
- maBtnLeft45.SetOutputSizePixel( aTbxSize );
- maBtnLeft45.SetQuickHelpText(1, SVX_RESSTR(STR_HELP_LEFT)); //acc wj
-
- maBtnRight45.SetItemImage(1,maRotRight);
- aTbxSize = maBtnRight45.CalcWindowSizePixel();
- maBtnRight45.SetOutputSizePixel( aTbxSize );
- maBtnRight45.SetQuickHelpText(1, SVX_RESSTR(STR_HELP_RIGHT)); //acc wj
-
- maBtnLeft45.SetBackground(Wallpaper());
- maBtnLeft45.SetPaintTransparent(true);
- maBtnRight45.SetBackground(Wallpaper());
- maBtnRight45.SetPaintTransparent(true);
+ maBtnRight45->SetSelectHdl( aLink );
+ maBtnLeft45->SetItemImage(1,maRotLeft);
+ Size aTbxSize = maBtnLeft45->CalcWindowSizePixel();
+ maBtnLeft45->SetOutputSizePixel( aTbxSize );
+ maBtnLeft45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_LEFT)); //acc wj
+
+ maBtnRight45->SetItemImage(1,maRotRight);
+ aTbxSize = maBtnRight45->CalcWindowSizePixel();
+ maBtnRight45->SetOutputSizePixel( aTbxSize );
+ maBtnRight45->SetQuickHelpText(1, SVX_RESSTR(STR_HELP_RIGHT)); //acc wj
+
+ maBtnLeft45->SetBackground(Wallpaper());
+ maBtnLeft45->SetPaintTransparent(true);
+ maBtnRight45->SetBackground(Wallpaper());
+ maBtnRight45->SetPaintTransparent(true);
FreeResource();
mpBindings = mrAreaPropertyPanel.GetBindings();
}
-
-
AreaTransparencyGradientControl::~AreaTransparencyGradientControl()
{
+ disposeOnce();
+}
+
+void AreaTransparencyGradientControl::dispose()
+{
+ maFtTrgrCenterX.disposeAndClear();
+ maMtrTrgrCenterX.disposeAndClear();
+ maFtTrgrCenterY.disposeAndClear();
+ maMtrTrgrCenterY.disposeAndClear();
+ maFtTrgrAngle.disposeAndClear();
+ maMtrTrgrAngle.disposeAndClear();
+ maBtnLeft45.disposeAndClear();
+ maBtnRight45.disposeAndClear();
+ maFtTrgrStartValue.disposeAndClear();
+ maMtrTrgrStartValue.disposeAndClear();
+ maFtTrgrEndValue.disposeAndClear();
+ maMtrTrgrEndValue.disposeAndClear();
+ maFtTrgrBorder.disposeAndClear();
+ maMtrTrgrBorder.disposeAndClear();
+ PopupControl::dispose();
}
void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGradientItem)
@@ -123,60 +141,60 @@ void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGra
aSize2 = LogicToPixel( aSize2, MapMode(MAP_APPFONT) );
long aPosY = 0;
Point aPointAngle;
- Size aSizeAngle = maMtrTrgrAngle.GetSizePixel();
- Size aTbxSize = maBtnLeft45.CalcWindowSizePixel();
+ Size aSizeAngle = maMtrTrgrAngle->GetSizePixel();
+ Size aTbxSize = maBtnLeft45->CalcWindowSizePixel();
switch(eXGS)
{
case css::awt::GradientStyle_LINEAR:
case css::awt::GradientStyle_AXIAL:
- maFtTrgrCenterX.Hide();
- maMtrTrgrCenterX.Hide();
- maFtTrgrCenterY.Hide();
- maMtrTrgrCenterY.Hide();
- maFtTrgrAngle.Show();
- maFtTrgrAngle.SetPosPixel(APOS1_1);
- maMtrTrgrAngle.Show();
- maMtrTrgrAngle.SetPosPixel(APOS2_1);
- maFtTrgrStartValue.SetPosPixel(APOS1_3);
- maMtrTrgrStartValue.SetPosPixel(APOS1_4);
- maFtTrgrEndValue.SetPosPixel(APOS2_3);
- maMtrTrgrEndValue.SetPosPixel(APOS2_4);
- maFtTrgrBorder.SetPosPixel(APOS1_5);
- maMtrTrgrBorder.SetPosPixel(APOS1_6);
-
- maBtnLeft45.Show();
- maBtnRight45.Show();
-
- aPointAngle = maMtrTrgrAngle.GetPosPixel();
+ maFtTrgrCenterX->Hide();
+ maMtrTrgrCenterX->Hide();
+ maFtTrgrCenterY->Hide();
+ maMtrTrgrCenterY->Hide();
+ maFtTrgrAngle->Show();
+ maFtTrgrAngle->SetPosPixel(APOS1_1);
+ maMtrTrgrAngle->Show();
+ maMtrTrgrAngle->SetPosPixel(APOS2_1);
+ maFtTrgrStartValue->SetPosPixel(APOS1_3);
+ maMtrTrgrStartValue->SetPosPixel(APOS1_4);
+ maFtTrgrEndValue->SetPosPixel(APOS2_3);
+ maMtrTrgrEndValue->SetPosPixel(APOS2_4);
+ maFtTrgrBorder->SetPosPixel(APOS1_5);
+ maMtrTrgrBorder->SetPosPixel(APOS1_6);
+
+ maBtnLeft45->Show();
+ maBtnRight45->Show();
+
+ aPointAngle = maMtrTrgrAngle->GetPosPixel();
aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight();
- maBtnLeft45.SetPosPixel(Point(APOS_Left_Right_1.getX(), aPosY));
- maBtnRight45.SetPosPixel(Point(APOS_Left_Right_2.getX(), aPosY));
+ maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_1.getX(), aPosY));
+ maBtnRight45->SetPosPixel(Point(APOS_Left_Right_2.getX(), aPosY));
SetSizePixel(aSize2);
break;
case css::awt::GradientStyle_RADIAL:
- maFtTrgrCenterX.Show();
- maFtTrgrCenterX.SetPosPixel(APOS1_1);
- maMtrTrgrCenterX.Show();
- maMtrTrgrCenterX.SetPosPixel(APOS2_1);
- maFtTrgrCenterY.Show();
- maFtTrgrCenterY.SetPosPixel(APOS1_2);
- maMtrTrgrCenterY.Show();
- maMtrTrgrCenterY.SetPosPixel(APOS2_2);
- maFtTrgrAngle.Hide();
- maMtrTrgrAngle.Hide();
- maFtTrgrStartValue.SetPosPixel(APOS1_3);
- maMtrTrgrStartValue.SetPosPixel(APOS1_4);
- maFtTrgrEndValue.SetPosPixel(APOS2_3);
- maMtrTrgrEndValue.SetPosPixel(APOS2_4);
- maFtTrgrBorder.SetPosPixel(APOS1_5);
- maMtrTrgrBorder.SetPosPixel(APOS1_6);
-
- maBtnLeft45.Hide();
- maBtnRight45.Hide();
+ maFtTrgrCenterX->Show();
+ maFtTrgrCenterX->SetPosPixel(APOS1_1);
+ maMtrTrgrCenterX->Show();
+ maMtrTrgrCenterX->SetPosPixel(APOS2_1);
+ maFtTrgrCenterY->Show();
+ maFtTrgrCenterY->SetPosPixel(APOS1_2);
+ maMtrTrgrCenterY->Show();
+ maMtrTrgrCenterY->SetPosPixel(APOS2_2);
+ maFtTrgrAngle->Hide();
+ maMtrTrgrAngle->Hide();
+ maFtTrgrStartValue->SetPosPixel(APOS1_3);
+ maMtrTrgrStartValue->SetPosPixel(APOS1_4);
+ maFtTrgrEndValue->SetPosPixel(APOS2_3);
+ maMtrTrgrEndValue->SetPosPixel(APOS2_4);
+ maFtTrgrBorder->SetPosPixel(APOS1_5);
+ maMtrTrgrBorder->SetPosPixel(APOS1_6);
+
+ maBtnLeft45->Hide();
+ maBtnRight45->Hide();
SetSizePixel(aSize2);
@@ -185,34 +203,34 @@ void AreaTransparencyGradientControl::Rearrange(XFillFloatTransparenceItem* pGra
case css::awt::GradientStyle_ELLIPTICAL:
case css::awt::GradientStyle_SQUARE:
case css::awt::GradientStyle_RECT:
- maFtTrgrCenterX.Show();
- maFtTrgrCenterX.SetPosPixel(APOS1_1);
- maMtrTrgrCenterX.Show();
- maMtrTrgrCenterX.SetPosPixel(APOS2_1);
- maFtTrgrCenterY.Show();
- maFtTrgrCenterY.SetPosPixel(APOS1_2);
- maMtrTrgrCenterY.Show();
- maMtrTrgrCenterY.SetPosPixel(APOS2_2);
- maFtTrgrAngle.Show();
- maFtTrgrAngle.SetPosPixel(APOS1_3);
- maMtrTrgrAngle.Show();
- maMtrTrgrAngle.SetPosPixel(APOS1_4);
-
- maFtTrgrStartValue.SetPosPixel(APOS1_5);
- maMtrTrgrStartValue.SetPosPixel(APOS1_6);
- maFtTrgrEndValue.SetPosPixel(APOS2_5);
- maMtrTrgrEndValue.SetPosPixel(APOS2_6);
- maFtTrgrBorder.SetPosPixel(APOS1_7);
- maMtrTrgrBorder.SetPosPixel(APOS1_8);
-
- maBtnLeft45.Show();
- maBtnRight45.Show();
-
- aPointAngle = maMtrTrgrAngle.GetPosPixel();
+ maFtTrgrCenterX->Show();
+ maFtTrgrCenterX->SetPosPixel(APOS1_1);
+ maMtrTrgrCenterX->Show();
+ maMtrTrgrCenterX->SetPosPixel(APOS2_1);
+ maFtTrgrCenterY->Show();
+ maFtTrgrCenterY->SetPosPixel(APOS1_2);
+ maMtrTrgrCenterY->Show();
+ maMtrTrgrCenterY->SetPosPixel(APOS2_2);
+ maFtTrgrAngle->Show();
+ maFtTrgrAngle->SetPosPixel(APOS1_3);
+ maMtrTrgrAngle->Show();
+ maMtrTrgrAngle->SetPosPixel(APOS1_4);
+
+ maFtTrgrStartValue->SetPosPixel(APOS1_5);
+ maMtrTrgrStartValue->SetPosPixel(APOS1_6);
+ maFtTrgrEndValue->SetPosPixel(APOS2_5);
+ maMtrTrgrEndValue->SetPosPixel(APOS2_6);
+ maFtTrgrBorder->SetPosPixel(APOS1_7);
+ maMtrTrgrBorder->SetPosPixel(APOS1_8);
+
+ maBtnLeft45->Show();
+ maBtnRight45->Show();
+
+ aPointAngle = maMtrTrgrAngle->GetPosPixel();
aPosY = aPointAngle.getY() + aSizeAngle.getHeight() - aTbxSize.getHeight();
- maBtnLeft45.SetPosPixel(Point(APOS_Left_Right_3.getX(), aPosY));
- maBtnRight45.SetPosPixel(Point(APOS_Left_Right_4.getX(), aPosY));
+ maBtnLeft45->SetPosPixel(Point(APOS_Left_Right_3.getX(), aPosY));
+ maBtnRight45->SetPosPixel(Point(APOS_Left_Right_4.getX(), aPosY));
SetSizePixel(aSize);
@@ -247,12 +265,12 @@ void AreaTransparencyGradientControl::InitStatus(XFillFloatTransparenceItem* pGr
{
aGradient = rGradient;
}
- maMtrTrgrCenterX.SetValue(aGradient.GetXOffset());
- maMtrTrgrCenterY.SetValue(aGradient.GetYOffset());
- maMtrTrgrAngle.SetValue(aGradient.GetAngle() / 10);
- maMtrTrgrStartValue.SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255));
- maMtrTrgrEndValue.SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255));
- maMtrTrgrBorder.SetValue(aGradient.GetBorder());
+ maMtrTrgrCenterX->SetValue(aGradient.GetXOffset());
+ maMtrTrgrCenterY->SetValue(aGradient.GetYOffset());
+ maMtrTrgrAngle->SetValue(aGradient.GetAngle() / 10);
+ maMtrTrgrStartValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetStartColor().GetRed() + 1) * 100) / 255));
+ maMtrTrgrEndValue->SetValue((sal_uInt16)((((sal_uInt16)aGradient.GetEndColor().GetRed() + 1) * 100) / 255));
+ maMtrTrgrBorder->SetValue(aGradient.GetBorder());
}
@@ -261,21 +279,21 @@ void AreaTransparencyGradientControl::InitStatus(XFillFloatTransparenceItem* pGr
void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, sal_uInt8 nEndCol )
{
//Added
- sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle.GetValue();
+ sal_Int16 aMtrValue = (sal_Int16)maMtrTrgrAngle->GetValue();
while(aMtrValue<0)
aMtrValue += 360;
sal_uInt16 nVal = aMtrValue/360;
nVal = aMtrValue - nVal*360;
- maMtrTrgrAngle.SetValue(nVal);
+ maMtrTrgrAngle->SetValue(nVal);
//End of new code
XGradient aTmpGradient(
Color(nStartCol, nStartCol, nStartCol),
Color(nEndCol, nEndCol, nEndCol),
(css::awt::GradientStyle)(mrAreaPropertyPanel.GetSelectedTransparencyTypeIndex()-2),
- (sal_uInt16)maMtrTrgrAngle.GetValue() * 10,
- (sal_uInt16)maMtrTrgrCenterX.GetValue(),
- (sal_uInt16)maMtrTrgrCenterY.GetValue(),
- (sal_uInt16)maMtrTrgrBorder.GetValue(),
+ (sal_uInt16)maMtrTrgrAngle->GetValue() * 10,
+ (sal_uInt16)maMtrTrgrCenterX->GetValue(),
+ (sal_uInt16)maMtrTrgrCenterY->GetValue(),
+ (sal_uInt16)maMtrTrgrBorder->GetValue(),
100, 100);
mrAreaPropertyPanel.SetGradient(aTmpGradient);
@@ -292,8 +310,8 @@ void AreaTransparencyGradientControl::ExecuteValueModify( sal_uInt8 nStartCol, s
IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl)
{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue.GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue.GetValue() * 255) / 100);
+ sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
+ sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
ExecuteValueModify( nStartCol, nEndCol );
return 0L;
}
@@ -303,13 +321,13 @@ IMPL_LINK_NOARG(AreaTransparencyGradientControl, ModifiedTrgrHdl_Impl)
IMPL_LINK_NOARG(AreaTransparencyGradientControl, Left_Click45_Impl)
{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue.GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue.GetValue() * 255) / 100);
- sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle.GetValue();
+ sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
+ sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
+ sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
if(aTemp>=315)
aTemp -= 360;
aTemp += 45;
- maMtrTrgrAngle.SetValue(aTemp);
+ maMtrTrgrAngle->SetValue(aTemp);
ExecuteValueModify( nStartCol, nEndCol );
return 0L;
}
@@ -319,13 +337,13 @@ IMPL_LINK_NOARG(AreaTransparencyGradientControl, Left_Click45_Impl)
IMPL_LINK_NOARG(AreaTransparencyGradientControl, Right_Click45_Impl)
{
- sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue.GetValue() * 255) / 100);
- sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue.GetValue() * 255) / 100);
- sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle.GetValue();
+ sal_uInt8 nStartCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrStartValue->GetValue() * 255) / 100);
+ sal_uInt8 nEndCol = (sal_uInt8)(((sal_uInt16)maMtrTrgrEndValue->GetValue() * 255) / 100);
+ sal_uInt16 aTemp = (sal_uInt16)maMtrTrgrAngle->GetValue();
if(aTemp<45)
aTemp += 360;
aTemp -= 45;
- maMtrTrgrAngle.SetValue(aTemp);
+ maMtrTrgrAngle->SetValue(aTemp);
ExecuteValueModify( nStartCol, nEndCol );
return 0L;
}
diff --git a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
index 3486508cb133..eb8cfc37285d 100644
--- a/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
+++ b/svx/source/sidebar/area/AreaTransparencyGradientControl.hxx
@@ -42,6 +42,7 @@ public:
vcl::Window* pParent,
AreaPropertyPanel& rPanel);
virtual ~AreaTransparencyGradientControl();
+ virtual void dispose() SAL_OVERRIDE;
void Rearrange(XFillFloatTransparenceItem* pGradientItem);
void InitStatus(XFillFloatTransparenceItem* pGradientItem);
@@ -49,20 +50,20 @@ public:
void SetControlState_Impl(css::awt::GradientStyle eXGS);
private:
- FixedText maFtTrgrCenterX;
- MetricField maMtrTrgrCenterX;
- FixedText maFtTrgrCenterY;
- MetricField maMtrTrgrCenterY;
- FixedText maFtTrgrAngle;
- MetricField maMtrTrgrAngle;
- ToolBox maBtnLeft45;
- ToolBox maBtnRight45;
- FixedText maFtTrgrStartValue;
- MetricField maMtrTrgrStartValue;
- FixedText maFtTrgrEndValue;
- MetricField maMtrTrgrEndValue;
- FixedText maFtTrgrBorder;
- MetricField maMtrTrgrBorder;
+ VclPtr<FixedText> maFtTrgrCenterX;
+ VclPtr<MetricField> maMtrTrgrCenterX;
+ VclPtr<FixedText> maFtTrgrCenterY;
+ VclPtr<MetricField> maMtrTrgrCenterY;
+ VclPtr<FixedText> maFtTrgrAngle;
+ VclPtr<MetricField> maMtrTrgrAngle;
+ VclPtr<ToolBox> maBtnLeft45;
+ VclPtr<ToolBox> maBtnRight45;
+ VclPtr<FixedText> maFtTrgrStartValue;
+ VclPtr<MetricField> maMtrTrgrStartValue;
+ VclPtr<FixedText> maFtTrgrEndValue;
+ VclPtr<MetricField> maMtrTrgrEndValue;
+ VclPtr<FixedText> maFtTrgrBorder;
+ VclPtr<MetricField> maMtrTrgrBorder;
Image maRotLeft;
Image maRotRight;
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index 55caa6c2feba..6b8a3d11d68d 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -66,12 +66,33 @@ GraphicPropertyPanel::GraphicPropertyPanel(
Initialize();
}
-
-
GraphicPropertyPanel::~GraphicPropertyPanel()
{
+ disposeOnce();
}
+void GraphicPropertyPanel::dispose()
+{
+ mpMtrBrightness.clear();
+ mpMtrContrast.clear();
+ mpLBColorMode.clear();
+ mpMtrTrans.clear();
+ mpMtrRed.clear();
+ mpMtrGreen.clear();
+ mpMtrBlue.clear();
+ mpMtrGamma.clear();
+
+ maBrightControl.dispose();
+ maContrastControl.dispose();
+ maTransparenceControl.dispose();
+ maRedControl.dispose();
+ maGreenControl.dispose();
+ maBlueControl.dispose();
+ maGammaControl.dispose();
+ maModeControl.dispose();
+
+ PanelLayout::dispose();
+}
void GraphicPropertyPanel::Initialize()
@@ -221,7 +242,7 @@ void GraphicPropertyPanel::SetupIcons()
-GraphicPropertyPanel* GraphicPropertyPanel::Create (
+VclPtr<vcl::Window> GraphicPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
@@ -233,10 +254,10 @@ GraphicPropertyPanel* GraphicPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to GraphicPropertyPanel::Create", NULL, 2);
- return new GraphicPropertyPanel(
- pParent,
- rxFrame,
- pBindings);
+ return VclPtr<GraphicPropertyPanel>::Create(
+ pParent,
+ rxFrame,
+ pBindings);
}
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
index 33e0010b46f1..83024d3f028e 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
@@ -39,7 +39,10 @@ class GraphicPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static GraphicPropertyPanel* Create(
+ virtual ~GraphicPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -55,16 +58,22 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ GraphicPropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+
private:
//ui controls
- MetricField* mpMtrBrightness;
- MetricField* mpMtrContrast;
- ListBox* mpLBColorMode;
- MetricField* mpMtrTrans;
- MetricField* mpMtrRed;
- MetricField* mpMtrGreen;
- MetricField* mpMtrBlue;
- MetricField* mpMtrGamma;
+ VclPtr<MetricField> mpMtrBrightness;
+ VclPtr<MetricField> mpMtrContrast;
+ VclPtr<ListBox> mpLBColorMode;
+ VclPtr<MetricField> mpMtrTrans;
+ VclPtr<MetricField> mpMtrRed;
+ VclPtr<MetricField> mpMtrGreen;
+ VclPtr<MetricField> mpMtrBlue;
+ VclPtr<MetricField> mpMtrGamma;
::sfx2::sidebar::ControllerItem maBrightControl;
::sfx2::sidebar::ControllerItem maContrastControl;
@@ -93,13 +102,6 @@ private:
DECL_LINK( BlueHdl, void*);
DECL_LINK( GammaHdl, void*);
- // constructor/destuctor
- GraphicPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~GraphicPropertyPanel();
-
static void SetupIcons();
void Initialize();
};
diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.cxx b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
index cbf133f32eca..590759bd7568 100644
--- a/svx/source/sidebar/insert/InsertPropertyPanel.cxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.cxx
@@ -72,16 +72,21 @@ InsertPropertyPanel::InsertPropertyPanel (
pTopWindow->AddChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
}
-
-
-
InsertPropertyPanel::~InsertPropertyPanel()
{
+ disposeOnce();
+}
+
+void InsertPropertyPanel::dispose()
+{
// Remove window child listener.
vcl::Window* pTopWindow = this;
while (pTopWindow->GetParent() != NULL)
pTopWindow = pTopWindow->GetParent();
pTopWindow->RemoveChildEventListener(LINK(this, InsertPropertyPanel, WindowEventListener));
+ mpStandardShapesToolBox.clear();
+ mpCustomShapesToolBox.clear();
+ PanelLayout::dispose();
}
@@ -118,13 +123,13 @@ IMPL_LINK(InsertPropertyPanel, WindowEventListener, VclSimpleEvent*, pEvent)
if (nId == 0)
return 1;
- SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox);
+ SidebarToolBox* pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpStandardShapesToolBox.get());
if (pSidebarToolBox == NULL)
return 1;
sal_uInt16 nItemId (pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path));
if (nItemId == 0)
{
- pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox);
+ pSidebarToolBox = dynamic_cast<SidebarToolBox*>(mpCustomShapesToolBox.get());
if (pSidebarToolBox == NULL)
return 1;
nItemId = pSidebarToolBox->GetItemIdForSubToolbarName(aURL.Path);
diff --git a/svx/source/sidebar/insert/InsertPropertyPanel.hxx b/svx/source/sidebar/insert/InsertPropertyPanel.hxx
index bef58fd1919c..2539695313bf 100644
--- a/svx/source/sidebar/insert/InsertPropertyPanel.hxx
+++ b/svx/source/sidebar/insert/InsertPropertyPanel.hxx
@@ -42,10 +42,11 @@ public:
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual ~InsertPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
private:
- ToolBox* mpStandardShapesToolBox;
- ToolBox* mpCustomShapesToolBox;
+ VclPtr<ToolBox> mpStandardShapesToolBox;
+ VclPtr<ToolBox> mpCustomShapesToolBox;
const css::uno::Reference<css::frame::XFrame> mxFrame;
DECL_LINK(WindowEventListener, VclSimpleEvent*);
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 02d7f3389aec..004fef29dc0b 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -194,6 +194,37 @@ LinePropertyPanel::LinePropertyPanel(
LinePropertyPanel::~LinePropertyPanel()
{
+ disposeOnce();
+}
+
+void LinePropertyPanel::dispose()
+{
+ mpFTWidth.clear();
+ mpTBWidth.clear();
+ mpFTStyle.clear();
+ mpLBStyle.clear();
+ mpFTTrancparency.clear();
+ mpMFTransparent.clear();
+ mpFTArrow.clear();
+ mpLBStart.clear();
+ mpLBEnd.clear();
+ mpFTEdgeStyle.clear();
+ mpLBEdgeStyle.clear();
+ mpFTCapStyle.clear();
+ mpLBCapStyle.clear();
+
+ maStyleControl.dispose();
+ maDashControl.dispose();
+ maWidthControl.dispose();
+ maStartControl.dispose();
+ maEndControl.dispose();
+ maLineEndListControl.dispose();
+ maLineStyleListControl.dispose();
+ maTransControl.dispose();
+ maEdgeStyle.dispose();
+ maCapStyle.dispose();
+
+ PanelLayout::dispose();
}
void LinePropertyPanel::Initialize()
@@ -267,7 +298,7 @@ void LinePropertyPanel::SetupIcons()
}
}
-LinePropertyPanel* LinePropertyPanel::Create (
+VclPtr<vcl::Window> LinePropertyPanel::Create (
vcl::Window* pParent,
const uno::Reference<frame::XFrame>& rxFrame,
SfxBindings* pBindings)
@@ -279,7 +310,7 @@ LinePropertyPanel* LinePropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to LinePropertyPanel::Create", NULL, 2);
- return new LinePropertyPanel(pParent, rxFrame, pBindings);
+ return VclPtr<LinePropertyPanel>::Create(pParent, rxFrame, pBindings);
}
void LinePropertyPanel::DataChanged(const DataChangedEvent& /*rEvent*/)
@@ -750,9 +781,9 @@ IMPL_LINK( LinePropertyPanel, ChangeTransparentHdl, void *, EMPTYARG )
return 0L;
}
-PopupControl* LinePropertyPanel::CreateLineWidthPopupControl (PopupContainer* pParent)
+VclPtr<PopupControl> LinePropertyPanel::CreateLineWidthPopupControl (PopupContainer* pParent)
{
- return new LineWidthControl(pParent, *this);
+ return VclPtrInstance<LineWidthControl>(pParent, *this);
}
void LinePropertyPanel::EndLineWidthPopupMode()
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index 2d6a2898b7aa..33a9b7675abe 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -60,7 +60,10 @@ class LinePropertyPanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static LinePropertyPanel* Create(
+ virtual ~LinePropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -82,21 +85,27 @@ public:
void EndLineWidthPopupMode();
+ // constructor/destuctor
+ LinePropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+
private:
//ui controls
- FixedText* mpFTWidth;
- ToolBox* mpTBWidth;
- FixedText* mpFTStyle;
- ListBox* mpLBStyle;
- FixedText* mpFTTrancparency;
- MetricField* mpMFTransparent;
- FixedText* mpFTArrow;
- ListBox* mpLBStart;
- ListBox* mpLBEnd;
- FixedText* mpFTEdgeStyle;
- ListBox* mpLBEdgeStyle;
- FixedText* mpFTCapStyle;
- ListBox* mpLBCapStyle;
+ VclPtr<FixedText> mpFTWidth;
+ VclPtr<ToolBox> mpTBWidth;
+ VclPtr<FixedText> mpFTStyle;
+ VclPtr<ListBox> mpLBStyle;
+ VclPtr<FixedText> mpFTTrancparency;
+ VclPtr<MetricField> mpMFTransparent;
+ VclPtr<FixedText> mpFTArrow;
+ VclPtr<ListBox> mpLBStart;
+ VclPtr<ListBox> mpLBEnd;
+ VclPtr<FixedText> mpFTEdgeStyle;
+ VclPtr<ListBox> mpLBEdgeStyle;
+ VclPtr<FixedText> mpFTCapStyle;
+ VclPtr<ListBox> mpLBCapStyle;
//ControllerItem
sfx2::sidebar::ControllerItem maStyleControl;
@@ -152,14 +161,7 @@ private:
DECL_LINK(ChangeEdgeStyleHdl, void *);
DECL_LINK(ChangeCapStyleHdl, void *);
- // constructor/destuctor
- LinePropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~LinePropertyPanel();
-
- PopupControl* CreateLineWidthPopupControl (PopupContainer* pParent);
+ VclPtr<PopupControl> CreateLineWidthPopupControl (PopupContainer* pParent);
};
} } // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/line/LineWidthControl.cxx b/svx/source/sidebar/line/LineWidthControl.cxx
index 98fb8d2e9b1f..fd986ee94f54 100644
--- a/svx/source/sidebar/line/LineWidthControl.cxx
+++ b/svx/source/sidebar/line/LineWidthControl.cxx
@@ -41,10 +41,10 @@ LineWidthControl::LineWidthControl (
: svx::sidebar::PopupControl(pParent,SVX_RES(RID_POPUPPANEL_LINEPAGE_WIDTH)),
mrLinePropertyPanel(rPanel),
mpBindings(NULL),
- maVSWidth( this, SVX_RES(VS_WIDTH)),
- maFTCus( this, SVX_RES(FT_CUSTOME)),
- maFTWidth( this, SVX_RES(FT_LINE_WIDTH)),
- maMFWidth( this, SVX_RES(MF_WIDTH)),
+ maVSWidth(VclPtr<LineWidthValueSet>::Create(this, SVX_RES(VS_WIDTH))),
+ maFTCus( VclPtr<FixedText>::Create(this, SVX_RES(FT_CUSTOME))),
+ maFTWidth( VclPtr<FixedText>::Create(this, SVX_RES(FT_LINE_WIDTH))),
+ maMFWidth( VclPtr<MetricField>::Create(this, SVX_RES(MF_WIDTH))),
meMapUnit(SFX_MAPUNIT_TWIP),
rStr(NULL),
mstrPT(SVX_RESSTR(STR_PT)),
@@ -61,12 +61,19 @@ LineWidthControl::LineWidthControl (
mpBindings = mrLinePropertyPanel.GetBindings();
}
-
-
-
LineWidthControl::~LineWidthControl()
{
+ disposeOnce();
+}
+
+void LineWidthControl::dispose()
+{
delete[] rStr;
+ maVSWidth.disposeAndClear();
+ maFTCus.disposeAndClear();
+ maFTWidth.disposeAndClear();
+ maMFWidth.disposeAndClear();
+ svx::sidebar::PopupControl::dispose();
}
@@ -104,33 +111,33 @@ void LineWidthControl::Paint(const Rectangle& rect)
void LineWidthControl::Initialize()
{
- maVSWidth.SetStyle( maVSWidth.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD |
+ maVSWidth->SetStyle( maVSWidth->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );// WB_NAMEFIELD | WB_ITEMBORDER |WB_DOUBLEBORDER | WB_NONEFIELD |
//for high contrast wj
if(GetSettings().GetStyleSettings().GetHighContrastMode())
{
- maVSWidth.SetColor(GetSettings().GetStyleSettings().GetMenuColor());
+ maVSWidth->SetColor(GetSettings().GetStyleSettings().GetMenuColor());
// maBorder.SetBackground(GetSettings().GetStyleSettings().GetMenuColor());
- maFTWidth.SetBackground(GetSettings().GetStyleSettings().GetMenuColor());
+ maFTWidth->SetBackground(GetSettings().GetStyleSettings().GetMenuColor());
}
else
{
- maVSWidth.SetColor(COL_WHITE);
+ maVSWidth->SetColor(COL_WHITE);
// maBorder.SetBackground(Wallpaper(COL_WHITE));
- maFTWidth.SetBackground(Wallpaper(COL_WHITE));
+ maFTWidth->SetBackground(Wallpaper(COL_WHITE));
}
- sal_Int64 nFirst= maMFWidth.Denormalize( maMFWidth.GetFirst( FUNIT_TWIP ) );
- sal_Int64 nLast = maMFWidth.Denormalize( maMFWidth.GetLast( FUNIT_TWIP ) );
- sal_Int64 nMin = maMFWidth.Denormalize( maMFWidth.GetMin( FUNIT_TWIP ) );
- sal_Int64 nMax = maMFWidth.Denormalize( maMFWidth.GetMax( FUNIT_TWIP ) );
- maMFWidth.SetSpinSize( 10 );
- maMFWidth.SetUnit( FUNIT_POINT );
- if( maMFWidth.GetDecimalDigits() > 1 )
- maMFWidth.SetDecimalDigits( 1 );
- maMFWidth.SetFirst( maMFWidth.Normalize( nFirst ), FUNIT_TWIP );
- maMFWidth.SetLast( maMFWidth.Normalize( nLast ), FUNIT_TWIP );
- maMFWidth.SetMin( maMFWidth.Normalize( nMin ), FUNIT_TWIP );
- maMFWidth.SetMax( maMFWidth.Normalize( nMax ), FUNIT_TWIP );
+ sal_Int64 nFirst= maMFWidth->Denormalize( maMFWidth->GetFirst( FUNIT_TWIP ) );
+ sal_Int64 nLast = maMFWidth->Denormalize( maMFWidth->GetLast( FUNIT_TWIP ) );
+ sal_Int64 nMin = maMFWidth->Denormalize( maMFWidth->GetMin( FUNIT_TWIP ) );
+ sal_Int64 nMax = maMFWidth->Denormalize( maMFWidth->GetMax( FUNIT_TWIP ) );
+ maMFWidth->SetSpinSize( 10 );
+ maMFWidth->SetUnit( FUNIT_POINT );
+ if( maMFWidth->GetDecimalDigits() > 1 )
+ maMFWidth->SetDecimalDigits( 1 );
+ maMFWidth->SetFirst( maMFWidth->Normalize( nFirst ), FUNIT_TWIP );
+ maMFWidth->SetLast( maMFWidth->Normalize( nLast ), FUNIT_TWIP );
+ maMFWidth->SetMin( maMFWidth->Normalize( nMin ), FUNIT_TWIP );
+ maMFWidth->SetMax( maMFWidth->Normalize( nMax ), FUNIT_TWIP );
rStr = new OUString[9];
//modify,
@@ -157,28 +164,28 @@ void LineWidthControl::Initialize()
for(sal_uInt16 i = 1 ; i <= 9 ; i++)
{
- maVSWidth.InsertItem(i);
- maVSWidth.SetItemText(i, rStr[i-1]);
+ maVSWidth->InsertItem(i);
+ maVSWidth->SetItemText(i, rStr[i-1]);
}
- maVSWidth.SetUnit(rStr);
- maVSWidth.SetItemData(1, reinterpret_cast<void*>(5));
- maVSWidth.SetItemData(2, reinterpret_cast<void*>(8));
- maVSWidth.SetItemData(3, reinterpret_cast<void*>(10));
- maVSWidth.SetItemData(4, reinterpret_cast<void*>(15));
- maVSWidth.SetItemData(5, reinterpret_cast<void*>(23));
- maVSWidth.SetItemData(6, reinterpret_cast<void*>(30));
- maVSWidth.SetItemData(7, reinterpret_cast<void*>(45));
- maVSWidth.SetItemData(8, reinterpret_cast<void*>(60));
- maVSWidth.SetImage(maIMGCusGray);
-
- maVSWidth.SetSelItem(0);
+ maVSWidth->SetUnit(rStr);
+ maVSWidth->SetItemData(1, reinterpret_cast<void*>(5));
+ maVSWidth->SetItemData(2, reinterpret_cast<void*>(8));
+ maVSWidth->SetItemData(3, reinterpret_cast<void*>(10));
+ maVSWidth->SetItemData(4, reinterpret_cast<void*>(15));
+ maVSWidth->SetItemData(5, reinterpret_cast<void*>(23));
+ maVSWidth->SetItemData(6, reinterpret_cast<void*>(30));
+ maVSWidth->SetItemData(7, reinterpret_cast<void*>(45));
+ maVSWidth->SetItemData(8, reinterpret_cast<void*>(60));
+ maVSWidth->SetImage(maIMGCusGray);
+
+ maVSWidth->SetSelItem(0);
Link aLink = LINK( this, LineWidthControl, VSSelectHdl ) ;
- maVSWidth.SetSelectHdl(aLink);
+ maVSWidth->SetSelectHdl(aLink);
aLink = LINK(this, LineWidthControl, MFModifyHdl);
- maMFWidth.SetModifyHdl(aLink);
+ maMFWidth->SetModifyHdl(aLink);
- maVSWidth.StartSelection();
- maVSWidth.Show();
+ maVSWidth->StartSelection();
+ maVSWidth->Show();
}
@@ -187,9 +194,9 @@ void LineWidthControl::Initialize()
void LineWidthControl::GetFocus()
{
if(!mbVSFocus)
- maMFWidth.GrabFocus();
+ maMFWidth->GrabFocus();
else
- maVSWidth.GrabFocus();
+ maVSWidth->GrabFocus();
}
@@ -198,7 +205,7 @@ void LineWidthControl::GetFocus()
void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit eMapUnit)
{
mbVSFocus = true;
- maVSWidth.SetSelItem(0);
+ maVSWidth->SetSelItem(0);
mbCloseByEdit = false;
meMapUnit = eMapUnit;
SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_LINE_WIDTH_GLOBAL_VALUE );
@@ -212,54 +219,54 @@ void LineWidthControl::SetWidthSelect( long lValue, bool bValuable, SfxMapUnit e
OUString aWinData( aTmp );
mnCustomWidth = aWinData.toInt32();
mbCustom = true;
- maVSWidth.SetImage(maIMGCus);
- maVSWidth.SetCusEnable(true);
+ maVSWidth->SetImage(maIMGCus);
+ maVSWidth->SetCusEnable(true);
OUString aStrTip( OUString::number( (double)mnCustomWidth / 10));
aStrTip += mstrPT;
- maVSWidth.SetItemText(9, aStrTip);
+ maVSWidth->SetItemText(9, aStrTip);
}
else
{
mbCustom = false;
- maVSWidth.SetImage(maIMGCusGray);
- maVSWidth.SetCusEnable(false);
+ maVSWidth->SetImage(maIMGCusGray);
+ maVSWidth->SetCusEnable(false);
//modify
//String aStrTip(String(SVX_RES(STR_WIDTH_LAST_CUSTOM)));
- //maVSWidth.SetItemText(9, aStrTip);
- maVSWidth.SetItemText(9, rStr[8]);
+ //maVSWidth->SetItemText(9, aStrTip);
+ maVSWidth->SetItemText(9, rStr[8]);
}
if(bValuable)
{
sal_Int64 nVal = OutputDevice::LogicToLogic( lValue, (MapUnit)eMapUnit, MAP_100TH_MM );
- nVal = maMFWidth.Normalize( nVal );
- maMFWidth.SetValue( nVal, FUNIT_100TH_MM );
+ nVal = maMFWidth->Normalize( nVal );
+ maMFWidth->SetValue( nVal, FUNIT_100TH_MM );
}
else
{
- maMFWidth.SetText( "" );
+ maMFWidth->SetText( "" );
}
MapUnit eOrgUnit = (MapUnit)eMapUnit;
MapUnit ePntUnit( MAP_TWIP );
lValue = LogicToLogic( lValue , eOrgUnit, ePntUnit );
- OUString strCurrValue = maMFWidth.GetText();
+ OUString strCurrValue = maMFWidth->GetText();
sal_uInt16 i = 0;
for(; i < 8; i++)
if(strCurrValue == rStr[i])
{
- maVSWidth.SetSelItem(i+1);
+ maVSWidth->SetSelItem(i+1);
break;
}
if (i>=8)
{
mbVSFocus = false;
- maVSWidth.SetSelItem(0);
+ maVSWidth->SetSelItem(0);
}
- maVSWidth.Format();
- maVSWidth.StartSelection();
+ maVSWidth->Format();
+ maVSWidth->StartSelection();
}
@@ -269,11 +276,11 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
{
if(pControl == &maVSWidth)
{
- sal_uInt16 iPos = maVSWidth.GetSelectItemId();
+ sal_uInt16 iPos = maVSWidth->GetSelectItemId();
if(iPos >= 1 && iPos <= 8)
{
- sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(maVSWidth.GetItemData( iPos )), MAP_POINT, (MapUnit)meMapUnit);
- nVal = maMFWidth.Denormalize(nVal);
+ sal_IntPtr nVal = LogicToLogic(reinterpret_cast<sal_IntPtr>(maVSWidth->GetItemData( iPos )), MAP_POINT, (MapUnit)meMapUnit);
+ nVal = maMFWidth->Denormalize(nVal);
XLineWidthItem aWidthItem( nVal );
mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &aWidthItem, 0L);
mrLinePropertyPanel.SetWidthIcon(iPos);
@@ -287,7 +294,7 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
if(mbCustom)
{
long nVal = LogicToLogic(mnCustomWidth , MAP_POINT, (MapUnit)meMapUnit);
- nVal = maMFWidth.Denormalize(nVal);
+ nVal = maMFWidth->Denormalize(nVal);
XLineWidthItem aWidthItem( nVal );
mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &aWidthItem, 0L);
mrLinePropertyPanel.SetWidth(nVal);
@@ -296,10 +303,10 @@ IMPL_LINK(LineWidthControl, VSSelectHdl, void *, pControl)
}
else
{
- maVSWidth.SetNoSelection(); //add , set no selection and keep the last select item
- maVSWidth.Format();
+ maVSWidth->SetNoSelection(); //add , set no selection and keep the last select item
+ maVSWidth->Format();
Invalidate();
- maVSWidth.StartSelection();
+ maVSWidth->StartSelection();
}
//modify end
}
@@ -316,16 +323,16 @@ IMPL_LINK(LineWidthControl, MFModifyHdl, void *, pControl)
{
if(pControl == &maMFWidth)
{
- if(maVSWidth.GetSelItem())
+ if(maVSWidth->GetSelItem())
{
- maVSWidth.SetSelItem(0);
- maVSWidth.Format();
+ maVSWidth->SetSelItem(0);
+ maVSWidth->Format();
Invalidate();
- maVSWidth.StartSelection();
+ maVSWidth->StartSelection();
}
- long nTmp = static_cast<long>(maMFWidth.GetValue());
+ long nTmp = static_cast<long>(maMFWidth->GetValue());
long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)meMapUnit );
- sal_Int32 nNewWidth = (short)maMFWidth.Denormalize( nVal );
+ sal_Int32 nNewWidth = (short)maMFWidth->Denormalize( nVal );
XLineWidthItem aWidthItem(nNewWidth);
mpBindings->GetDispatcher()->Execute(SID_ATTR_LINE_WIDTH, SfxCallMode::RECORD, &aWidthItem, 0L);
diff --git a/svx/source/sidebar/line/LineWidthControl.hxx b/svx/source/sidebar/line/LineWidthControl.hxx
index 4afa1e595c88..5af26026e92a 100644
--- a/svx/source/sidebar/line/LineWidthControl.hxx
+++ b/svx/source/sidebar/line/LineWidthControl.hxx
@@ -38,6 +38,7 @@ class LineWidthControl
public:
LineWidthControl (vcl::Window* pParent, LinePropertyPanel& rPanel);
virtual ~LineWidthControl();
+ virtual void dispose() SAL_OVERRIDE;
virtual void GetFocus() SAL_OVERRIDE;
virtual void Paint(const Rectangle& rect) SAL_OVERRIDE;
@@ -47,12 +48,12 @@ public:
long GetTmpCustomWidth() { return mnTmpCustomWidth;}
private:
- LinePropertyPanel& mrLinePropertyPanel;
+ LinePropertyPanel& mrLinePropertyPanel;
SfxBindings* mpBindings;
- LineWidthValueSet maVSWidth;
- FixedText maFTCus;
- FixedText maFTWidth;
- MetricField maMFWidth;
+ VclPtr<LineWidthValueSet> maVSWidth;
+ VclPtr<FixedText> maFTCus;
+ VclPtr<FixedText> maFTWidth;
+ VclPtr<MetricField> maMFWidth;
SfxMapUnit meMapUnit;
OUString* rStr;
OUString mstrPT;
diff --git a/svx/source/sidebar/line/LineWidthValueSet.cxx b/svx/source/sidebar/line/LineWidthValueSet.cxx
index fb17d25cc84d..532a11cdd9c5 100644
--- a/svx/source/sidebar/line/LineWidthValueSet.cxx
+++ b/svx/source/sidebar/line/LineWidthValueSet.cxx
@@ -41,12 +41,15 @@ LineWidthValueSet::LineWidthValueSet (
LineWidthValueSet::~LineWidthValueSet()
{
- delete pVDev;
- delete[] strUnit;
+ disposeOnce();
}
-
-
+void LineWidthValueSet::dispose()
+{
+ pVDev.disposeAndClear();
+ delete[] strUnit;
+ ValueSet::dispose();
+}
void LineWidthValueSet::SetUnit(OUString* str)
{
diff --git a/svx/source/sidebar/line/LineWidthValueSet.hxx b/svx/source/sidebar/line/LineWidthValueSet.hxx
index 4fe20e46208f..7cb02031a272 100644
--- a/svx/source/sidebar/line/LineWidthValueSet.hxx
+++ b/svx/source/sidebar/line/LineWidthValueSet.hxx
@@ -30,6 +30,7 @@ class LineWidthValueSet
public:
LineWidthValueSet (vcl::Window* pParent, const ResId& rResId);
virtual ~LineWidthValueSet();
+ virtual void dispose() SAL_OVERRIDE;
void SetUnit(OUString* str);
void SetSelItem(sal_uInt16 nSel);
@@ -40,7 +41,7 @@ public:
virtual void UserDraw( const UserDrawEvent& rUDEvt ) SAL_OVERRIDE;
protected:
- VirtualDevice* pVDev;
+ VclPtr<VirtualDevice> pVDev;
sal_uInt16 nSelItem;
OUString* strUnit;
Image imgCus;
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
index 136e2c349964..29f93b25ddc2 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx
@@ -62,7 +62,7 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId)
mpLineDistAtPercentBox = get<MetricField>("percent_box");
mpLineDistAtMetricBox = get<MetricField>("metric_box");
- mpActLineDistFld = mpLineDistAtPercentBox;
+ mpActLineDistFld = mpLineDistAtPercentBox.get();
meLNSpaceUnit = SFX_MAPUNIT_100TH_MM;
@@ -94,6 +94,21 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId)
ParaLineSpacingControl::~ParaLineSpacingControl()
{
+ disposeOnce();
+}
+
+void ParaLineSpacingControl::dispose()
+{
+ mpActLineDistFld.clear();
+ mpSpacing1Button.clear();
+ mpSpacing115Button.clear();
+ mpSpacing15Button.clear();
+ mpSpacing2Button.clear();
+ mpLineDist.clear();
+ mpLineDistLabel.clear();
+ mpLineDistAtPercentBox.clear();
+ mpLineDistAtMetricBox.clear();
+ SfxPopupWindow::dispose();
}
void ParaLineSpacingControl::Initialize()
@@ -245,7 +260,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_DURCH:
mpLineDistAtPercentBox->Hide();
- mpActLineDistFld = mpLineDistAtMetricBox;
+ mpActLineDistFld = mpLineDistAtMetricBox.get();
mpLineDistAtMetricBox->SetMin(0);
if (mpLineDistAtMetricBox->GetText().isEmpty())
@@ -259,7 +274,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_MIN:
mpLineDistAtPercentBox->Hide();
- mpActLineDistFld = mpLineDistAtMetricBox;
+ mpActLineDistFld = mpLineDistAtMetricBox.get();
mpLineDistAtMetricBox->SetMin(0);
if (mpLineDistAtMetricBox->GetText().isEmpty())
@@ -273,7 +288,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_PROP:
mpLineDistAtMetricBox->Hide();
- mpActLineDistFld = mpLineDistAtPercentBox;
+ mpActLineDistFld = mpLineDistAtPercentBox.get();
if (mpLineDistAtPercentBox->GetText().isEmpty())
mpLineDistAtPercentBox->SetValue(mpLineDistAtPercentBox->Normalize(100), FUNIT_TWIP);
@@ -286,7 +301,7 @@ void ParaLineSpacingControl::UpdateMetricFields()
case LLINESPACE_FIX:
mpLineDistAtPercentBox->Hide();
- mpActLineDistFld = mpLineDistAtMetricBox;
+ mpActLineDistFld = mpLineDistAtMetricBox.get();
sal_Int64 nTemp = mpLineDistAtMetricBox->GetValue();
mpLineDistAtMetricBox->SetMin(mpLineDistAtMetricBox->Normalize(MIN_FIXED_DISTANCE), FUNIT_TWIP);
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
index a14df2c9d575..cd2422ef2bf1 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx
@@ -31,22 +31,23 @@ class ParaLineSpacingControl : public SfxPopupWindow
public:
ParaLineSpacingControl(sal_uInt16 nId);
virtual ~ParaLineSpacingControl();
+ virtual void dispose() SAL_OVERRIDE;
private:
SfxMapUnit meLNSpaceUnit;
- Edit* mpActLineDistFld;
+ VclPtr<Edit> mpActLineDistFld;
- PushButton* mpSpacing1Button;
- PushButton* mpSpacing115Button;
- PushButton* mpSpacing15Button;
- PushButton* mpSpacing2Button;
+ VclPtr<PushButton> mpSpacing1Button;
+ VclPtr<PushButton> mpSpacing115Button;
+ VclPtr<PushButton> mpSpacing15Button;
+ VclPtr<PushButton> mpSpacing2Button;
- ListBox* mpLineDist;
+ VclPtr<ListBox> mpLineDist;
- FixedText* mpLineDistLabel;
- MetricField* mpLineDistAtPercentBox;
- MetricField* mpLineDistAtMetricBox;
+ VclPtr<FixedText> mpLineDistLabel;
+ VclPtr<MetricField> mpLineDistAtPercentBox;
+ VclPtr<MetricField> mpLineDistAtMetricBox;
private:
/// Setup the widgets with values from the document.
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
index 5b1329178b9a..4041ef6a887a 100644
--- a/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
+++ b/svx/source/sidebar/paragraph/ParaLineSpacingPopup.cxx
@@ -42,9 +42,9 @@ SfxPopupWindowType ParaLineSpacingPopup::GetPopupWindowType() const
return SfxPopupWindowType::ONTIMEOUT;
}
-SfxPopupWindow* ParaLineSpacingPopup::CreatePopupWindow()
+VclPtr<SfxPopupWindow> ParaLineSpacingPopup::CreatePopupWindow()
{
- ParaLineSpacingControl* pControl = new ParaLineSpacingControl(GetSlotId());
+ VclPtr<ParaLineSpacingControl> pControl = VclPtr<ParaLineSpacingControl>::Create(GetSlotId());
pControl->StartPopupMode(&GetToolBox(), FLOATWIN_POPUPMODE_GRABFOCUS|FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE);
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index b78e985ed94a..db3241acfc04 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -55,7 +55,7 @@ namespace svx {namespace sidebar {
#define MAX_SC_SD 116220200
#define NEGA_MAXVALUE -10000000
-ParaPropertyPanel* ParaPropertyPanel::Create (
+VclPtr<vcl::Window> ParaPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -68,11 +68,11 @@ ParaPropertyPanel* ParaPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to ParaPropertyPanel::Create", NULL, 2);
- return new ParaPropertyPanel(
- pParent,
- rxFrame,
- pBindings,
- rxSidebar);
+ return VclPtr<ParaPropertyPanel>::Create(
+ pParent,
+ rxFrame,
+ pBindings,
+ rxSidebar);
}
void ParaPropertyPanel::HandleContextChange (
@@ -191,10 +191,6 @@ void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent)
(void)rEvent;
}
-ParaPropertyPanel::~ParaPropertyPanel()
-{
-}
-
void ParaPropertyPanel::ReSize(bool /* bSize */)
{
if (mxSidebar.is())
@@ -750,6 +746,35 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
m_aMetricCtl.RequestUpdate();
}
+ParaPropertyPanel::~ParaPropertyPanel()
+{
+ disposeOnce();
+}
+
+void ParaPropertyPanel::dispose()
+{
+ mpTBxVertAlign.clear();
+ mpTBxNumBullet.clear();
+ mpTBxBackColor.clear();
+ mpTopDist.clear();
+ mpBottomDist.clear();
+ mpTbxIndent_IncDec.clear();
+ mpTbxProDemote.clear();
+ mpLeftIndent.clear();
+ mpRightIndent.clear();
+ mpFLineIndent.clear();
+
+ maLRSpaceControl.dispose();
+ maULSpaceControl.dispose();
+ maOutLineLeftControl.dispose();
+ maOutLineRightControl.dispose();
+ maDecIndentControl.dispose();
+ maIncIndentControl.dispose();
+ m_aMetricCtl.dispose();
+
+ PanelLayout::dispose();
+}
+
} } // end of namespace svx::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index b7f46b82b6a2..2a0ac3b0165c 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -43,7 +43,10 @@ class ParaPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static ParaPropertyPanel* Create (
+ virtual ~ParaPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -63,21 +66,27 @@ public:
static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
+ ParaPropertyPanel (
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings,
+ const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+
private:
// UI controls
//Alignment
- ToolBox* mpTBxVertAlign;
+ VclPtr<ToolBox> mpTBxVertAlign;
//NumBullet&Backcolor
- ToolBox* mpTBxNumBullet;
- ToolBox* mpTBxBackColor;
+ VclPtr<ToolBox> mpTBxNumBullet;
+ VclPtr<ToolBox> mpTBxBackColor;
//Paragraph spacing
- SvxRelativeField* mpTopDist;
- SvxRelativeField* mpBottomDist;
- ToolBox* mpTbxIndent_IncDec;
- ToolBox* mpTbxProDemote;
- SvxRelativeField* mpLeftIndent;
- SvxRelativeField* mpRightIndent;
- SvxRelativeField* mpFLineIndent;
+ VclPtr<SvxRelativeField> mpTopDist;
+ VclPtr<SvxRelativeField> mpBottomDist;
+ VclPtr<ToolBox> mpTbxIndent_IncDec;
+ VclPtr<ToolBox> mpTbxProDemote;
+ VclPtr<SvxRelativeField> mpLeftIndent;
+ VclPtr<SvxRelativeField> mpRightIndent;
+ VclPtr<SvxRelativeField> mpFLineIndent;
// Resources
Image maSpace3;
@@ -108,13 +117,6 @@ private:
SfxBindings* mpBindings;
css::uno::Reference<css::ui::XSidebar> mxSidebar;
- ParaPropertyPanel (
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual ~ParaPropertyPanel();
-
DECL_LINK(ModifyIndentHdl_Impl, void*);
DECL_LINK(ClickIndent_IncDec_Hdl_Impl, ToolBox*);
DECL_LINK(ClickProDemote_Hdl_Impl, ToolBox*);
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index b9c3c3cd5b6f..1c459d47d1ba 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -115,12 +115,46 @@ PosSizePropertyPanel::PosSizePropertyPanel(
mpBindings->Update( SID_ATTR_METRIC );
}
-
-
PosSizePropertyPanel::~PosSizePropertyPanel()
{
+ disposeOnce();
+}
+
+void PosSizePropertyPanel::dispose()
+{
+ mpFtPosX.clear();
+ mpMtrPosX.clear();
+ mpFtPosY.clear();
+ mpMtrPosY.clear();
+ mpFtWidth.clear();
+ mpMtrWidth.clear();
+ mpFtHeight.clear();
+ mpMtrHeight.clear();
+ mpCbxScale.clear();
+ mpFtAngle.clear();
+ mpMtrAngle.clear();
+ mpDial.clear();
+ mpFtFlip.clear();
+ mpFlipTbx.clear();
+
+ maTransfPosXControl.dispose();
+ maTransfPosYControl.dispose();
+ maTransfWidthControl.dispose();
+ maTransfHeightControl.dispose();
+
+ maSvxAngleControl.dispose();
+ maRotXControl.dispose();
+ maRotYControl.dispose();
+ maProPosControl.dispose();
+ maProSizeControl.dispose();
+ maAutoWidthControl.dispose();
+ maAutoHeightControl.dispose();
+ m_aMetricCtl.dispose();
+
+ PanelLayout::dispose();
}
+
namespace
{
bool hasText(const SdrView& rSdrView)
@@ -213,7 +247,7 @@ void PosSizePropertyPanel::SetupIcons()
-PosSizePropertyPanel* PosSizePropertyPanel::Create (
+VclPtr<vcl::Window> PosSizePropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -226,11 +260,11 @@ PosSizePropertyPanel* PosSizePropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to PosSizePropertyPanel::Create", NULL, 2);
- return new PosSizePropertyPanel(
- pParent,
- rxFrame,
- pBindings,
- rxSidebar);
+ return VclPtr<PosSizePropertyPanel>::Create(
+ pParent,
+ rxFrame,
+ pBindings,
+ rxSidebar);
}
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index efa51e7a09c2..1225ce07694a 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -50,7 +50,10 @@ class PosSizePropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static PosSizePropertyPanel* Create(
+ virtual ~PosSizePropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -70,30 +73,37 @@ public:
SfxBindings* GetBindings() { return mpBindings;}
+ // constructor/destuctor
+ PosSizePropertyPanel(
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings,
+ const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+
private:
//Position
- FixedText* mpFtPosX;
- MetricField* mpMtrPosX;
- FixedText* mpFtPosY;
- MetricField* mpMtrPosY;
+ VclPtr<FixedText> mpFtPosX;
+ VclPtr<MetricField> mpMtrPosX;
+ VclPtr<FixedText> mpFtPosY;
+ VclPtr<MetricField> mpMtrPosY;
// size
- FixedText* mpFtWidth;
- MetricField* mpMtrWidth;
- FixedText* mpFtHeight;
- MetricField* mpMtrHeight;
- CheckBox* mpCbxScale;
+ VclPtr<FixedText> mpFtWidth;
+ VclPtr<MetricField> mpMtrWidth;
+ VclPtr<FixedText> mpFtHeight;
+ VclPtr<MetricField> mpMtrHeight;
+ VclPtr<CheckBox> mpCbxScale;
//rotation
- FixedText* mpFtAngle;
- MetricBox* mpMtrAngle;
+ VclPtr<FixedText> mpFtAngle;
+ VclPtr<MetricBox> mpMtrAngle;
//rotation control
- SidebarDialControl* mpDial;
+ VclPtr<SidebarDialControl> mpDial;
//flip
- FixedText* mpFtFlip;
- ToolBox* mpFlipTbx;
+ VclPtr<FixedText> mpFtFlip;
+ VclPtr<ToolBox> mpFlipTbx;
// Internal variables
basegfx::B2DRange maRect;
@@ -154,14 +164,6 @@ private:
void executePosY();
void executeSize();
- // constructor/destuctor
- PosSizePropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual ~PosSizePropertyPanel();
-
void MetricState( SfxItemState eState, const SfxPoolItem* pState );
static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
void DisableControls();
diff --git a/svx/source/sidebar/possize/SidebarDialControl.cxx b/svx/source/sidebar/possize/SidebarDialControl.cxx
index dc30100751e6..df10da6ed4ec 100644
--- a/svx/source/sidebar/possize/SidebarDialControl.cxx
+++ b/svx/source/sidebar/possize/SidebarDialControl.cxx
@@ -35,10 +35,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT vcl::Window* SAL_CALL makeSidebarDialControl(vcl
return new SidebarDialControl(pParent, WB_TABSTOP);
}
-SidebarDialControl::~SidebarDialControl()
-{
-}
-
Size SidebarDialControl::GetOptimalSize() const
{
return LogicToPixel(Size(10, 10), MAP_APPFONT);
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index 3a798f22fece..bd1489431c3c 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -36,13 +36,13 @@ TextCharacterSpacingControl::TextCharacterSpacingControl (
: PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_SPACING))
, mrTextPropertyPanel(rPanel)
, mpBindings(pBindings)
-, maVSSpacing (ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING))
-, maLastCus (this, SVX_RES(FT_LASTCUSTOM))
+, maVSSpacing (VclPtr<ValueSetWithTextControl>::Create(ValueSetWithTextControl::IMAGE_TEXT,this, SVX_RES(VS_SPACING)))
+, maLastCus (VclPtr<FixedText>::Create(this, SVX_RES(FT_LASTCUSTOM)))
//, maBorder (this, SVX_RES(CT_BORDER))
-, maFTSpacing (this, SVX_RES(FT_SPACING))
-, maLBKerning (this, SVX_RES(LB_KERNING))
-, maFTBy (this, SVX_RES(FT_BY))
-, maEditKerning (this, SVX_RES(ED_KERNING))
+, maFTSpacing (VclPtr<FixedText>::Create(this, SVX_RES(FT_SPACING)))
+, maLBKerning (VclPtr<ListBox>::Create(this, SVX_RES(LB_KERNING)))
+, maFTBy (VclPtr<FixedText>::Create(this, SVX_RES(FT_BY)))
+, maEditKerning (VclPtr<MetricField>::Create(this, SVX_RES(ED_KERNING)))
, mpImg (NULL)
, mpImgSel (NULL)
@@ -65,36 +65,49 @@ TextCharacterSpacingControl::TextCharacterSpacingControl (
initial();
FreeResource();
Link aLink = LINK(this, TextCharacterSpacingControl, KerningSelectHdl);
- maLBKerning.SetSelectHdl(aLink);
+ maLBKerning->SetSelectHdl(aLink);
aLink =LINK(this, TextCharacterSpacingControl, KerningModifyHdl);
- maEditKerning.SetModifyHdl(aLink);
+ maEditKerning->SetModifyHdl(aLink);
}
+
TextCharacterSpacingControl::~TextCharacterSpacingControl()
{
+ disposeOnce();
+}
+
+void TextCharacterSpacingControl::dispose()
+{
delete[] mpImg;
delete[] mpImgSel;
delete[] mpStr;
delete[] mpStrTip;
+ maVSSpacing.disposeAndClear();
+ maLastCus.disposeAndClear();
+ maFTSpacing.disposeAndClear();
+ maLBKerning.disposeAndClear();
+ maFTBy.disposeAndClear();
+ maEditKerning.disposeAndClear();
+ svx::sidebar::PopupControl::dispose();
}
void TextCharacterSpacingControl::initial()
{
- maVSSpacing.SetStyle( maVSSpacing.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
+ maVSSpacing->SetStyle( maVSSpacing->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
{
- maVSSpacing.SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+ maVSSpacing->SetControlBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maVSSpacing.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
+ maVSSpacing->SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maVSSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+ maVSSpacing->SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maFTSpacing.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+ maFTSpacing->SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maFTBy.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
+ maFTBy->SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
GetSettings().GetStyleSettings().GetMenuColor():
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
}
@@ -128,21 +141,21 @@ void TextCharacterSpacingControl::initial()
mpStrTip[4] = SVX_RESSTR(STR_VERY_LOOSE_TIP);
for (int i=0;i<5;i++)
- maVSSpacing.AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
+ maVSSpacing->AddItem(mpImg[i], &mpImgSel[i],mpStr[i],&mpStrTip[i]);
- maVSSpacing.AddItem( maImgCus, 0, maStrCus, 0 );
+ maVSSpacing->AddItem( maImgCus, 0, maStrCus, 0 );
- maVSSpacing.SetNoSelection();
+ maVSSpacing->SetNoSelection();
Link aLink = LINK(this, TextCharacterSpacingControl,VSSelHdl );
- maVSSpacing.SetSelectHdl(aLink);
- maVSSpacing.StartSelection();
- maVSSpacing.Show();
+ maVSSpacing->SetSelectHdl(aLink);
+ maVSSpacing->StartSelection();
+ maVSSpacing->Show();
}
void TextCharacterSpacingControl::Rearrange(bool bLBAvailable,bool bAvailable, long nKerning)
{
mbVS = true;
- maVSSpacing.SetNoSelection();
+ maVSSpacing->SetNoSelection();
SvtViewOptions aWinOpt( E_WINDOW, SIDEBAR_SPACING_GLOBAL_VALUE );
if ( aWinOpt.Exists() )
{
@@ -164,131 +177,131 @@ void TextCharacterSpacingControl::Rearrange(bool bLBAvailable,bool bAvailable, l
if( !mnLastCus )
{
- maVSSpacing.ReplaceItemImages(6, maImgCusGrey,0);
+ maVSSpacing->ReplaceItemImages(6, maImgCusGrey,0);
}
else
{
//set custom tips
- maVSSpacing.ReplaceItemImages(6, maImgCus,0);
+ maVSSpacing->ReplaceItemImages(6, maImgCus,0);
if(mnCustomKern > 0)
{
OUString aStrTip( maStrCusE); //LAST CUSTOM no tip defect //add
aStrTip += OUString::number( (double)mnCustomKern / 10);
aStrTip += " " + maStrUnit; // modify
- maVSSpacing.SetItemText(6,aStrTip);
+ maVSSpacing->SetItemText(6,aStrTip);
}
else if(mnCustomKern < 0)
{
OUString aStrTip(maStrCusC) ; //LAST CUSTOM no tip defect //add
aStrTip += OUString::number( (double)-mnCustomKern / 10);
aStrTip += " " + maStrUnit; // modify
- maVSSpacing.SetItemText( 6, aStrTip );
+ maVSSpacing->SetItemText( 6, aStrTip );
}
else
{
OUString aStrTip(maStrCusN) ; //LAST CUSTOM no tip defect //add
- maVSSpacing.SetItemText( 6, aStrTip );
+ maVSSpacing->SetItemText( 6, aStrTip );
}
}
if(bLBAvailable && bAvailable)
{
- maLBKerning.Enable();
- maFTSpacing.Enable();
+ maLBKerning->Enable();
+ maFTSpacing->Enable();
SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
MapUnit eOrgUnit = (MapUnit)eUnit;
MapUnit ePntUnit( MAP_POINT );
- long nBig = maEditKerning.Normalize(nKerning);
+ long nBig = maEditKerning->Normalize(nKerning);
nKerning = LogicToLogic( nBig, eOrgUnit, ePntUnit );
if ( nKerning > 0 )
{
- maFTBy.Enable();
- maEditKerning.Enable();
- maEditKerning.SetMax( 9999 );
- maEditKerning.SetLast( 9999 );
- maEditKerning.SetValue( nKerning );
- maLBKerning.SelectEntryPos( SIDEBAR_SPACE_EXPAND );
+ maFTBy->Enable();
+ maEditKerning->Enable();
+ maEditKerning->SetMax( 9999 );
+ maEditKerning->SetLast( 9999 );
+ maEditKerning->SetValue( nKerning );
+ maLBKerning->SelectEntryPos( SIDEBAR_SPACE_EXPAND );
if(nKerning == 30)
{
- maVSSpacing.SelectItem(4);
+ maVSSpacing->SelectItem(4);
}
else if(nKerning == 60)
{
- maVSSpacing.SelectItem(5);
+ maVSSpacing->SelectItem(5);
}
else
{
- maVSSpacing.SetNoSelection();
- maVSSpacing.SelectItem(0);
+ maVSSpacing->SetNoSelection();
+ maVSSpacing->SelectItem(0);
mbVS = false;
}
}
else if ( nKerning < 0 )
{
- maFTBy.Enable();
- maEditKerning.Enable();
- maEditKerning.SetValue( -nKerning );
- maLBKerning.SelectEntryPos( SIDEBAR_SPACE_CONDENSED );
+ maFTBy->Enable();
+ maEditKerning->Enable();
+ maEditKerning->SetValue( -nKerning );
+ maLBKerning->SelectEntryPos( SIDEBAR_SPACE_CONDENSED );
long nMax = mrTextPropertyPanel.GetSelFontSize()/6;
- maEditKerning.SetMax( maEditKerning.Normalize( nMax ), FUNIT_POINT );
- maEditKerning.SetLast( maEditKerning.GetMax( maEditKerning.GetUnit() ) );
+ maEditKerning->SetMax( maEditKerning->Normalize( nMax ), FUNIT_POINT );
+ maEditKerning->SetLast( maEditKerning->GetMax( maEditKerning->GetUnit() ) );
if( nKerning == -30 )
{
- maVSSpacing.SelectItem(1);
+ maVSSpacing->SelectItem(1);
}
else if( nKerning == -15 )
{
- maVSSpacing.SelectItem(2);
+ maVSSpacing->SelectItem(2);
}
else
{
- maVSSpacing.SetNoSelection();
- maVSSpacing.SelectItem(0);
+ maVSSpacing->SetNoSelection();
+ maVSSpacing->SelectItem(0);
mbVS = false;
}
}
else
{
- maVSSpacing.SelectItem(3);
- maLBKerning.SelectEntryPos( SIDEBAR_SPACE_NORMAL );
- maFTBy.Disable();
- maEditKerning.Disable();
- maEditKerning.SetValue( 0 );
- maEditKerning.SetMax( 9999 );
- maEditKerning.SetLast( 9999 );
+ maVSSpacing->SelectItem(3);
+ maLBKerning->SelectEntryPos( SIDEBAR_SPACE_NORMAL );
+ maFTBy->Disable();
+ maEditKerning->Disable();
+ maEditKerning->SetValue( 0 );
+ maEditKerning->SetMax( 9999 );
+ maEditKerning->SetLast( 9999 );
}
}
else if(bLBAvailable && !bAvailable)
{
//modified
- maVSSpacing.SetNoSelection();
- maVSSpacing.SelectItem(0);
+ maVSSpacing->SetNoSelection();
+ maVSSpacing->SelectItem(0);
mbVS = false;
- maLBKerning.Enable();
- maFTSpacing.Enable();
- maLBKerning.SetNoSelection();
- maEditKerning.SetText(OUString());
- maEditKerning.Disable();
- maFTBy.Disable();
+ maLBKerning->Enable();
+ maFTSpacing->Enable();
+ maLBKerning->SetNoSelection();
+ maEditKerning->SetText(OUString());
+ maEditKerning->Disable();
+ maFTBy->Disable();
}
else
{
- maVSSpacing.SetNoSelection();
- maVSSpacing.SelectItem(0);
+ maVSSpacing->SetNoSelection();
+ maVSSpacing->SelectItem(0);
mbVS = false;
- maEditKerning.SetText(OUString());
- maLBKerning.SetNoSelection();
- maLBKerning.Disable();
- maFTSpacing.Disable();
- maEditKerning.Disable();
- maFTBy.Disable();
+ maEditKerning->SetText(OUString());
+ maLBKerning->SetNoSelection();
+ maLBKerning->Disable();
+ maFTSpacing->Disable();
+ maEditKerning->Disable();
+ maFTBy->Disable();
}
GetFocus();
- maVSSpacing.Format();
- maVSSpacing.StartSelection();
+ maVSSpacing->Format();
+ maVSSpacing->StartSelection();
}
IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
{
@@ -296,14 +309,14 @@ IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
if(pControl == &maVSSpacing)
{
- sal_uInt16 iPos = maVSSpacing.GetSelectItemId();
+ sal_uInt16 iPos = maVSSpacing->GetSelectItemId();
short nKern = 0;
SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
long nVal = 0;
if(iPos == 1)
{
nVal = LogicToLogic(30, MAP_POINT, (MapUnit)eUnit);
- nKern = (short)maEditKerning.Denormalize(nVal);
+ nKern = (short)maEditKerning->Denormalize(nVal);
SvxKerningItem aKernItem(-nKern, SID_ATTR_CHAR_KERNING);
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
@@ -311,7 +324,7 @@ IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
else if(iPos == 2)
{
nVal = LogicToLogic(15, MAP_POINT, (MapUnit)eUnit);
- nKern = (short)maEditKerning.Denormalize(nVal);
+ nKern = (short)maEditKerning->Denormalize(nVal);
SvxKerningItem aKernItem(-nKern, SID_ATTR_CHAR_KERNING);
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
@@ -325,7 +338,7 @@ IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
else if(iPos == 4)
{
nVal = LogicToLogic(30, MAP_POINT, (MapUnit)eUnit);
- nKern = (short)maEditKerning.Denormalize(nVal);
+ nKern = (short)maEditKerning->Denormalize(nVal);
SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
@@ -333,7 +346,7 @@ IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
else if(iPos == 5)
{
nVal = LogicToLogic(60, MAP_POINT, (MapUnit)eUnit);
- nKern = (short)maEditKerning.Denormalize(nVal);
+ nKern = (short)maEditKerning->Denormalize(nVal);
SvxKerningItem aKernItem(nKern, SID_ATTR_CHAR_KERNING);
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
@@ -344,17 +357,17 @@ IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
if(mbCusEnable)
{
nVal = LogicToLogic(mnCustomKern, MAP_POINT, (MapUnit)eUnit);
- nKern = (short)maEditKerning.Denormalize(nVal);
+ nKern = (short)maEditKerning->Denormalize(nVal);
SvxKerningItem aKernItem(nKern , SID_ATTR_CHAR_KERNING);
mpBindings->GetDispatcher()->Execute(SID_ATTR_CHAR_KERNING, SfxCallMode::RECORD, &aKernItem, 0L);
mnLastCus = SPACING_CLOSE_BY_CLICK_ICON;
}
else
{
- maVSSpacing.SetNoSelection(); //add , set no selection and keep the last select item
- maVSSpacing.Format();
+ maVSSpacing->SetNoSelection(); //add , set no selection and keep the last select item
+ maVSSpacing->Format();
Invalidate();
- maVSSpacing.StartSelection();
+ maVSSpacing->StartSelection();
}
//modify end
}
@@ -370,67 +383,67 @@ IMPL_LINK(TextCharacterSpacingControl, VSSelHdl, void *, pControl)
IMPL_LINK(TextCharacterSpacingControl, KerningSelectHdl, ListBox*, EMPTYARG)
{
- if ( maLBKerning.GetSelectEntryPos() > 0 )
+ if ( maLBKerning->GetSelectEntryPos() > 0 )
{
- maFTBy.Enable();
- maEditKerning.Enable();
+ maFTBy->Enable();
+ maEditKerning->Enable();
}
else
{
- maEditKerning.SetValue( 0 );
- maFTBy.Disable();
- maEditKerning.Disable();
+ maEditKerning->SetValue( 0 );
+ maFTBy->Disable();
+ maEditKerning->Disable();
}
- if ( maVSSpacing.GetSelectItemId() > 0 )
+ if ( maVSSpacing->GetSelectItemId() > 0 )
{
- maVSSpacing.SetNoSelection();
- maVSSpacing.SelectItem(0);
- maVSSpacing.Format();
+ maVSSpacing->SetNoSelection();
+ maVSSpacing->SelectItem(0);
+ maVSSpacing->Format();
Invalidate();
- maVSSpacing.StartSelection();
+ maVSSpacing->StartSelection();
}
KerningModifyHdl( NULL );
return 0;
}
IMPL_LINK(TextCharacterSpacingControl, KerningModifyHdl, MetricField*, EMPTYARG)
{
- if ( maVSSpacing.GetSelectItemId() > 0 )
+ if ( maVSSpacing->GetSelectItemId() > 0 )
{
- maVSSpacing.SetNoSelection();
- maVSSpacing.SelectItem(0);
- maVSSpacing.Format();
+ maVSSpacing->SetNoSelection();
+ maVSSpacing->SelectItem(0);
+ maVSSpacing->Format();
Invalidate();
- maVSSpacing.StartSelection();
+ maVSSpacing->StartSelection();
}
- sal_uInt16 nPos = maLBKerning.GetSelectEntryPos();
+ sal_uInt16 nPos = maLBKerning->GetSelectEntryPos();
short nKern = 0;
SfxMapUnit eUnit = mrTextPropertyPanel.GetSpaceController().GetCoreMetric();
mnLastCus = SPACING_CLOSE_BY_CUS_EDIT;
if ( nPos == SIDEBAR_SPACE_EXPAND || nPos == SIDEBAR_SPACE_CONDENSED )
{
- long nTmp = static_cast<long>(maEditKerning.GetValue());
+ long nTmp = static_cast<long>(maEditKerning->GetValue());
if ( nPos == SIDEBAR_SPACE_CONDENSED )
{
long nMax = mrTextPropertyPanel.GetSelFontSize()/6;
- maEditKerning.SetMax( maEditKerning.Normalize( nMax ), FUNIT_TWIP );
- maEditKerning.SetLast( maEditKerning.GetMax( maEditKerning.GetUnit() ) );
- if(nTmp > maEditKerning.GetMax())
- nTmp = maEditKerning.GetMax();
+ maEditKerning->SetMax( maEditKerning->Normalize( nMax ), FUNIT_TWIP );
+ maEditKerning->SetLast( maEditKerning->GetMax( maEditKerning->GetUnit() ) );
+ if(nTmp > maEditKerning->GetMax())
+ nTmp = maEditKerning->GetMax();
mnCustomKern = -nTmp;
long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
- nKern = (short)maEditKerning.Denormalize( nVal );
+ nKern = (short)maEditKerning->Denormalize( nVal );
nKern *= - 1;
}
else
{
- maEditKerning.SetMax( 9999 );
- maEditKerning.SetLast( 9999 );
- if(nTmp > maEditKerning.GetMax(FUNIT_TWIP))
- nTmp = maEditKerning.GetMax(FUNIT_TWIP);
+ maEditKerning->SetMax( 9999 );
+ maEditKerning->SetLast( 9999 );
+ if(nTmp > maEditKerning->GetMax(FUNIT_TWIP))
+ nTmp = maEditKerning->GetMax(FUNIT_TWIP);
mnCustomKern = nTmp;
long nVal = LogicToLogic( nTmp, MAP_POINT, (MapUnit)eUnit );
- nKern = (short)maEditKerning.Denormalize( nVal );
+ nKern = (short)maEditKerning->Denormalize( nVal );
}
}
else
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
index b96dd8945d1a..7d5289f8d52f 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
@@ -45,6 +45,7 @@ public:
svx::sidebar::TextPropertyPanel& rPanel,
SfxBindings* pBindings);
virtual ~TextCharacterSpacingControl();
+ virtual void dispose() SAL_OVERRIDE;
void Rearrange(bool bLBAvailable,bool bAvailable, long nKerning);
//virtual void Paint(const Rectangle& rect);
@@ -57,14 +58,14 @@ private:
svx::sidebar::TextPropertyPanel& mrTextPropertyPanel;
SfxBindings* mpBindings;
- ValueSetWithTextControl maVSSpacing;
+ VclPtr<ValueSetWithTextControl> maVSSpacing;
- FixedText maLastCus;
+ VclPtr<FixedText> maLastCus;
- FixedText maFTSpacing;
- ListBox maLBKerning;
- FixedText maFTBy;
- MetricField maEditKerning;
+ VclPtr<FixedText> maFTSpacing;
+ VclPtr<ListBox> maLBKerning;
+ VclPtr<FixedText> maFTBy;
+ VclPtr<MetricField> maEditKerning;
Image* mpImg;
Image* mpImgSel;
diff --git a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
index 1137cdb41aaa..e063245d9007 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingPopup.cxx
@@ -25,7 +25,7 @@ namespace svx { namespace sidebar {
TextCharacterSpacingPopup::TextCharacterSpacingPopup (
vcl::Window* pParent,
- const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator)
+ const ::boost::function<VclPtr<PopupControl>(PopupContainer*)>& rControlCreator)
: Popup(
pParent,
rControlCreator,
diff --git a/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx b/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
index 9a55c0faa8d4..b93e4fc52b15 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingPopup.hxx
@@ -31,7 +31,7 @@ class TextCharacterSpacingPopup
public :
TextCharacterSpacingPopup (
vcl::Window* pParent,
- const ::boost::function<PopupControl*(PopupContainer*)>& rControlCreator);
+ const ::boost::function<VclPtr<PopupControl>(PopupContainer*)>& rControlCreator);
virtual ~TextCharacterSpacingPopup();
void Rearrange (bool bLBAvailable,bool bAvailable, long nKerning);
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index b069099feb56..b6d9e09a803b 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -43,14 +43,14 @@ const char UNO_UNDERLINE[] = ".uno:Underline";
namespace svx { namespace sidebar {
-PopupControl* TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
+VclPtr<PopupControl> TextPropertyPanel::CreateCharacterSpacingControl (PopupContainer* pParent)
{
- return new TextCharacterSpacingControl(pParent, *this, mpBindings);
+ return VclPtrInstance<TextCharacterSpacingControl>(pParent, *this, mpBindings);
}
-PopupControl* TextPropertyPanel::CreateUnderlinePopupControl (PopupContainer* pParent)
+VclPtr<PopupControl> TextPropertyPanel::CreateUnderlinePopupControl (PopupContainer* pParent)
{
- return new TextUnderlineControl(pParent, *this, mpBindings);
+ return VclPtrInstance<TextUnderlineControl>(pParent, *this, mpBindings);
}
long TextPropertyPanel::GetSelFontSize()
@@ -62,7 +62,7 @@ long TextPropertyPanel::GetSelFontSize()
return nH;
}
-TextPropertyPanel* TextPropertyPanel::Create (
+VclPtr<vcl::Window> TextPropertyPanel::Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -75,11 +75,11 @@ TextPropertyPanel* TextPropertyPanel::Create (
if (pBindings == NULL)
throw lang::IllegalArgumentException("no SfxBindings given to TextPropertyPanel::Create", NULL, 2);
- return new TextPropertyPanel(
- pParent,
- rxFrame,
- pBindings,
- rContext);
+ return VclPtr<TextPropertyPanel>::Create(
+ pParent,
+ rxFrame,
+ pBindings,
+ rContext);
}
@@ -116,6 +116,22 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref
TextPropertyPanel::~TextPropertyPanel()
{
+ disposeOnce();
+}
+
+void TextPropertyPanel::dispose()
+{
+ mpToolBoxFont.clear();
+ mpToolBoxIncDec.clear();
+ mpToolBoxSpacing.clear();
+ mpToolBoxFontColorSw.clear();
+ mpToolBoxFontColor.clear();
+
+ maFontSizeControl.dispose();
+ maUnderlineControl.dispose();
+ maSpacingControl.dispose();
+
+ PanelLayout::dispose();
}
void TextPropertyPanel::HandleContextChange (
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 7d7a229ddcfc..583300dc4b70 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -46,7 +46,10 @@ class TextPropertyPanel
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static TextPropertyPanel* Create (
+ virtual ~TextPropertyPanel();
+ virtual void dispose() SAL_OVERRIDE;
+
+ static VclPtr<vcl::Window> Create (
vcl::Window* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
@@ -71,13 +74,19 @@ public:
const SfxPoolItem* pState,
const bool bIsEnabled) SAL_OVERRIDE;
+ TextPropertyPanel (
+ vcl::Window* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings,
+ const ::sfx2::sidebar::EnumContext& rContext);
+
private:
//ui controls
- ToolBox* mpToolBoxFont;
- ToolBox* mpToolBoxIncDec;
- ToolBox* mpToolBoxSpacing;
- ToolBox* mpToolBoxFontColorSw;
- ToolBox* mpToolBoxFontColor;
+ VclPtr<ToolBox> mpToolBoxFont;
+ VclPtr<ToolBox> mpToolBoxIncDec;
+ VclPtr<ToolBox> mpToolBoxSpacing;
+ VclPtr<ToolBox> mpToolBoxFontColorSw;
+ VclPtr<ToolBox> mpToolBoxFontColor;
//control items
::sfx2::sidebar::ControllerItem maFontSizeControl;
@@ -97,16 +106,8 @@ private:
::sfx2::sidebar::EnumContext maContext;
SfxBindings* mpBindings;
- TextPropertyPanel (
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings,
- const ::sfx2::sidebar::EnumContext& rContext);
- virtual ~TextPropertyPanel();
-
-
- PopupControl* CreateCharacterSpacingControl (PopupContainer* pParent);
- PopupControl* CreateUnderlinePopupControl (PopupContainer* pParent);
+ VclPtr<PopupControl> CreateCharacterSpacingControl (PopupContainer* pParent);
+ VclPtr<PopupControl> CreateUnderlinePopupControl (PopupContainer* pParent);
DECL_LINK(SpacingClickHdl, ToolBox*);
DECL_LINK(UnderlineClickHdl, ToolBox* );
diff --git a/svx/source/sidebar/text/TextUnderlineControl.cxx b/svx/source/sidebar/text/TextUnderlineControl.cxx
index 61f94f8b48a0..a0eae0efb4b2 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.cxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.cxx
@@ -35,8 +35,8 @@ TextUnderlineControl::TextUnderlineControl (
: svx::sidebar::PopupControl( pParent,SVX_RES(RID_POPUPPANEL_TEXTPAGE_UNDERLINE))
, mrTextPropertyPanel(rPanel)
, mpBindings(pBindings)
-, maVSUnderline( this, SVX_RES(VS_UNDERLINE))
-, maPBOptions (this, SVX_RES(PB_OPTIONS) )
+, maVSUnderline(VclPtr<ValueSet>::Create(this, SVX_RES(VS_UNDERLINE)))
+, maPBOptions (VclPtr<PushButton>::Create(this, SVX_RES(PB_OPTIONS)))
, maIMGSingle (SVX_RES(IMG_SINGLE))
, maIMGDouble (SVX_RES(IMG_DOUBLE))
@@ -65,138 +65,150 @@ TextUnderlineControl::TextUnderlineControl (
FreeResource();
}
+TextUnderlineControl::~TextUnderlineControl()
+{
+ disposeOnce();
+}
+
+void TextUnderlineControl::dispose()
+{
+ maVSUnderline.disposeAndClear();
+ maPBOptions.disposeAndClear();
+ svx::sidebar::PopupControl::dispose();
+}
+
void TextUnderlineControl::initial()
{
- maVSUnderline.SetColor(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
+ maVSUnderline->SetColor(GetSettings().GetStyleSettings().GetHighContrastMode() ?
+ GetSettings().GetStyleSettings().GetMenuColor() :
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
- maVSUnderline.SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode()?
- GetSettings().GetStyleSettings().GetMenuColor():
+ maVSUnderline->SetBackground(GetSettings().GetStyleSettings().GetHighContrastMode() ?
+ GetSettings().GetStyleSettings().GetMenuColor() :
sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Paint_PanelBackground ));
Link aLink = LINK( this, TextUnderlineControl, PBClickHdl ) ;
- maPBOptions.SetClickHdl(aLink);
+ maPBOptions->SetClickHdl(aLink);
- maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
+ maVSUnderline->SetStyle( maVSUnderline->GetStyle()| WB_3DLOOK | WB_NO_DIRECTSELECT );
// 'none' item
- maVSUnderline.SetStyle( maVSUnderline.GetStyle()| WB_NONEFIELD | WB_MENUSTYLEVALUESET );
- maVSUnderline.SetText( SVX_RESSTR(STR_WITHOUT) );
+ maVSUnderline->SetStyle( maVSUnderline->GetStyle()| WB_NONEFIELD | WB_MENUSTYLEVALUESET );
+ maVSUnderline->SetText( SVX_RESSTR(STR_WITHOUT) );
- maVSUnderline.InsertItem(1, maIMGSingle, SVX_RESSTR(STR_SINGLE));
- maVSUnderline.SetItemData(1, reinterpret_cast<void*>(UNDERLINE_SINGLE));
+ maVSUnderline->InsertItem(1, maIMGSingle, SVX_RESSTR(STR_SINGLE));
+ maVSUnderline->SetItemData(1, reinterpret_cast<void*>(UNDERLINE_SINGLE));
- maVSUnderline.InsertItem(2, maIMGDouble, SVX_RESSTR(STR_DOUBLE));
- maVSUnderline.SetItemData(2, reinterpret_cast<void*>(UNDERLINE_DOUBLE));
+ maVSUnderline->InsertItem(2, maIMGDouble, SVX_RESSTR(STR_DOUBLE));
+ maVSUnderline->SetItemData(2, reinterpret_cast<void*>(UNDERLINE_DOUBLE));
- maVSUnderline.InsertItem(3, maIMGBold, SVX_RESSTR(STR_BOLD));
- maVSUnderline.SetItemData(3, reinterpret_cast<void*>(UNDERLINE_BOLD));
+ maVSUnderline->InsertItem(3, maIMGBold, SVX_RESSTR(STR_BOLD));
+ maVSUnderline->SetItemData(3, reinterpret_cast<void*>(UNDERLINE_BOLD));
- maVSUnderline.InsertItem(4, maIMGDot, SVX_RESSTR(STR_DOT));
- maVSUnderline.SetItemData(4, reinterpret_cast<void*>(UNDERLINE_DOTTED));
+ maVSUnderline->InsertItem(4, maIMGDot, SVX_RESSTR(STR_DOT));
+ maVSUnderline->SetItemData(4, reinterpret_cast<void*>(UNDERLINE_DOTTED));
- maVSUnderline.InsertItem(5, maIMGDotBold, SVX_RESSTR(STR_DOT_BOLD));
- maVSUnderline.SetItemData(5, reinterpret_cast<void*>(UNDERLINE_BOLDDOTTED));
+ maVSUnderline->InsertItem(5, maIMGDotBold, SVX_RESSTR(STR_DOT_BOLD));
+ maVSUnderline->SetItemData(5, reinterpret_cast<void*>(UNDERLINE_BOLDDOTTED));
- maVSUnderline.InsertItem(6, maIMGDash, SVX_RESSTR(STR_DASH));
- maVSUnderline.SetItemData(6, reinterpret_cast<void*>(UNDERLINE_DASH));
+ maVSUnderline->InsertItem(6, maIMGDash, SVX_RESSTR(STR_DASH));
+ maVSUnderline->SetItemData(6, reinterpret_cast<void*>(UNDERLINE_DASH));
- maVSUnderline.InsertItem(7, maIMGDashLong, SVX_RESSTR(STR_DASH_LONG));
- maVSUnderline.SetItemData(7, reinterpret_cast<void*>(UNDERLINE_LONGDASH));
+ maVSUnderline->InsertItem(7, maIMGDashLong, SVX_RESSTR(STR_DASH_LONG));
+ maVSUnderline->SetItemData(7, reinterpret_cast<void*>(UNDERLINE_LONGDASH));
- maVSUnderline.InsertItem(8, maIMGDashDot, SVX_RESSTR(STR_DASH_DOT));
- maVSUnderline.SetItemData(8, reinterpret_cast<void*>(UNDERLINE_DASHDOT));
+ maVSUnderline->InsertItem(8, maIMGDashDot, SVX_RESSTR(STR_DASH_DOT));
+ maVSUnderline->SetItemData(8, reinterpret_cast<void*>(UNDERLINE_DASHDOT));
- maVSUnderline.InsertItem(9, maIMGDashDotDot, SVX_RESSTR(STR_DASH_DOT_DOT));
- maVSUnderline.SetItemData(9, reinterpret_cast<void*>(UNDERLINE_DASHDOTDOT));
+ maVSUnderline->InsertItem(9, maIMGDashDotDot, SVX_RESSTR(STR_DASH_DOT_DOT));
+ maVSUnderline->SetItemData(9, reinterpret_cast<void*>(UNDERLINE_DASHDOTDOT));
- maVSUnderline.InsertItem(10, maIMGWave, SVX_RESSTR(STR_WAVE));
- maVSUnderline.SetItemData(10, reinterpret_cast<void*>(UNDERLINE_WAVE));
+ maVSUnderline->InsertItem(10, maIMGWave, SVX_RESSTR(STR_WAVE));
+ maVSUnderline->SetItemData(10, reinterpret_cast<void*>(UNDERLINE_WAVE));
- maVSUnderline.SetColCount( 1 );
+ maVSUnderline->SetColCount( 1 );
aLink = LINK( this, TextUnderlineControl, VSSelectHdl ) ;
- maVSUnderline.SetSelectHdl(aLink);
+ maVSUnderline->SetSelectHdl(aLink);
- maVSUnderline.StartSelection();
- maVSUnderline.Show();
+ maVSUnderline->StartSelection();
+ maVSUnderline->Show();
}
void TextUnderlineControl::Rearrange(FontUnderline eLine)
{
- maVSUnderline.SetItemImage(1, maIMGSingle);
- maVSUnderline.SetItemImage(2, maIMGDouble );
- maVSUnderline.SetItemImage(3, maIMGBold);
- maVSUnderline.SetItemImage(4, maIMGDot);
- maVSUnderline.SetItemImage(5, maIMGDotBold);
- maVSUnderline.SetItemImage(6, maIMGDash);
- maVSUnderline.SetItemImage(7, maIMGDashLong);
- maVSUnderline.SetItemImage(8, maIMGDashDot);
- maVSUnderline.SetItemImage(9, maIMGDashDotDot);
- maVSUnderline.SetItemImage(10, maIMGWave);
+ maVSUnderline->SetItemImage(1, maIMGSingle);
+ maVSUnderline->SetItemImage(2, maIMGDouble );
+ maVSUnderline->SetItemImage(3, maIMGBold);
+ maVSUnderline->SetItemImage(4, maIMGDot);
+ maVSUnderline->SetItemImage(5, maIMGDotBold);
+ maVSUnderline->SetItemImage(6, maIMGDash);
+ maVSUnderline->SetItemImage(7, maIMGDashLong);
+ maVSUnderline->SetItemImage(8, maIMGDashDot);
+ maVSUnderline->SetItemImage(9, maIMGDashDotDot);
+ maVSUnderline->SetItemImage(10, maIMGWave);
switch(eLine)
{
case UNDERLINE_SINGLE:
- maVSUnderline.SetItemImage(1, maIMGSingleSel);
- maVSUnderline.SelectItem(1);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(1, maIMGSingleSel);
+ maVSUnderline->SelectItem(1);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_DOUBLE:
- maVSUnderline.SetItemImage(2, maIMGDoubleSel);
- maVSUnderline.SelectItem(2);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(2, maIMGDoubleSel);
+ maVSUnderline->SelectItem(2);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_BOLD:
- maVSUnderline.SetItemImage(3, maIMGBoldSel);
- maVSUnderline.SelectItem(3);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(3, maIMGBoldSel);
+ maVSUnderline->SelectItem(3);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_DOTTED:
- maVSUnderline.SetItemImage(4, maIMGDotSel);
- maVSUnderline.SelectItem(4);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(4, maIMGDotSel);
+ maVSUnderline->SelectItem(4);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_BOLDDOTTED:
- maVSUnderline.SetItemImage(5, maIMGDotBoldSel);
- maVSUnderline.SelectItem(5);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(5, maIMGDotBoldSel);
+ maVSUnderline->SelectItem(5);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_DASH:
- maVSUnderline.SetItemImage(6, maIMGDashSel);
- maVSUnderline.SelectItem(6);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(6, maIMGDashSel);
+ maVSUnderline->SelectItem(6);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_LONGDASH:
- maVSUnderline.SetItemImage(7, maIMGDashLongSel);
- maVSUnderline.SelectItem(7);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(7, maIMGDashLongSel);
+ maVSUnderline->SelectItem(7);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_DASHDOT:
- maVSUnderline.SetItemImage(8, maIMGDashDotSel);
- maVSUnderline.SelectItem(8);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(8, maIMGDashDotSel);
+ maVSUnderline->SelectItem(8);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_DASHDOTDOT:
- maVSUnderline.SetItemImage(9, maIMGDashDotDotSel);
- maVSUnderline.SelectItem(9);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(9, maIMGDashDotDotSel);
+ maVSUnderline->SelectItem(9);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_WAVE:
- maVSUnderline.SetItemImage(10, maIMGWaveSel);
- maVSUnderline.SelectItem(10);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SetItemImage(10, maIMGWaveSel);
+ maVSUnderline->SelectItem(10);
+ maVSUnderline->GrabFocus();
break;
case UNDERLINE_NONE:
- maVSUnderline.SelectItem(0);
- maVSUnderline.GrabFocus();
+ maVSUnderline->SelectItem(0);
+ maVSUnderline->GrabFocus();
break;
default:
- maVSUnderline.SelectItem(1);
- maVSUnderline.SetNoSelection();
- maPBOptions.GrabFocus();
+ maVSUnderline->SelectItem(1);
+ maVSUnderline->SetNoSelection();
+ maPBOptions->GrabFocus();
}
- maVSUnderline.StartSelection();
+ maVSUnderline->StartSelection();
}
@@ -204,10 +216,10 @@ IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
{
if ( pControl == &maVSUnderline )
{
- const sal_uInt16 iPos = maVSUnderline.GetSelectItemId();
+ const sal_uInt16 iPos = maVSUnderline->GetSelectItemId();
const FontUnderline eUnderline = ( iPos == 0 )
? UNDERLINE_NONE
- : static_cast<FontUnderline>(reinterpret_cast<sal_uInt64>(maVSUnderline.GetItemData( iPos )));
+ : static_cast<FontUnderline>(reinterpret_cast<sal_uInt64>(maVSUnderline->GetItemData( iPos )));
SvxUnderlineItem aLineItem(eUnderline, SID_ATTR_CHAR_UNDERLINE);
@@ -220,7 +232,7 @@ IMPL_LINK(TextUnderlineControl, VSSelectHdl, void *, pControl)
IMPL_LINK(TextUnderlineControl, PBClickHdl, PushButton *, pPBtn)
{
- if(pPBtn == &maPBOptions)
+ if(pPBtn == maPBOptions.get())
{
if (mpBindings)
{
diff --git a/svx/source/sidebar/text/TextUnderlineControl.hxx b/svx/source/sidebar/text/TextUnderlineControl.hxx
index 5e32256c3364..441e15798eda 100644
--- a/svx/source/sidebar/text/TextUnderlineControl.hxx
+++ b/svx/source/sidebar/text/TextUnderlineControl.hxx
@@ -36,13 +36,15 @@ public:
vcl::Window* pParent,
svx::sidebar::TextPropertyPanel& rPanel,
SfxBindings* pBindings);
+ virtual ~TextUnderlineControl();
+ virtual void dispose() SAL_OVERRIDE;
void Rearrange(FontUnderline eLine);
private:
svx::sidebar::TextPropertyPanel& mrTextPropertyPanel;
SfxBindings* mpBindings;
- ValueSet maVSUnderline;
- PushButton maPBOptions;
+ VclPtr<ValueSet> maVSUnderline;
+ VclPtr<PushButton> maPBOptions;
Image maIMGSingle;
Image maIMGDouble;
diff --git a/svx/source/sidebar/tools/Popup.cxx b/svx/source/sidebar/tools/Popup.cxx
index 8647fb398b16..c1a04c3bc177 100644
--- a/svx/source/sidebar/tools/Popup.cxx
+++ b/svx/source/sidebar/tools/Popup.cxx
@@ -36,7 +36,7 @@ Popup::Popup (
msAccessibleName(rsAccessibleName),
mxContainer()
{
- OSL_ASSERT(mpParent!=NULL);
+ OSL_ASSERT(mpParent!=nullptr);
OSL_ASSERT(maControlCreator);
}
@@ -94,8 +94,8 @@ void Popup::SetPopupModeEndHandler (const ::boost::function<void()>& rCallback)
void Popup::ProvideContainerAndControl()
{
if ( ! (mxContainer && mxControl)
- && mpParent!=NULL
- && maControlCreator)
+ && mpParent != nullptr
+ && maControlCreator)
{
CreateContainerAndControl();
}
@@ -103,7 +103,7 @@ void Popup::ProvideContainerAndControl()
void Popup::CreateContainerAndControl()
{
- mxContainer.reset(new PopupContainer(mpParent));
+ mxContainer.reset(VclPtr<PopupContainer>::Create(mpParent));
mxContainer->SetAccessibleName(msAccessibleName);
mxContainer->SetPopupModeEndHdl(LINK(this, Popup, PopupModeEndHandler));
mxContainer->SetBorderStyle(mxContainer->GetBorderStyle() | WindowBorderStyle::MENU);
diff --git a/svx/source/sidebar/tools/PopupContainer.cxx b/svx/source/sidebar/tools/PopupContainer.cxx
index 675e80fbabf1..efb478dfa764 100644
--- a/svx/source/sidebar/tools/PopupContainer.cxx
+++ b/svx/source/sidebar/tools/PopupContainer.cxx
@@ -27,16 +27,11 @@ PopupContainer::PopupContainer (vcl::Window* pParent)
{
}
-
-
-
PopupContainer::~PopupContainer()
{
+ disposeOnce();
}
-
-
-
bool PopupContainer::Notify (NotifyEvent& rEvent)
{
if (rEvent.GetType() == MouseNotifyEvent::LOSEFOCUS)
diff --git a/svx/source/sidebar/tools/PopupControl.cxx b/svx/source/sidebar/tools/PopupControl.cxx
index 48a908b4938f..660798090a72 100644
--- a/svx/source/sidebar/tools/PopupControl.cxx
+++ b/svx/source/sidebar/tools/PopupControl.cxx
@@ -35,16 +35,6 @@ PopupControl::PopupControl (
SetBackground(Theme::GetWallpaper(Theme::Paint_DropDownBackground));
}
-
-
-
-PopupControl::~PopupControl()
-{
-}
-
-
-
-
void PopupControl::Paint (const Rectangle& rBox)
{
Control::Paint(rBox);
diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index 3927029ad371..d6d96b6f4dbc 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -41,12 +41,6 @@ ValueSetWithTextControl::ValueSetWithTextControl(
SetColCount( 1 );
}
-
-ValueSetWithTextControl::~ValueSetWithTextControl()
-{
-}
-
-
void ValueSetWithTextControl::AddItem(
const Image& rItemImage,
const Image* pSelectedItemImage,