ui/motif/stock.c

changeset 30
34513f76d5a8
parent 22
bcf880b29bc3
child 34
0ec8a5f17782
--- a/ui/motif/stock.c	Thu Apr 10 11:37:41 2014 +0200
+++ b/ui/motif/stock.c	Fri Apr 11 17:02:19 2014 +0200
@@ -30,6 +30,7 @@
 #include <stdlib.h>
 
 #include "stock.h"
+#include "../ui/properties.h"
 #include "../../ucx/map.h"
 
 static UcxMap *stock_items;
@@ -63,5 +64,12 @@
 }
 
 UiStockItem* ui_get_stock_item(char *id) {
-    return ucx_map_cstr_get(stock_items, id);
+    UiStockItem *item = ucx_map_cstr_get(stock_items, id);
+    if(item) {
+        char *label = uistr_n(id);
+        if(label) {
+            item->label = label;
+        }
+    }
+    return item;
 }

mercurial