vcl: a couple more places that shouldn't be stack-allocating Window objects
Change-Id: I773fb5ed066db2c22b3d50198dff350b755ab24a
diff --git a/include/vcl/layout.hxx b/include/vcl/layout.hxx
index 522b856..d11da2c 100644
--- a/include/vcl/layout.hxx
+++ b/include/vcl/layout.hxx
@@ -577,7 +577,7 @@ private:
bool m_bUserManagedScrolling;
VclPtr<ScrollBar> m_pVScroll;
VclPtr<ScrollBar> m_pHScroll;
ScrollBarBox m_aScrollBarBox;
VclPtr<ScrollBarBox> m_aScrollBarBox;
};
class VCL_DLLPUBLIC VclViewport : public VclBin
@@ -619,13 +619,13 @@ private:
}
};
EventBoxHelper m_aEventBoxHelper;
VclPtr<EventBoxHelper> m_aEventBoxHelper;
public:
VclEventBox(vcl::Window* pParent)
: VclBin(pParent)
, m_aEventBoxHelper(this)
, m_aEventBoxHelper(new EventBoxHelper(this))
{
m_aEventBoxHelper.Show();
m_aEventBoxHelper->Show();
}
virtual vcl::Window *get_child() SAL_OVERRIDE;
virtual const vcl::Window *get_child() const SAL_OVERRIDE;
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index ad2cb67..6a6c154 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -1612,7 +1612,7 @@ VclScrolledWindow::VclScrolledWindow(vcl::Window *pParent, WinBits nStyle)
, m_bUserManagedScrolling(false)
, m_pVScroll(new ScrollBar(this, WB_HIDE | WB_VERT))
, m_pHScroll(new ScrollBar(this, WB_HIDE | WB_HORZ))
, m_aScrollBarBox(this, WB_HIDE)
, m_aScrollBarBox(new ScrollBarBox(this, WB_HIDE))
{
SetType(WINDOW_SCROLLWINDOW);
@@ -1764,12 +1764,12 @@ void VclScrolledWindow::setAllocation(const Size &rAllocation)
if (m_pVScroll->IsVisible() && m_pHScroll->IsVisible())
{
Point aBoxPos(aInnerSize.Width(), aInnerSize.Height());
m_aScrollBarBox.SetPosSizePixel(aBoxPos, Size(nScrollBarWidth, nScrollBarHeight));
m_aScrollBarBox.Show();
m_aScrollBarBox->SetPosSizePixel(aBoxPos, Size(nScrollBarWidth, nScrollBarHeight));
m_aScrollBarBox->Show();
}
else
{
m_aScrollBarBox.Hide();
m_aScrollBarBox->Hide();
}
if (pChild && pChild->IsVisible())
@@ -1835,7 +1835,7 @@ const vcl::Window *VclEventBox::get_child() const
{
const WindowImpl* pWindowImpl = ImplGetWindowImpl();
assert(pWindowImpl->mpFirstChild == &m_aEventBoxHelper);
assert(pWindowImpl->mpFirstChild == m_aEventBoxHelper.get());
return pWindowImpl->mpFirstChild->GetWindow(WINDOW_NEXT);
}