summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-06-30 14:56:29 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-06-30 14:57:57 +0200
commit0223eb2c6498a40a8d32575c9af189c570e490f6 (patch)
tree8d80b2691f997fabad421d8de4508486c32e7be0 /vcl
parent5f50d9593d0754fc4c4c0655b14b27f5ad5635e4 (diff)
Once ~SystemWindow calls ~Window, this is no longer a SystemWindow
...and hopefully it is just as fine to start this safety check at the paren, anyway. Change-Id: Ie3d7a1e233b9e3076a6603f2c6312d57b42b0f77
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/window.cxx15
1 files changed, 11 insertions, 4 deletions
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 7fb93e28dd12..4770d1a47f26 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -65,6 +65,7 @@
#include <com/sun/star/rendering/XSpriteCanvas.hpp>
#include <comphelper/processfactory.hxx>
+#include <cassert>
#include <set>
#include <typeinfo>
@@ -327,13 +328,16 @@ Window::~Window()
Application::Abort(OStringToOUString(aTempStr.makeStringAndClear(), RTL_TEXTENCODING_UTF8)); // abort in debug builds, this must be fixed!
}
- Window* pMyParent = this;
+ Window* pMyParent = GetParent();
SystemWindow* pMySysWin = NULL;
while ( pMyParent )
{
if ( pMyParent->IsSystemWindow() )
- pMySysWin = (SystemWindow*)pMyParent;
+ {
+ pMySysWin = dynamic_cast<SystemWindow *>(pMyParent);
+ assert(pMyParent != 0);
+ }
pMyParent = pMyParent->GetParent();
}
if ( pMySysWin && pMySysWin->ImplIsInTaskPaneList( this ) )
@@ -349,13 +353,16 @@ Window::~Window()
if( mpWindowImpl->mbIsInTaskPaneList )
{
- Window* pMyParent = this;
+ Window* pMyParent = GetParent();
SystemWindow* pMySysWin = NULL;
while ( pMyParent )
{
if ( pMyParent->IsSystemWindow() )
- pMySysWin = (SystemWindow*)pMyParent;
+ {
+ pMySysWin = dynamic_cast<SystemWindow *>(pMyParent);
+ assert(pMyParent != 0);
+ }
pMyParent = pMyParent->GetParent();
}
if ( pMySysWin && pMySysWin->ImplIsInTaskPaneList( this ) )