summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-06-13 14:51:06 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:28 +0100
commit8246cf84085ce6fdbb3b77a16d8a37d5eb9710a7 (patch)
treed997a3e1d3ae9283f5e07f442f3e30fec03199e5 /vcl/source/window/window.cxx
parent4f5895169a40abff8fec77d92648653aa14cc596 (diff)
allow bare Windows to be replaceable too (GtkDrawingArea)
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r--vcl/source/window/window.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 2a2c574c5dca..bb1562cfe849 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4180,8 +4180,11 @@ Window::Window( Window* pParent, WinBits nStyle )
// -----------------------------------------------------------------------
Window::Window( Window* pParent, const ResId& rResId )
+ : mpWindowImpl(NULL)
{
DBG_CTOR( Window, ImplDbgCheckWindow );
+ if (VclBuilderContainer::replace_buildable(pParent, rResId.GetId(), *this))
+ return;
ImplInitWindowData( WINDOW_WINDOW );
rResId.SetRT( RSC_WINDOW );
@@ -9674,7 +9677,6 @@ uno::Any Window::getWidgetAnyProperty(const rtl::OString &rString) const
Size Window::get_preferred_size() const
{
Size aRet(mpWindowImpl->mnWidthRequest, mpWindowImpl->mnHeightRequest);
- fprintf(stderr, "numbers are %d %d\n", aRet.Width(), aRet.Height());
if (aRet.Width() == -1 || aRet.Height() == -1)
{
Size aOptimal = GetOptimalSize(WINDOWSIZE_PREFERRED);
@@ -9688,6 +9690,12 @@ Size Window::get_preferred_size() const
void Window::take_properties(Window &rOther)
{
+ if (!mpWindowImpl)
+ {
+ ImplInitWindowData(WINDOW_WINDOW);
+ ImplInit(rOther.GetParent(), rOther.GetStyle(), NULL);
+ }
+
WindowImpl *pWindowImpl = rOther.mpWindowImpl;
if (!mpWindowImpl->mpRealParent)
ImplInit(pWindowImpl->mpRealParent, rOther.GetStyle(), NULL);