Skip to content
  • Dmitry Kazakov's avatar
    Implement KoShape::cloneShape() · 7699443c
    Dmitry Kazakov authored
    This is a mandatory function to be able to load shapes from SVG,
    because the same shape may be instantiated from different places.
    We still need to discuss whether we need to really "share" the
    shape template, but for now I just deep-copy them (which is the
    easiest because of shape normalization problem we have).
    
    There are the following drawbacks/hacks in this patch:
    
    1) Not all the shapes have KoShape::cloneShape() implemented! Basically,
       it is defined only for group shape and all the descendants of a path
       shape (which are the only shapes used in SVG). Other shapes use the
       default implementation which simply returns null.
    
       Ideally, there should be no default implementation and all the shapes
       should define it. But, given that we are going to deprecate quite a lot
       of stuff, I'll keep them just unimplemented for now.
    
    2) The following shape properties are not yet copied during cloning:
    
       * toolDelegates
       * dependees
       * shadow
       * border
       * filterEf...
    7699443c