Commit 866500bf authored by Alexander.Trofimov's avatar Alexander.Trofimov

Поправил чтение sqref. Поправил проверки.

parent 536980ce
...@@ -3605,13 +3605,13 @@ ...@@ -3605,13 +3605,13 @@
var oThis = this; var oThis = this;
for(var i = 0, length = aReplies.length; i < length; ++i) for(var i = 0, length = aReplies.length; i < length; ++i)
this.bs.WriteItem( c_oSer_CommentData.Reply, function(){oThis.WriteCommentData(aReplies[i]);}); this.bs.WriteItem( c_oSer_CommentData.Reply, function(){oThis.WriteCommentData(aReplies[i]);});
} };
this.WriteSparklineGroups = function(oSparklineGroups) this.WriteSparklineGroups = function(oSparklineGroups)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = oSparklineGroups.arrSparklineGroup.length; i < length; ++i) for(var i = 0, length = oSparklineGroups.arrSparklineGroup.length; i < length; ++i)
this.bs.WriteItem( c_oSer_Sparkline.SparklineGroup, function(){oThis.WriteSparklineGroup(oSparklineGroups.arrSparklineGroup[i]);}); this.bs.WriteItem( c_oSer_Sparkline.SparklineGroup, function(){oThis.WriteSparklineGroup(oSparklineGroups.arrSparklineGroup[i]);});
} };
this.WriteSparklineGroup = function(oSparklineGroup) this.WriteSparklineGroup = function(oSparklineGroup)
{ {
var oThis = this; var oThis = this;
...@@ -3697,23 +3697,22 @@ ...@@ -3697,23 +3697,22 @@
if (null != oSparklineGroup.arrSparklines) { if (null != oSparklineGroup.arrSparklines) {
this.bs.WriteItem(c_oSer_Sparkline.Sparklines, function(){oThis.WriteSparklines(oSparklineGroup);}); this.bs.WriteItem(c_oSer_Sparkline.Sparklines, function(){oThis.WriteSparklines(oSparklineGroup);});
} }
} };
this.WriteSparklines = function(oSparklineGroup) this.WriteSparklines = function(oSparklineGroup)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = oSparklineGroup.arrSparklines.length; i < length; ++i) for(var i = 0, length = oSparklineGroup.arrSparklines.length; i < length; ++i)
this.bs.WriteItem( c_oSer_Sparkline.Sparkline, function(){oThis.WriteSparkline(oSparklineGroup.arrSparklines[i]);}); this.bs.WriteItem( c_oSer_Sparkline.Sparkline, function(){oThis.WriteSparkline(oSparklineGroup.arrSparklines[i]);});
} };
this.WriteSparkline = function(oSparkline) this.WriteSparkline = function(oSparkline)
{ {
var oThis = this;
if (null != oSparkline.f) { if (null != oSparkline.f) {
this.memory.WriteByte(c_oSer_Sparkline.SparklineRef); this.memory.WriteByte(c_oSer_Sparkline.SparklineRef);
this.memory.WriteString2(oSparkline.f); this.memory.WriteString2(oSparkline.f);
} }
if (null != oSparkline.sqref) { if (null != oSparkline.sqref) {
this.memory.WriteByte(c_oSer_Sparkline.SparklineSqRef); this.memory.WriteByte(c_oSer_Sparkline.SparklineSqRef);
this.memory.WriteString2(oSparkline.sqref); this.memory.WriteString2(oSparkline.sqref.getName());
} }
} }
} }
...@@ -6628,12 +6627,11 @@ ...@@ -6628,12 +6627,11 @@
return res; return res;
}; };
this.ReadSparkline = function (type, length, oSparkline) { this.ReadSparkline = function (type, length, oSparkline) {
var oThis = this;
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
if (c_oSer_Sparkline.SparklineRef === type) { if (c_oSer_Sparkline.SparklineRef === type) {
oSparkline.f = this.stream.GetString2LE(length); oSparkline.f = this.stream.GetString2LE(length);
} else if (c_oSer_Sparkline.SparklineSqRef === type) { } else if (c_oSer_Sparkline.SparklineSqRef === type) {
oSparkline.sqref = this.stream.GetString2LE(length); oSparkline.setSqref(this.stream.GetString2LE(length));
} else } else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
......
...@@ -4456,7 +4456,7 @@ function sparklineGroup() { ...@@ -4456,7 +4456,7 @@ function sparklineGroup() {
this.rightToLeft = false; this.rightToLeft = false;
// elements // elements
this.colorSeries = null; // ToDo добавить значения по умолчанию this.colorSeries = null;
this.colorNegative = null; this.colorNegative = null;
this.colorAxis = null; this.colorAxis = null;
this.colorMarkers = null; this.colorMarkers = null;
...@@ -4464,7 +4464,7 @@ function sparklineGroup() { ...@@ -4464,7 +4464,7 @@ function sparklineGroup() {
this.colorLast = null; this.colorLast = null;
this.colorHigh = null; this.colorHigh = null;
this.colorLow = null; this.colorLow = null;
this.f = '??'; this.f = null;
this.arrSparklines = []; this.arrSparklines = [];
this.arrCachedSparklines = []; this.arrCachedSparklines = [];
} }
...@@ -4492,11 +4492,14 @@ sparklineGroup.prototype.updateCache = function(range) { ...@@ -4492,11 +4492,14 @@ sparklineGroup.prototype.updateCache = function(range) {
}; };
/** @constructor */ /** @constructor */
function sparkline() { function sparkline() {
this.sqref = '??'; // ToDo добавить значение по умолчанию this.sqref = null;
this.f = '??'; this.f = null;
} }
sparkline.prototype.setSqref = function(sqref) {
this.sqref = Asc.g_oRangeCache.getAscRange(sqref);
};
sparkline.prototype.checkInRange = function(range) { sparkline.prototype.checkInRange = function(range) {
range.intersectionSimple(this.sqref); return this.sqref ? range.isIntersect(this.sqref) : false;
}; };
// For Auto Filters // For Auto Filters
......
...@@ -369,7 +369,7 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -369,7 +369,7 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
var chart_space = DrawingObjectsController.prototype._getChartSpace(chartSeries, settings, true); var chart_space = DrawingObjectsController.prototype._getChartSpace(chartSeries, settings, true);
chart_space.setWorksheet(worksheetView.model); chart_space.setWorksheet(worksheetView.model);
this.chartSpace = chart_space; this.chartSpace = chart_space;
var oBBox = worksheetView.model.getCell2(oSparkline.sqref); var oBBox = oSparkline.sqref;
this.col = oBBox.c1; this.col = oBBox.c1;
this.row = oBBox.r1; this.row = oBBox.r1;
this.extX = worksheetView.getColumnWidth(oBBox.c1, 3); this.extX = worksheetView.getColumnWidth(oBBox.c1, 3);
......
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