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