GNOME Bugzilla – Bug 330129
Export locking sheet to Excel
Last modified: 2006-03-14 02:29:19 UTC
Please describe the problem: When your sheet in gnumeric is locked, and then you saved as a Ms Excel file format, when you open this file in Ms Excel 97, your sheet is doesn't locked. Steps to reproduce: 1. In gnumeric you lock the sheet, you save 2. then you save as Ms Excel 97/2000 3. You open the new file in Ms Excel 97, and you see that the sheet is not locked Actual results: The sheet in Ms Excel 97 is not locked Expected results: The sheet in Ms Excel 97 is locked Does this happen every time? yes Other information:
If MS Excel does not see the lock, we must be _ex_porting it incorrectly.
Created attachment 61105 [details] [review] Excel support (both import/export) for protection of worksheets and workbook. Excel support for protection of worksheets and workbook. Password protection is not yet implemented. Look at Bug 334257 too.
Created attachment 61171 [details] [review] New version of previous patch - Workbook Window Protection is turned off WINDOWPROTECT (which protects the window setting like size of window, etc.) is now not turned on by workbook protection. I think this is expected behaviour. Just the content of workbook e.g. PROTECT is turned on during export to Excel file. No change on importing was made.
The main difference between this patch and its xml cousin is that I am more confident I understand the xml one, :-) Anyway, shouldn't excel_read_workbook_PROTECT check for (q->length >= 2) if it is going to read two bytes? Or is it really supposed to read just one byte? Are we *sure* that ewb->gnum_wb_view is not NULL in the code + ms_biff_put_2byte (ewb->bp, BIFF_WINDOWPROTECT, 0); + ms_biff_put_2byte (ewb->bp, BIFF_PROTECT, ewb->gnum_wb_view->is_protected ? 1 : 0); ? And what if there is more than one view? I notice that code a few lines later actually loops through views.
Fixed in cvs, thanks.