summaryrefslogtreecommitdiff
path: root/vcl/source/window/window.cxx
diff options
context:
space:
mode:
authorIvo Hinkelmann <ihi@openoffice.org>2007-03-26 11:36:17 +0000
committerIvo Hinkelmann <ihi@openoffice.org>2007-03-26 11:36:17 +0000
commitfbd2ecdc7fe7faff152c4697edba795cbf5b3576 (patch)
treeae25f5cd4aa5a9858a18145f3996c2d150b1f9ac /vcl/source/window/window.cxx
parent9e4331e56bc4b29193a5f4c92e4e508721e8e4dd (diff)
INTEGRATION: CWS vcl76 (1.253.4); FILE MERGED
2007/03/20 17:36:23 pl 1.253.4.1: #i75563# do the sensible thing on reparent to self
Diffstat (limited to 'vcl/source/window/window.cxx')
-rw-r--r--vcl/source/window/window.cxx14
1 files changed, 9 insertions, 5 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index be3d687d0673..c7bbaa25d5a4 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: window.cxx,v $
*
- * $Revision: 1.253 $
+ * $Revision: 1.254 $
*
- * last change: $Author: obo $ $Date: 2007-03-05 15:25:22 $
+ * last change: $Author: ihi $ $Date: 2007-03-26 12:36:17 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -6144,6 +6144,10 @@ void Window::SetParent( Window* pNewParent )
{
DBG_CHKTHIS( Window, ImplDbgCheckWindow );
DBG_ASSERT( pNewParent, "Window::SetParent(): pParent == NULL" );
+ DBG_ASSERT( pNewParent != this, "someone tried to reparent a window to itself" );
+
+ if( pNewParent == this )
+ return;
// check if the taskpanelist would change and move the window pointer accordingly
SystemWindow *pSysWin = ImplGetLastSystemWindow(this);
@@ -6161,9 +6165,6 @@ void Window::SetParent( Window* pNewParent )
ImplSetFrameParent( pNewParent );
- if ( mpWindowImpl->mbFrame )
- mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
-
if ( mpWindowImpl->mpBorderWindow )
{
mpWindowImpl->mpRealParent = pNewParent;
@@ -6174,6 +6175,9 @@ void Window::SetParent( Window* pNewParent )
if ( mpWindowImpl->mpParent == pNewParent )
return;
+ if ( mpWindowImpl->mbFrame )
+ mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame );
+
BOOL bVisible = IsVisible();
Show( FALSE, SHOW_NOFOCUSCHANGE );