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

Bug 25717 - При удалении копии листа с диаграммой падает ошибка в консоль

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@57493 954022d7-b5bf-4e40-9824-e11837661b57
parent d9c140ca
......@@ -2115,42 +2115,7 @@ function DrawingObjects() {
} else
shapeCtx.updatedRect = null;
// Area for update
/*if ( graphicOption ) {
var updatedRect = { x: 0, y: 0, w: 0, h: 0 };
var updatedRange = graphicOption.getUpdatedRange();
var offsetX = worksheet.cols[worksheet.getFirstVisibleCol(true)].left - worksheet.cellsLeft;
var offsetY = worksheet.rows[worksheet.getFirstVisibleRow(true)].top - worksheet.cellsTop;
var x1 = worksheet.cols[updatedRange.c1].left - offsetX;
var y1 = worksheet.rows[updatedRange.r1].top - offsetY;
var x2 = worksheet.cols[updatedRange.c2].left - offsetX;
var y2 = worksheet.rows[updatedRange.r2].top - offsetY;
var w = x2 - x1;
var h = y2 - y1;
updatedRect.x = ptToMm(x1) - pxToMm(scrollOffset.getX());
updatedRect.y = ptToMm(y1) - pxToMm(scrollOffset.getY());
updatedRect.w = ptToMm(w);
updatedRect.h = ptToMm(h);
shapeCtx.m_oContext.beginPath();
shapeCtx.m_oContext.strokeStyle = "#FF0000";
shapeCtx.m_oContext.rect(mmToPx(updatedRect.x) + scrollOffset.getX(), mmToPx(updatedRect.y) + scrollOffset.getY(), mmToPx(updatedRect.w), mmToPx(updatedRect.h));
shapeCtx.m_oContext.stroke();
shapeCtx.updatedRect = updatedRect;
if ( graphicOption.type === c_oAscGraphicOption.AddText ) {
drawingCtx.clearRect( x1, y1, w, h );
drawingCtx.setFillStyle(worksheet.settings.cells.defaultState.background).fillRect(x1, y1, w, h);
worksheet._drawGrid(undefined, updatedRange);
worksheet._drawCellsAndBorders(undefined, updatedRange);
}
}
else
shapeCtx.updatedRect = null;*/
for (var i = 0; i < aObjects.length; i++) {
var drawingObject = aObjects[i];
......@@ -2189,10 +2154,12 @@ function DrawingObjects() {
if ( !printOptions ) {
if ( aObjects.length ) {
if ( _this.controller.selectedObjects.length )
{
_this.OnUpdateOverlay();
}
_this.drawingDocument.CheckTargetShow();
_this.controller.updateSelectionState();
_this.controller.updateSelectionState(true);
}
}
}
};
......
......@@ -1286,20 +1286,15 @@ DrawingObjectsController.prototype =
{
content.Set_ParagraphIndent(indent);
}
else
{
if(this.selectedObjects.length ===1)
else if(this.document)
{
content = this.selectedObjects[0].getDocContent ? this.selectedObjects[0].getDocContent() : null;
if(content)
if(this.selectedObjects.length > 0)
{
content.Set_ApplyToAll(true);
content.Set_ParagraphIndent(indent);
content.Set_ApplyToAll(false);
}
else
var parent_paragraph = this.selectedObjects[0].parent.Get_ParentParagraph();
if(parent_paragraph)
{
this.selectedObjects[0].parent.Get_ParentParagraph().Set_Ind(indent, true)
parent_paragraph.Set_Ind(indent, true);
this.document.Recalculate();
}
}
}
......@@ -3035,7 +3030,7 @@ DrawingObjectsController.prototype =
},
updateSelectionState: function()
updateSelectionState: function(bNoCheck)
{
var text_object;
if(this.selection.textSelection)
......@@ -3061,7 +3056,7 @@ DrawingObjectsController.prototype =
{
text_object.updateSelectionState(this.drawingObjects.drawingDocument);
}
else
else if(bNoCheck !== true)
{
this.drawingObjects.drawingDocument.UpdateTargetTransform(null);
this.drawingObjects.drawingDocument.TargetEnd();
......@@ -3069,7 +3064,6 @@ DrawingObjectsController.prototype =
this.drawingObjects.drawingDocument.SelectClear();
this.drawingObjects.drawingDocument.SelectShow();
}
this.updateOverlay();
},
remove: function(dir)
......@@ -3197,6 +3191,7 @@ DrawingObjectsController.prototype =
this.resetSelection();
this.recalculate();
}
this.updateOverlay();
}
},
......
......@@ -604,8 +604,8 @@ CDLbl.prototype =
getStyles: function()
{
return ExecuteNoHistory(function(){
//todo: доработать
if(this.lastStyleObject)
return this.lastStyleObject;
var styles = new CStyles();
var style = new CStyle("dataLblStyle", null, null, null);
var text_pr = new CTextPr();
......@@ -713,6 +713,8 @@ CDLbl.prototype =
style.TextPr.Merge(this.txPr.content.Content[0].Pr.DefaultRunPr);
}
styles.Add(style);
if(!(this instanceof CTitle))
this.lastStyleObject = {lastId: style.Id, styles: styles};
return {lastId: style.Id, styles: styles};
}, this, []);
},
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -1180,8 +1180,19 @@ CGraphicObjects.prototype =
documentUpdateRulersState: function()
{
if(this.selectedObjects.length === 1 && this.selectedObjects[0].documentUpdateRulersState)
this.selectedObjects[0].documentUpdateRulersState();
var content = this.getTargetDocContent();
if(content && content.Parent && content.Parent.getObjectType && content.Parent.getObjectType() === historyitem_type_Shape)
{
content.Parent.documentUpdateRulersState();
}
//else if(this.selectedObjects.length > 0)
//{
// var parent_paragraph = this.selectedObjects[0].parent.Get_ParentParagraph();
// if(parent_paragraph)
// {
// parent_paragraph.Document_UpdateRulersState();
// }
//}
},
documentUpdateInterfaceState: function()
......
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