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

- Исправил баг с неправильной очисткой листа при перемещении шейпа

- Исправлены баги: #20231, #20264, #20273, #20234

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49689 954022d7-b5bf-4e40-9824-e11837661b57
parent 0e2edac7
...@@ -3055,6 +3055,9 @@ function DrawingObjects() { ...@@ -3055,6 +3055,9 @@ function DrawingObjects() {
var boundsChecker = _this.getBoundsChecker(aObjects[i]); var boundsChecker = _this.getBoundsChecker(aObjects[i]);
restoreSheetArea(boundsChecker); restoreSheetArea(boundsChecker);
aBoundsCheckers.push(boundsChecker); aBoundsCheckers.push(boundsChecker);
if ( (_top >= boundsChecker.Bounds.min_y) || (_left >= boundsChecker.Bounds.min_x) )
bHeaders = true;
} }
if ( bHeaders ) if ( bHeaders )
...@@ -3066,18 +3069,30 @@ function DrawingObjects() { ...@@ -3066,18 +3069,30 @@ function DrawingObjects() {
var _w = checker.Bounds.max_x - checker.Bounds.min_x; var _w = checker.Bounds.max_x - checker.Bounds.min_x;
var _h = checker.Bounds.max_y - checker.Bounds.min_y; var _h = checker.Bounds.max_y - checker.Bounds.min_y;
//overlayCtx.clearRect( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), mmToPt(_w), mmToPt(_h) ); overlayCtx.clearRect( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), mmToPt(_w), mmToPt(_h) );
//drawingCtx.clearRect( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), mmToPt(_w), mmToPt(_h) ); drawingCtx.clearRect( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), mmToPt(_w), mmToPt(_h) );
var foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), true); // Top left
var foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.min_y + pxToMm(scrollOffset.y)), true);
var topRow = foundRow ? foundRow.row : 0; var topRow = foundRow ? foundRow.row : 0;
var foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), true); var foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.min_x + pxToMm(scrollOffset.x)), true);
var leftCol = foundCol ? foundCol.col : 0; var leftCol = foundCol ? foundCol.col : 0;
// Right bottom
foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.max_y + pxToMm(scrollOffset.y)), true); foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.max_y + pxToMm(scrollOffset.y)), true);
var bottomRow = foundRow ? foundRow.row : 0; while ( !foundRow ) {
worksheet.expandRowsOnScroll(true);
foundRow = worksheet._findRowUnderCursor( mmToPt(checker.Bounds.max_y + pxToMm(scrollOffset.y)), true);
}
var bottomRow = foundRow.row;
foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.max_x + pxToMm(scrollOffset.x)), true); foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.max_x + pxToMm(scrollOffset.x)), true);
var rightcol = foundCol ? foundCol.col : 0; while ( !foundCol ) {
worksheet.expandColsOnScroll(true);
foundCol = worksheet._findColUnderCursor( mmToPt(checker.Bounds.max_x + pxToMm(scrollOffset.x)), true);
}
var rightcol = foundCol.col;
var r_ = asc_Range( leftCol, topRow, rightcol, bottomRow ); var r_ = asc_Range( leftCol, topRow, rightcol, bottomRow );
worksheet._drawGrid( drawingCtx, r_); worksheet._drawGrid( drawingCtx, r_);
...@@ -3095,7 +3110,8 @@ function DrawingObjects() { ...@@ -3095,7 +3110,8 @@ function DrawingObjects() {
aObjects[i].graphicObject.draw(shapeOverlayCtx); aObjects[i].graphicObject.draw(shapeOverlayCtx);
} }
_this.drawWorksheetHeaders(); if ( aObjects.length )
_this.drawWorksheetHeaders();
} }
//----------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------
...@@ -3195,20 +3211,30 @@ function DrawingObjects() { ...@@ -3195,20 +3211,30 @@ function DrawingObjects() {
var top = worksheet.getCellTop(0, 3) + pxToMm(1); var top = worksheet.getCellTop(0, 3) + pxToMm(1);
var left = worksheet.getCellLeft(0, 3) + pxToMm(1); var left = worksheet.getCellLeft(0, 3) + pxToMm(1);
for (var i = 0; i < aObjects.length; i++) { function updateHeaders() {
worksheet._drawColumnHeaders();
var obj = aObjects[i]; worksheet._drawRowHeaders();
if ( bForce || (obj.from.col < fvc) || (obj.from.row < fvr) ) {
worksheet._drawColumnHeaders();
worksheet._drawRowHeaders();
// cols header on overlay // cols header on overlay
overlayCtx.clearRect( 0, 0, overlayCtx.getWidth(), worksheet.getCellTop(0, 1) ); overlayCtx.clearRect( 0, 0, overlayCtx.getWidth(), worksheet.getCellTop(0, 1) );
// rows header on overlay // rows header on overlay
overlayCtx.clearRect( 0, 0, worksheet.getCellLeft(0, 1), overlayCtx.getHeight() ); overlayCtx.clearRect( 0, 0, worksheet.getCellLeft(0, 1), overlayCtx.getHeight() );
break; }
if ( bForce )
updateHeaders();
else {
var bRedraw = false;
for (var i = 0; i < aObjects.length; i++) {
var obj = aObjects[i];
if ( (obj.from.col < fvc) || (obj.from.row < fvr) ) {
bRedraw = true;
break;
}
} }
if ( bRedraw )
updateHeaders();
} }
if ( !_this.selectedGraphicObjectsExists() ) if ( !_this.selectedGraphicObjectsExists() )
worksheet._drawActiveHeaders(); worksheet._drawActiveHeaders();
...@@ -3277,6 +3303,8 @@ function DrawingObjects() { ...@@ -3277,6 +3303,8 @@ function DrawingObjects() {
worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical); worksheet.model.workbook.handlers.trigger("asc_onError", c_oAscError.ID.UplImageUrl, c_oAscError.Level.NoCritical);
} }
else { else {
History.Create_NewPoint();
var obj = _this.createDrawingObject(); var obj = _this.createDrawingObject();
obj.worksheet = worksheet; obj.worksheet = worksheet;
...@@ -3396,6 +3424,7 @@ function DrawingObjects() { ...@@ -3396,6 +3424,7 @@ function DrawingObjects() {
chart.rebuildSeries(); chart.rebuildSeries();
chart.worksheet = worksheet; // Для формул серий chart.worksheet = worksheet; // Для формул серий
History.Create_NewPoint();
return this.controller.addChartDrawingObject(chart, options); return this.controller.addChartDrawingObject(chart, options);
} }
else if ( isObject(chart) && chart["binary"] ) { else if ( isObject(chart) && chart["binary"] ) {
...@@ -3929,13 +3958,11 @@ function DrawingObjects() { ...@@ -3929,13 +3958,11 @@ function DrawingObjects() {
graphic.setDrawingBase(obj); graphic.setDrawingBase(obj);
var ret; var ret;
if(isRealNumber(position)) if (isRealNumber(position)) {
{
aObjects.splice(position, 0, obj); aObjects.splice(position, 0, obj);
ret = position; ret = position;
} }
else else {
{
ret = aObjects.length; ret = aObjects.length;
aObjects.push(obj); aObjects.push(obj);
} }
...@@ -4014,12 +4041,18 @@ function DrawingObjects() { ...@@ -4014,12 +4041,18 @@ function DrawingObjects() {
_this.deleteDrawingBase = function(graphicId) { _this.deleteDrawingBase = function(graphicId) {
var bRedraw = false;
for (var i = 0; i < aObjects.length; i++) { for (var i = 0; i < aObjects.length; i++) {
if ( aObjects[i].graphicObject.Id == graphicId ) { if ( aObjects[i].graphicObject.Id == graphicId ) {
aObjects[i].graphicObject.deselect(_this.controller);
aObjects.splice(i, 1); aObjects.splice(i, 1);
bRedraw = true;
return i; return i;
} }
} }
if ( bRedraw )
_this.showDrawingObjects(true);
return null; return null;
}; };
...@@ -4081,7 +4114,7 @@ function DrawingObjects() { ...@@ -4081,7 +4114,7 @@ function DrawingObjects() {
aObjects[i].graphicObject.lockType = c_oAscLockTypes.kLockTypeNone; aObjects[i].graphicObject.lockType = c_oAscLockTypes.kLockTypeNone;
//shapeCtx.DrawLockObjectRect(aObjects[i].graphicObject.lockType, aObjects[i].graphicObject.x, aObjects[i].graphicObject.y, aObjects[i].graphicObject.extX, aObjects[i].graphicObject.extY ); //shapeCtx.DrawLockObjectRect(aObjects[i].graphicObject.lockType, aObjects[i].graphicObject.x, aObjects[i].graphicObject.y, aObjects[i].graphicObject.extX, aObjects[i].graphicObject.extY );
} }
_this.showDrawingObjects(true); //_this.showDrawingObjects(true);
} }
_this.setScrollOffset = function(x_px, y_px) { _this.setScrollOffset = function(x_px, y_px) {
......
...@@ -569,7 +569,7 @@ CChartAsGroup.prototype = ...@@ -569,7 +569,7 @@ CChartAsGroup.prototype =
{ {
var title_string; var title_string;
if(this.chart.header.bDefaultTitle || !(typeof this.chart.header.title === "string")) if(this.chart.header.bDefaultTitle || !(typeof this.chart.header.title === "string"))
title_string = "Chart Title"; title_string = this.chart.header.title;
else else
title_string = this.chart.header.title; title_string = this.chart.header.title;
...@@ -582,7 +582,7 @@ CChartAsGroup.prototype = ...@@ -582,7 +582,7 @@ CChartAsGroup.prototype =
if(isRealObject(this.chart.xAxis) && this.chart.xAxis.bShow) if(isRealObject(this.chart.xAxis) && this.chart.xAxis.bShow)
{ {
if(this.chart.xAxis.bDefaultTitle || !(typeof this.chart.xAxis.title === "string")) if(this.chart.xAxis.bDefaultTitle || !(typeof this.chart.xAxis.title === "string"))
title_string = "X Axis"; title_string = this.chart.xAxis.title;
else else
title_string = this.chart.xAxis.title; title_string = this.chart.xAxis.title;
...@@ -600,7 +600,7 @@ CChartAsGroup.prototype = ...@@ -600,7 +600,7 @@ CChartAsGroup.prototype =
if(isRealObject(this.chart.yAxis) && this.chart.yAxis.bShow) if(isRealObject(this.chart.yAxis) && this.chart.yAxis.bShow)
{ {
if(this.chart.yAxis.bDefaultTitle || !(typeof this.chart.yAxis.title === "string")) if(this.chart.yAxis.bDefaultTitle || !(typeof this.chart.yAxis.title === "string"))
title_string = "Y Axis"; title_string = this.chart.yAxis.title;
else else
title_string = this.chart.yAxis.title; title_string = this.chart.yAxis.title;
......
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