summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-05-24 11:00:11 +0200
committerMiklos Vajna <vmiklos@collabora.com>2023-05-24 12:38:09 +0200
commit08fa2903df1a7cf9a1647fcf967e4c8b57dad793 (patch)
tree498ae2d00dba08ca65d913a113d204e158cc53fc /sw/source/uibase
parent0ce9c61f35151f115b42e24fabe6f7bae5ee8783 (diff)
sw floattable: add a DoNotBreakWrappedTables compat flag
RTF doesn't break floating table across pages, and there is a matching DOCX compat flag to handle such documents. We can ignore floating table info on the model as a workaround, but that would mean the info is lost on save, so that's not ideal. Instead add a new compat flag that disables fly split at a layout level, which allows both not splitting tables & retaining the model-level info. This commit does the doc model, UNO API, layout & ODT filter, the Word filters are not yet updated. This compat flag is probably quite rare, so introduce a mechanism to only write the compat flag when it's true: this way the majority of the documents don't need to say anything about it and we can assume "false" for them. Also fix two missing xmlTextWriterEndElement() calls in the xml dumper. Change-Id: I32321ec204d7bfe011fcf024b97c906da0db8aae Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152190 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx18
1 files changed, 18 insertions, 0 deletions
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 9786964a4282..5273bc0e5432 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -153,6 +153,7 @@ enum SwDocumentSettingsPropertyHandles
HANDLE_IMAGE_PREFERRED_DPI,
HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE,
HANDLE_HYPHENATE_URLS,
+ HANDLE_DO_NOT_BREAK_WRAPPED_TABLES,
HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS,
HANDLE_NO_NUMBERING_SHOW_FOLLOWBY,
HANDLE_DROP_CAP_PUNCTUATION,
@@ -256,6 +257,7 @@ static rtl::Reference<MasterPropertySetInfo> lcl_createSettingsInfo()
{ OUString("ImagePreferredDPI"), HANDLE_IMAGE_PREFERRED_DPI, cppu::UnoType<sal_Int32>::get(), 0 },
{ OUString("AutoFirstLineIndentDisregardLineSpace"), HANDLE_AUTO_FIRST_LINE_INDENT_DISREGARD_LINE_SPACE, cppu::UnoType<bool>::get(), 0 },
{ OUString("HyphenateURLs"), HANDLE_HYPHENATE_URLS, cppu::UnoType<bool>::get(), 0 },
+ { OUString("DoNotBreakWrappedTables"), HANDLE_DO_NOT_BREAK_WRAPPED_TABLES, cppu::UnoType<bool>::get(), 0 },
{ OUString("WordLikeWrapForAsCharFlys"), HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS, cppu::UnoType<bool>::get(), 0 },
{ OUString("NoNumberingShowFollowBy"), HANDLE_NO_NUMBERING_SHOW_FOLLOWBY, cppu::UnoType<bool>::get(), 0 },
{ OUString("DropCapPunctuation"), HANDLE_DROP_CAP_PUNCTUATION, cppu::UnoType<bool>::get(), 0 },
@@ -1070,6 +1072,16 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
}
}
break;
+ case HANDLE_DO_NOT_BREAK_WRAPPED_TABLES:
+ {
+ bool bTmp;
+ if (rValue >>= bTmp)
+ {
+ mpDoc->getIDocumentSettingAccess().set(
+ DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES, bTmp);
+ }
+ }
+ break;
case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
{
bool bTmp;
@@ -1630,6 +1642,12 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
DocumentSettingId::HYPHENATE_URLS);
}
break;
+ case HANDLE_DO_NOT_BREAK_WRAPPED_TABLES:
+ {
+ rValue <<= mpDoc->getIDocumentSettingAccess().get(
+ DocumentSettingId::DO_NOT_BREAK_WRAPPED_TABLES);
+ }
+ break;
case HANDLE_WORD_LIKE_WRAP_FOR_AS_CHAR_FLYS:
{
rValue <<= mpDoc->getIDocumentSettingAccess().get(