summaryrefslogtreecommitdiff
path: root/vcl/source/window/dialog.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-09-26 16:14:28 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-09-28 08:48:54 +0100
commit03e4a93815b3ab60d767c9b8cdc3b816cde24706 (patch)
tree72c9a917459c55dd2f0eeb984cdb7494bbebcafa /vcl/source/window/dialog.cxx
parent2f6e8daf883fe67a1cebc2cdf9d54e41b064a55c (diff)
defer initializing dialog until sizeable/unsizeable is known
we have to defer initializing the dialog until we have determined the sizeable/unsizable info as we can't change it after the fact Change-Id: I27c90f8f92953d919b36cddc6a99fae9d7db47eb
Diffstat (limited to 'vcl/source/window/dialog.cxx')
-rw-r--r--vcl/source/window/dialog.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index a47f338f1002..807f9d6e9964 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -504,19 +504,31 @@ rtl::OUString VclBuilderContainer::getUIRootDir()
return sShareLayer;
}
+//we can't change sizeable after the fact, so need to defer until we know and then
+//do the init. Find the real parent stashed in mpDialogParent.
+void Dialog::doDeferredInit(bool bResizable)
+{
+ WinBits nBits = WB_3DLOOK|WB_CLOSEABLE|WB_MOVEABLE;
+ if (bResizable)
+ nBits |= WB_SIZEABLE;
+ Window *pParent = mpDialogParent;
+ mpDialogParent = NULL;
+ ImplInit(pParent, nBits);
+}
+
Dialog::Dialog(Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription)
: SystemWindow( WINDOW_DIALOG )
+ , mpDialogParent(pParent) //will be unset in doDeferredInit
{
ImplInitDialogData();
- ImplInit(pParent, WB_SIZEMOVE|WB_3DLOOK|WB_CLOSEABLE);
m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID);
}
Dialog::Dialog(Window* pParent, const rtl::OString& rID, const rtl::OUString& rUIXMLDescription, WindowType nType)
: SystemWindow( nType )
+ , mpDialogParent(pParent) //will be unset in doDeferredInit
{
ImplInitDialogData();
- ImplInit(pParent, WB_SIZEMOVE|WB_3DLOOK|WB_CLOSEABLE);
m_pUIBuilder = new VclBuilder(this, getUIRootDir(), rUIXMLDescription, rID);
}