From 6e1fba8a7262325eb7adf8f90c0f53359ae3e555 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Tue, 27 Nov 2012 15:42:12 +0000 Subject: [PATCH] try and make error message a little more useful Change-Id: I20070965dbf2632461fc74cc8a9795c7ddded269 --- vcl/inc/vcl/builder.hxx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx index cbda844bee2b..82bd805a2661 100644 --- a/vcl/inc/vcl/builder.hxx +++ b/vcl/inc/vcl/builder.hxx @@ -10,6 +10,7 @@ #ifndef _VCLBUILDER_HXX #define _VCLBUILDER_HXX +#include #include #include #include @@ -150,6 +151,9 @@ public: template T* get(T*& ret, OString sID) { Window *w = get_by_name(sID); + SAL_WARN_IF(!w, "vcl.layout", "widget " << sID.getStr() << " not found in .ui"); + SAL_WARN_IF(!dynamic_cast(w), + "vcl.layout", "widget " << sID.getStr() << " needs to have type " << typeid(T).name()); assert(w && dynamic_cast(w)); ret = static_cast(w); return ret; @@ -158,6 +162,8 @@ public: template T* get(OString sID) { Window *w = get_by_name(sID); + SAL_WARN_IF(w && !dynamic_cast(w), + "vcl.layout", "widget " << sID.getStr() << " needs to have type " << typeid(T).name()); assert(!w || dynamic_cast(w)); return static_cast(w); }