diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-29 17:17:45 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2017-11-30 08:07:09 +0100 |
commit | 343af46fc301a984929e071d477b8fb9f211e289 (patch) | |
tree | aa29a1fbd386c88acb3310933bacc2d411b47c6c | |
parent | c26f644db80e10f755911d277aac0e1d42731d29 (diff) |
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@libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r-- | sw/source/filter/xml/xmlexp.cxx | 5 |
1 files changed, 5 insertions, 0 deletions
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)) { |