insertions must not be deleted anymore!

This commit is contained in:
Kevin Jahns
2015-04-23 17:40:40 +02:00
parent 6fc33e40bb
commit 0a89150fab
12 changed files with 55917 additions and 212 deletions

View File

@@ -366,7 +366,7 @@ module.exports = ()->
# An insert operation is always positioned between two other insert operations.
# Internally this is realized as associative lists, whereby each insert operation has a predecessor and a successor.
# For the sake of efficiency we maintain two lists:
# - The short-list (abbrev. sl) maintains only the operations that are not deleted
# - The short-list (abbrev. sl) maintains only the operations that are not deleted (unimplemented, good idea?)
# - The complete-list (abbrev. cl) maintains all operations
#
class ops.Insert extends ops.Operation
@@ -425,7 +425,7 @@ module.exports = ()->
super garbagecollect
if callLater
@parent.callOperationSpecificDeleteEvents(this, o)
if @prev_cl?.isDeleted()
if @prev_cl? and @prev_cl.isDeleted()
# garbage collect prev_cl
@prev_cl.applyDelete()
@@ -451,7 +451,8 @@ module.exports = ()->
# (e.g. the following operation order must be invertible :
# Insert refers to content, then the content is deleted)
# Therefore, we have to do this in the cleanup
if @content instanceof ops.Operation
# * NODE: We never delete Insertions!
if @content instanceof ops.Operation and not (@content instanceof ops.Insert)
@content.referenced_by--
if @content.referenced_by <= 0 and not @content.is_deleted
@content.applyDelete()

View File

@@ -320,7 +320,7 @@ module.exports = ()->
constructor: (custom_type, @_composition_value, composition_value_operations, uid, tmp_composition_ref)->
# we can't use @seveOperation 'composition_ref', tmp_composition_ref here,
# because then there is a "loop" (insertion refers to parant, refers to insertion..)
# because then there is a "loop" (insertion refers to parent, refers to insertion..)
# This is why we have to check in @callOperationSpecificInsertEvents until we find it
super custom_type, uid
if tmp_composition_ref?