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

            Bug ID: 173682
           Summary: PDF/UA: FILEOPEN PPTX ignores a:tblPr/@firstRow -
                    every table's first row is exported as /TH
           Product: LibreOffice
           Version: 26.8.0.3 release
          Hardware: All
                OS: macOS (All)
            Status: UNCONFIRMED
          Keywords: accessibility, filter:pdf, filter:pptx
          Severity: normal
          Priority: medium
         Component: Impress
          Assignee: [email protected]
          Reporter: [email protected]
            Blocks: 139007

Created attachment 208694
  --> https://bugs.documentfoundation.org/attachment.cgi?id=208694&action=edit
PPTX saved by PowerPoint, 2x2 table, no firstRow - first row exported as /TH

When a PPTX table has no header row (a:tblPr without firstRow="1"), tagged PDF
export still tags its first row as /TH. A data row is announced to assistive
technology as column headers.

The same table saved as ODP, without table:use-first-row-styles, exports
correctly with no /TH. So the flag is lost on OOXML import, not on PDF export.

Steps to reproduce:
1. Open the attached table-no-header-row.pptx. It has a 2x2 table;
ppt/slides/slide1.xml contains <a:tblPr bandRow="1"/> with no firstRow
attribute. The file was saved by PowerPoint 16.113.2 (macOS), which keeps
firstRow absent.
2. File > Export as PDF with "Tagged PDF" checked (PDF/UA mode is not needed).
3. Inspect the structure tree.

Actual: the first row is /TH (2 x TH, 2 x TD).
Expected: all cells are /TD (4 x TD), because the firstRow attribute of
CT_TableProperties is optional and defaults to false (ECMA-376 Part 1,
DrawingML schema).

Control: the attached table-no-header-row.odp holds the same table without
table:use-first-row-styles. It exports as 0 x TH, 4 x TD, which is correct.

Cause:
- The PDF export decides TH vs TD from the table's UseFirstRowStyle setting:
svx/source/table/viewcontactoftableobj.cxx:363, aCellPos.mnRow == 0 &&
rTableObj.getTableStyleSettings().mbUseFirstRow.
- That setting defaults to true: svx/source/table/svdotable.cxx:160,
mbUseFirstRow(true).
- The ODF import sets it from table:use-first-row-styles:
xmloff/source/draw/sdpropls.cxx:394.
- The OOXML import reads firstRow
(oox/source/drawingml/table/tablecontext.cxx:54) but uses it only to choose
cell formatting (oox/source/drawingml/table/tablecell.cxx:317). Nothing in oox/
sets UseFirstRowStyle, so every imported PPTX table keeps the default true.

A PPTX table that does have firstRow="1" gets the right result only because the
default happens to match. That is why this is easy to miss in tests: a positive
test case passes, and only a table without a header row shows the defect.

Versions:
- LibreOfficeDev 27.2.0.0.alpha0 (e668dc84eb97bf46fc108ec209fc8383a34123f7),
macOS
- LibreOffice 26.8.0.3 (bce0998afefdbc355585ca324285661a2170ba77), macOS

Code references are from master e668dc84eb97.


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=139007
[Bug 139007] [META] PDF accessibility
-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to