https://bugs.documentfoundation.org/show_bug.cgi?id=174374

            Bug ID: 174374
           Summary: DOCX import: INDEX field with both \f and \h fails to
                    load
           Product: LibreOffice
           Version: 27.2.0.0 alpha0+ master
          Hardware: All
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Description:
DOCX import: INDEX field with both \f and \h fails to load
How it was run: soffice --headless --convert-to odt with a fresh user profile.
It printed “Unspecified Application Error” and wrote no file.

Steps to Reproduce:
Use control files provided at this link:
https://www.dropbox.com/scl/fo/ngjohc415493rbcw0ypll/AEhXkt-gFJOviGKh2FewlJU?rlkey=bvo94qt6kujk5oyd5qrfpjt0w&st=yaheo980&dl=0

Actual Results:
DOCX import: INDEX field with both \f and \h fails to load

Expected Results:
DOCX import: INDEX field with both \f and \h loads


Reproducible: Always


User Profile Reset: No

Additional Info:
Reported by Claude Opus 5.5 when I asked it to modify a .docx file:

Summary: FILEOPEN DOCX: document fails to load when INDEX field has both \f and
\h switches

Steps to reproduce:
1. Open the attached index-f-and-h-fails.docx (1 KB, made by hand,
schema-valid;
   Word opens it).

Actual result:
Load fails. Headless conversion reports "Unspecified Application Error" and
writes no output.

Expected result:
The document opens and shows the index, as in Word.

Details:
document.xml contains an XE field  XE "apple" \f D  and an INDEX field whose
result spans paragraphs:  INDEX \f D \h A . The body section has
<w:cols w:space="720"/>, which Word writes into almost every document.

The file loads if any one of these is removed:
- the \f switch (attached control-h-only-opens.docx)
- the \h switch (attached control-f-only-opens.docx)
- the <w:cols> element in sectPr
Quoting the switch values (\f "D" \h "A") still fails.

Real-world case: a 230-page Word manuscript with a two-column index using an
entry type (\f) and letter headings (\h A) cannot be opened at all.

Probable cause (from reading the source, not debugged):
DomainMapper_Impl::handleIndex creates com.sun.star.text.UserIndex when \f is
present (behaviour added for tdf#77051, commit 05f92eb1359c, LibreOffice 7.3).
It then sets "UseAlphabeticalSeparators" for \h, which a UserIndex does not
have. The same lines are present in libreoffice-24-2, libreoffice-25-8 and
master (sw/source/writerfilter/dmapper/DomainMapper_Impl.cxx). Probably a
regression from 7.3; I have not tested versions before or after 24.2.

Version: 24.2.7.2 (X86_64), Build ID: 420(Build:2)
Ubuntu package 4:24.2.7-0ubuntu0.24.04.7, Ubuntu 24.04.5 LTS

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to