Commit e338baf0 authored by Dmitry.Vikulov's avatar Dmitry.Vikulov Committed by Alexander.Trofimov

- updateRange для комментариев

- исправлен баг с перестроением серий диаграмм

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@53326 954022d7-b5bf-4e40-9824-e11837661b57
parent ece71999
...@@ -2960,8 +2960,7 @@ function DrawingObjects() { ...@@ -2960,8 +2960,7 @@ function DrawingObjects() {
drawingObject.graphicObject.chart.rebuildSeries(); drawingObject.graphicObject.chart.rebuildSeries();
drawingObject.graphicObject.init(theme); drawingObject.graphicObject.init(theme);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
...@@ -2975,21 +2974,18 @@ function DrawingObjects() { ...@@ -2975,21 +2974,18 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingDocument(_this.drawingDocument); drawingObject.graphicObject.setDrawingDocument(_this.drawingDocument);
var xfrm = drawingObject.graphicObject.spPr.xfrm; var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme); drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm) if (!xfrm)
{ {
drawingObject.graphicObject.setXfrmObject(new CXfrm()); drawingObject.graphicObject.setXfrmObject(new CXfrm());
} }
if(isRealObject(drawingObject.graphicObject.drawingBase)) if (isRealObject(drawingObject.graphicObject.drawingBase))
{ {
var metrics = drawingObject.graphicObject.drawingBase.getGraphicObjectMetrics(); var metrics = drawingObject.graphicObject.drawingBase.getGraphicObjectMetrics();
//drawingObject.graphicObject.setXfrmObject(new CXfrm());
drawingObject.graphicObject.spPr.xfrm.setPosition(metrics.x, metrics.y); drawingObject.graphicObject.spPr.xfrm.setPosition(metrics.x, metrics.y);
drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY); drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY);
} }
drawingObject.graphicObject.recalculate(aImagesSync); drawingObject.graphicObject.recalculate(aImagesSync);
//aObjects.push( drawingObject ); History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject); var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
...@@ -3003,20 +2999,18 @@ function DrawingObjects() { ...@@ -3003,20 +2999,18 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(_this); drawingObject.graphicObject.setDrawingObjects(_this);
var xfrm = drawingObject.graphicObject.spPr.xfrm; var xfrm = drawingObject.graphicObject.spPr.xfrm;
if(!xfrm) if (!xfrm)
{ {
drawingObject.graphicObject.setXfrmObject(new CXfrm()); drawingObject.graphicObject.setXfrmObject(new CXfrm());
} }
if(isRealObject(drawingObject.graphicObject.drawingBase)) if (isRealObject(drawingObject.graphicObject.drawingBase))
{ {
var metrics = drawingObject.graphicObject.drawingBase.getGraphicObjectMetrics(); var metrics = drawingObject.graphicObject.drawingBase.getGraphicObjectMetrics();
//drawingObject.graphicObject.setXfrmObject(new CXfrm());
drawingObject.graphicObject.spPr.xfrm.setPosition(metrics.x, metrics.y); drawingObject.graphicObject.spPr.xfrm.setPosition(metrics.x, metrics.y);
drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY); drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY);
} }
drawingObject.graphicObject.recalculate(aImagesSync); drawingObject.graphicObject.recalculate(aImagesSync);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
} }
...@@ -3027,27 +3021,18 @@ function DrawingObjects() { ...@@ -3027,27 +3021,18 @@ function DrawingObjects() {
var xfrm = drawingObject.graphicObject.spPr.xfrm; var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme); drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm) if (!xfrm)
{ {
drawingObject.graphicObject.setXfrmObject(new CXfrm()); drawingObject.graphicObject.setXfrmObject(new CXfrm());
} }
if(isRealObject(drawingObject.graphicObject.drawingBase))
{
//var metrics = drawingObject.graphicObject.drawingBase.getGraphicObjectMetrics();
//drawingObject.graphicObject.setXfrmObject(new CXfrm());
//drawingObject.graphicObject.spPr.xfrm.setPosition(metrics.x, metrics.y);
//drawingObject.graphicObject.spPr.xfrm.setExtents(metrics.extX, metrics.extY);
//drawingObject.graphicObject.spPr.xfrm.setChildExtents(metrics.extX, metrics.extY);
//drawingObject.graphicObject.spPr.xfrm.setChildOffsets(0, 0);
}
drawingObject.graphicObject.setDrawingDocument(this.drawingDocument); drawingObject.graphicObject.setDrawingDocument(this.drawingDocument);
var old_len = aImagesSync.length; var old_len = aImagesSync.length;
drawingObject.graphicObject.initCharts(); drawingObject.graphicObject.initCharts();
drawingObject.graphicObject.recalculate(aImagesSync); drawingObject.graphicObject.recalculate(aImagesSync);
if(aImagesSync.length > old_len) if (aImagesSync.length > old_len)
aObjectsSync[aObjectsSync.length] = drawingObject; aObjectsSync[aObjectsSync.length] = drawingObject;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null, History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects(); drawingObject.graphicObject.addToDrawingObjects();
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject); var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
...@@ -3068,7 +3053,6 @@ function DrawingObjects() { ...@@ -3068,7 +3053,6 @@ function DrawingObjects() {
drawingObject.graphicObject.recalculate(); drawingObject.graphicObject.recalculate();
drawingObject.setGraphicObjectCoords(); drawingObject.setGraphicObjectCoords();
drawingObject.graphicObject.draw(shapeCtx); drawingObject.graphicObject.draw(shapeCtx);
aObjects.push(drawingObject);
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject); var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
aBoundsCheckers.push(boundsChecker); aBoundsCheckers.push(boundsChecker);
...@@ -3087,6 +3071,7 @@ function DrawingObjects() { ...@@ -3087,6 +3071,7 @@ function DrawingObjects() {
window.attachEvent("onmessage", this._uploadMessage); window.attachEvent("onmessage", this._uploadMessage);
} }
} }
_this.shiftMap = {}; _this.shiftMap = {};
worksheet.model.Drawings = aObjects; worksheet.model.Drawings = aObjects;
isInit = true; isInit = true;
...@@ -3491,13 +3476,12 @@ function DrawingObjects() { ...@@ -3491,13 +3476,12 @@ function DrawingObjects() {
return; return;
if ( drawingCtx ) { if ( drawingCtx ) {
if ( clearCanvas ) if ( clearCanvas ) {
_this.clearDrawingObjects(); _this.clearDrawingObjects();
if ( aObjects.length ) {
worksheet._drawGraphic(); worksheet._drawGraphic();
}
if ( aObjects.length ) {
// Clip // Clip
_this.clipGraphicsCanvas(shapeCtx, graphicOption); _this.clipGraphicsCanvas(shapeCtx, graphicOption);
...@@ -4058,15 +4042,23 @@ function DrawingObjects() { ...@@ -4058,15 +4042,23 @@ function DrawingObjects() {
} }
} }
_this.rebuildChartGraphicObjects = function() { _this.rebuildChartGraphicObjects = function(range) {
var bRebuild = true;
for (var i = 0; i < aObjects.length; i++) { for (var i = 0; i < aObjects.length; i++) {
var graphicObject = aObjects[i].graphicObject; var graphicObject = aObjects[i].graphicObject;
if ( graphicObject.isChart() && graphicObject.chart.range.intervalObject ) { if ( graphicObject.isChart() && graphicObject.chart.range.intervalObject ) {
bRebuild = true;
if ( range ) {
if ( !range.intersection(graphicObject.chart.range.intervalObject.bbox) )
bRebuild = false;
}
if ( bRebuild ) {
graphicObject.chart.rebuildSeries(); graphicObject.chart.rebuildSeries();
graphicObject.recalculate(); graphicObject.recalculate();
} }
} }
} }
}
_this.updateDrawingObject = function(bInsert, operType, updateRange) { _this.updateDrawingObject = function(bInsert, operType, updateRange) {
......
...@@ -687,12 +687,9 @@ function asc_CCellCommentator(currentSheet) { ...@@ -687,12 +687,9 @@ function asc_CCellCommentator(currentSheet) {
return (findCol && findRow) ? _this.asc_getComments(findCol.col, findRow.row) : []; return (findCol && findRow) ? _this.asc_getComments(findCol.col, findRow.row) : [];
} }
_this.drawCommentCells = function() { _this.drawCommentCells = function(updatedRange) {
if ( isViewerMode() ) if ( isViewerMode() || !_this.bShow )
return;
if (!_this.bShow)
return; return;
var fvr = _this.worksheet.getFirstVisibleRow(); var fvr = _this.worksheet.getFirstVisibleRow();
...@@ -709,6 +706,12 @@ function asc_CCellCommentator(currentSheet) { ...@@ -709,6 +706,12 @@ function asc_CCellCommentator(currentSheet) {
// Get cell metrics // Get cell metrics
var commentCell = _this.aComments[i]; var commentCell = _this.aComments[i];
if ( updatedRange ) {
if ( !((commentCell.nCol >= updatedRange.c1) && (commentCell.nCol <= updatedRange.c2) && (commentCell.nRow >= updatedRange.r1) && (commentCell.nRow <= updatedRange.r2)) )
continue;
}
var mergedRange = _this.worksheet.model.getMergedByCell(commentCell.nRow, commentCell.nCol); var mergedRange = _this.worksheet.model.getMergedByCell(commentCell.nRow, commentCell.nCol);
var drawCol = mergedRange ? mergedRange.c2 : commentCell.nCol; var drawCol = mergedRange ? mergedRange.c2 : commentCell.nCol;
var drawRow = mergedRange ? mergedRange.r1 : commentCell.nRow; var drawRow = mergedRange ? mergedRange.r1 : commentCell.nRow;
......
...@@ -1806,7 +1806,7 @@ ...@@ -1806,7 +1806,7 @@
this._fixSelectionOfMergedCells(); this._fixSelectionOfMergedCells();
this._fixSelectionOfHiddenCells(); this._fixSelectionOfHiddenCells();
this._drawGraphic(); this._drawGraphic();
this.objectRender.showDrawingObjectsEx(true); this.objectRender.showDrawingObjects(false);
if (this.overlayCtx) { if (this.overlayCtx) {
this._drawSelection(); this._drawSelection();
} }
...@@ -3371,9 +3371,9 @@ ...@@ -3371,9 +3371,9 @@
} }
}, },
_drawGraphic: function() { _drawGraphic: function(updatedRange) {
this._drawElements(this.autoFilters, this.autoFilters.drawAutoF2); this._drawElements(this.autoFilters, this.autoFilters.drawAutoF2);
this.cellCommentator.drawCommentCells(); this.cellCommentator.drawCommentCells(updatedRange);
}, },
cleanSelection: function (range, isFrozen) { cleanSelection: function (range, isFrozen) {
...@@ -5018,7 +5018,7 @@ ...@@ -5018,7 +5018,7 @@
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
//ToDo this.drawDepCells(); //ToDo this.drawDepCells();
this._drawGraphic(); this._drawGraphic(rangeGraphic);
this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollVertical, rangeGraphic)); this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollVertical, rangeGraphic));
return this; return this;
}, },
...@@ -5105,7 +5105,7 @@ ...@@ -5105,7 +5105,7 @@
this.cellCommentator.updateCommentPosition(); this.cellCommentator.updateCommentPosition();
//ToDo this.drawDepCells(); //ToDo this.drawDepCells();
this._drawGraphic(); this._drawGraphic(rangeGraphic);
this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollHorizontal, rangeGraphic)); this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollHorizontal, rangeGraphic));
return this; return this;
}, },
...@@ -10001,7 +10001,7 @@ ...@@ -10001,7 +10001,7 @@
t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo()); t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo());
} }
t.objectRender.rebuildChartGraphicObjects(); t.objectRender.rebuildChartGraphicObjects(t.activeRange.clone(true));
t.cellCommentator.updateCommentPosition(); t.cellCommentator.updateCommentPosition();
t.draw(lockDraw); t.draw(lockDraw);
}, },
......
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