Bug 165995 - FILESAVE PPTX: top/bottom Border spacing is not exported (or left/right if zero)
Summary: FILESAVE PPTX: top/bottom Border spacing is not exported (or left/right if zero)
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Justin L
URL:
Whiteboard: target:25.8.0
Keywords: filter:pptx
Depends on:
Blocks: PPTX-Tables
  Show dependency treegraph
 
Reported: 2025-03-31 21:02 UTC by Justin L
Modified: 2025-04-03 17:08 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Justin L 2025-03-31 21:02:19 UTC
As seen with FixedCellHeight_affectingShape_LiberationAutofitB.pptx (attachment 200062 [details] from bug 165950), round-tripping the file in LO causes the border spacing (which is zero) to be lost, and instead it reloads with some default values.

The same thing is true if various border spacing values are provided - all is simply lost on a round-trip.

In the case of this unit test, it should have written
    <a:tcPr marL="0" marR="0", marT="0", marB="0">
just like this example document has.

I presume the defaults are coming from oox/source/drawingml/table/tablecell.cxx
TableCell::TableCell() ...
, mnMarL( 91440 )
, mnMarR( 91440 )
, mnMarT( 45720 )
, mnMarB( 45720 )

and oox/source/drawingml/table/tablecellcontext.cxx
case A_TOKEN( tcPr ):       // CT_TableCellProperties
    mrTableCell.setLeftMargin( rAttribs.getInteger( XML_marL, 91440 ) );
    ...

This ought to be written out in oox/source/export/shapes.cxx ShapeExport::WriteTableCellProperties, especially if 0, not
sax_fastparser::UseIf(OString::number(oox::drawingml::convertHmmToEmu(nLeftMargin)), nLeftMargin > 0)
Comment 1 Commit Notification 2025-04-01 01:56:08 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/a2c58edd20f243697a0790d323816094e319b2a7

tdf#165995 pptx export: table cell margins weren't exported

It will be available in 25.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.