Bug 53992 - FORMATTING MS-COMPAT: Handling of fo:wrap-option and sequential <text:p> elements
Summary: FORMATTING MS-COMPAT: Handling of fo:wrap-option and sequential <text:p> elem...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Spreadsheet (show other bugs)
Version: 3.6.0.4 release
Hardware: All All
: medium normal
Assignee: Not Assigned
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-24 08:13 UTC by Nicholas Shanks
Modified: 2014-07-03 21:17 UTC (History)
5 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Nicholas Shanks 2012-08-24 08:13:21 UTC
One of either LO or Microsoft Excel is wrong here, but I don't know which. Without determining who is wrong and who is right, LO can implement a change which mitigates the problem.

In LO, two consecutive <text:p> elements in a string cell will appear as two lines with no additional formatting needed. In Excel, they appear concatenated with no whitespace between them, unless an fo:wrap-option="wrap" attribute is also present in the cell's style.

I have not checked the specs but I will presume that the default wrapping behaviour (i.e. the default value for fo:wrap-options) is not to wrap cell contents. Cells in spreadsheets normally just overflow in the x direction when their contents don't fit.

If the <text:p> object is, to use HTML parlance, block-level, then Excel is wrong, two p elements should progress in the block-level direction.
If the <text:p> object is inline-level, then LO is wrong and a fo:wrap-option value forcing wrapping is REQUIRED to create wrapping behaviour.
So can you both check the OpenDocument specs and see whether <text:p> is block or inline.


The code Excel spits out is correctly shown on two lines in both UAs (code excerpt below).
The code LO spits out is not shown correctly when opened in Excel (as below but without fo:wrap-option element).


<style:style name="ce0" style:family="table-cell">
  <style:table-cell-properties fo:wrap-option="wrap"/>
</style:style>

<table:table-cell table:style-name="ce0" office:value-type="string">
  <text:p>Line 1</text:p><text:p>Line 2</text:p>
</table:table-cell>


As a workaround, I suggest that LO emit a fo:wrap-option="wrap" attribute anyway, even if it turns out not to be necessary by the letter of the published spec, so that files saved by it can be opened in Excel 2007, 2008, 2010 and possibly future versions. I expect that this will mean cells containing text:p elements with contents wider than the cell will see wrapping within a text:p block, like this: (not verified)

+------------------+
|Line 1 Line 1 Line|
|1                 |
|Line 2            |
+------------------+

Rather than the overflowing first text:p being clipped, and the cell height being consequently smaller. I think this side-effect is reasonably acceptable given that the alternative is no line wrapping when opened in Excel.
Comment 1 bfoman 2013-03-14 14:01:35 UTC
CCing Calc expert from https://wiki.documentfoundation.org/FindTheExpert.
Please comment and set status accordingly.
Comment 2 Markus Mohrhard 2013-06-28 02:11:33 UTC
(In reply to comment #0)
> One of either LO or Microsoft Excel is wrong here, but I don't know which.
> Without determining who is wrong and who is right, LO can implement a change
> which mitigates the problem.
> 
> In LO, two consecutive <text:p> elements in a string cell will appear as two
> lines with no additional formatting needed. In Excel, they appear
> concatenated with no whitespace between them, unless an
> fo:wrap-option="wrap" attribute is also present in the cell's style.
> 
> I have not checked the specs but I will presume that the default wrapping
> behaviour (i.e. the default value for fo:wrap-options) is not to wrap cell
> contents. Cells in spreadsheets normally just overflow in the x direction
> when their contents don't fit.
> 

No. The spec does not specify the default behavior so actually both applications are correct.

I agree that we can export the wrap-options attribute unconditionally but it does not solve the problem that there are still documents and will be documents without that attribute.

@Thorsten: Is there a reason why there is no default value in the ODF1.2 RNG? I haven't found any default value definitions for optional attributes in the whole spec.
Comment 3 (unused account) 2013-06-28 20:16:05 UTC
bugzilla-daemon@freedesktop.org wrote:
> @Thorsten: Is there a reason why there is no default value in the
> ODF1.2 RNG?
>
There are a few - let's please treat missing ones as a bug in the
spec.
Comment 4 Joel Madero 2013-09-09 03:27:12 UTC
@Thorsten/Markus - can we mark this as NEW & prioritize?
Comment 5 Robinson Tryon (qubit) 2014-07-03 21:17:04 UTC
(had a chat w/Markus)

Whiteboard: Remove 'NeedAdvice'
Status -> NEW

Thorsten -- could you please file a bug in the ODF issue tracker? (and link to it from here)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.