From 57b1f6c2db2340d078ee9e5f347efdf20dc1ea9b Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Tue, 09 Nov 2021 17:54:54 +0200 Subject: [PATCH] tdf#143793 sw new compat: wrap in headers/endnotes again. Back in OOo 2 era, the decision was made to ignore shapes' text-wrapping in headers/footers and footnotes/endnotes in order to mimic what Word does. That allowed LO-authored documents to look the same when exported to MS formats. (It also involved having the body wrap around heading shapes, all collected under USE_FORMER_TEXT_WRAPPING.) That might not have been such a good idea. MS reversed course in 2013 (compatibilityMode 15) and now doesn't ignore the wrap settings anymore. Starting in LO 7.0, we started exporting our DOCX as compat15, so now LO-authored documents don't look the same as in Word again. Since it makes sense to honor the wrap settings, and since it once again increases compatiblity with all still-supported MSWord DOCX formats, lets "revert" back to the expected behaviour of not ignoring these settings. There is one likely downside, and that is that any change like this will cause layout loops in documents that didn't loop before. It is just exposing an existing problem, but it could exaggerate a previously less-travelled code path. So I'm going to wait till 7.4 before promoting this. Change-Id: Iec71567851b6b6a863343617f66097bc11fe9a74 --- diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index 823f595..b89eaa4 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -60,7 +60,7 @@ mbAddFlyOffsets(false), mbAddVerticalFlyOffsets(false), mbUseHiResolutionVirtualDevice(true), - mbUseTextWrappingOnHeadersEndnotes(false), // tdf#104254 + mbUseTextWrappingOnHeadersEndnotes(true), // tdf#104254 mbMathBaselineAlignment(false), // default for *old* documents is 'off' mbStylesNoDefault(false), mbFloattableNomargins(false), diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 36932bb..ef2c57a 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1288,6 +1288,7 @@ bool bUseFormerLineSpacing = false; bool bUseFormerObjectPositioning = false; bool bUseFormerTextWrapping = false; + bool bUseTextWrappingOnHeadersEndnotes = false; bool bConsiderWrapOnObjPos = false; bool bIgnoreFirstLineIndentInNumbering = false; bool bDoNotJustifyLinesWithManualBreak = false; @@ -1361,6 +1362,8 @@ bUseFormerObjectPositioning = true; else if ( rValue.Name == "UseFormerTextWrapping" ) bUseFormerTextWrapping = true; + else if ( rValue.Name == "UseTextWrappingOnHeadersEndnotes" ) + bUseTextWrappingOnHeadersEndnotes = true; else if ( rValue.Name == "UseOldNumbering" ) bUseOldNumbering = true; else if ( rValue.Name == "ConsiderTextWrapOnObjPos" ) @@ -1463,6 +1466,11 @@ xProps->setPropertyValue( "UseFormerTextWrapping", makeAny( true ) ); } + if (!bUseTextWrappingOnHeadersEndnotes) + { + xProps->setPropertyValue("UseTextWrappingOnHeadersEndnotes", makeAny(false)); + } + if (!bConsiderWrapOnObjPos && bAreUserSettingsFromDocument) { xProps->setPropertyValue( "ConsiderTextWrapOnObjPos", makeAny( false ) );