Commit 63bf7c9b authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

Bug 26663 - Скрытые значения фильтрованного диапазона учитываются при построении диаграммы

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@58529 954022d7-b5bf-4e40-9824-e11837661b57
parent 9d159686
......@@ -226,7 +226,7 @@ ChartPreviewManager.prototype.getChartByType = function(type)
var settings = new asc_ChartSettings();
settings.type = type;
var chartSeries = {series: this.getAscChartSeriesDefault(type), parsedHeaders: {bLeft: true, bTop: true}};
var chart_space = DrawingObjectsController.prototype._getChartSpace(chartSeries, settings);
var chart_space = DrawingObjectsController.prototype._getChartSpace(chartSeries, settings, true);
if(window["Asc"]["editor"])
{
......
......@@ -2945,41 +2945,41 @@ DrawingObjectsController.prototype =
ret.type = calc_chart_type;
return ret;
},
_getChartSpace: function (chartSeries, options) {
_getChartSpace: function (chartSeries, options, bUseCache) {
switch (options.type) {
case c_oAscChartTypeSettings.lineNormal:
case c_oAscChartTypeSettings.lineNormalMarker:
return CreateLineChart(chartSeries, GROUPING_STANDARD);
return CreateLineChart(chartSeries, GROUPING_STANDARD, bUseCache);
case c_oAscChartTypeSettings.lineStacked:
case c_oAscChartTypeSettings.lineStackedMarker:
return CreateLineChart(chartSeries, GROUPING_STACKED);
return CreateLineChart(chartSeries, GROUPING_STACKED, bUseCache);
case c_oAscChartTypeSettings.lineStackedPer:
case c_oAscChartTypeSettings.lineStackedPerMarker:
return CreateLineChart(chartSeries, GROUPING_PERCENT_STACKED);
return CreateLineChart(chartSeries, GROUPING_PERCENT_STACKED, bUseCache);
case c_oAscChartTypeSettings.barNormal:
return CreateBarChart(chartSeries, BAR_GROUPING_CLUSTERED);
return CreateBarChart(chartSeries, BAR_GROUPING_CLUSTERED, bUseCache);
case c_oAscChartTypeSettings.barStacked:
return CreateBarChart(chartSeries, BAR_GROUPING_STACKED);
return CreateBarChart(chartSeries, BAR_GROUPING_STACKED, bUseCache);
case c_oAscChartTypeSettings.barStackedPer:
return CreateBarChart(chartSeries, BAR_GROUPING_PERCENT_STACKED);
return CreateBarChart(chartSeries, BAR_GROUPING_PERCENT_STACKED, bUseCache);
case c_oAscChartTypeSettings.hBarNormal:
return CreateHBarChart(chartSeries, BAR_GROUPING_CLUSTERED);
return CreateHBarChart(chartSeries, BAR_GROUPING_CLUSTERED, bUseCache);
case c_oAscChartTypeSettings.hBarStacked:
return CreateHBarChart(chartSeries, BAR_GROUPING_STACKED);
return CreateHBarChart(chartSeries, BAR_GROUPING_STACKED, bUseCache);
case c_oAscChartTypeSettings.hBarStackedPer:
return CreateHBarChart(chartSeries, BAR_GROUPING_PERCENT_STACKED);
return CreateHBarChart(chartSeries, BAR_GROUPING_PERCENT_STACKED, bUseCache);
case c_oAscChartTypeSettings.areaNormal:
return CreateAreaChart(chartSeries, GROUPING_STANDARD);
return CreateAreaChart(chartSeries, GROUPING_STANDARD, bUseCache);
case c_oAscChartTypeSettings.areaStacked:
return CreateAreaChart(chartSeries, GROUPING_STACKED);
return CreateAreaChart(chartSeries, GROUPING_STACKED, bUseCache);
case c_oAscChartTypeSettings.areaStackedPer:
return CreateAreaChart(chartSeries, GROUPING_PERCENT_STACKED);
return CreateAreaChart(chartSeries, GROUPING_PERCENT_STACKED, bUseCache);
case c_oAscChartTypeSettings.stock:
return CreateStockChart(chartSeries);
return CreateStockChart(chartSeries, bUseCache);
case c_oAscChartTypeSettings.doughnut:
return CreatePieChart(chartSeries, true);
return CreatePieChart(chartSeries, true, bUseCache);
case c_oAscChartTypeSettings.pie:
return CreatePieChart(chartSeries, false);
return CreatePieChart(chartSeries, false, bUseCache);
case c_oAscChartTypeSettings.scatter:
case c_oAscChartTypeSettings.scatterLine:
case c_oAscChartTypeSettings.scatterLineMarker:
......@@ -2987,7 +2987,7 @@ DrawingObjectsController.prototype =
case c_oAscChartTypeSettings.scatterNone:
case c_oAscChartTypeSettings.scatterSmooth:
case c_oAscChartTypeSettings.scatterSmoothMarker:
return CreateScatterChart(chartSeries);
return CreateScatterChart(chartSeries, bUseCache);
// radar return CreateRadarChart(chartSeries);
}
......@@ -3017,7 +3017,7 @@ DrawingObjectsController.prototype =
}
else if(isRealObject(chart))
{
ret = DrawingObjectsController.prototype._getChartSpace.call(this, chart, options);
ret = DrawingObjectsController.prototype._getChartSpace.call(this, chart, options, true);
ret.setBDeleted(false);
ret.setStyle(2);
ret.setSpPr(new CSpPr());
......
......@@ -11978,7 +11978,7 @@ CPageSetup.prototype =
};
function CreateLineChart(chartSeries, type)
function CreateLineChart(chartSeries, type, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12039,16 +12039,19 @@ function CreateLineChart(chartSeries, type)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
{
......@@ -12057,16 +12060,19 @@ function CreateLineChart(chartSeries, type)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache && typeof asc_series[i].TxCache.Formula === "string" && asc_series[i].TxCache.Formula.length > 0)
......@@ -12076,13 +12082,16 @@ function CreateLineChart(chartSeries, type)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
line_chart.addSer(series);
}
......@@ -12143,7 +12152,7 @@ function CreateLineChart(chartSeries, type)
return chart_space;
}
function CreateBarChart(chartSeries, type)
function CreateBarChart(chartSeries, type, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12192,16 +12201,19 @@ function CreateBarChart(chartSeries, type)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
{
......@@ -12210,16 +12222,19 @@ function CreateBarChart(chartSeries, type)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache && typeof asc_series[i].TxCache.Formula === "string" && asc_series[i].TxCache.Formula.length > 0)
......@@ -12229,13 +12244,16 @@ function CreateBarChart(chartSeries, type)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
bar_chart.addSer(series);
}
......@@ -12300,7 +12318,7 @@ function CreateBarChart(chartSeries, type)
return chart_space;
}
function CreateHBarChart(chartSeries, type)
function CreateHBarChart(chartSeries, type, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12347,16 +12365,19 @@ function CreateHBarChart(chartSeries, type)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
......@@ -12366,16 +12387,19 @@ function CreateHBarChart(chartSeries, type)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache && typeof asc_series[i].TxCache.Formula === "string" && asc_series[i].TxCache.Formula.length > 0)
......@@ -12385,13 +12409,16 @@ function CreateHBarChart(chartSeries, type)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
bar_chart.addSer(series);
......@@ -12462,7 +12489,7 @@ function CreateHBarChart(chartSeries, type)
return chart_space;
}
function CreateAreaChart(chartSeries, type)
function CreateAreaChart(chartSeries, type, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12509,16 +12536,19 @@ function CreateAreaChart(chartSeries, type)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
......@@ -12528,16 +12558,19 @@ function CreateAreaChart(chartSeries, type)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache && typeof asc_series[i].TxCache.Formula === "string" && asc_series[i].TxCache.Formula.length > 0)
......@@ -12547,13 +12580,16 @@ function CreateAreaChart(chartSeries, type)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
area_chart.addSer(series);
......@@ -12620,7 +12656,7 @@ function CreateAreaChart(chartSeries, type)
return chart_space;
}
function CreatePieChart(chartSeries, bDoughnut)
function CreatePieChart(chartSeries, bDoughnut, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12648,16 +12684,19 @@ function CreatePieChart(chartSeries, bDoughnut)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
......@@ -12667,16 +12706,19 @@ function CreatePieChart(chartSeries, bDoughnut)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache && typeof asc_series[i].TxCache.Formula === "string" && asc_series[i].TxCache.Formula.length > 0)
......@@ -12686,13 +12728,16 @@ function CreatePieChart(chartSeries, bDoughnut)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
pie_chart.addSer(series);
......@@ -12726,7 +12771,7 @@ function CreatePieChart(chartSeries, bDoughnut)
return chart_space;
}
function CreateScatterChart(chartSeries)
function CreateScatterChart(chartSeries, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12773,16 +12818,19 @@ function CreateScatterChart(chartSeries)
x_val.setNumRef(new CNumRef());
var num_ref = x_val.numRef;
num_ref.setF(first_series.Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(first_series.Val.NumCache.length);
for(var j = 0; j < first_series.Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(first_series.Val.NumCache[j].numFormatStr);
pt.setVal(first_series.Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(first_series.Val.NumCache.length);
for(var j = 0; j < first_series.Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(first_series.Val.NumCache[j].numFormatStr);
pt.setVal(first_series.Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
}
series.setYVal(new CYVal());
......@@ -12790,16 +12838,19 @@ function CreateScatterChart(chartSeries)
y_val.setNumRef(new CNumRef());
var num_ref = y_val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
//if(parsedHeaders.bTop)
//{
......@@ -12879,15 +12930,10 @@ function CreateScatterChart(chartSeries)
page_margins.setT(0.75);
page_margins.setHeader(0.3);
page_margins.setFooter(0.3);
return chart_space;
}
function CreateStockChart(chartSeries)
function CreateStockChart(chartSeries, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -12949,16 +12995,19 @@ function CreateStockChart(chartSeries)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
......@@ -12971,21 +13020,24 @@ function CreateStockChart(chartSeries)
cat.setNumRef(new CNumRef());
var num_ref = cat.numRef;
num_ref.setF(asc_series[i].Cat.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
num_cache.setPtCount(cat_num_cache.length);
num_cache.setFormatCode(asc_series[i].Cat.formatCode);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setVal(cat_num_cache[j].val);
if(cat_num_cache[j].numFormatStr !== asc_series[i].Cat.formatCode)
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
num_cache.setPtCount(cat_num_cache.length);
num_cache.setFormatCode(asc_series[i].Cat.formatCode);
for(var j= 0; j < cat_num_cache.length; ++j)
{
pt.setFormatCode(cat_num_cache[j].numFormatStr);
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setVal(cat_num_cache[j].val);
if(cat_num_cache[j].numFormatStr !== asc_series[i].Cat.formatCode)
{
pt.setFormatCode(cat_num_cache[j].numFormatStr);
}
num_cache.addPt(pt);
}
num_cache.addPt(pt);
}
}
else
......@@ -12993,16 +13045,19 @@ function CreateStockChart(chartSeries)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
......@@ -13014,13 +13069,16 @@ function CreateStockChart(chartSeries)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
line_chart.addSer(series);
......@@ -13164,7 +13222,7 @@ function CreateScatterAxis()
return {valAx: val_ax, catAx: cat_ax};
}
function CreateRadarChart(chartSeries)
function CreateRadarChart(chartSeries, bUseCache)
{
var asc_series = chartSeries.series;
var chart_space = new CChartSpace();
......@@ -13209,16 +13267,19 @@ function CreateRadarChart(chartSeries)
val.setNumRef(new CNumRef());
var num_ref = val.numRef;
num_ref.setF(asc_series[i].Val.Formula);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
if(bUseCache)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
num_ref.setNumCache(new CNumLit());
var num_cache = num_ref.numCache;
num_cache.setPtCount(asc_series[i].Val.NumCache.length);
for(var j = 0; j < asc_series[i].Val.NumCache.length; ++j)
{
var pt = new CNumericPoint();
pt.setIdx(j);
pt.setFormatCode(asc_series[i].Val.NumCache[j].numFormatStr);
pt.setVal(asc_series[i].Val.NumCache[j].val);
num_cache.addPt(pt);
}
}
if(parsedHeaders.bTop)
{
......@@ -13227,17 +13288,21 @@ function CreateRadarChart(chartSeries)
cat.setStrRef(new CStrRef());
var str_ref = cat.strRef;
str_ref.setF(asc_series[i].Cat.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
if(bUseCache)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
var cat_num_cache = asc_series[i].Cat.NumCache;
str_cache.setPtCount(cat_num_cache.length);
for(var j= 0; j < cat_num_cache.length; ++j)
{
var string_pt = new CStringPoint();
string_pt.setIdx(j);
string_pt.setVal(cat_num_cache[j].val);
str_cache.addPt(string_pt);
}
}
}
if(parsedHeaders.bLeft && asc_series[i].TxCache && typeof asc_series[i].TxCache.Formula === "string" && asc_series[i].TxCache.Formula.length > 0)
{
......@@ -13246,13 +13311,16 @@ function CreateRadarChart(chartSeries)
tx.setStrRef(new CStrRef());
var str_ref = tx.strRef;
str_ref.setF(asc_series[i].TxCache.Formula);
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
if(bUseCache)
{
str_ref.setStrCache(new CStrCache());
var str_cache = str_ref.strCache;
str_cache.setPtCount(1);
str_cache.addPt(new CStringPoint());
var pt = str_cache.pt[0];
pt.setIdx(0);
pt.setVal(asc_series[i].TxCache.Tx);
}
}
bar_chart.addSer(series);
}
......
......@@ -507,7 +507,10 @@ function BinaryPPTYLoader()
var _sl_count = s.GetULong();
for (var i = 0; i < _sl_count; i++)
{
this.presentation.slideLayouts[i] = this.ReadSlideLayout();
this.presentation.slideLayouts[i].setSlideSize(this.presentation.Width, this.presentation.Height);
}
}
if (!this.IsThemeLoader)
......@@ -519,7 +522,10 @@ function BinaryPPTYLoader()
var _s_count = s.GetULong();
for (var i = 0; i < _s_count; i++)
{
this.presentation.insertSlide(i, this.ReadSlide(i)) ;
this.presentation.Slides[i].setSlideSize(this.presentation.Width, this.presentation.Height);
}
}
if (undefined != _main_tables["25"])
......
......@@ -2552,7 +2552,7 @@ CPresentation.prototype =
this.Width = Data.oldW;
this.Height = Data.oldH;
this.changeSlideSizeFunction(kw, kh);
this.changeSlideSizeFunction(this.Width, this.Height);
editor.asc_fireCallback("asc_onPresentationSize", this.Width, this.Height);
break;
......@@ -2595,7 +2595,7 @@ CPresentation.prototype =
var kh = Data.newH/this.Height;
this.Width = Data.newW;
this.Height = Data.newH;
this.changeSlideSizeFunction(kw, kh);
this.changeSlideSizeFunction(this.Width, this.Height);
editor.asc_fireCallback("asc_onPresentationSize", this.Width, this.Height);
break;
}
......@@ -3056,15 +3056,10 @@ CPresentation.prototype =
_new_master.presentation = this;
var _master_width = _new_master.Width;
var _master_height = _new_master.Height;
if(_master_height !== this.Height || _master_width !== this.Width)
themeInfo.Master.changeSize(this.Width, this.Height);
for(i = 0; i < themeInfo.Master.sldLayoutLst.length; ++i)
{
var kw = this.Width/_master_width;
var kh = this.Height/_master_height;
themeInfo.Master.changeSize(kw, kh);
for(i = 0; i < themeInfo.Master.sldLayoutLst.length; ++i)
{
themeInfo.Master.sldLayoutLst[i].changeSize(kw, kh);
}
themeInfo.Master.sldLayoutLst[i].changeSize(this.Width, this.Height);
}
var slides_array = [];
for(i = 0; i < arr_ind.length; ++i)
......@@ -3092,22 +3087,22 @@ CPresentation.prototype =
this.Document_UpdateInterfaceState();
},
changeSlideSizeFunction: function(kw, kh)
changeSlideSizeFunction: function(width, height)
{
ExecuteNoHistory(function()
{
for(var i = 0; i < this.slideMasters.length; ++i)
{
this.slideMasters[i].changeSize(kw, kh);
this.slideMasters[i].changeSize(width, height);
var master = this.slideMasters[i];
for(var j = 0; j < master.sldLayoutLst.length; ++j)
{
master.sldLayoutLst[j].changeSize(kw, kh);
master.sldLayoutLst[j].changeSize(width, height);
}
}
for(var i = 0; i < this.Slides.length; ++i)
{
this.Slides[i].changeSize(kw, kh);
this.Slides[i].changeSize(width, height);
}
}, this, []);
},
......@@ -3118,11 +3113,9 @@ CPresentation.prototype =
{
History.Create_NewPoint();
History.Add(this, {Type: historyitem_Presentation_SlideSize, oldW: this.Width, newW: width, oldH: this.Height, newH: height});
var kw = width/this.Width;
var kh = height/this.Height;
this.Width = width;
this.Height = height;
this.changeSlideSizeFunction(kw, kh);
this.changeSlideSizeFunction(this.Width, this.Height);
this.Recalculate();
}
},
......@@ -3543,9 +3536,8 @@ CPresentation.prototype =
this.Height = h;
CollaborativeEditing.ScaleX = kw;
CollaborativeEditing.ScaleY = kh;
this.changeSlideSizeFunction(kw, kh);
this.changeSlideSizeFunction(this.Width, this.Height);
editor.asc_fireCallback("asc_onPresentationSize", this.Width, this.Height);
break;
}
case historyitem_Presentation_AddSlideMaster:
......
......@@ -755,9 +755,10 @@ Slide.prototype =
}
},
changeSize: function(kw, kh)
changeSize: function(width, height)
{
this.setSlideSize(this.Width*kw, this.Height*kh);
var kw = width/this.Width, kh = height/this.Height;
this.setSlideSize(width, height);
for(var i = 0; i < this.cSld.spTree.length; ++i)
{
this.cSld.spTree[i].changeSize(kw, kh);
......
......@@ -212,6 +212,8 @@ CHistory.prototype =
this.Points[this.Index].Items.push( Item );
var bZIndexManager = !(typeof ZIndexManager === "undefined");
var bPresentation = !(typeof CPresentation === "undefined");
var bSlide = !(typeof Slide === "undefined");
if ( ( Class instanceof CDocument && ( historyitem_Document_AddItem === Data.Type || historyitem_Document_RemoveItem === Data.Type ) ) ||
( Class instanceof CDocumentContent && ( historyitem_DocumentContent_AddItem === Data.Type || historyitem_DocumentContent_RemoveItem === Data.Type ) ) ||
( Class instanceof CTable && ( historyitem_Table_AddRow === Data.Type || historyitem_Table_RemoveRow === Data.Type ) ) ||
......@@ -219,7 +221,10 @@ CHistory.prototype =
( Class instanceof Paragraph && ( historyitem_Paragraph_AddItem === Data.Type || historyitem_Paragraph_RemoveItem === Data.Type ) ) ||
( Class instanceof ParaHyperlink && ( historyitem_Hyperlink_AddItem === Data.Type || historyitem_Hyperlink_RemoveItem === Data.Type ) ) ||
( Class instanceof ParaRun && ( historyitem_ParaRun_AddItem === Data.Type || historyitem_ParaRun_RemoveItem === Data.Type ) ) ||
( bZIndexManager && Class instanceof ZIndexManager && (historyitem_ZIndexManagerRemoveItem === Data.Type || historyitem_ZIndexManagerAddItem === Data.Type )))
( bZIndexManager && Class instanceof ZIndexManager && (historyitem_ZIndexManagerRemoveItem === Data.Type || historyitem_ZIndexManagerAddItem === Data.Type )) ||
( bPresentation && Class instanceof CPresentation && (historyitem_Presentation_AddSlide === Data.Type || historyitem_Presentation_RemoveSlide === Data.Type)) ||
( bSlide && Class instanceof Slide && (historyitem_SlideAddToSpTree === Data.Type || historyitem_SlideRemoveFromSpTree === Data.Type))
)
{
var bAdd = ( ( Class instanceof CDocument && historyitem_Document_AddItem === Data.Type ) ||
( Class instanceof CDocumentContent && historyitem_DocumentContent_AddItem === Data.Type ) ||
......@@ -228,7 +233,9 @@ CHistory.prototype =
( Class instanceof Paragraph && historyitem_Paragraph_AddItem === Data.Type ) ||
( Class instanceof ParaHyperlink && historyitem_Hyperlink_AddItem === Data.Type ) ||
( Class instanceof ParaRun && historyitem_ParaRun_AddItem === Data.Type ) ||
(bZIndexManager && Class instanceof ZIndexManager && historyitem_ZIndexManagerAddItem === Data.Type )
(bZIndexManager && Class instanceof ZIndexManager && historyitem_ZIndexManagerAddItem === Data.Type ) ||
( bPresentation && Class instanceof CPresentation && (historyitem_Presentation_AddSlide === Data.Type )) ||
( bSlide && Class instanceof Slide && (historyitem_SlideAddToSpTree === Data.Type))
) ? true : false;
var Count = 1;
......
......@@ -22,7 +22,7 @@ Paragraph.prototype.Recalculate_FastWholeParagraph = function()
return [];
// Если изменения происходят в специальном пустом параграфе-конце секции, тогда запускаем обычный пересчет
if (true === this.LogicDocument.Pages[this.Get_StartPage_Absolute()].Check_EndSectionPara(this))
if ( this.LogicDocument && true === this.LogicDocument.Pages[this.Get_StartPage_Absolute()].Check_EndSectionPara(this))
return [];
// Здесь мы отдельно обрабатываем случаи быстрого пересчета параграфов, которые были разбиты на 1-2
......
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