sw: RTF export: fix invalid RTF for shapes and text frames again

Desktop / LibreOffice - Michael Stahl [cib.de] - 19 November 2019 10:16 UTC

It turns out that commit 4652b911c4376048a452709c953197e1a879a921 wasn't quite right: writing out the m_aRunText doesn't necessarily put it in the right place, it just happened to work on that bugdoc but in other cases the shape may be written before the paragraph properties of the paragraph it's in...

So instead change the text frame case to save and restore the run related buffers and members, so that the text frame itself can do whatever it wants, and the result is appended to m_aRunText.

The members saved are a superset of those saved in WriteHeaderFooter_Impl(), writeTextFrame(), TextFootnote_Impl().

Also another thing was missing is that OLE objects would trigger the assert because they are also buffered into m_aRunText, e.g. ooo46760-1.odt.

Change-Id: Icc6988f8ed19724c593760df46e0254792cd1735 Reviewed-on: https://gerrit.libreoffice.org/83105

da967d5f8f45 sw: RTF export: fix invalid RTF for shapes and text frames again
sw/CppunitTest_sw_rtfexport4.mk | 1 +
sw/qa/extras/rtfexport/data/anchor.fodt | 101 ++++++++++++++++++++++++++++
sw/qa/extras/rtfexport/rtfexport4.cxx | 33 +++++++++
sw/source/filter/ww8/rtfattributeoutput.cxx | 41 +++++++++--
sw/source/filter/ww8/rtfattributeoutput.hxx | 1 +
5 files changed, 173 insertions(+), 4 deletions(-)

Upstream: cgit.freedesktop.org

  • Share