diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-10-09 10:31:01 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-10-09 16:41:55 +0100 |
commit | 5fe7a4245d5c0a5c00c5f72f10781f624ad599fb (patch) | |
tree | 54096be20562a0d42acca44f6ef643b08edfbdd5 /vcl | |
parent | d19067683df48fd6a31dbe82da69f14f7680bf0b (diff) |
always assert on a missing widget for the typical case
Change-Id: Ia68bfa8a3d2a6091491d69a9141a7c47556097fe
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/vcl/builder.hxx | 3 | ||||
-rw-r--r-- | vcl/source/control/fixed.cxx | 1 |
2 files changed, 4 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); diff --git a/vcl/source/control/fixed.cxx b/vcl/source/control/fixed.cxx index 785f65c41db4..9409fe6698ac 100644 --- a/vcl/source/control/fixed.cxx +++ b/vcl/source/control/fixed.cxx @@ -476,6 +476,7 @@ bool FixedText::set_property(const rtl::OString &rKey, const rtl::OString &rValu } else return Control::set_property(rKey, rValue); + return true; } // ======================================================================= |