Menu

#182 crash with empty text object (3.2.9a)

xfig
pending
nobody
None
2025-01-02
2025-01-01
No

Create any text object; open Edit dialog for it; erase everything in "text" field; press Apply or Done.

I think the correct behaviour should be to show an warning/error "can't set empty text" and either use the old text or to block the operation.

Discussion

  • Vladislav Zavjalov

    For me this happens as a side-effect of #178: I'm using 8-bit locale and I can occasionaly have a foreign utf8 symbol in a text object. In this case text objects are shown correctly, but Edit dialog truncates text starting from the "bad" symbol (and the text can become empty).

    I think it's good to fix the crash anyway, but not sure what is better to do with #178.
    Is it possible to show text and comments in dialogs in utf8 and avoid conversions? Is it reasonable to set utf8 locale in xfig internally? Or we can just say that it's an expected situation and I can always run xfig in utf8 locale if needed.

     
  • Vladislav Zavjalov

    I've checked that xfig can read empty text objects from a file (but then it's not possible to select end edit them). So another possible solution for this issue would be to allow setting empty text in the dialog.

     

    Last edit: Vladislav Zavjalov 2025-01-01
  • tkl

    tkl - 2025-01-01
    • status: open --> pending
     
  • tkl

    tkl - 2025-01-01

    With commit [6cbbec] editing a text object and truncating the string to be empty is now equivalent to deleting that text object. Immediate Undo, accordingly, restores the original text, before the edit operation was attempted. With respect to text being truncated due to characters not available in the current locale, see ticket [#178].

     

    Related

    Tickets: #178
    Commit: [6cbbec]

  • Vladislav Zavjalov

    I think, it's a reasonable solution. Probably, empty text read from file should be deleted as well (like it happens with 2-point polygons)

     
  • tkl

    tkl - 2025-01-02

    The above commit does ignore empty text on reading. Previously, the empty text objects were only ignored when saving a fig file.

     

Log in to post a comment.

MongoDB Logo MongoDB