diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-02-19 20:43:33 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-02-19 22:41:18 +0100 |
commit | 19613544fcba9e08d0d9f24cbd976ed12431d4b2 (patch) | |
tree | 70568be2d39824c2c6f97fca67e52edd4383661a /editeng | |
parent | 992f3922cfe164369f47b5a0f614a54bd539e52a (diff) |
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/+/130201
Tested-by: Caolán McNamara <caolanm@redhat.com>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'editeng')
-rw-r--r-- | editeng/source/outliner/outliner.cxx | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index d5e6630cefe4..41e6ebc4adad 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -381,6 +381,7 @@ std::optional<OutlinerParaObject> Outliner::CreateParaObject( sal_Int32 nStartPa aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara); } + xText->ClearPortionInfo(); // tdf#147166 the PortionInfo is unwanted here OutlinerParaObject aPObj(std::move(xText), std::move(aParagraphDataVector), bIsEditDoc); aPObj.SetOutlinerMode(GetOutlinerMode()); |