On Sat, 2019-05-04 at 09:47 +0430, Vahid Bashiri via dia-list wrote:
> Hi all
> I made a skim of file "diagram.c" and in the
> function diagram_selected_break_external there are little things that
> might lead to erroneous behavior in case that multiple objects
> connected to single connection point. I am not sure about it being a
> bug so I am posting here in case someone take a closer look.
> - line 708 "break; /* Not connected */" 
> after finding first unconnected object it doesn't go on with other
> objects connected to that CP.
> I think a "continue" might solve the problem.
> -line 750 "list = g_list_next(list);"
> need to run only if the previous "if" statement doesn't run because
> we modify the list with 
> g_list_previous inside that "if" statement and the g_list_next
> will result in skipping some objects on the list. It looks like an
> "else" might solve the problem.

I'm not completely sure what your saying here and GitLab would be a
better venue, but here goes
You seem to be concerned we are breaking out of a loop to soon, but  I
don't thing we do:

     [...]
698  list = dia->data->selected;
699  while (list != NULL) {                    <- I think this is the
loop you think we are breaking out of, which would be bad
700    obj = (DiaObject *)list->data;
701    
702    /* Break connections between this object and objects not
selected: */
703    for (i=0;i<obj->num_handles;i++) {      <- But we are actually
breaking out of this loop
704      ConnectionPoint *con_point;
705      con_point = obj->handles[i]->connected_to;
706      
707      if ( con_point == NULL )
708        break; /* Not connected */          <- Break works on both
for and while loops
709      
710      other_obj = con_point->object;        <- If we didn't break
this would SEGFAULT
         [...]
717    }
       [...]
750    list = g_list_next(list);
751  }
     [...]
    
It's quite likely I've completely misunderstood your message though
> _______________________________________________dia-list mailing 
> listdia-l...@gnome.org
> https://nam02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fmail.gnome.org%2Fmailman%2Flistinfo%2Fdia-list&amp;data=02%7C01%7C%7Cc18b3cf0a95d4a0324e008d6d04fd8d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636925438687171491&amp;sdata=Wwz5N0ki9NLThFUimnusrRzF%2BV7bDYDda3STp4aXQcM%3D&amp;reserved=0
> FAQ at 
> https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flive.gnome.org%2FDia%2FFaq&amp;data=02%7C01%7C%7Cc18b3cf0a95d4a0324e008d6d04fd8d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636925438687171491&amp;sdata=ixAVJCHCXMcT3SJiFZNepwF%2FT8KajrWAY%2BR3Umser0E%3D&amp;reserved=0
> Main page at 
> https://nam02.safelinks.protection.outlook.com/?url=http%3A%2F%2Flive.gnome.org%2FDia&amp;data=02%7C01%7C%7Cc18b3cf0a95d4a0324e008d6d04fd8d3%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C636925438687171491&amp;sdata=ZLBS6ZuZ%2BeQwt6uREvRznJKeiBFInJDZZjC1qLtAXME%3D&amp;reserved=0
> 
-- 
Zander Brown <zbr...@gnome.org>
GNOME Design Tooling (Icon Preview)
Dia Diagram Editor

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
dia-list mailing list
dia-list@gnome.org
https://mail.gnome.org/mailman/listinfo/dia-list
FAQ at http://live.gnome.org/Dia/Faq
Main page at http://live.gnome.org/Dia

Reply via email to