summaryrefslogtreecommitdiff
path: root/sw/source/filter/xml/xmlimp.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin.luth@collabora.com>2020-04-16 16:36:15 +0300
committerJustin Luth <justin_luth@sil.org>2020-07-17 19:49:05 +0200
commite4635544b816d1ca27bd1ebba60f51444b0a898e (patch)
treee4af3fb130255955973daaa6cf4d98a0ef5903fe /sw/source/filter/xml/xmlimp.cxx
parentca2dfac3e790fb384e904502fe1ededd695001af (diff)
tdf#104596 sw COMPAT layout: wrap in header for in-table flies
You might have noticed that text in header/footers will not wrap around fly frames, but just run underneath, regardless of the wrap settings. Strange, eh? [This is also true in footnotes.] In an ancient effort to be compatible with MS strangeness, OOo decided to do this as well for interoperability reasons. http://openoffice.org/specs/writer/compatibility/adjust-text-wrapping.sxw Apparently, flies in tables are exempt from that rule in MSO, so this patch adds that exemption. TABLE EXEMPTION IS AN EXPERIMENTAL ASSUMPTION BASED ON VISUAL OBSERVATION FROM THIS BUG REPORT. IT IS NOT BASED ON DOCUMENTATION. I did look in DOC and DOCX manuals, and did a google search, but found nothing. A compat variable keeps older ODT files no-wrap, so that we don't break layout of existing documents. This variable is only read in the ODT import filter. If it doesn't exist for ODT, it is set to false. By default it is true, so it automatically is enabled for anything that doesn't modify it in its import filter, including all DOC/DOCX/RTF etc, and newly created ODT documents. In other words, allowing wrapping in the header for table-anchors is the new default behaviour unless an import filter turns it off. Headers/footers are the most common example. I also tested with footnotes, and found that Word 2016 does wrap in that case as well, even though the UI only allows AS_CHAR anchoring. FYI: Allowing wrapping at ALL times can be set with the Writer compatibility option "Use OpenOffice.org 1.1 text wrapping around objects". Change-Id: I9ad0c82df4af794079cce86fad9e401ea4575e59 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92378 Tested-by: Jenkins Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw/source/filter/xml/xmlimp.cxx')
-rw-r--r--sw/source/filter/xml/xmlimp.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 5495d67e210c..bcec7a220d80 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1358,6 +1358,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bool bPropLineSpacingShrinksFirstLine = false;
bool bSubtractFlysAnchoredAtFlys = false;
bool bCollapseEmptyCellPara = false;
+ bool bIsSetAllowWrapWhenAnchoredInTable = false;
const PropertyValue* currentDatabaseDataSource = nullptr;
const PropertyValue* currentDatabaseCommand = nullptr;
@@ -1454,6 +1455,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
bSubtractFlysAnchoredAtFlys = true;
else if (rValue.Name == "CollapseEmptyCellPara")
bCollapseEmptyCellPara = true;
+ else if ( rValue.Name == "AllowWrapWhenAnchoredInTable" )
+ bIsSetAllowWrapWhenAnchoredInTable = true;
}
catch( Exception& )
{
@@ -1624,6 +1627,9 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
if (!bCollapseEmptyCellPara)
xProps->setPropertyValue("CollapseEmptyCellPara", makeAny(false));
+ if (!bIsSetAllowWrapWhenAnchoredInTable)
+ xProps->setPropertyValue("AllowWrapWhenAnchoredInTable", makeAny(false));
+
SwDoc *pDoc = getDoc();
SfxPrinter *pPrinter = pDoc->getIDocumentDeviceAccess().getPrinter( false );
if( pPrinter )