X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;ds=inline;f=source%2Flogic.cpp;h=db382fe6074f14aebea7293d61808f1ff0e5c100;hb=9fdbf99cdb3c5620e665c3ecb34e83d778cb311a;hp=16444892a591b752aa7eff5e95b0f1bf67bfc07e;hpb=525351c67a74fc3434fd1fb993bb9fa78b681f1f;p=libs%2Fgltk.git diff --git a/source/logic.cpp b/source/logic.cpp index 1644489..db382fe 100644 --- a/source/logic.cpp +++ b/source/logic.cpp @@ -1,10 +1,4 @@ -/* $Id$ - -This file is part of libmspgltk -Copyright © 2007 Mikko Rasa, Mikkosoft Productions -Distributed under the LGPL -*/ - +#include #include "logic.h" using namespace std; @@ -21,16 +15,13 @@ Logic::Loader::Loader(Logic &l, const map &w): void Logic::Loader::bind(const string &wdg, const string &data) { - map::const_iterator i=widgets.find(wdg); - if(i==widgets.end()) - throw KeyError("Unknown widget", wdg); - - string::size_type colon=data.find(':'); WidgetBinding act; - act.wdg=i->second; - act.type=data.substr(0, colon); + act.wdg = get_item(widgets, wdg); + + string::size_type colon = data.find(':'); + act.type = data.substr(0, colon); if(colon!=string::npos) - act.data=data.substr(colon+1); + act.data = data.substr(colon+1); logic.bindings.push_back(act); }