[Libreoffice-commits] core.git: 2 commits - vcl/inc vcl/source
Stephan Bergmann
sbergman at redhat.com
Mon Jun 30 05:58:21 PDT 2014
vcl/inc/window.h | 5 ++++-
vcl/source/window/window.cxx | 15 +++++++++++----
2 files changed, 15 insertions(+), 5 deletions(-)
New commits:
commit 0223eb2c6498a40a8d32575c9af189c570e490f6
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Jun 30 14:56:29 2014 +0200
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
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 7fb93e2..4770d1a 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 ) )
commit 5f50d9593d0754fc4c4c0655b14b27f5ad5635e4
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Jun 30 14:54:57 2014 +0200
Mark WindowImpl as noncopyable
Change-Id: I80f981216067a03578cfc812b006e6b68b77068e
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index d8c864b..ccecb3d 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -20,6 +20,9 @@
#ifndef INCLUDED_VCL_INC_WINDOW_H
#define INCLUDED_VCL_INC_WINDOW_H
+#include <sal/config.h>
+
+#include <boost/noncopyable.hpp>
#include <com/sun/star/uno/Reference.hxx>
#include <cppuhelper/weakref.hxx>
#include <list>
@@ -192,7 +195,7 @@ struct ImplAccessibleInfos
enum AlwaysInputMode { AlwaysInputNone = 0, AlwaysInputEnabled = 1, AlwaysInputDisabled =2 };
-class WindowImpl
+class WindowImpl: private boost::noncopyable
{
public:
WindowImpl( WindowType );
More information about the Libreoffice-commits
mailing list