summaryrefslogtreecommitdiff
path: root/sfx2/source/sidebar/TitleBar.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-01-13 14:50:19 +0200
committerMichael Meeks <michael.meeks@collabora.com>2015-04-09 20:58:55 +0100
commitfbe6619a34b617a04a5135e40c70a172a44eefef (patch)
tree4cc507a0e9c6d9e6317b814f3a9a0e63e6301226 /sfx2/source/sidebar/TitleBar.cxx
parentce8cfbd3b90f11c3f2edc88a0dab625aabb6293d (diff)
vcl: VclPtr conversion in sfx2
Change-Id: I78ea3f4304ace27c6db0e3d0651bd65043dcbc68
Diffstat (limited to 'sfx2/source/sidebar/TitleBar.cxx')
-rw-r--r--sfx2/source/sidebar/TitleBar.cxx23
1 files changed, 15 insertions, 8 deletions
diff --git a/sfx2/source/sidebar/TitleBar.cxx b/sfx2/source/sidebar/TitleBar.cxx
index fa9b8c23a1d7..0e0e49567d3b 100644
--- a/sfx2/source/sidebar/TitleBar.cxx
+++ b/sfx2/source/sidebar/TitleBar.cxx
@@ -41,17 +41,24 @@ TitleBar::TitleBar (
vcl::Window* pParentWindow,
const sidebar::Paint& rInitialBackgroundPaint)
: Window(pParentWindow),
- maToolBox(this),
+ maToolBox(new SidebarToolBox(this)),
msTitle(rsTitle),
maIcon()
{
SetBackground(rInitialBackgroundPaint.GetWallpaper());
- maToolBox.SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
+ maToolBox->SetSelectHdl(LINK(this, TitleBar, SelectionHandler));
}
-TitleBar::~TitleBar (void)
+TitleBar::~TitleBar()
{
+ dispose();
+}
+
+void TitleBar::dispose()
+{
+ maToolBox.disposeAndClear();
+ vcl::Window::dispose();
}
void TitleBar::SetTitle (const ::rtl::OUString& rsTitle)
@@ -102,9 +109,9 @@ void TitleBar::setPosSizePixel (
Window::setPosSizePixel(nX,nY,nWidth,nHeight,nFlags);
// Place the toolbox.
- const sal_Int32 nToolBoxWidth (maToolBox.GetItemPosRect(0).GetWidth());
- maToolBox.setPosSizePixel(nWidth-nToolBoxWidth,0, nToolBoxWidth,nHeight, WINDOW_POSSIZE_POSSIZE);
- maToolBox.Show();
+ const sal_Int32 nToolBoxWidth (maToolBox->GetItemPosRect(0).GetWidth());
+ maToolBox->setPosSizePixel(nWidth-nToolBoxWidth,0, nToolBoxWidth,nHeight, WINDOW_POSSIZE_POSSIZE);
+ maToolBox->Show();
}
void TitleBar::HandleToolBoxItemClick (const sal_uInt16 nItemIndex)
@@ -181,8 +188,8 @@ void TitleBar::PaintFocus (const Rectangle& rFocusBox)
IMPL_LINK(TitleBar, SelectionHandler, ToolBox*, pToolBox)
{
(void)pToolBox;
- OSL_ASSERT(&maToolBox==pToolBox);
- const sal_uInt16 nItemId (maToolBox.GetHighlightItemId());
+ OSL_ASSERT(maToolBox.get()==pToolBox);
+ const sal_uInt16 nItemId (maToolBox->GetHighlightItemId());
HandleToolBoxItemClick(nItemId);