Commit 81138dc2 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix chart ranges

fix move formula and chart ranges
parent d6a63849
...@@ -239,15 +239,14 @@ CHistory.prototype.UndoRedoPrepare = function (oRedoObjectParam, bUndo) { ...@@ -239,15 +239,14 @@ CHistory.prototype.UndoRedoPrepare = function (oRedoObjectParam, bUndo) {
else else
this.workbook.bRedoChanges = true; this.workbook.bRedoChanges = true;
if(!window["NATIVE_EDITOR_ENJINE"]) { if (!window["NATIVE_EDITOR_ENJINE"]) {
var wsViews = Asc["editor"].wb.wsViews; var wsViews = Asc["editor"].wb.wsViews;
for (var i = 0; i < wsViews.length; ++i) { for (var i = 0; i < wsViews.length; ++i) {
if (wsViews[i] && wsViews[i].objectRender && wsViews[i].objectRender.controller) { if (wsViews[i]) {
wsViews[i].objectRender.controller.resetSelection(undefined, true); if (wsViews[i].objectRender && wsViews[i].objectRender.controller) {
} wsViews[i].objectRender.controller.resetSelection(undefined, true);
if (wsViews[i] && wsViews[i].isChartAreaEditMode ) { }
wsViews[i].isChartAreaEditMode = false; wsViews[i].endEditChart();
wsViews[i].arrActiveChartsRanges = [];
} }
} }
} }
......
...@@ -2927,28 +2927,27 @@ Workbook.prototype.DeserializeHistory = function(aChanges, fCallback){ ...@@ -2927,28 +2927,27 @@ Workbook.prototype.DeserializeHistory = function(aChanges, fCallback){
if(oThis.oApi.collaborativeEditing.getFast()){ if(oThis.oApi.collaborativeEditing.getFast()){
AscCommon.CollaborativeEditing.Clear_DocumentPositions(); AscCommon.CollaborativeEditing.Clear_DocumentPositions();
} }
for(var i in wsViews) for (var i in wsViews) {
{ if (isRealObject(wsViews[i]) && isRealObject(wsViews[i].objectRender) &&
if(isRealObject(wsViews[i]) && isRealObject(wsViews[i].objectRender) && isRealObject(wsViews[i].objectRender.controller)) isRealObject(wsViews[i].objectRender.controller)) {
{ wsViews[i].endEditChart();
if ( wsViews[i].isChartAreaEditMode ) { if (oThis.oApi.collaborativeEditing.getFast()) {
wsViews[i].isChartAreaEditMode = false; var oState = wsViews[i].objectRender.saveStateBeforeLoadChanges();
wsViews[i].arrActiveChartsRanges = []; if (oState) {
} if (oState.Pos) {
if(oThis.oApi.collaborativeEditing.getFast()){ AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.Pos);
var oState = wsViews[i].objectRender.saveStateBeforeLoadChanges(); }
if(oState){ if (oState.StartPos) {
if (oState.Pos) AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.StartPos);
AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.Pos); }
if (oState.StartPos) if (oState.EndPos) {
AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.StartPos); AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.EndPos);
if (oState.EndPos) }
AscCommon.CollaborativeEditing.Add_DocumentPosition(oState.EndPos); }
} }
} wsViews[i].objectRender.controller.resetSelection();
wsViews[i].objectRender.controller.resetSelection(); }
} }
}
oFormulaLocaleInfo.Parse = false; oFormulaLocaleInfo.Parse = false;
oFormulaLocaleInfo.DigitSep = false; oFormulaLocaleInfo.DigitSep = false;
History.Clear(); History.Clear();
...@@ -3008,14 +3007,10 @@ Workbook.prototype.DeserializeHistoryNative = function(oRedoObjectParam, data, i ...@@ -3008,14 +3007,10 @@ Workbook.prototype.DeserializeHistoryNative = function(oRedoObjectParam, data, i
if(null == oRedoObjectParam) if(null == oRedoObjectParam)
{ {
var wsViews = window["Asc"]["editor"].wb.wsViews; var wsViews = window["Asc"]["editor"].wb.wsViews;
for(var i in wsViews) for (var i in wsViews) {
{ if (isRealObject(wsViews[i]) && isRealObject(wsViews[i].objectRender) &&
if(isRealObject(wsViews[i]) && isRealObject(wsViews[i].objectRender) && isRealObject(wsViews[i].objectRender.controller)) isRealObject(wsViews[i].objectRender.controller)) {
{ wsViews[i].endEditChart();
if ( wsViews[i].isChartAreaEditMode ) {
wsViews[i].isChartAreaEditMode = false;
wsViews[i].arrActiveChartsRanges = [];
}
wsViews[i].objectRender.controller.resetSelection(); wsViews[i].objectRender.controller.resetSelection();
} }
} }
......
...@@ -607,7 +607,7 @@ ...@@ -607,7 +607,7 @@
if (!d) return; if (!d) return;
t.scroll(d); t.scroll(d);
asc_applyFunction(callback); asc_applyFunction(callback);
}, event.metaKey || event.ctrlKey); });
}; };
/** /**
......
...@@ -1154,9 +1154,9 @@ ...@@ -1154,9 +1154,9 @@
}; };
// Обработка перемещения диапазона // Обработка перемещения диапазона
WorkbookView.prototype._onMoveRangeHandle = function(x, y, callback, ctrlKey) { WorkbookView.prototype._onMoveRangeHandle = function(x, y, callback) {
var ws = this.getWorksheet(); var ws = this.getWorksheet();
var d = ws.changeSelectionMoveRangeHandle(x, y, ctrlKey); var d = ws.changeSelectionMoveRangeHandle(x, y);
asc_applyFunction(callback, d); asc_applyFunction(callback, d);
}; };
......
This diff is collapsed.
...@@ -2494,10 +2494,7 @@ function DrawingObjects() { ...@@ -2494,10 +2494,7 @@ function DrawingObjects() {
aObjects.length = 0; aObjects.length = 0;
var listRange = new AscCommonExcel.Range(worksheet.model, 0, 0, worksheet.nRowsCount - 1, worksheet.nColsCount - 1); var listRange = new AscCommonExcel.Range(worksheet.model, 0, 0, worksheet.nRowsCount - 1, worksheet.nColsCount - 1);
listRange.cleanAll(); listRange.cleanAll();
if ( worksheet.isChartAreaEditMode ) { worksheet.endEditChart();
worksheet.isChartAreaEditMode = false;
worksheet.arrActiveChartsRanges = [];
}
var asc_chart_binary = new Asc.asc_CChartBinary(); var asc_chart_binary = new Asc.asc_CChartBinary();
asc_chart_binary.asc_setBinary(chart["binary"]); asc_chart_binary.asc_setBinary(chart["binary"]);
asc_chart_binary.asc_setThemeBinary(chart["themeBinary"]); asc_chart_binary.asc_setThemeBinary(chart["themeBinary"]);
...@@ -3515,7 +3512,7 @@ function DrawingObjects() { ...@@ -3515,7 +3512,7 @@ function DrawingObjects() {
if ( aObjects[i].graphicObject.Id == graphicId ) { if ( aObjects[i].graphicObject.Id == graphicId ) {
aObjects[i].graphicObject.deselect(_this.controller); aObjects[i].graphicObject.deselect(_this.controller);
if ( aObjects[i].isChart() ) if ( aObjects[i].isChart() )
worksheet.arrActiveChartsRanges = []; worksheet.endEditChart();
aObjects.splice(i, 1); aObjects.splice(i, 1);
bRedraw = true; bRedraw = true;
position = i; position = i;
...@@ -3940,7 +3937,7 @@ function DrawingObjects() { ...@@ -3940,7 +3937,7 @@ function DrawingObjects() {
_this.selectDrawingObjectRange = function(drawing) { _this.selectDrawingObjectRange = function(drawing) {
worksheet.cleanSelection(); worksheet.cleanSelection();
worksheet.arrActiveChartsRanges = []; worksheet.endEditChart();
if(!drawing.bbox || drawing.bbox.worksheet !== worksheet.model) if(!drawing.bbox || drawing.bbox.worksheet !== worksheet.model)
return; return;
...@@ -3961,17 +3958,13 @@ function DrawingObjects() { ...@@ -3961,17 +3958,13 @@ function DrawingObjects() {
} }
var BB = drawing.bbox.seriesBBox; var BB = drawing.bbox.seriesBBox;
var range = asc.Range(BB.c1, BB.r1, BB.c2, BB.r2, true); var range = asc.Range(BB.c1, BB.r1, BB.c2, BB.r2, true);
worksheet.arrActiveChartsRanges.push(range); worksheet.setChartRange(range);
worksheet.isChartAreaEditMode = true; worksheet._drawSelection();
worksheet._drawSelection();
}; };
_this.unselectDrawingObjects = function() { _this.unselectDrawingObjects = function() {
if ( worksheet.isChartAreaEditMode ) { worksheet.endEditChart();
worksheet.isChartAreaEditMode = false;
worksheet.arrActiveChartsRanges = [];
}
_this.controller.resetSelectionState(); _this.controller.resetSelectionState();
_this.OnUpdateOverlay(); _this.OnUpdateOverlay();
}; };
......
...@@ -813,7 +813,7 @@ DrawingObjectsController.prototype = ...@@ -813,7 +813,7 @@ DrawingObjectsController.prototype =
} }
this.chartForProps = this.getSelectionState(); this.chartForProps = this.getSelectionState();
this.resetSelection(); this.resetSelection();
this.drawingObjects.getWorksheet().arrActiveChartsRanges = []; this.drawingObjects.getWorksheet().endEditChart();
var oldIsStartAdd = window["Asc"]["editor"].isStartAddShape; var oldIsStartAdd = window["Asc"]["editor"].isStartAddShape;
window["Asc"]["editor"].isStartAddShape = true; window["Asc"]["editor"].isStartAddShape = true;
this.updateOverlay(); this.updateOverlay();
...@@ -4620,7 +4620,7 @@ DrawingObjectsController.prototype = ...@@ -4620,7 +4620,7 @@ DrawingObjectsController.prototype =
var worksheet = this.drawingObjects.getWorksheet(); var worksheet = this.drawingObjects.getWorksheet();
if(worksheet) if(worksheet)
{ {
worksheet.arrActiveChartsRanges = []; worksheet.endEditChart();
} }
if(this.selection.groupSelection) if(this.selection.groupSelection)
{ {
......
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