Commit 2c4454ac authored by Sergey.Luzyanin's avatar Sergey.Luzyanin Committed by Alexander.Trofimov

Bug 27937 - Запретить изменять диаграмму на stock через правый тулбар

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61191 954022d7-b5bf-4e40-9824-e11837661b57
parent 45a259d8
......@@ -47,6 +47,26 @@ function checkInternalSelection(selection)
return !!(selection.groupSelection || selection.chartSelection || selection.textSelection);
}
function CheckStockChart(oDrawingObjects, oApi)
{
var selectedObjectsByType = oDrawingObjects.getSelectedObjectsByTypes();
if(selectedObjectsByType.charts[0])
{
var chartSpace = selectedObjectsByType.charts[0];
if(chartSpace && chartSpace.chart && chartSpace.chart.plotArea && chartSpace.chart.plotArea.charts[0] && chartSpace.chart.plotArea.charts[0].getObjectType() !== historyitem_type_StockChart)
{
if(chartSpace.chart.plotArea.charts[0].series.length !== 4)
{
oApi.asc_fireCallback("asc_onError", c_oAscError.ID.StockChartError, c_oAscError.Level.NoCritical);
oApi.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
return false;
}
}
}
return true;
}
function CheckLinePreset(preset)
{
return preset === "line";
......
......@@ -3201,6 +3201,13 @@ asc_docs_api.prototype.asc_setChartTranslate = function(translate) {
asc_docs_api.prototype.ChartApply = function(obj)
{
if(obj.ChartProperties && obj.ChartProperties.type === c_oAscChartTypeSettings.stock && this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage])
{
if(!CheckStockChart(this.WordControl.m_oLogicDocument.Slides[this.WordControl.m_oLogicDocument.CurPage].graphicObjects, this))
{
return;
}
}
this.WordControl.m_oLogicDocument.ChartApply(obj);
}
asc_docs_api.prototype.set_Size = function(width, height){
......
......@@ -5329,19 +5329,9 @@ asc_docs_api.prototype.ImgApply = function(obj)
/*проверка корректности данных для биржевой диаграммы*/
if(obj.ChartProperties && obj.ChartProperties.type === c_oAscChartTypeSettings.stock)
{
var selectedObjectsByType = LogicDocument.DrawingObjects.getSelectedObjectsByTypes();
if(selectedObjectsByType.charts[0])
if(!CheckStockChart(this.WordControl.m_oLogicDocument.DrawingObjects, this))
{
var chartSpace = selectedObjectsByType.charts[0];
if(chartSpace && chartSpace.chart && chartSpace.chart.plotArea && chartSpace.chart.plotArea.charts[0] && chartSpace.chart.plotArea.charts[0].getObjectType() !== historyitem_type_StockChart)
{
if(chartSpace.chart.plotArea.charts[0].series.length !== 4)
{
this.asc_fireCallback("asc_onError", c_oAscError.ID.StockChartError, c_oAscError.Level.NoCritical);
this.WordControl.m_oLogicDocument.Document_UpdateInterfaceState();
return;
}
}
return;
}
}
......@@ -7551,11 +7541,11 @@ function _onOpenCommand(fCallback, incomeObject) {
}
function _downloadAs(editor, filetype, fCallback, bStart, sSaveKey) {
var oAdditionalData = {};
oAdditionalData["c"] = "save";
oAdditionalData["c"] = "sfct";
oAdditionalData["id"] = documentId;
oAdditionalData["userid"] = documentUserId;
oAdditionalData["vkey"] = documentVKey;
oAdditionalData["outputformat"] = filetype;
oAdditionalData["outputformat"] = 0x1001;
if (null != sSaveKey)
oAdditionalData["savekey"] = sSaveKey;
if (c_oAscFileType.PDF === filetype) {
......
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