Blame SOURCES/0001-fdo-70201-sw-eliminate-no-extent-RSID-only-AUTOFMT-h.patch

2135ec
From a79a7f315a0a3bc8148a88bb1d3c6f83a4552094 Mon Sep 17 00:00:00 2001
2135ec
From: Michael Stahl <mstahl@redhat.com>
2135ec
Date: Tue, 8 Oct 2013 18:37:35 +0200
2135ec
Subject: [PATCH] fdo#70201: sw: eliminate no-extent RSID-only AUTOFMT hints
2135ec
2135ec
These are already filtered out in SwpHints::TryInsertHint(), but they
2135ec
can be produced by a SwTxtNode::Update() following some deletion like in
2135ec
SwTxtNode::ReplaceText() (or maybe CutImpl() and RstAttr() too?).
2135ec
2135ec
So in order to prevent SwHistorySetTxt being created for these,
2135ec
filter them out in SwpHints::MergePortions(), which has the advantage
2135ec
that it's one location to change; probably filtering in Update() and
2135ec
RstAttr() both would work too.
2135ec
2135ec
(regression from 6db39dbd7378351f6476f6db25eb7110c9cfb291)
2135ec
2135ec
Change-Id: I597a9ab290dcc3fb1b624dd2dca241c462acf256
2135ec
(cherry picked from commit 91159b1c31a7fd474ba0b97828f593604790ce3c)
2135ec
---
2135ec
 sw/source/core/txtnode/thints.cxx | 9 +++++++++
2135ec
 1 file changed, 9 insertions(+)
2135ec
2135ec
diff --git a/sw/source/core/txtnode/thints.cxx b/sw/source/core/txtnode/thints.cxx
2135ec
index 0893dac..34dac0a 100644
2135ec
--- a/sw/source/core/txtnode/thints.cxx
2135ec
+++ b/sw/source/core/txtnode/thints.cxx
2135ec
@@ -2528,6 +2528,15 @@ bool SwpHints::MergePortions( SwTxtNode& rNode )
2135ec
                     pHt->GetAutoFmt().GetStyleHandle());
2135ec
             if ((pSet->Count() == 1) && pSet->GetItem(RES_CHRATR_RSID, false))
2135ec
             {
2135ec
+                // fdo#70201: eliminate no-extent RSID-only AUTOFMT
2135ec
+                // could be produced by ReplaceText or (maybe?) RstAttr
2135ec
+                if (*pHt->GetStart() == *pHt->GetEnd())
2135ec
+                {
2135ec
+                    SwpHintsArray::DeleteAtPos(i); // kill it without History!
2135ec
+                    SwTxtAttr::Destroy(pHt, rNode.GetDoc()->GetAttrPool());
2135ec
+                    --i;
2135ec
+                    continue;
2135ec
+                }
2135ec
                 // fdo#52028: this one has _only_ RSID => ignore it completely
2135ec
                 if (!pHt->IsFormatIgnoreStart() || !pHt->IsFormatIgnoreEnd())
2135ec
                 {
2135ec
-- 
2135ec
1.8.3.1
2135ec