Blame SOURCES/0001-EditTextObjectImpl-copy-ctor-doesn-t-exactly-copy-Ed.patch

110047
From 3925cf39742ebee935498b14571f13f3e8b64b49 Mon Sep 17 00:00:00 2001
110047
From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= <caolanm@redhat.com>
110047
Date: Sat, 19 Feb 2022 20:43:33 +0000
110047
Subject: [PATCH] EditTextObjectImpl copy ctor doesn't exactly copy
110047
 EditTextObjectImpl
110047
MIME-Version: 1.0
110047
Content-Type: text/plain; charset=UTF-8
110047
Content-Transfer-Encoding: 8bit
110047
110047
and this is apparently relied on, so eliding the copy gives unexpected
110047
results.
110047
110047
EditTextObjectImpl::Clone returns a copy of *this, but the
110047
EditTextObjectImpl copy ctor explicitly does not copy the "PortionInfo"
110047
member, so in:
110047
110047
commit fb8973f31f111229be5184f4e4223e963ced2c7b
110047
Author: Caolán McNamara <caolanm@redhat.com>
110047
Date:   Sat Oct 10 19:21:38 2020 +0100
110047
110047
    ofz#23492 the only user of this ctor throws away the original of the clone
110047
110047
    so we can take ownership of the original instead
110047
110047
where the copy was optimized away we want from a state where there was a
110047
new EditTextObjectImpl with an empty PortionInfo member to one where the
110047
PortionInfo of the EditTextObjectImpl was retained.
110047
110047
So explicitly clear this unwanted info.
110047
110047
It's very hard to make rational judgements about code if a copy behaves
110047
differently than the orignal :-(
110047
110047
Change-Id: I642d60841d6bdccbf830f8a2ccdbd9f542a8aa18
110047
---
110047
 editeng/source/outliner/outliner.cxx | 1 +
110047
 1 file changed, 1 insertion(+)
110047
110047
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
110047
index 9c474131352c..d48e4a542723 100644
110047
--- a/editeng/source/outliner/outliner.cxx
110047
+++ b/editeng/source/outliner/outliner.cxx
110047
@@ -383,6 +383,7 @@ std::unique_ptr<OutlinerParaObject> Outliner::CreateParaObject( sal_Int32 nStart
110047
         aParagraphDataVector[nPara-nStartPara] = *GetParagraph(nPara);
110047
     }
110047
 
110047
+    xText->ClearPortionInfo(); // tdf#147166 the PortionInfo is unwanted here
110047
     std::unique_ptr<OutlinerParaObject> pPObj(new OutlinerParaObject(std::move(xText), aParagraphDataVector, bIsEditDoc));
110047
     pPObj->SetOutlinerMode(GetMode());
110047
 
110047
-- 
110047
2.35.1
110047