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

Bug 25681 - Ошибка в консоли после вырезание диаграммы из группы и двойного...

Bug 25681 - Ошибка в консоли после вырезание диаграммы из группы и двойного undo; тормоза при изменении данных на листе

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57473 954022d7-b5bf-4e40-9824-e11837661b57
parent da5c151f
...@@ -2078,7 +2078,6 @@ function DrawingObjects() { ...@@ -2078,7 +2078,6 @@ function DrawingObjects() {
*****************************************/ *****************************************/
// Undo/Redo // Undo/Redo
_this.drawingDocument.CheckTargetShow();
if ( (worksheet.model.index != api.wb.model.getActive()) && !printOptions ) if ( (worksheet.model.index != api.wb.model.getActive()) && !printOptions )
return; return;
...@@ -2192,6 +2191,8 @@ function DrawingObjects() { ...@@ -2192,6 +2191,8 @@ function DrawingObjects() {
if ( _this.controller.selectedObjects.length ) if ( _this.controller.selectedObjects.length )
_this.OnUpdateOverlay(); _this.OnUpdateOverlay();
} }
_this.drawingDocument.CheckTargetShow();
_this.controller.updateSelectionState();
} }
}; };
...@@ -2628,29 +2629,7 @@ function DrawingObjects() { ...@@ -2628,29 +2629,7 @@ function DrawingObjects() {
window["Asc"]["editor"]._loadFonts(font_map, window["Asc"]["editor"]._loadFonts(font_map,
function() function()
{ {
oNewChartSpace.getAllRasterImages(aImagesSync);
oNewChartSpace.setBDeleted(false);
oNewChartSpace.setWorksheet(worksheet.model);
oNewChartSpace.addToDrawingObjects();
oNewChartSpace.recalculate();
CheckSpPrXfrm(oNewChartSpace);
var canvas_height = worksheet.drawingCtx.getHeight(3);
var pos_y = (canvas_height - oNewChartSpace.spPr.xfrm.extY)/2;
if(pos_y < 0)
{
pos_y = 0;
}
var canvas_width = worksheet.drawingCtx.getWidth(3);
var pos_x = (canvas_width - oNewChartSpace.spPr.xfrm.extX)/2;
if(pos_x < 0)
{
pos_x = 0;
}
oNewChartSpace.spPr.xfrm.setOffX(pos_x);
oNewChartSpace.spPr.xfrm.setOffY(pos_y);
oNewChartSpace.recalculate();
var min_r = 0, max_r = 0, min_c = 0, max_c = 0; var min_r = 0, max_r = 0, min_c = 0, max_c = 0;
...@@ -2787,6 +2766,29 @@ function DrawingObjects() { ...@@ -2787,6 +2766,29 @@ function DrawingObjects() {
} }
} }
worksheet._updateCellsRange(new asc_Range(0, 0, Math.max(worksheet.nColsCount - 1, max_c), Math.max(worksheet.nRowsCount - 1, max_r))); worksheet._updateCellsRange(new asc_Range(0, 0, Math.max(worksheet.nColsCount - 1, max_c), Math.max(worksheet.nRowsCount - 1, max_r)));
oNewChartSpace.getAllRasterImages(aImagesSync);
oNewChartSpace.setBDeleted(false);
oNewChartSpace.setWorksheet(worksheet.model);
oNewChartSpace.addToDrawingObjects();
oNewChartSpace.recalculate();
CheckSpPrXfrm(oNewChartSpace);
var canvas_height = worksheet.drawingCtx.getHeight(3);
var pos_y = (canvas_height - oNewChartSpace.spPr.xfrm.extY)/2;
if(pos_y < 0)
{
pos_y = 0;
}
var canvas_width = worksheet.drawingCtx.getWidth(3);
var pos_x = (canvas_width - oNewChartSpace.spPr.xfrm.extX)/2;
if(pos_x < 0)
{
pos_x = 0;
}
oNewChartSpace.spPr.xfrm.setOffX(pos_x);
oNewChartSpace.spPr.xfrm.setOffY(pos_y);
oNewChartSpace.recalculate();
_this.showDrawingObjects(false); _this.showDrawingObjects(false);
_this.controller.selectObject(oNewChartSpace, 0); _this.controller.selectObject(oNewChartSpace, 0);
_this.sendGraphicObjectProps(); _this.sendGraphicObjectProps();
...@@ -2816,15 +2818,37 @@ function DrawingObjects() { ...@@ -2816,15 +2818,37 @@ function DrawingObjects() {
_this.rebuildChartGraphicObjects = function(data) _this.rebuildChartGraphicObjects = function(data)
{ {
var wsViews = Asc["editor"].wb.wsViews; ExecuteNoHistory(function(){
var wsViews = Asc["editor"].wb.wsViews;
var changedArr = [];
if(data.changedRange)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.changedRange.c1, data.changedRange.r1, data.changedRange.c2, data.changedRange.r2)))
}
if(data.added)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.added.c1, data.added.r1, data.added.c2, data.added.r2)))
}
for(var i = 0; i < wsViews.length; ++i) if(data.hided)
{
if(wsViews[i])
{ {
wsViews[i].objectRender.rebuildCharts(data); changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.hided.c1, data.hided.r1, data.hided.c2, data.hided.r2)))
} }
}
if(data.removed)
{
changedArr.push(new BBoxInfo(worksheet.model, asc_Range(data.removed.c1, data.removed.r1, data.removed.c2, data.removed.r2)))
}
for(var i = 0; i < wsViews.length; ++i)
{
if(wsViews[i])
{
wsViews[i].objectRender.rebuildCharts(changedArr);
}
}
}, _this, []);
}; };
...@@ -3219,7 +3243,7 @@ function DrawingObjects() { ...@@ -3219,7 +3243,7 @@ function DrawingObjects() {
var graphicObject = aObjects[i].graphicObject; var graphicObject = aObjects[i].graphicObject;
if ( graphicObject.updateChartReferences ) if ( graphicObject.updateChartReferences )
{ {
graphicObject.updateChartReferences(oldWorksheet, parserHelp.getEscapeSheetName(newWorksheet)); graphicObject.updateChartReferences(oldWorksheet, newWorksheet);
} }
} }
if(this.controller) if(this.controller)
...@@ -3233,7 +3257,7 @@ function DrawingObjects() { ...@@ -3233,7 +3257,7 @@ function DrawingObjects() {
var graphicObject = aObjects[i].graphicObject; var graphicObject = aObjects[i].graphicObject;
if ( graphicObject.updateChartReferences2 ) if ( graphicObject.updateChartReferences2 )
{ {
graphicObject.updateChartReferences2(oldWorksheet, parserHelp.getEscapeSheetName(newWorksheet)); graphicObject.updateChartReferences2(oldWorksheet, newWorksheet);
} }
} }
}; };
......
...@@ -4922,7 +4922,7 @@ DrawingObjectsController.prototype = ...@@ -4922,7 +4922,7 @@ DrawingObjectsController.prototype =
} }
callback.apply(_this, args); callback.apply(_this, args);
_this.startRecalculate(); _this.startRecalculate();
_this.recalculateCurPos(); // _this.recalculateCurPos();
_this.drawingObjects.sendGraphicObjectProps(); _this.drawingObjects.sendGraphicObjectProps();
} }
}; };
......
This diff is collapsed.
...@@ -106,6 +106,7 @@ var historyitem_ChartSpace_SetTxPr = 2093; ...@@ -106,6 +106,7 @@ var historyitem_ChartSpace_SetTxPr = 2093;
var historyitem_ChartSpace_SetUserShapes = 2094; var historyitem_ChartSpace_SetUserShapes = 2094;
var historyitem_ChartSpace_SetThemeOverride = 2095; var historyitem_ChartSpace_SetThemeOverride = 2095;
var historyitem_ChartSpace_SetGroup = 2096; var historyitem_ChartSpace_SetGroup = 2096;
var historyitem_ChartSpace_SetParent = 2097;
var historyitem_Legend_SetLayout = 2095; var historyitem_Legend_SetLayout = 2095;
var historyitem_Legend_AddLegendEntry = 2096; var historyitem_Legend_AddLegendEntry = 2096;
var historyitem_Legend_SetLegendPos = 2097; var historyitem_Legend_SetLegendPos = 2097;
......
...@@ -2251,7 +2251,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS"; ...@@ -2251,7 +2251,7 @@ var ASC_DOCS_API_USE_EMBEDDED_FONTS = "@@ASC_DOCS_API_USE_EMBEDDED_FONTS";
History.TurnOn(); History.TurnOn();
if ( ws ) if ( ws )
ws.objectRender.updateChartReferences(activeName, ws.model.sName); ws.objectRender.updateChartReferences(parserHelp.getEscapeSheetName(activeName), parserHelp.getEscapeSheetName(ws.model.sName));
} }
// Удаляем Worksheet и получаем новый активный индекс (-1 означает, что ничего не удалилось) // Удаляем Worksheet и получаем новый активный индекс (-1 означает, что ничего не удалилось)
......
...@@ -2123,7 +2123,7 @@ Woorksheet.prototype.copyDrawingObjects=function(oNewWs, wsFrom) ...@@ -2123,7 +2123,7 @@ Woorksheet.prototype.copyDrawingObjects=function(oNewWs, wsFrom)
} }
NEW_WORKSHEET_DRAWING_DOCUMENT = null; NEW_WORKSHEET_DRAWING_DOCUMENT = null;
drawingObjects.pushToAObjects(oNewWs.Drawings); drawingObjects.pushToAObjects(oNewWs.Drawings);
drawingObjects.updateChartReferences2(wsFrom.sName, oNewWs.sName); drawingObjects.updateChartReferences2(parserHelp.getEscapeSheetName(wsFrom.sName), parserHelp.getEscapeSheetName(oNewWs.sName));
} }
}; };
Woorksheet.prototype.init=function(){ Woorksheet.prototype.init=function(){
......
...@@ -260,7 +260,7 @@ DrawingObjectsController.prototype.startRecalculate = function() ...@@ -260,7 +260,7 @@ DrawingObjectsController.prototype.startRecalculate = function()
{ {
this.recalculate(); this.recalculate();
this.drawingObjects.showDrawingObjects(true); this.drawingObjects.showDrawingObjects(true);
this.updateSelectionState(); //this.updateSelectionState();
}; };
DrawingObjectsController.prototype.getDrawingObjects = function() DrawingObjectsController.prototype.getDrawingObjects = function()
...@@ -503,8 +503,8 @@ DrawingObjectsController.prototype.onKeyPress = function(e) ...@@ -503,8 +503,8 @@ DrawingObjectsController.prototype.onKeyPress = function(e)
}, []); }, []);
bRetValue = true; bRetValue = true;
} }
if ( true == bRetValue ) //if ( true == bRetValue )
this.updateSelectionState(); // this.updateSelectionState();
return bRetValue; return bRetValue;
}; };
......
...@@ -4970,7 +4970,7 @@ ParaDrawing.prototype = ...@@ -4970,7 +4970,7 @@ ParaDrawing.prototype =
} }
if(isRealObject(this.GraphicObj)) if(isRealObject(this.GraphicObj))
{ {
this.GraphicObj.parent = this; //this.GraphicObj.parent = this;
this.GraphicObj.handleUpdateExtents && this.GraphicObj.handleUpdateExtents(); this.GraphicObj.handleUpdateExtents && this.GraphicObj.handleUpdateExtents();
} }
break; break;
...@@ -5092,7 +5092,7 @@ ParaDrawing.prototype = ...@@ -5092,7 +5092,7 @@ ParaDrawing.prototype =
if(isRealObject(this.GraphicObj)) if(isRealObject(this.GraphicObj))
{ {
this.GraphicObj.parent = this; //this.GraphicObj.parent = this;
this.GraphicObj.handleUpdateExtents && this.GraphicObj.handleUpdateExtents(); this.GraphicObj.handleUpdateExtents && this.GraphicObj.handleUpdateExtents();
} }
...@@ -5607,11 +5607,11 @@ ParaDrawing.prototype = ...@@ -5607,11 +5607,11 @@ ParaDrawing.prototype =
{ {
this.GraphicObj = null; this.GraphicObj = null;
} }
if(isRealObject(this.GraphicObj)) //if(isRealObject(this.GraphicObj))
this.GraphicObj.parent = this; // this.GraphicObj.parent = this;
if(isRealObject(this.GraphicObj)) if(isRealObject(this.GraphicObj))
{ {
this.GraphicObj.parent = this; //this.GraphicObj.parent = this;
this.GraphicObj.handleUpdateExtents && this.GraphicObj.handleUpdateExtents(); this.GraphicObj.handleUpdateExtents && this.GraphicObj.handleUpdateExtents();
} }
break; break;
......
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