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

            Bug ID: 174425
           Summary: FILEOPEN HWP 3.x: text inside tables is lost; tables
                    are imported as empty frames
           Product: LibreOffice
           Version: 26.8.2.2 release
          Hardware: All
                OS: macOS (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 209622
  --> https://bugs.documentfoundation.org/attachment.cgi?id=209622&action=edit
Minimal HWP 3.x file with one 2x2 table (hand-assembled from the format
specification)

Description:
When a Hangul Word Processor 3.x (.hwp, "HWP Document File V3.00") document
that contains tables is opened in Writer, the table content is missing. Each
table becomes an empty frame (draw:frame with an empty draw:text-box) and no
table is created. Most text outside tables is imported.

Steps to Reproduce:
1. Open the attached hwp3-table-2x2.hwp in Writer (or run: soffice --headless
--convert-to odt hwp3-table-2x2.hwp).
2. Look at the document between the lines "BEFORE-TABLE" and "AFTER-TABLE".

Actual Results:
Only "BEFORE-TABLE" and "AFTER-TABLE" are shown. The 2x2 table with the cell
texts CELL-A1, CELL-B1, CELL-A2, CELL-B2 is missing. The converted ODT contains
no table:table element.

Expected Results:
A 2x2 table with the four cell texts.

Reproducible: Always

Version: 26.8.2.2 (9dea406ab7695df6325b11b0e19fdca8db4b7276), macOS on Apple
Silicon. I have not tested other platforms or older versions.

Additional Info:
The attached file was assembled by hand from the published "Hangul Document
File Format 3.0" specification, so it is free of third-party content. The same
happens with documents saved by Hangul itself. I converted seven public HWP 3.x
test files to ODT with LibreOffice 26.8.2.2 and compared the result with the
table cells found by an independent HWP3 parser
(https://github.com/kimi230/hwp3):

file                          tables  cells  found  table:table  frames  empty
hwp3-table-cell-order.hwp          1     29      0            0       1      1
hwp3-table-grid-gap.hwp            6     84      0            0       6      6
hwp3-table-caption.hwp             1     21      0            0       1      0
hwp3-empty-cell.hwp                2      7      0            0       2      2
05434_vehicle_log_form.hwp         2     49      1            0       2      2
20099369_yeongwol_forms.hwp        4     88     16            0       4      4
hwp3-sample.hwp                    6     69     36            0      10      6

tables      = tables in the HWP3 file
cells       = table cells with text (two or more characters)
found       = cell texts that are present in the ODT
table:table = table:table elements in the ODT
frames      = draw:frame elements in the ODT
empty       = empty text boxes in the ODT

The few "found" texts are short strings that also occur outside the tables.

These files are in the rhwp repository (https://github.com/edwardkim/rhwp),
under fuzz/corpus/parse_hwp3/, samples/issue5916/ and samples/issue5699/.

A possible lead: hwpfilter does emit the table. HwpReader::makeTextBox() in
hwpfilter/source/hwpreader.cxx opens a draw:text-box and calls makeTable(),
which writes table:table. The imported document nevertheless ends up with an
empty text box, so the table seems to be dropped after the filter hands over
its XML. I have not checked older versions, so I do not know whether this is a
regression.

Related, in the same documents: line-drawing characters used for old text-mode
tables are imported as ASCII (+ - |), and a few symbol codes come out as a
replacement box. I can file those separately if useful.

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

Reply via email to