tdf#77051 DOCX: fix user index and index entry support
commit05f92eb1359c399c43d3bcbe8942034408fa23eb
authorLászló Németh <nemeth@numbertext.org>
Fri, 1 Oct 2021 15:42:48 +0000 (1 17:42 +0200)
committerLászló Németh <nemeth@numbertext.org>
Mon, 4 Oct 2021 06:22:23 +0000 (4 08:22 +0200)
tree84e4c5fcdd8f8fd84f25160db52b17dd64e0a50f
parentf8e086f185b31f753074fd22ecc73c44b193a784
tdf#77051 DOCX: fix user index and index entry support

defined by field code \f.

E.g. INDEX \f "user-index" inserts only the entries
defined by XE "entry" \f "user-index" field codes.

Revert commit a7bc9c1e4977bd3430df69287fa0a8377a686c58
"fdo#77051: Preservation of Index field flag '\f'", which
added an undocumented UNO property only for round-trip
support of INDEX, but not for XE index entries, so the
DOCX export still resulted a broken index with lost
entries, not only the import was broken because of the
missing functionality in com.sun.star.text.DocumentIndex.

Now the import uses com.sun.star.text.UserIndex and
com.sun.star.text.UserIndexMark index and index entry
fields, which support the requested user index not
only during the DOCX and OpenDocument round-trip, but
its run-time functionality, the multiple user-defined
indices.

Note: for manual testing, update the user index (the
first index) of the left original unit test document
IndexFieldFlagF.docx: the updated index is not empty,
as before, but contains the user index entries.

Change-Id: Ia6139bba88907051fd050cfd40809f5544b9a89e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/122930
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
12 files changed:
sw/inc/tox.hxx
sw/inc/unomap.hxx
sw/inc/unoprnms.hxx
sw/qa/extras/ooxmlexport/ooxmlfieldexport.cxx
sw/source/core/tox/tox.cxx
sw/source/core/unocore/unoidx.cxx
sw/source/core/unocore/unomap.cxx
sw/source/filter/ww8/wrtw8nds.cxx
sw/source/filter/ww8/ww8atr.cxx
writerfilter/source/dmapper/DomainMapper_Impl.cxx
writerfilter/source/dmapper/PropertyIds.cxx
writerfilter/source/dmapper/PropertyIds.hxx