From: Mikko Rasa Date: Fri, 2 Nov 2007 20:14:36 +0000 (+0000) Subject: Bugfixes X-Git-Tag: 1.0~12 X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=0812e7601e9ef6081d01b243ba0365aed652d773;p=libs%2Fdatafile.git Bugfixes --- diff --git a/source/collection.h b/source/collection.h index 24be69d..5fcaab3 100644 --- a/source/collection.h +++ b/source/collection.h @@ -110,7 +110,7 @@ private: ItemCreatorBridge *creator=dynamic_cast *>(this); if(creator) { - creator->create(coll, name, ptr); + ptr=creator->create(coll, name); return true; } return false; @@ -120,7 +120,7 @@ private: template struct ItemCreatorBridge: public ItemCreatorBase { - virtual bool create(Collection &, const std::string &, S *&) const =0; + virtual S *create(Collection &, const std::string &) const =0; }; template @@ -213,7 +213,7 @@ public: if(!item) throw TypeError("Item '"+name+"' is not of correct type"); - return *item->data; + return item->data; } /** @@ -236,7 +236,7 @@ public: { // We already know that the item didn't exist yet items[name]=new Item(d); - return *d; + return d; } } throw KeyError("Item '"+name+"' not found in collection"); @@ -246,7 +246,7 @@ public: if(!item) throw TypeError("Item '"+name+"' is not of correct type"); - return *item->data; + return item->data; } /** diff --git a/source/loader.h b/source/loader.h index acc84fe..951eeb0 100644 --- a/source/loader.h +++ b/source/loader.h @@ -196,7 +196,7 @@ public: { if(st.args.size()!=1) throw TypeError(st.get_location()+": Wrong number of arguments"); typename L::Loader &ldr=dynamic_cast(l); - ldr.get_object().*ptr0=&ldr.get_collection().template get(st.args[0].get()); + ldr.get_object().*ptr0=ldr.get_collection().template get(st.args[0].get()); } private: Pointer0Type ptr0;