Commit db0e60ba authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

правки в DependencyGraph при вводе и сдвиге

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53628 954022d7-b5bf-4e40-9824-e11837661b57
parent 124572ea
...@@ -2775,7 +2775,13 @@ parserFormula.prototype = { ...@@ -2775,7 +2775,13 @@ parserFormula.prototype = {
} }
return this; return this;
}, },
setRefError : function(wsId, cellId){
for ( var i = 0; i < this.outStack.length; i++ ) {
var node = this.outStack[i];
if ( node instanceof cRef || node instanceof cArea || node instanceof cRef3D || node instanceof cArea3D )
this.outStack[i] = new cError( cErrorType.bad_reference );
}
},
/* /*
Для изменения ссылок на конкретную ячейку. Для изменения ссылок на конкретную ячейку.
offset - на сколько сдвигаем ячейку (offset = {offsetCol:intNumber, offsetRow:intNumber}) offset - на сколько сдвигаем ячейку (offset = {offsetCol:intNumber, offsetRow:intNumber})
......
This diff is collapsed.
...@@ -3367,7 +3367,7 @@ TreeRB.prototype = { ...@@ -3367,7 +3367,7 @@ TreeRB.prototype = {
_init : function(){ _init : function(){
this.nil = new TreeRBNode(); this.nil = new TreeRBNode();
this.nil.left = this.nil.right = this.nil.parent = this.nil; this.nil.left = this.nil.right = this.nil.parent = this.nil;
this.nil.key = Number.MIN_VALUE; this.nil.key = -Number.MAX_VALUE;
this.nil.red = 0; this.nil.red = 0;
this.nil.storedValue = null; this.nil.storedValue = null;
...@@ -3635,7 +3635,7 @@ TreeRB.prototype = { ...@@ -3635,7 +3635,7 @@ TreeRB.prototype = {
return oRes; return oRes;
}, },
getNodeAll : function(){ getNodeAll : function(){
return this.enumerate(Number.MIN_VALUE, Number.MAX_VALUE); return this.enumerate(-Number.MAX_VALUE, Number.MAX_VALUE);
} }
}; };
...@@ -3646,7 +3646,7 @@ Asc.extendClass(IntervalTreeRB, TreeRB); ...@@ -3646,7 +3646,7 @@ Asc.extendClass(IntervalTreeRB, TreeRB);
IntervalTreeRB.prototype._init = function (x) { IntervalTreeRB.prototype._init = function (x) {
this.nil = new IntervalTreeRBNode(); this.nil = new IntervalTreeRBNode();
this.nil.left = this.nil.right = this.nil.parent = this.nil; this.nil.left = this.nil.right = this.nil.parent = this.nil;
this.nil.key = this.nil.high = this.nil.maxHigh = Number.MIN_VALUE; this.nil.key = this.nil.high = this.nil.maxHigh = -Number.MAX_VALUE;
this.nil.minLow = Number.MAX_VALUE; this.nil.minLow = Number.MAX_VALUE;
this.nil.red = 0; this.nil.red = 0;
this.nil.storedValue = null; this.nil.storedValue = null;
...@@ -3654,7 +3654,7 @@ IntervalTreeRB.prototype._init = function (x) { ...@@ -3654,7 +3654,7 @@ IntervalTreeRB.prototype._init = function (x) {
this.root = new IntervalTreeRBNode(); this.root = new IntervalTreeRBNode();
this.root.left = this.nil.right = this.nil.parent = this.nil; this.root.left = this.nil.right = this.nil.parent = this.nil;
this.root.key = this.root.high = this.root.maxHigh = Number.MAX_VALUE; this.root.key = this.root.high = this.root.maxHigh = Number.MAX_VALUE;
this.root.minLow = Number.MIN_VALUE; this.root.minLow = -Number.MAX_VALUE;
this.root.red = 0; this.root.red = 0;
this.root.storedValue = null; this.root.storedValue = null;
}; };
...@@ -3666,7 +3666,7 @@ IntervalTreeRB.prototype._fixUpMaxHigh = function (x) { ...@@ -3666,7 +3666,7 @@ IntervalTreeRB.prototype._fixUpMaxHigh = function (x) {
} }
}; };
IntervalTreeRB.prototype._cleanMaxHigh = function (x) { IntervalTreeRB.prototype._cleanMaxHigh = function (x) {
x.maxHigh = Number.MIN_VALUE; x.maxHigh = -Number.MAX_VALUE;
x.minLow = Number.MAX_VALUE; x.minLow = Number.MAX_VALUE;
}; };
IntervalTreeRB.prototype._overlap = function (a1, a2, b1, b2) { IntervalTreeRB.prototype._overlap = function (a1, a2, b1, b2) {
...@@ -3840,8 +3840,40 @@ RangeDataManager.prototype = { ...@@ -3840,8 +3840,40 @@ RangeDataManager.prototype = {
var bboxGet = shiftGetBBox(bbox, bHor); var bboxGet = shiftGetBBox(bbox, bHor);
return {bbox: bboxGet, elems: this.get(bboxGet)}; return {bbox: bboxGet, elems: this.get(bboxGet)};
}, },
shiftSort : function(a, b, bAsc, bRow)
{
var nRes = 0;
if(null == a.to || null == b.to)
{
if(null == a.to && null == b.to)
nRes = 0;
else if(null == a.to)
nRes = 1;
else if(null == b.to)
nRes = -1;
}
else
{
if(bRow)
{
if(bAsc)
nRes = a.to.r1 - b.to.r1;
else
nRes = b.to.r1 - a.to.r1;
}
else
{
if(bAsc)
nRes = a.to.c1 - b.to.c1;
else
nRes = b.to.c1 - a.to.c1;
}
}
return nRes;
},
shift : function(bbox, bAdd, bHor, oGetRes) shift : function(bbox, bAdd, bHor, oGetRes)
{ {
var _this = this;
if(null == oGetRes) if(null == oGetRes)
oGetRes = this.shiftGet(bbox, bHor); oGetRes = this.shiftGet(bbox, bHor);
var aToChange = []; var aToChange = [];
...@@ -3943,16 +3975,16 @@ RangeDataManager.prototype = { ...@@ -3943,16 +3975,16 @@ RangeDataManager.prototype = {
if(bHor) if(bHor)
{ {
if(bAdd) if(bAdd)
aToChange.sort(function(a, b){return b.to.c1 - a.to.c1;}); aToChange.sort(function(a, b){return _this.shiftSort(a, b, false, false);});
else else
aToChange.sort(function(a, b){return a.to.c1 - b.to.c1;}); aToChange.sort(function(a, b){return _this.shiftSort(a, b, true, false);});
} }
else else
{ {
if(bAdd) if(bAdd)
aToChange.sort(function(a, b){return b.to.r1 - a.to.r1;}); aToChange.sort(function(a, b){return _this.shiftSort(a, b, false, true);});
else else
aToChange.sort(function(a, b){return a.to.r1 - b.to.r1;}); aToChange.sort(function(a, b){return _this.shiftSort(a, b, true, true);});
} }
for(var i = 0, length = aToChange.length; i < length; ++i) for(var i = 0, length = aToChange.length; i < length; ++i)
{ {
...@@ -4085,7 +4117,7 @@ CellArea.prototype = { ...@@ -4085,7 +4117,7 @@ CellArea.prototype = {
else else
{ {
var bboxAsc = Asc.Range(bbox.c1, bbox.r1, bbox.c2, bbox.r2); var bboxAsc = Asc.Range(bbox.c1, bbox.r1, bbox.c2, bbox.r2);
if(!bboxAsc.contains(elem.col, elem.row)) if(!bboxAsc.containsRange(elem.bbox))
{ {
to = elem.bbox.clone(); to = elem.bbox.clone();
if(bHor) if(bHor)
......
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