summaryrefslogtreecommitdiff
path: root/navit/map.c
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-05-31 18:50:32 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-05-31 18:50:32 +0000
commit8411100161a364e1c39beb3bd7256b246d1974f5 (patch)
tree1a5e5ebf866033ea85a0f1cd818d433102c4bc81 /navit/map.c
parent92007982bd2c0e22e9f7d565eeaea607d57e2c2f (diff)
downloadnavit-8411100161a364e1c39beb3bd7256b246d1974f5.tar.gz
Fix:data_binfile:Fixed a few search bugs
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1092 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/map.c')
-rw-r--r--navit/map.c31
1 files changed, 31 insertions, 0 deletions
diff --git a/navit/map.c b/navit/map.c
index a5198df3a..5c5813268 100644
--- a/navit/map.c
+++ b/navit/map.c
@@ -184,6 +184,10 @@ map_search_new(struct map *m, struct item *item, struct attr *search_attr, int p
if (m->meth.charset)
this_->search_attr.u.str=g_convert(this_->search_attr.u.str, -1,m->meth.charset,"utf-8",NULL,NULL,NULL);
this_->priv=m->meth.map_search_new(m->priv, item, &this_->search_attr, partial);
+ if (! this_->priv) {
+ g_free(this_);
+ this_=NULL;
+ }
} else {
g_free(this_);
this_=NULL;
@@ -248,3 +252,30 @@ map_selection_destroy(struct map_selection *sel)
sel = next;
}
}
+
+int
+map_selection_contains_item_rect(struct map_selection *sel, struct item *item)
+{
+ struct coord c;
+ struct coord_rect r;
+ int count=0;
+ while (item_coord_get(item, &c, 1)) {
+ if (! count) {
+ r.lu=c;
+ r.rl=c;
+ } else
+ coord_rect_extend(&r, &c);
+ count++;
+ }
+ if (! count)
+ return 0;
+ return map_selection_contains_rect(sel, &r);
+
+}
+
+
+int
+map_priv_is(struct map *map, struct map_priv *priv)
+{
+ return (map->priv == priv);
+}