Skip to content
  • Duncan McIntosh's avatar
    objects: add a flag for 'variants' to fix intdata problem · 0fd7bd3a
    Duncan McIntosh authored and Zander Brown's avatar Zander Brown committed
    In a sheet, objects can have an intdata attribute, which is usually used
    in I*/GRAFCET/UML to pick a different variation of the object. It does
    this by setting user_data, but some objects --- like AADL's --- use
    this property for a vtable. It's possible to get Dia to crash with a
    sheet something like the following:
    
        <?xml version="1.0" encoding="UTF-8" standalone="no"?>
        <sheet xmlns="http://www.lysator.liu.se/~alla/dia/dia-sheet-ns">
          <name>Proof of Concept</name>
          <description>Tada!</description>
          <contents>
            <object name="AADL - Process" intdata="2">
              <description>Dereference 0x2</description>
            </object>
          </contents>
        </sheet>
    
    To fix this, only set user_data if the object type has
    DIA_OBJECT_HAS_VARIANTS set; only objects that actually want it will
    have it set.
    
    "Misc - Measure" never used it anyways, so just remove it from the
    sheet.
    0fd7bd3a