Fix bug in SearchResultPanel when search result is the name of a project POU
authorLaurent Bessard
Wed, 29 Aug 2012 23:02:04 +0200
changeset 753 8a70e85f7e12
parent 752 6b63246474ff
child 754 48966b6ceedc
Fix bug in SearchResultPanel when search result is the name of a project POU
SearchResultPanel.py
--- a/SearchResultPanel.py	Mon Aug 27 23:09:48 2012 +0200
+++ b/SearchResultPanel.py	Wed Aug 29 23:02:04 2012 +0200
@@ -195,7 +195,7 @@
                 
                 children = element_infos.setdefault("children", [])
                 for infos, start, end, text in results:
-                    if element_type == ITEM_DATATYPE:
+                    if infos[1] == "name" or element_type == ITEM_DATATYPE:
                         child_name = GenerateName(infos[1:])
                         child_type = element_type
                     else:
@@ -203,7 +203,9 @@
                             child_type = element_type
                         else:
                             child_type = infos[1]
-                        if child_type == "body":
+                        if child_type == "name":
+                            child_name = "name"
+                        elif child_type == "body":
                             child_name = "body"
                             if element_type == ITEM_TRANSITION:
                                 child_type = self.ParentWindow.Controler.GetTransitionBodyType(words[1], words[2])