map_set_attr(struct map *this_, struct attr *attr)
{
this_->attrs=attr_generic_set_attr(this_->attrs, attr);
+ if (this_->meth.map_set_attr)
+ this_->meth.map_set_attr(this_->priv, attr);
callback_list_call_attr_2(this_->attr_cbl, attr->type, this_, attr);
return 1;
}
* have a look into country.c for details. Because of that every map plugin has to accept a country item
* to be passed as "superior item".
*
- * Note: If you change something here, please make shure to also update the documentation of mapset_search_new()
+ * Note: If you change something here, please make sure to also update the documentation of mapset_search_new()
* in mapset.c!
*
* @param m The map that should be searched
this_=g_new0(struct map_search,1);
this_->m=m;
this_->search_attr=*search_attr;
- if (search_attr->type >= attr_country_all && search_attr->type <= attr_country_name)
+ if ((search_attr->type >= attr_country_all && search_attr->type <= attr_country_name) || search_attr->type == attr_country_id)
this_->priv=country_search_new(&this_->search_attr, partial);
else {
if (m->meth.map_search_new) {
if (! this_)
return NULL;
- if (this_->search_attr.type >= attr_country_all && this_->search_attr.type <= attr_country_name)
+ if ((this_->search_attr.type >= attr_country_all && this_->search_attr.type <= attr_country_name) || this_->search_attr.type == attr_country_id)
return country_search_get_item(this_->priv);
ret=this_->m->meth.map_search_get_item(this_->priv);
if (ret)
{
FILE *f;
f=fopen(file,"w");
- map_dump_filedesc(map, f);
- fclose(f);
+ if (f) {
+ map_dump_filedesc(map, f);
+ fclose(f);
+ } else
+ dbg(0,"failed to open file '%s'\n",file);
}
void