diff --git a/Fireworks/Core/src/FWItemAccessorFactory.cc b/Fireworks/Core/src/FWItemAccessorFactory.cc index f9731f7e9d553..f35dc64e4d816 100644 --- a/Fireworks/Core/src/FWItemAccessorFactory.cc +++ b/Fireworks/Core/src/FWItemAccessorFactory.cc @@ -76,15 +76,15 @@ FWItemAccessorFactory::~FWItemAccessorFactory() we return the a FWItemTVirtualCollectionProxyAccessor constructed using the associated TVirtualCollectionProxy. + If above is not true, we lookup the plugin based + FWItemAccessorRegistry for a plugin that can handle the + given type. + If the type is not a collection but it contains only one element which is a collection, we return a FWItemTVirtualCollectionProxyAccessor using the TVirtualCollectionProxy of that element. - If none of the above is true, we lookup the plugin based - FWItemAccessorRegistry for a plugin that can handle the - given type. - Failing that, we return a FWItemSingleAccessor which threats the object as if it was not a collection. Notice that this also will mean that the product associated to @a iClass will not show up in the @@ -107,19 +107,6 @@ FWItemAccessorFactory::accessorFor(const TClass* iClass) const new FWItemTVirtualCollectionProxyAccessor(iClass, boost::shared_ptr(iClass->GetCollectionProxy()->Generate()))); } - else if (hasMemberTVirtualCollectionProxy(iClass, member,offset)) - { - if (debug) - fwLog(fwlog::kDebug) << "class "<< iClass->GetName() - << " only contains data member " << member->GetName() - << " which uses FWItemTVirtualCollectionProxyAccessor." - << std::endl; - - return boost::shared_ptr( - new FWItemTVirtualCollectionProxyAccessor(iClass, - boost::shared_ptr(member->GetCollectionProxy()->Generate()), - offset)); - } // Iterate on the available plugins and use the one which handles // the iClass type. @@ -137,6 +124,20 @@ FWItemAccessorFactory::accessorFor(const TClass* iClass) const return boost::shared_ptr(FWItemAccessorRegistry::get()->create(accessorName, iClass)); } + if (hasMemberTVirtualCollectionProxy(iClass, member,offset)) + { + if (debug) + fwLog(fwlog::kDebug) << "class "<< iClass->GetName() + << " only contains data member " << member->GetName() + << " which uses FWItemTVirtualCollectionProxyAccessor." + << std::endl; + + return boost::shared_ptr( + new FWItemTVirtualCollectionProxyAccessor(iClass, + boost::shared_ptr(member->GetCollectionProxy()->Generate()), + offset)); + } + return boost::shared_ptr(new FWItemSingleAccessor(iClass)); }