fdo#85282: Correct adjustment of range reference on delete & shift.

Change-Id: I6e01c160f77599dfa4a2e55b60e23d256184c822
fdo#85282: Write test for this.

Change-Id: I2a0567c2872b503ceb3740127b6b58b1d1789690