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

            Bug ID: 151100
           Summary: Table in a shape in a header is lost on ODT export
           Product: LibreOffice
           Version: unspecified
          Hardware: All
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected], [email protected]

As Caolán McNamara noted in bug 150927 comment #8:
> https://bugs.documentfoundation.org/attachment.cgi?id=148210 (from bug
> 122628) ... asserts on export to odt

This started to assert after commit 5a9fe1d80ea977c439dd10ee2056abe6b0cb4d07
  Date Fri Jul 29 17:00:14 2022 +0200
    tdf#145226 sw: ODF export: fix table-row/table-cell styles

but was thought to be related to commit
35021cd56b3b4e38035804087f215c80085564be
  Date Wed Aug 5 11:16:32 2020 +0300
    tdf#124470: Split export of table autostyles out from collection phase

However, it is obviously a pre-existing problem, since saving the mentioned
file using 7.0.0 (i.e., prior to the latter commit) drops the table in the
shape in the header of the first page.

The code that prevents collection respective autostyles necessary for export of
the table in the header is in XMLShapeExport::collectShapeAutoStyles, where it
skips the block when xText is "empty".

The respective skip appeared in commit 73fcb052edf1a21d785583bc53e8b4323b577bb1
  Date Thu Nov 22 12:26:35 2001 +0000
    #90330# only export text autostyles for shapes with text

and was later relaxed by commit 7661bbbaef31adfdb298b1447301b24a70f85834
  Date Fri Nov 25 22:46:34 2016 +0100
    tdf#102479 ODF export: ignore exceptions when checking shape text

that obviously handled a similar problem. It mentioned:

> assume that the getString() check that was added there in commit
> 73fcb052edf1a21d785583bc53e8b4323b577bb1 is just a performance
> optimization; the actual export of auto styles and content uses
> XEnumerationAccess anyway.

Yet, it seems that just tolerating exceptions here is not enough, and thus we
need to drop the check completely, assuming it's the performance optimization,
and assuming that processing the empty text objects would be fast anyway.

Alternatively, we might want to use XEnumerationAccess and check if it's empty.

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

Reply via email to