summaryrefslogtreecommitdiff
path: root/vcl/inc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2012-10-09 10:31:01 +0100
committerCaolán McNamara <caolanm@redhat.com>2012-10-09 16:41:55 +0100
commit5fe7a4245d5c0a5c00c5f72f10781f624ad599fb (patch)
tree54096be20562a0d42acca44f6ef643b08edfbdd5 /vcl/inc
parentd19067683df48fd6a31dbe82da69f14f7680bf0b (diff)
always assert on a missing widget for the typical case
Change-Id: Ia68bfa8a3d2a6091491d69a9141a7c47556097fe
Diffstat (limited to 'vcl/inc')
-rw-r--r--vcl/inc/vcl/builder.hxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/vcl/inc/vcl/builder.hxx b/vcl/inc/vcl/builder.hxx
index 0a6574c8af03..aae959a3fe31 100644
--- a/vcl/inc/vcl/builder.hxx
+++ b/vcl/inc/vcl/builder.hxx
@@ -140,9 +140,11 @@ public:
VclBuilder(Window *pParent, OUString sUIRootDir, OUString sUIFile, OString sID = OString());
~VclBuilder();
Window *get_widget_root();
+ //sID must exist and be of type T
template <typename T> T* get(T*& ret, OString sID)
{
Window *w = get_by_name(sID);
+ assert(w);
ret = static_cast<T*>(w);
#if OSL_DEBUG_LEVEL > 0
@@ -155,6 +157,7 @@ public:
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);