Bug 91267 - MSO2013 Template - D&B Business Verification - Column Width too Small
Summary: MSO2013 Template - D&B Business Verification - Column Width too Small
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: Other All
: medium normal
Assignee: Markus Mohrhard
URL:
Whiteboard: target:5.0.0
Keywords:
Depends on:
Blocks: Excel-2013-Templates
  Show dependency treegraph
 
Reported: 2015-05-13 19:21 UTC by Joel Madero
Modified: 2015-05-22 19:24 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
Original.xlsx (49.52 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2015-05-13 19:21 UTC, Joel Madero
Details
Original.pdf (191.27 KB, application/pdf)
2015-05-13 19:21 UTC, Joel Madero
Details
Screenshot with pdf and LIbreOffice view. (69.38 KB, image/png)
2015-05-13 21:20 UTC, m_a_riosv
Details
Screenshot of MSO 2013 (103.27 KB, image/jpeg)
2015-05-13 21:25 UTC, Joel Madero
Details
Sheet2.pdf (201.35 KB, application/pdf)
2015-05-14 03:09 UTC, Joel Madero
Details
Screenshott with zoom 100% in LibreOffice (93.25 KB, image/png)
2015-05-14 08:45 UTC, m_a_riosv
Details
Screenshott with zoom 90% in LibreOffice (87.92 KB, image/png)
2015-05-14 08:46 UTC, m_a_riosv
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joel Madero 2015-05-13 19:21:03 UTC
Created attachment 115572 [details]
Original.xlsx

Windows 7
Version: 5.0.0.0.alpha1+
Build ID: 5b3a30f40a7ce476922649b734f6ede1c2fdef4b
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-05-13_01:52:36
Locale: en-US (en_US)

1) Open Original.xlxs with LibreOffice
2) Compare column widths (for instance C and D) to Original.pdf or open the Original.xlsx file in Microsoft Office 2013


Observe: Column width is too narrow and text is cut off (e.g., C12, D17)
Comment 1 Joel Madero 2015-05-13 19:21:21 UTC
Created attachment 115573 [details]
Original.pdf
Comment 2 m_a_riosv 2015-05-13 21:20:55 UTC
Created attachment 115577 [details]
Screenshot with pdf and LIbreOffice view.

Sorry @Joel, but as I see is the same as in the pdf. It's easy to see if Menu/Tools/Options/LibreOffice calc/View - Display - Text overflow is disable.

A bit better in LibreOffice than in the pdf.

To me not a bug. Please if you are not agree reopen it.
Comment 3 Joel Madero 2015-05-13 21:24:03 UTC
Crap your right about the pdf - but if you open it in MSO 2013 - that's not what you see. I'll add a screenshot...

Maybe a bug in Microsoft Office?
Comment 4 Joel Madero 2015-05-13 21:25:49 UTC
Created attachment 115578 [details]
Screenshot of MSO 2013
Comment 5 Joel Madero 2015-05-13 21:34:50 UTC
I talked to Markus about this - he said even if the pdf renders like we show - if we show different from MSO does than we should report and mark as NEW.

Moving back to UNCONFIRMED until someone can confirm it's different from the attached screenshot
Comment 6 m_a_riosv 2015-05-13 21:56:15 UTC
Sorry @Joel, I never had MSO, 123 since 1983.

Can be the issue with the font?. Seems it's the same issue with column B.
A change in the column with it's strange.
Maybe a first comprobation could be verify if it is the same width with both programs.

Column C has 64,84 mm. with LibreOffice, and has the same opening with ApacheOo
Comment 7 Joel Madero 2015-05-14 03:08:52 UTC
Additional proof that column widths are incorrectly imported:

1) Open Original.xlsx in LibreOffice
2) Go to sheet "Combined Output"
3) Look at the merged cell in B5

Compare the wrap/text placement to "Sheet2.pdf" - you can see that the text is wrapped differently in LibreOffice due to the difference in column size.
Comment 8 Joel Madero 2015-05-14 03:09:08 UTC
Created attachment 115586 [details]
Sheet2.pdf
Comment 9 m_a_riosv 2015-05-14 08:45:26 UTC
Created attachment 115592 [details]
Screenshott with zoom 100% in LibreOffice

For me it depends on the LibreOffice zoom level.

At zoom 100% like in the attached screenshoot it's fine, reducing zoom at 90% it changes. (attached in next comment).
Comment 10 m_a_riosv 2015-05-14 08:46:21 UTC
Created attachment 115593 [details]
Screenshott with zoom 90% in LibreOffice
Comment 11 Buovjaga 2015-05-18 10:35:52 UTC
Confirmed the zoom issue.
However, D17 has cut off text even with 100% zoom as even mario's screenshot shows. I'll set to NEW.

Info about how MSO calculates column width & height: https://support.office.com/en-us/article/Change-the-column-width-and-row-height-db30658d-0c0b-44ad-825f-55f1cb4d9957

Ubuntu 15.04 64-bit 
Version: 5.0.0.0.alpha1+
Build ID: 51d16cc69d8ad9065f61d108ea25d6a025a2e228
TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time: 2015-05-17_03:58:58
Locale: en-US (en_US.UTF-8)
Comment 12 Markus Mohrhard 2015-05-19 03:55:11 UTC
I think I promised Joel to look into this one after fixing my other document.
Comment 13 Markus Mohrhard 2015-05-19 05:39:06 UTC
So, this one requires some more work by me.

Inside OOXML the column width is stored as multiple of the longest character from the set "01234567890". In our import we currently make the assumption that we don't need the character length which of course results in wrong values during the import.
Comment 14 Markus Mohrhard 2015-05-19 21:48:07 UTC
(In reply to Markus Mohrhard from comment #13)
> So, this one requires some more work by me.
> 
> Inside OOXML the column width is stored as multiple of the longest character
> from the set "01234567890". In our import we currently make the assumption
> that we don't need the character length which of course results in wrong
> values during the import.

That analysis was wrong. We are actually getting the character widths. So now I'm back to zero understanding what is going wrong.
Comment 15 Markus Mohrhard 2015-05-20 02:03:10 UTC
Please test with a daily build and a screen ruler that the column width values from calc and excel are the same for you now.

I had to use one ugly hack to get the last problem fixed and hope that this one is working across all machines.
Comment 16 Commit Notification 2015-05-20 02:05:09 UTC
Markus Mohrhard committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=16726a1b37df8bdcae02b3c7699df814977222bd

better algorithm for OOXML column width import, tdf#91267

It will be available in 5.0.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 17 Buovjaga 2015-05-22 08:05:26 UTC
(In reply to Joel Madero from comment #4)
> Created attachment 115578 [details]
> Screenshot of MSO 2013

D17 of the first sheet still has the last L cut off a bit (the bottom bar of the L to be exact!) at 100% zoom.

Win 7 Pro 64-bit Version: 5.1.0.0.alpha1+
Build ID: 83eb114394879cbfd073322a51c47d02553c1fcf
TinderBox: Win-x86@39, Branch:master, Time: 2015-05-22_06:33:51
Locale: fi-FI (fi_FI)
Comment 18 Cor Nouws 2015-05-22 08:48:36 UTC
Note:
This file is made with the Calibri font. I've seen terrible formatting ánd printing issues with xlsx files based on Calibri when that font was not available.
Perfect example of vendor-lockin.

If Carlito and Caladea are installed one can set Tools > Options > LibreOffice > Fonts replacement table:
Calibri by Carlito
Cambria by Caladea
Comment 19 Joel Madero 2015-05-22 19:24:57 UTC
Well if the goal is perfect interoperability for these templates - we need to figure out how to correctly handle Calibri (the alternative of telling every user who ever uses a MSO 2013 template to go find another font, while ideal in the open source world, is not practical or realistic in the current atmosphere).