diff options
author | Justin Luth <justin_luth@sil.org> | 2021-06-03 13:38:33 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-06-08 15:23:29 +0200 |
commit | a2d8a737f41cbb0ed8a51a99b1c233b25e433d1c (patch) | |
tree | ccdd9e7607b7b0d08aff136181132009b0775a79 /sw/source/uibase | |
parent | c4c8202359e574bce784f6b40ce95e49e983c7bb (diff) |
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 <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 26454819b9c1..26a2e8285300 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -134,6 +134,7 @@ enum SwDocumentSettingsPropertyHandles HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, HANDLE_EMBED_SYSTEM_FONTS, HANDLE_TAB_OVER_MARGIN, + HANDLE_TAB_OVER_SPACING, HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, HANDLE_SURROUND_TEXT_WRAP_SMALL, HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, @@ -228,6 +229,7 @@ static rtl::Reference<MasterPropertySetInfo> lcl_createSettingsInfo() { OUString("EmbedComplexScriptFonts"), HANDLE_EMBED_COMPLEX_SCRIPT_FONTS, cppu::UnoType<bool>::get(), 0}, { OUString("EmbedSystemFonts"), HANDLE_EMBED_SYSTEM_FONTS, cppu::UnoType<bool>::get(), 0}, { OUString("TabOverMargin"), HANDLE_TAB_OVER_MARGIN, cppu::UnoType<bool>::get(), 0}, + { OUString("TabOverSpacing"), HANDLE_TAB_OVER_SPACING, cppu::UnoType<bool>::get(), 0}, { OUString("TreatSingleColumnBreakAsPageBreak"), HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK, cppu::UnoType<bool>::get(), 0}, { OUString("SurroundTextWrapSmall"), HANDLE_SURROUND_TEXT_WRAP_SMALL, cppu::UnoType<bool>::get(), 0}, { OUString("ApplyParagraphMarkFormatToNumbering"), HANDLE_APPLY_PARAGRAPH_MARK_FORMAT_TO_NUMBERING, cppu::UnoType<bool>::get(), 0}, @@ -894,6 +896,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_MARGIN, bTmp); } break; + case HANDLE_TAB_OVER_SPACING: + { + bool bTmp = *o3tl::doAccess<bool>(rValue); + mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::TAB_OVER_SPACING, bTmp); + } + break; case HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK: { bool bTmp = *o3tl::doAccess<bool>(rValue); @@ -1441,6 +1449,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::TAB_OVER_MARGIN ); } break; + case HANDLE_TAB_OVER_SPACING: + { + rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::TAB_OVER_SPACING); + } + break; case HANDLE_TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK: { rValue <<= mpDoc->getIDocumentSettingAccess().get( DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK ); |