[Libreoffice-bugs] [Bug 112571] FILESAVE XLSX New named range is created every time an Excel made spreadsheet that contains print ranges is saved as XLSX

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Nov 23 05:39:01 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=112571

--- Comment #8 from Aron Budea <baron at caesar.elte.hu> ---
The main issue is that eg. print area is exported once as a built-in name:

void XclExpNameManagerImpl::CreateBuiltInNames()
https://opengrok.libreoffice.org/xref/core/sc/source/filter/excel/xename.cxx#575

...and then as a user name as well (as many as there were). This is why after
each save there's one extra range. A set of "_0"-s are added during import to
avoid clash.

This is what the named range in xl\worksheets.xml looks like after one save
(different sample than the attachment, the range is different), at this point
the names are still clashing:

<definedNames>
  <definedName function="false" hidden="false" localSheetId="0"
name="_xlnm.Print_Area" vbProcedure="false">Sheet1!$A$1:$E$5</definedName>
  <definedName function="false" hidden="false" localSheetId="0"
name="_xlnm.Print_Area"
vbProcedure="false">Sheet1!$A$1:$E$5</definedName></definedNames>

Note how in XclExpNameManagerImpl::CreateBuiltInNames() other built-in names
are created as well.
The quick fix seems to be to skip adding the user-created names separately if
they match a built-in name. Maybe they shouldn't even be listed among the
user-created names, if it's possible?

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20171123/95fc55a3/attachment.html>


More information about the Libreoffice-bugs mailing list