Commit 68bfab20 authored by konovalovsergey's avatar konovalovsergey

calculation cycle when defname depend on cell with same defname; more compact...

calculation cycle when defname depend on cell with same defname; more compact conditional formating dependency listening
parent ea40ed16
......@@ -436,6 +436,7 @@ $( function () {
AscCommonExcel.g_oUndoRedoRow = new AscCommonExcel.UndoRedoRowCol(wb, true);
AscCommonExcel.g_oUndoRedoComment = new AscCommonExcel.UndoRedoComment(wb);
AscCommonExcel.g_oUndoRedoAutoFilters = new AscCommonExcel.UndoRedoAutoFilters(wb);
AscCommonExcel.g_DefNameWorksheet = new AscCommonExcel.Worksheet(wb, -1);
// g_oUndoRedoGraphicObjects = new UndoRedoGraphicObjects(wb);
g_oIdCounter.Set_Load(false);
......@@ -488,6 +489,22 @@ $( function () {
} );
test( "Test: \"Defined names cycle\"", function () {
var newName = new Asc.asc_CDefName("q", "SUM('"+ws.getName()+"'!A2)");
wb.editDefinesNames(null, newName);
ws.getRange2( "Q1" ).setValue( "=q" );
ws.getRange2( "Q2" ).setValue( "=q" );
ws.getRange2( "Q3" ).setValue( "1" );
strictEqual( ws.getRange2( "Q1" ).getValueWithFormat(), "1" );
strictEqual( ws.getRange2( "Q2" ).getValueWithFormat(), "1" );
var newName = new Asc.asc_CDefName("w", "'"+ws.getName()+"'!A1");
wb.editDefinesNames(null, newName);
ws.getRange2( "Q4" ).setValue( "=w" );
strictEqual( ws.getRange2( "Q4" ).getValueWithFormat(), "#REF!" );
});
test( "Test: \"Parse intersection\"", function () {
ws.getRange2( "A7" ).setValue( "1" );
......
......@@ -94,7 +94,7 @@
if (AscCommon.c_oNotifyParentType.CanDo === type) {
return true;
} else if (AscCommon.c_oNotifyParentType.IsDefName === type) {
return true;
return {bbox: this.cf.getBBox(), ranges: this.cf.ranges};
} else if (AscCommon.c_oNotifyParentType.Change === type) {
this.ws.setDirtyConditionalFormatting(new AscCommonExcel.MultiplyRange(this.cf.ranges));
}
......
This diff is collapsed.
......@@ -551,6 +551,7 @@
var temp;
var offsetRow = offset.offsetRow;
var offsetCol = offset.offsetCol;
//todo offset A1048576:A1 (offsetRow = 1 -> A1:A2; offsetRow = -1 -> A1048575:A1048576)
if (0 === this.r1 && gc_nMaxRow0 === this.r2) {
//full sheet is 1:1048576 but offsetRow is valid for it
offsetRow = 0;
......@@ -1500,7 +1501,7 @@
if (null == oRes && null != oCacheVal.first && null != oCacheVal.last) {
var r1 = oCacheVal.first.getRow0(), r2 = oCacheVal.last.getRow0(), c1 = oCacheVal.first.getCol0(), c2 = oCacheVal.last.getCol0();
var r1Abs = oCacheVal.first.getRowAbs(), r2Abs = oCacheVal.last.getRowAbs(),
c1Abs = oCacheVal.first.getColAbs(), c2Abs = oCacheVal.first.getColAbs();
c1Abs = oCacheVal.first.getColAbs(), c2Abs = oCacheVal.last.getColAbs();
if (oCacheVal.first.getIsRow() && oCacheVal.last.getIsRow()) {
c1 = 0;
c2 = gc_nMaxCol0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment