From 3fb424b4326cff4f810fb24977e387bdb9e5a34e Mon Sep 17 00:00:00 2001 From: Justin Luth Date: Mon, 25 May 2020 18:55:59 +0300 Subject: tdf#133370 docx export: don't export unseen columnbreak A compatibility option indicates whether a column break is treated as a page break when there are no columns. (Currently true only for DOCX). Don't export this column break when compat is off, because it WILL show up as a page-break in Word and LO when loaded. In theory, the RTF and DOC code that converts these into page-breaks on import could now be removed, but I can't think of any reason why that would be of benefit. testColumnBreak_ColumnCountIsZero in ooxmlexport4 covers the situation where docx MUST round-trip these. Change-Id: I5c17e43d90469bdb86087c61dadf48a9440f7b96 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94799 Tested-by: Jenkins Reviewed-by: Justin Luth Reviewed-by: Miklos Vajna --- sw/source/filter/ww8/docxexport.hxx | 2 -- sw/source/filter/ww8/rtfexport.hxx | 2 -- sw/source/filter/ww8/wrtww8.hxx | 5 ----- sw/source/filter/ww8/ww8atr.cxx | 3 ++- 4 files changed, 2 insertions(+), 10 deletions(-) (limited to 'sw/source') diff --git a/sw/source/filter/ww8/docxexport.hxx b/sw/source/filter/ww8/docxexport.hxx index 04d29c2f65b9..74336b72d454 100644 --- a/sw/source/filter/ww8/docxexport.hxx +++ b/sw/source/filter/ww8/docxexport.hxx @@ -131,8 +131,6 @@ public: /// Access to the sections/headers/footres. virtual MSWordSections& Sections() const override; - virtual bool SupportsOneColumnBreak() const override { return true; } - virtual bool FieldsQuoted() const override { return true; } virtual bool AddSectionBreaksForTOX() const override { return true; } diff --git a/sw/source/filter/ww8/rtfexport.hxx b/sw/source/filter/ww8/rtfexport.hxx index 77f4244f35f7..0c0d35d1a97f 100644 --- a/sw/source/filter/ww8/rtfexport.hxx +++ b/sw/source/filter/ww8/rtfexport.hxx @@ -58,8 +58,6 @@ public: /// Access to the Rtf Sdr exporter. RtfSdrExport& SdrExporter() const; - bool SupportsOneColumnBreak() const override { return false; } - bool FieldsQuoted() const override { return true; } bool AddSectionBreaksForTOX() const override { return false; } diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx index 8c66df7a630a..8753314664ca 100644 --- a/sw/source/filter/ww8/wrtww8.hxx +++ b/sw/source/filter/ww8/wrtww8.hxx @@ -677,9 +677,6 @@ public: /// Access to the sections/headers/footres. virtual MSWordSections& Sections() const = 0; - /// Determines if column break with one column should be exported or not. - virtual bool SupportsOneColumnBreak() const = 0; - /// Determines if the import filter already quoted fields or not. virtual bool FieldsQuoted() const = 0; @@ -1020,8 +1017,6 @@ public: virtual bool AllowPostponedTextInTable() const override { return false; } - virtual bool SupportsOneColumnBreak() const override { return false; } - virtual bool FieldsQuoted() const override { return false; } virtual bool AddSectionBreaksForTOX() const override { return false; } diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index a9a9151b31bd..4b913d9fa576 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -3867,7 +3867,8 @@ void AttributeOutputBase::FormatBreak( const SvxFormatBreakItem& rBreak ) [[fallthrough]]; case SvxBreak::ColumnAfter: case SvxBreak::ColumnBoth: - if ( GetExport().Sections().CurrentNumberOfColumns( *GetExport().m_pDoc ) > 1 || GetExport().SupportsOneColumnBreak() ) + if ( GetExport().m_pDoc->getIDocumentSettingAccess().get( DocumentSettingId::TREAT_SINGLE_COLUMN_BREAK_AS_PAGE_BREAK ) + || GetExport().Sections().CurrentNumberOfColumns( *GetExport().m_pDoc ) > 1 ) { nC = msword::ColumnBreak; } -- cgit v1.2.3