Uploaded image for project: 'ZK Spreadsheet'
  1. ZK Spreadsheet
  2. ZSS-685

Do not import duplicate cell style

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Normal Normal
    • 3.5.0
    • 3.5.0
    • ZSS Component
    • Security Level: Jimmy

      Currently, AbstractExcelImporter determines whether a POI cell style is duplicated or not by cell style's index. But we found some styles with different indexes have identical content (see attached Excel file). 3.5 importer cannot reduce style count for such kind of Excel file. The attached Excel file provided by customers is created by continuously editing and adding sheets in the same file in 2.6 ZSS. Its style object count already exceeds Excel file upper limit according to specification. So open the file with Excel will prompt users to recover it.

      Excel specification and limits
      2003: http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HP005199291.aspx
      2007: http://office.microsoft.com/en-001/excel-help/excel-specifications-and-limits-HP010073849.aspx?CTT=1

      If an importer can compare incoming style and imported style with their content, when two styles content are identical, it reuses previously imported style object without creating new one.

      Notes for Implementation:

      I found XSSFCellStyle and HSSFCellStyle both implement equal() and hash(). Just change current importedStyle key with CellStyle can make this work. (see ReduceRedundantStyleImporter.java)

            Jenkins Jenkins
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: