| Summary: | XLSX file with a frozen column causes Excel on OSX to degrade | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Kuno Meyer <kuno.meyer> |
| Component: | Calc | Assignee: | Bartosz <gang65> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | aron.budea, gang65, suokunlong |
| Priority: | medium | Keywords: | filter:xlsx |
| Version: | 5.1.4.2 release | ||
| Hardware: | All | ||
| OS: | All | ||
| See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=100014 https://bugs.documentfoundation.org/show_bug.cgi?id=90975 https://bugs.documentfoundation.org/show_bug.cgi?id=86957 |
||
| Whiteboard: | interoperability target:5.3.0 target:5.2.4 | ||
| Crash report or crash signature: | Regression By: | ||
| Attachments: |
File created with LO 5.1.4 causing Excel/OSX behave badly
File created with LO 5.1.4 with manual fix (remove windowProtection="true") |
||
|
Description
Kuno Meyer
2016-07-20 19:09:22 UTC
Someone had a similar issue in bug 100014 (and bug 90975 was also similar). Is Protect Workbook set in Excel with this file, and does unsetting it fixes the incorrect behavior? Attachment 126330 [details] indeed has workbook protection flag set. I did not set this, so this might indeed be bug 90975, despite of the fact that that bug is RESOLVED WORKSFORME. According to https://support.office.com/en-us/article/Protect-a-workbook-7e365a4d-3e89-4616-84ca-1931257c1517, there are multiple types of workbook protection: a) structure protection, b) window protection. According to that link, Window protection has been dropped with MSO 2013, but what I observe here with Excel 2010 on Windows, it comes quite close to what I remember having observed with Excel 2011 on OSX. More investigation needed at home this evening. Created attachment 126351 [details]
File created with LO 5.1.4 with manual fix (remove windowProtection="true")
With Excel 2010 on Windows
--------------------------
- setting workbook protection to "structure" alters:
/xl/workbooks.xml: <workbookProtection lockStructure="1"/> is added
- setting workbook protection to "window" alters:
/xl/workbooks.xml: <workbookProtection lockWindows="1"/> is added
/xl/worksheets/sheet1.xml: windowProtection="1" to the <sheetView> element
/xl/worksheets/sheet2.xml: windowProtection="1" to the <sheetView> element
/xl/worksheets/sheet3.xml: windowProtection="1" to the <sheetView> element
- activating "View > Freeze Panes" alters:
/xl/worksheets/sheet1.xml:
- one <pane> and 3 <section> subelements (none yet there) to the <sheetView> element
- opening the "window" workbook-protected file in Excel 2011 on OSX exactly results in the described behaviour a)-c).
With LO 5.1.4, started from scratch:
-------------
- activating "View > Freeze Rows and Columns" alters:
/xl/worksheets/sheet1.xml:
- windowProtection="true" to the <sheetView> element
- one <pane> and 3 additional <section> subelements (one already there) to the <sheetView> element
Conclusion
----------
- LO really should not set windowProtection="true" in sheet1.xml when panes are frozen. Excel does not do that either. This is what this bug report is about.
- Excel/Win and Excel/OSX are insofar differently implemented as Excel/Win seems to look at <workbookProtection lockWindows="1"/> in workbook.xml (and does not assume workbook protection if it is missing) whereas Excel/OSX does not (and just follows the windowProtection flag in sheet1.xml).
- Excel uses 0/1 for boolean values, LO true/false. But this might be OK by definition of the file format.
@Kuno Do you have proposal how it could be implemented to fix it properly on both OSX and Windows side? Maybe bug on Excel itself should be submitted? No need to blame Excel. Just make sure that windowProtection="1" is not added to the <sheetView> element in /xl/worksheets/sheet<i>.xml when you freeze columns/panes. See https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=sc/source/filter/excel/xeview.cxx;h=09fbbc1fef52720f68d62f89314522ed9f895685;hb=40d892a2db4d750aaf0562c63004e693c028273c#l417: ... XML_windowProtection, XclXmlUtils::ToPsz( maData.mbFrozenPanes ), ... is most probably wrong. Thanks for investigation. I will prepare the patch which will fix that. I'm wondering when we should enable windowProtection="1"? Do you know some LibreOffice setting, which are equivalent to windowProtection="1" ? Based on https://gerrit.libreoffice.org/gitweb?p=core.git;a=blob;f=sc/source/filter/excel/excdoc.cxx;h=a1a2a75443d4bea88e0c63a49761f85ac0934c3e;hb=HEAD#l112, which seems to be the part that adds <workbookProtection ...> to workbooks.xml, the answer might be yes. Or, in other words, as conclusion from comment 6 and comment 8: replace: ... XML_windowProtection, XclXmlUtils::ToPsz( maData.mbFrozenPanes ), ... with something along the lines of: const ScTableProtection* pTabProtect = rDoc.GetTabProtection(mnScTab); ... XML_windowProtection, XclXmlUtils::ToPsz( pProtect && pProtect->isProtected() && pProtect->isOptionEnabled(ScDocProtection::WINDOWS)), ... 'needsConfirmationAdvise' is only used for unconfirmed bugs. Removing it from this bug. [NinjaEdit] Review for fixing the window freeze: https://gerrit.libreoffice.org/#/c/30076/ Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=0637d0f43d3dc5b41a1bbc5726d6a68b7c36a519 tdf#101042 Fix for frozen windows in Excel It will be available in 5.3.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. Bartosz Kosiorek committed a patch related to this issue. It has been pushed to "libreoffice-5-2": http://cgit.freedesktop.org/libreoffice/core/commit/?id=a6114042c590ff319e7d1877935e56e6c77bc3ee&h=libreoffice-5-2 tdf#101042 Fix for frozen windows in Excel It will be available in 5.2.4. 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. *** Bug 86957 has been marked as a duplicate of this bug. *** |