office-gobmx/writerfilter
Miklos Vajna 9700c1b217 sw content controls, plain text: add DOCX import
- the core of this is the writerfilter/ change to call PopSdt() for
  SdtControlType::plainText, which maps inline plain text SDTs to Writer content
  controls, not to input fields

- disable the grab-bag in this case, otherwise we would run duplicated <w:sdt>
  elements on export

- fix CppunitTest_sw_ooxmlexport7's testSdtAndShapeOverlapping by postponing
  the SDT start in DocxAttributeOutput::WriteContentControlStart() in case a
  shape is anchored at the same position as the SDT start: if the shape should
  start inside the content control, then it should be anchored after the dummy
  character

- reduce the debug output in VMLExport::Commit(), which could write control
  characters to the terminal on test failure, potentially breaking it (requiring
  a 'reset' to recover)

- fix CppunitTest_sw_ooxmlexport5's testSdt2Run: now we merge two runs inside a
  plain text content control into a single one, and there is no problem with
  that, so adapt the test instead

- fix CppunitTest_sw_ooxmlexport17's testTdf148361: plain text inline SDT is
  now a content control, not a field

- fix CppunitTest_sw_ooxmlfieldexport's testfdo82492: explicitly assert that
  there is 1 text run inside the SDT and there is a shape after it (outside).
  Also extend DocxAttributeOutput::EndContentControl(), so it ends the content
  control at the correct, earlier position in case it's followed by an as-char
  shape

- fix CppunitTest_sw_ooxmlfieldexport's testfdo82123: again assert that the SDT
  has 1 run with text, and there is a drawing after the SDT

- fix CppunitTest_sw_ooxmlfieldexport's testTdf104823: this revealed that some
  more complex logic is needed to support data bindings, so exclude
  text-with-databinding from the scope of this commit and continue to map those
  to input fields for now

- fix CppunitTest_sw_ooxmlfieldexport's testFdo81945: this had a similar
  problem as as-char shapes, but this time a new SDT is starting right after a
  previous SDT. Adapt DocxAttributeOutput::EndContentControl() accordingly,
  though perhaps this should be generalized later, so we always close SDTs in the
  previous run, unless this is the last run, or something similar

Change-Id: Ifaf581be884a683de6c8b932008a03ba43734b75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137399
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
2022-07-25 09:51:22 +02:00
..
documentation
inc
qa sw content controls, plain text: add DOCX import 2022-07-25 09:51:22 +02:00
source sw content controls, plain text: add DOCX import 2022-07-25 09:51:22 +02:00
util
CppunitTest_writerfilter_dmapper.mk
CppunitTest_writerfilter_filters_test.mk
CppunitTest_writerfilter_misc.mk
CppunitTest_writerfilter_rtftok.mk
CustomTarget_source.mk
IwyuFilter_writerfilter.yaml
Library_writerfilter.mk
Makefile
Module_writerfilter.mk
README.md

Import Filters for LibreOffice Writer

The writerfilter module contains import filters for Writer, using its UNO API.

Import filter for DOCX and RTF.

  • Module contents

    • documentation: RNG schema for the OOXML tokenizer, etc.
    • inc: module-global headers (can be included by any files under source)
    • qa: cppunit tests
    • source: the filters themselves
    • util: UNO passive registration config
  • Source contents

    • dmapper: the domain mapper, hiding UNO from the tokenizers, used by DOCX and RTF import
      • The incoming traffic of dmapper can be dumped into an XML file in /tmp in dbgutil builds, start soffice with the SW_DEBUG_WRITERFILTER=1 environment variable if you want that.
    • filter: the UNO filter service implementations, invoked by UNO and calling the dmapper + one of the tokenizers
    • ooxml: the docx tokenizer
    • rtftok: the rtf tokenizer