From a2d8a737f41cbb0ed8a51a99b1c233b25e433d1c Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Thu, 3 Jun 2021 13:38:33 +0200 Subject: tdf#142404 DOCX c15: add compat flag TabOverSpacing DOCX in 2013 (compatibilityMode 15) no longer supports TabOverMargin (i.e. the text margin), but it does a similar kind of thing if the tab goes into the spacing-after of a paragraph. So add a compat flag to handle this in-between kind of situation. I grepped -i "tab_*over_*margin" to see if I was missing anything. Decimal/Center proved to be only tabOverMargin. IsInSect shouldn't matter since it fits inside the printing range. The other places where I didn't insert TabOverSpacing didn't seem relevant based on a code read. Tab-after-tab still doesn't work great, but what we have is already a massive house of cards that will just collapse if changed. No real provision for handling tabs-over-paragraph-end. -auto-tabs are created instead of "beyond nMyRight" tab, unless it is the first tab defined. -doesn't allow auto-tabs to fill the remaining space. But on the other hand, MS Word's implementation of tabs follows some kind of incomprehensible bizarre logic, so just ignore the tabs completely, please. Change-Id: I3723107b29ec3e287ea8661544711c13eee3ca48 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116667 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna --- writerfilter/source/filter/WriterFilter.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'writerfilter/source/filter') diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx index 55bb89f1e21b..f665fbdc29a6 100644 --- a/writerfilter/source/filter/WriterFilter.cxx +++ b/writerfilter/source/filter/WriterFilter.cxx @@ -319,6 +319,11 @@ void WriterFilter::setTargetDocument(const uno::Reference& xDo xSettings->setPropertyValue("InvertBorderSpacing", uno::makeAny(true)); xSettings->setPropertyValue("CollapseEmptyCellPara", uno::makeAny(true)); xSettings->setPropertyValue("TabOverflow", uno::makeAny(true)); + // tdf#142404 TabOverSpacing (new for compatiblityMode15/Word2013+) is a subset of TabOverMargin + // (which applied to DOCX <= compatibilityMode14). + // TabOverMargin looks at tabs beyond the normal text area, + // while TabOverSpacing only refers to a tab beyond the paragraph margin. + xSettings->setPropertyValue("TabOverSpacing", uno::makeAny(true)); xSettings->setPropertyValue("UnbreakableNumberings", uno::makeAny(true)); xSettings->setPropertyValue("FloattableNomargins", uno::makeAny(true)); -- cgit