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() { ...@@ -2115,42 +2115,7 @@ function DrawingObjects() {
} else } else
shapeCtx.updatedRect = null; 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++) { for (var i = 0; i < aObjects.length; i++) {
var drawingObject = aObjects[i]; var drawingObject = aObjects[i];
...@@ -2189,10 +2154,12 @@ function DrawingObjects() { ...@@ -2189,10 +2154,12 @@ function DrawingObjects() {
if ( !printOptions ) { if ( !printOptions ) {
if ( aObjects.length ) { if ( aObjects.length ) {
if ( _this.controller.selectedObjects.length ) if ( _this.controller.selectedObjects.length )
{
_this.OnUpdateOverlay(); _this.OnUpdateOverlay();
_this.drawingDocument.CheckTargetShow();
_this.controller.updateSelectionState(true);
}
} }
_this.drawingDocument.CheckTargetShow();
_this.controller.updateSelectionState();
} }
}; };
......
...@@ -1286,20 +1286,15 @@ DrawingObjectsController.prototype = ...@@ -1286,20 +1286,15 @@ DrawingObjectsController.prototype =
{ {
content.Set_ParagraphIndent(indent); content.Set_ParagraphIndent(indent);
} }
else else if(this.document)
{ {
if(this.selectedObjects.length ===1) if(this.selectedObjects.length > 0)
{ {
content = this.selectedObjects[0].getDocContent ? this.selectedObjects[0].getDocContent() : null; var parent_paragraph = this.selectedObjects[0].parent.Get_ParentParagraph();
if(content) if(parent_paragraph)
{ {
content.Set_ApplyToAll(true); parent_paragraph.Set_Ind(indent, true);
content.Set_ParagraphIndent(indent); this.document.Recalculate();
content.Set_ApplyToAll(false);
}
else
{
this.selectedObjects[0].parent.Get_ParentParagraph().Set_Ind(indent, true)
} }
} }
} }
...@@ -3035,7 +3030,7 @@ DrawingObjectsController.prototype = ...@@ -3035,7 +3030,7 @@ DrawingObjectsController.prototype =
}, },
updateSelectionState: function() updateSelectionState: function(bNoCheck)
{ {
var text_object; var text_object;
if(this.selection.textSelection) if(this.selection.textSelection)
...@@ -3061,7 +3056,7 @@ DrawingObjectsController.prototype = ...@@ -3061,7 +3056,7 @@ DrawingObjectsController.prototype =
{ {
text_object.updateSelectionState(this.drawingObjects.drawingDocument); text_object.updateSelectionState(this.drawingObjects.drawingDocument);
} }
else else if(bNoCheck !== true)
{ {
this.drawingObjects.drawingDocument.UpdateTargetTransform(null); this.drawingObjects.drawingDocument.UpdateTargetTransform(null);
this.drawingObjects.drawingDocument.TargetEnd(); this.drawingObjects.drawingDocument.TargetEnd();
...@@ -3069,7 +3064,6 @@ DrawingObjectsController.prototype = ...@@ -3069,7 +3064,6 @@ DrawingObjectsController.prototype =
this.drawingObjects.drawingDocument.SelectClear(); this.drawingObjects.drawingDocument.SelectClear();
this.drawingObjects.drawingDocument.SelectShow(); this.drawingObjects.drawingDocument.SelectShow();
} }
this.updateOverlay();
}, },
remove: function(dir) remove: function(dir)
...@@ -3197,6 +3191,7 @@ DrawingObjectsController.prototype = ...@@ -3197,6 +3191,7 @@ DrawingObjectsController.prototype =
this.resetSelection(); this.resetSelection();
this.recalculate(); this.recalculate();
} }
this.updateOverlay();
} }
}, },
......
...@@ -604,8 +604,8 @@ CDLbl.prototype = ...@@ -604,8 +604,8 @@ CDLbl.prototype =
getStyles: function() getStyles: function()
{ {
return ExecuteNoHistory(function(){ return ExecuteNoHistory(function(){
if(this.lastStyleObject)
//todo: доработать return this.lastStyleObject;
var styles = new CStyles(); var styles = new CStyles();
var style = new CStyle("dataLblStyle", null, null, null); var style = new CStyle("dataLblStyle", null, null, null);
var text_pr = new CTextPr(); var text_pr = new CTextPr();
...@@ -713,6 +713,8 @@ CDLbl.prototype = ...@@ -713,6 +713,8 @@ CDLbl.prototype =
style.TextPr.Merge(this.txPr.content.Content[0].Pr.DefaultRunPr); style.TextPr.Merge(this.txPr.content.Content[0].Pr.DefaultRunPr);
} }
styles.Add(style); styles.Add(style);
if(!(this instanceof CTitle))
this.lastStyleObject = {lastId: style.Id, styles: styles};
return {lastId: style.Id, styles: styles}; return {lastId: style.Id, styles: styles};
}, this, []); }, 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 = ...@@ -1180,8 +1180,19 @@ CGraphicObjects.prototype =
documentUpdateRulersState: function() documentUpdateRulersState: function()
{ {
if(this.selectedObjects.length === 1 && this.selectedObjects[0].documentUpdateRulersState) var content = this.getTargetDocContent();
this.selectedObjects[0].documentUpdateRulersState(); 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() 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