Kaydet (Commit) 343af46f authored tarafından Miklos Vajna's avatar Miklos Vajna

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/45518Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst c26f644d
......@@ -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))
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment