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() {
drawingObject.graphicObject.chart.rebuildSeries();
drawingObject.graphicObject.init(theme);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_RecalculateAfterInit2Chart, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects();
......@@ -2975,21 +2974,18 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingDocument(_this.drawingDocument);
var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm)
if (!xfrm)
{
drawingObject.graphicObject.setXfrmObject(new CXfrm());
}
if(isRealObject(drawingObject.graphicObject.drawingBase))
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.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();
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
......@@ -3003,20 +2999,18 @@ function DrawingObjects() {
drawingObject.graphicObject.setDrawingObjects(_this);
var xfrm = drawingObject.graphicObject.spPr.xfrm;
if(!xfrm)
if (!xfrm)
{
drawingObject.graphicObject.setXfrmObject(new CXfrm());
}
if(isRealObject(drawingObject.graphicObject.drawingBase))
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.recalculate(aImagesSync);
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects();
}
......@@ -3027,27 +3021,18 @@ function DrawingObjects() {
var xfrm = drawingObject.graphicObject.spPr.xfrm;
drawingObject.graphicObject.checkThemeFonts(theme);
if(!xfrm)
if (!xfrm)
{
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);
var old_len = aImagesSync.length;
drawingObject.graphicObject.initCharts();
drawingObject.graphicObject.recalculate(aImagesSync);
if(aImagesSync.length > old_len)
if (aImagesSync.length > old_len)
aObjectsSync[aObjectsSync.length] = drawingObject;
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null,
new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
History.Add(g_oUndoRedoGraphicObjects, historyitem_AutoShapes_GroupRecalculateAfterLoad, null, null, new UndoRedoDataGraphicObjects(drawingObject.graphicObject.Get_Id(), new UndoRedoDataGOSingleProp(null, null)));
drawingObject.graphicObject.addToDrawingObjects();
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
......@@ -3068,7 +3053,6 @@ function DrawingObjects() {
drawingObject.graphicObject.recalculate();
drawingObject.setGraphicObjectCoords();
drawingObject.graphicObject.draw(shapeCtx);
aObjects.push(drawingObject);
var boundsChecker = _this.getBoundsChecker(drawingObject.graphicObject);
aBoundsCheckers.push(boundsChecker);
......@@ -3087,6 +3071,7 @@ function DrawingObjects() {
window.attachEvent("onmessage", this._uploadMessage);
}
}
_this.shiftMap = {};
worksheet.model.Drawings = aObjects;
isInit = true;
......@@ -3491,13 +3476,12 @@ function DrawingObjects() {
return;
if ( drawingCtx ) {
if ( clearCanvas )
if ( clearCanvas ) {
_this.clearDrawingObjects();
worksheet._drawGraphic();
}
if ( aObjects.length ) {
worksheet._drawGraphic();
// Clip
_this.clipGraphicsCanvas(shapeCtx, graphicOption);
......@@ -4058,12 +4042,20 @@ function DrawingObjects() {
}
}
_this.rebuildChartGraphicObjects = function() {
_this.rebuildChartGraphicObjects = function(range) {
var bRebuild = true;
for (var i = 0; i < aObjects.length; i++) {
var graphicObject = aObjects[i].graphicObject;
if ( graphicObject.isChart() && graphicObject.chart.range.intervalObject ) {
graphicObject.chart.rebuildSeries();
graphicObject.recalculate();
bRebuild = true;
if ( range ) {
if ( !range.intersection(graphicObject.chart.range.intervalObject.bbox) )
bRebuild = false;
}
if ( bRebuild ) {
graphicObject.chart.rebuildSeries();
graphicObject.recalculate();
}
}
}
}
......@@ -4865,7 +4857,7 @@ function DrawingObjects() {
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
}
else
_this.showDrawingObjects(true);
_this.showDrawingObjects(true);
}
}
......
......@@ -687,12 +687,9 @@ function asc_CCellCommentator(currentSheet) {
return (findCol && findRow) ? _this.asc_getComments(findCol.col, findRow.row) : [];
}
_this.drawCommentCells = function() {
_this.drawCommentCells = function(updatedRange) {
if ( isViewerMode() )
return;
if (!_this.bShow)
if ( isViewerMode() || !_this.bShow )
return;
var fvr = _this.worksheet.getFirstVisibleRow();
......@@ -709,6 +706,12 @@ function asc_CCellCommentator(currentSheet) {
// Get cell metrics
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 drawCol = mergedRange ? mergedRange.c2 : commentCell.nCol;
var drawRow = mergedRange ? mergedRange.r1 : commentCell.nRow;
......
......@@ -1806,7 +1806,7 @@
this._fixSelectionOfMergedCells();
this._fixSelectionOfHiddenCells();
this._drawGraphic();
this.objectRender.showDrawingObjectsEx(true);
this.objectRender.showDrawingObjects(false);
if (this.overlayCtx) {
this._drawSelection();
}
......@@ -3371,9 +3371,9 @@
}
},
_drawGraphic: function() {
_drawGraphic: function(updatedRange) {
this._drawElements(this.autoFilters, this.autoFilters.drawAutoF2);
this.cellCommentator.drawCommentCells();
this.cellCommentator.drawCommentCells(updatedRange);
},
cleanSelection: function (range, isFrozen) {
......@@ -5018,7 +5018,7 @@
this.cellCommentator.updateCommentPosition();
//ToDo this.drawDepCells();
this._drawGraphic();
this._drawGraphic(rangeGraphic);
this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollVertical, rangeGraphic));
return this;
},
......@@ -5105,7 +5105,7 @@
this.cellCommentator.updateCommentPosition();
//ToDo this.drawDepCells();
this._drawGraphic();
this._drawGraphic(rangeGraphic);
this.objectRender.showDrawingObjects(false, new GraphicOption(this, c_oAscGraphicOption.ScrollHorizontal, rangeGraphic));
return this;
},
......@@ -10001,7 +10001,7 @@
t.handlers.trigger("selectionMathInfoChanged", t.getSelectionMathInfo());
}
t.objectRender.rebuildChartGraphicObjects();
t.objectRender.rebuildChartGraphicObjects(t.activeRange.clone(true));
t.cellCommentator.updateCommentPosition();
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