sw/qa/extras/rtfexport/rtfexport.cxx |    2 ++
 sw/source/filter/ww8/wrtww8.cxx      |    4 ++++
 2 files changed, 6 insertions(+)

New commits:
commit 5deec1c02ca1f2df30b0c33d516d3aa10285fb3b
Author:     Justin Luth <justin_l...@sil.org>
AuthorDate: Tue Jan 8 11:17:12 2019 +0300
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Thu Jan 31 10:25:20 2019 +0100

    tdf#122456 filter/ww8 export: no fake section at end of document
    
    If Writer has a section that is ending, then the part after
    that would need to be another section for MS formats. However,
    if the section ends at the end of the document, there is
    no need to start a new section.
    
    This is particularly important for exporting RTF (preventing
    accumulating sections/paragraphs), but it also affects
    docx and doc (without noticable benefit or harm, but
    now instead of "fake" section properties it will end with
    the properties of the real section - which can only be a
    good thing, right?)
    
    This is one step in the right direction for resolving the comment
    //0xffffffff, what ... is going on with that!, fixme most terribly
    reinterpret_cast<SwSectionFormat*>(sal_IntPtr(-1))
    
    Change-Id: Ie0641eb78c11103b33e3d849fe0b7935476a6505
    Reviewed-on: https://gerrit.libreoffice.org/65974
    Tested-by: Jenkins
    Reviewed-by: Justin Luth <justin_l...@sil.org>
    Reviewed-on: https://gerrit.libreoffice.org/66051
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx 
b/sw/qa/extras/rtfexport/rtfexport.cxx
index 8dc665642278..7dd8d79ced50 100644
--- a/sw/qa/extras/rtfexport/rtfexport.cxx
+++ b/sw/qa/extras/rtfexport/rtfexport.cxx
@@ -1092,6 +1092,8 @@ DECLARE_RTFEXPORT_TEST(testTdf94043, "tdf94043.rtf")
     // This was 0, the separator line was not visible due to 0 width.
     CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(2),
                          getProperty<sal_Int32>(xTextColumns, 
"SeparatorLineWidth"));
+
+    CPPUNIT_ASSERT_EQUAL(7, getParagraphs());
 }
 
 DECLARE_RTFEXPORT_TEST(testTdf94377, "tdf94377.rtf")
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index c1703e6db15c..fe326ab9c822 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2778,6 +2778,10 @@ void MSWordExportBase::WriteText()
                     {
                         bNeedExportBreakHere = false;
                     }
+                    // No need to create a "fake" section if this is the end 
of the document,
+                    // except to emulate balanced columns.
+                    else if ( nColumnCount < 2 && aIdx == 
m_pDoc->GetNodes().GetEndOfContent() )
+                        bNeedExportBreakHere = false;
                 }
 
                 if (bNeedExportBreakHere)  //#120140# End of check
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to