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

Region name is not updated during column insert

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 3.9.1
    • ZSS Range & Model
    • None

      I've got a spreasheet with two named regions, both have a scope of current sheet.
      After inserting a row using org.zkoss.zss.api.impl.RangeImpl#insert
      named regions needs to recalculated since their position changes.

      While at org.zkoss.zss.model.impl.FormulaTunerHelper#extend i actualy do have my named regions in nameDependents, which is correct

      But in org.zkoss.zss.model.impl.FormulaTunerHelper#extendNameRef a call to

      SName name = book.getNameByName(dependent.getNameName());
      

      returns null.

      I guess the problem is actualy not in

      org.zkoss.zss.model.impl.BookImpl#getNameByName(java.lang.String, java.lang.String)
      

      since it does not need a special treatment for sheetName=null case, but rather at org.zkoss.zss.model.impl.FormulaTunerHelper#extend
      since it should pass sheetName of dependent cell down to BookImpl#getNameByName

      Offending callstack below

        at org.zkoss.zss.model.impl.BookImpl.getNameByName(BookImpl.java:894)
      	  at org.zkoss.zss.model.impl.FormulaTunerHelper.extendNameRef(FormulaTunerHelper.java:845)
      	  at org.zkoss.zss.model.impl.FormulaTunerHelper.extend(FormulaTunerHelper.java:487)
      	  at org.zkoss.zss.model.impl.SheetImpl.extendFormula(SheetImpl.java:1470)
      	  at org.zkoss.zss.model.impl.SheetImpl.shiftAfterColumnInsert(SheetImpl.java:1076)
      	  at org.zkoss.zss.model.impl.SheetImpl.insertColumn(SheetImpl.java:1027)
      	  at org.zkoss.zss.range.impl.InsertDeleteHelper.insert(InsertDeleteHelper.java:589)
      	  at org.zkoss.zss.range.impl.RangeImpl$14.doInvoke(RangeImpl.java:945)
      	  at org.zkoss.zss.range.impl.RangeImpl$ModelManipulationTask.invoke(RangeImpl.java:1766)
      	  at org.zkoss.zss.model.util.ReadWriteTask.doInWriteLock(ReadWriteTask.java:43)
      	  at org.zkoss.zss.range.impl.RangeImpl.insert(RangeImpl.java:948)
      	  at org.zkoss.zss.api.impl.RangeImpl.insert(RangeImpl.java:438)
      

            Unassigned Unassigned
            sirvaulterscoff sirvaulterscoff
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: