diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-04-16 16:36:15 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2020-07-17 19:49:05 +0200 |
commit | e4635544b816d1ca27bd1ebba60f51444b0a898e (patch) | |
tree | e4af3fb130255955973daaa6cf4d98a0ef5903fe /sw/source/uibase/uno | |
parent | ca2dfac3e790fb384e904502fe1ededd695001af (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/uibase/uno')
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 9af674558e86..3d103db1347c 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -145,6 +145,7 @@ enum SwDocumentSettingsPropertyHandles HANDLE_PROTECT_FIELDS, HANDLE_HEADER_SPACING_BELOW_LAST_PARA, HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA, + HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE, }; } @@ -237,6 +238,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo() { OUString("ProtectFields"), HANDLE_PROTECT_FIELDS, cppu::UnoType<bool>::get(), 0 }, { OUString("HeaderSpacingBelowLastPara"), HANDLE_HEADER_SPACING_BELOW_LAST_PARA, cppu::UnoType<bool>::get(), 0 }, { OUString("FrameAutowidthWithMorePara"), HANDLE_FRAME_AUTOWIDTH_WITH_MORE_PARA, cppu::UnoType<bool>::get(), 0 }, + { OUString("AllowWrapWhenAnchoredInTable"), HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE, cppu::UnoType<bool>::get(), 0 }, /* * As OS said, we don't have a view when we need to set this, so I have to @@ -992,6 +994,15 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf } } break; + case HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE: + { + bool bTmp; + if (rValue >>= bTmp) + { + mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE, bTmp); + } + } + break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } @@ -1483,6 +1494,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf DocumentSettingId::FRAME_AUTOWIDTH_WITH_MORE_PARA); } break; + case HANDLE_ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get( + DocumentSettingId::ALLOW_WRAP_WHEN_ANCHORED_IN_TABLE); + } + break; default: throw UnknownPropertyException(OUString::number(rInfo.mnHandle)); } |