diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-10 00:06:09 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-10 09:29:00 +0100 |
commit | c14bd74f268d4883a73f46a7ceac2d2e98ac96a3 (patch) | |
tree | 8c7135fc82b31cf5f9622de1ad8c3456e8e5f64c /vcl | |
parent | 0ea421781b16b449045e66c38007374ab2f2c509 (diff) |
don't do things differently on higher debug levels
Change-Id: Ib1fd8c4a5ab4db8d5889ea489b74569639994714
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/builder.hxx | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx index aae959a3fe31..83b1139b9eee 100644 --- a/vcl/inc/vcl/builder.hxx +++ b/vcl/inc/vcl/builder.hxx @@ -144,36 +144,17 @@ public: template <typename T> T* get(T*& ret, OString sID) { Window *w = get_by_name(sID); - assert(w); + assert(w && dynamic_cast<T*>(w)); ret = static_cast<T*>(w); - -#if OSL_DEBUG_LEVEL > 0 - if (w) - { - ret = dynamic_cast<T*>(w); - assert(ret); - } -#endif - return ret; } //sID may not exist, but must be of type T if it does template <typename T /*=Window if we had c++11*/> T* get(OString sID) { Window *w = get_by_name(sID); - T* ret = static_cast<T*>(w); - -#if OSL_DEBUG_LEVEL > 0 - if (w) - { - ret = dynamic_cast<T*>(w); - assert(ret); - } -#endif - - return ret; + assert(!w || dynamic_cast<T*>(w)); + return static_cast<T*>(w); } - OString get_by_window(const Window *pWindow) const; //for the purposes of retrofitting this to the existing code //look up sID, clone its properties into replacement and |