tdf#147166 EditTextObjectImpl copy ctor doesn't exactly copy EditTextObjectImpl
commit6842e0f786c7f3fc859bd7337427d7a4b37befed
authorCaolán McNamara <caolanm@redhat.com>
Sat, 19 Feb 2022 20:43:33 +0000 (19 20:43 +0000)
committerAdolfo Jayme Barrientos <fitojb@ubuntu.com>
Mon, 21 Feb 2022 12:23:28 +0000 (21 13:23 +0100)
treee0a3543939f3d257b7316ebdf0b8fb0912c92c9b
parentcb040adc86fa237c17d8800c9bda4757de230ebf
tdf#147166 EditTextObjectImpl copy ctor doesn't exactly copy EditTextObjectImpl

and this is apparently relied on, so eliding the copy gives unexpected
results.

EditTextObjectImpl::Clone returns a copy of *this, but the
EditTextObjectImpl copy ctor explicitly does not copy the "PortionInfo"
member, so in:

commit fb8973f31f111229be5184f4e4223e963ced2c7b
Author: Caolán McNamara <caolanm@redhat.com>
Date:   Sat Oct 10 19:21:38 2020 +0100

    ofz#23492 the only user of this ctor throws away the original of the clone

    so we can take ownership of the original instead

where the copy was optimized away we want from a state where there was a
new EditTextObjectImpl with an empty PortionInfo member to one where the
PortionInfo of the EditTextObjectImpl was retained.

So explicitly clear this unwanted info.

It's very hard to make rational judgements about code if a copy behaves
differently than the orignal :-(

Change-Id: I642d60841d6bdccbf830f8a2ccdbd9f542a8aa18
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/130158
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
editeng/source/outliner/outliner.cxx