[Libreoffice-commits] core.git: sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Nov 30 07:07:42 UTC 2017


 sw/source/filter/xml/xmlexp.cxx |    5 +++++
 1 file changed, 5 insertions(+)

New commits:
commit 343af46fc301a984929e071d477b8fb9f211e289
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Wed Nov 29 17:17:45 2017 +0100

    ODT filter: make sure we have a layout before export
    
    It is expected that the commandline --convert-to switch gives mostly the
    same result as save-as on the UI, but this was not the case for ODT, as
    the convert-to case had no layout available.
    
    As a result the explicit width of table columns or soft page-breaks were
    missing from the export result in the convert-to case.
    
    Given that Word formats already calculate the layout before export and
    during crashtesting we already wait for the OnLayoutFinished even before
    export, just enable calculating the layout before ODT export as well to
    shrink the cmdline vs GUI differences.
    
    [ No testcase: saving
    writerperfect/qa/unit/data/writer/epubexport/table.fodt with the writer8
    export filter would be a reproducer for this, but the test doesn't fail
    without the fix even aftet not calling CalcLayot() via the
    mustCalcLayoutOf() override, so I'm out of ideas right now how to test
    this. ]
    
    Change-Id: Ib05958e857f0a353b8740f2a87a6cf2f45f3c764
    Reviewed-on: https://gerrit.libreoffice.org/45518
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/sw/source/filter/xml/xmlexp.cxx b/sw/source/filter/xml/xmlexp.cxx
index 7d6d88940005..428b90ed6bc9 100644
--- a/sw/source/filter/xml/xmlexp.cxx
+++ b/sw/source/filter/xml/xmlexp.cxx
@@ -126,6 +126,11 @@ ErrCode SwXMLExport::exportDoc( enum XMLTokenEnum eClass )
 
     SwDoc *pDoc = getDoc();
 
+    // Make sure the layout is available to have more stability in the output
+    // markup.
+    if (SwViewShell* pViewShell = pDoc->getIDocumentLayoutAccess().GetCurrentViewShell())
+        pViewShell->CalcLayout();
+
     if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
                             SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
     {


More information about the Libreoffice-commits mailing list