- added GCC warning -Wstrict-prototypes
[blender.git] / source / blender / editors / object / object_select.c
index b131a358ae75e429146c5853331a29e2077575c8..deda2ce0129472d8c58dcc965b826b3518ea4f52 100644 (file)
@@ -51,6 +51,7 @@
 #include "BKE_property.h"
 #include "BKE_report.h"
 #include "BKE_scene.h"
+#include "BKE_library.h"
 #include "BKE_deform.h"
 
 #include "WM_api.h"
@@ -826,21 +827,26 @@ void OBJECT_OT_select_same_group(wmOperatorType *ot)
 /**************************** Select Mirror ****************************/
 static int object_select_mirror_exec(bContext *C, wmOperator *op)
 {
+       Scene *scene= CTX_data_scene(C);
        short extend;
        
        extend= RNA_boolean_get(op->ptr, "extend");
        
        CTX_DATA_BEGIN(C, Base*, primbase, selected_bases) {
-
                char tmpname[32];
+
                flip_side_name(tmpname, primbase->object->id.name+2, TRUE);
+               
+               if(strcmp(tmpname, primbase->object->id.name+2)!=0) { /* names differ */
+                       Object *ob= (Object *)find_id("OB", tmpname);
+                       if(ob) {
+                               Base *secbase= object_in_scene(ob, scene);
 
-               CTX_DATA_BEGIN(C, Base*, secbase, visible_bases) {
-                       if(!strcmp(secbase->object->id.name+2, tmpname)) {
-                               ED_base_object_select(secbase, BA_SELECT);
+                               if(secbase) {
+                                       ED_base_object_select(secbase, BA_SELECT);
+                               }
                        }
                }
-               CTX_DATA_END;
                
                if (extend == 0) ED_base_object_select(primbase, BA_DESELECT);