forked from amazingfate/loongoffice
This is a follow-up to commit 2bcfb7231b5ca74f02274cfb74ca8463f78905d6 "tdf#152872 sw: conditionally hide paragraph breaks". Word determines the paragraph properties differently depending on whether paragraphs are merged by hidden text (where the first paragraph containing non-hidden text wins) or delete redlines (where the last paragraph wins). This fixes the hidden text situation while leaving the delete redline situation as it is. The problem is that CheckParaRedlineMerge() only considers hidden text on the paragraph end marker (RES_PARATR_LIST_AUTOFMT) but not elsewhere in the paragraph, so there are extents for the hidden text. The actual hiding of that is done via ScriptInfo::m_HiddenChg, which cannot be removed and replaced by merging because it is required for Writer's notion of hidden paragraphs in SwTextFrame::IsHiddenNowImpl(). * FindParaPropsNodeIgnoreHidden() skips over nodes that contain only hidden text in case hidden text isn't shown * factor out ScriptInfo::InitScriptInfoHidden() because it is now needed to find the pParaPropsNode, but the rest of InitScriptInfo() requires the pParaPropsNode... * testTdf152872 requires changes as it was relying on ControlCharacters alone toggling the merging list of commits that tweaked setting pParaPropsNode: 58353884dc86bdb3c1464f8bbf8c3e131584b78a (related: tdf#130685) sw: adapt definition of sw_redlinehide index 0 b86ff2c6a88aa41379e74f11e8ec8497ff85ffd0 tdf#118699 sw_redlinehide: need some more changes to use the last node fa5eb82b398e29ae033f7b7c8c8195dfc10cf5b0 tdf#118699 change tracking: don't number empty lines beec1594587d0bf1ea2268f9a435c948b5580278 tdf#125319 sw_redlinehide: handle empty paragraphs more like Word c20308f1b919ca5ce61233068946e5fddb7eadb3 sw_redlinehide_4b: surprising discoveries Change-Id: If0e49a4d105dbf7d71e753967f36f2ec56f21f1d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181918 Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Tested-by: Jenkins (cherry picked from commit 8712673a445edeb28a5f3029bbcaa096f38d72e6) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/181957 Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>