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

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49524 954022d7-b5bf-4e40-9824-e11837661b57
parent faed83ee
......@@ -1125,8 +1125,9 @@ CChartAsGroup.prototype =
if ( !this.chart.range.intervalObject )
this.drawingObjects.intervalToIntervalObject(this.chart);
this.brush.fill.RasterImageId = this.drawingObjects.getChartRender().insertChart(this.chart, null, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0));
this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId);
this.brush.fill.canvas= this.drawingObjects.getChartRender().insertChart(this.chart, null, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0));
this.brush.fill.RasterImageId = "";
//this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId);
},
getInvertTransform: function()
......@@ -1470,8 +1471,9 @@ CChartAsGroup.prototype =
if ( !this.chart.range.intervalObject )
this.drawingObjects.intervalToIntervalObject(this.chart);
this.brush.fill.RasterImageId = this.drawingObjects.getChartRender().insertChart(this.chart, null, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0));
this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId);
this.brush.fill.canvas= this.drawingObjects.getChartRender().insertChart(this.chart, null, this.drawingObjects.convertMetric(this.extX, 3, 0),this.drawingObjects.convertMetric(this.extY, 3, 0));
this.brush.fill.RasterImageId = "";
//this.drawingObjects.loadImageRedraw(this.brush.fill.RasterImageId);
},
Undo: function(type, data)
......@@ -1481,6 +1483,12 @@ CChartAsGroup.prototype =
case historyitem_AutoShapes_RecalculateTransformUndo:
{
this.recalculate();
break;
}
case historyitem_AutoShapes_Add_To_Drawing_Objects:
{
this.drawingObjects.deleteDrawingBase(this.Id);
break;
}
}
},
......@@ -1492,6 +1500,13 @@ CChartAsGroup.prototype =
case historyitem_AutoShapes_RecalculateTransformRedo:
{
this.recalculate();
break;
}
case historyitem_AutoShapes_Add_To_Drawing_Objects:
{
this.drawingObjects.addGraphicObject(this, data.oldValue);
break;
}
}
},
......
......@@ -2753,6 +2753,7 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_result_shape_prop.canChangeArrows = true;
_result_shape_prop.fill = CompareUniFill(shapeProp1.fill, shapeProp2.fill);
_result_shape_prop.IsLocked = shapeProp1.IsLocked === true || shapeProp2.IsLocked === true;
if(isRealObject(shapeProp1.paddings) && isRealObject(shapeProp2.paddings))
{
_result_shape_prop.paddings = new asc_CPaddings();
......
......@@ -181,6 +181,78 @@ Paragraph.prototype =
},
recalculateFonts: function()
{
var theme = this.Parent.getTheme();
var color_map = this.Parent.getColorMap();
var TextPr = this.CompiledPr.Pr.TextPr;
if(isRealObject(TextPr.unifill) && isRealObject(TextPr.unifill.fill))
{
if(typeof TextPr.themeFont === "string")
{
var font_name = getFontInfo(TextPr.themeFont)(theme.themeElements.fontScheme);
TextPr.FontFamily = {Name: font_name, Index: -1};
}
}
for(var i = 0; i < this.Content.length; ++i)
{
if(this.Content[i].Type === para_TextPr)
{
TextPr = this.Content[i].Value;
if(typeof TextPr.themeFont === "string")
{
var font_name = getFontInfo(TextPr.themeFont)(theme.themeElements.fontScheme);
TextPr.FontFamily = {Name: font_name, Index: -1};
}
}
}
},
recalculateTextPr: function()
{
var theme = this.Parent.getTheme();
var color_map = this.Parent.getColorMap();
var TextPr = this.CompiledPr.Pr.TextPr;
if(isRealObject(TextPr.unifill) && isRealObject(TextPr.unifill.fill))
{
TextPr.unifill.calculate(theme, color_map, {R:0, G: 0, B: 0, A:255});
if(isRealObject(TextPr.unifill.fill.color))
{
var color = TextPr.unifill.fill.color.RGBA;
TextPr.Color = new CDocumentColor(color.R, color.G, color.B);
}
else if(Array.isArray(TextPr.unifill.fill.colors) && isRealObject(TextPr.unifill.fill.colors[0]))
{
var color = TextPr.unifill.fill.colors[0].RGBA;
TextPr.Color = new CDocumentColor(color.R, color.G, color.B);
}
}
for(var i = 0; i < this.Content.length; ++i)
{
if(this.Content[i].Type === para_TextPr)
{
TextPr = this.Content[i].Value;
if(isRealObject(TextPr.unifill) && isRealObject(TextPr.unifill.fill))
{
TextPr.unifill.calculate(theme, color_map, {R:0, G: 0, B: 0, A:255});
if(isRealObject(TextPr.unifill.fill.color))
{
var color = TextPr.unifill.fill.color.RGBA;
TextPr.Color = new CDocumentColor(color.R, color.G, color.B);
}
else if(Array.isArray(TextPr.unifill.fill.colors) && isRealObject(TextPr.unifill.fill.colors[0]))
{
var color = TextPr.unifill.fill.colors[0].RGBA;
TextPr.Color = new CDocumentColor(color.R, color.G, color.B);
}
}
}
}
},
GetType : function()
......@@ -6405,10 +6477,6 @@ Paragraph.prototype =
TextPr.FontFamily = {Name: font_name, Index: -1};
}
if ( undefined != TextPr.FontFamily )
{
var FName = TextPr.FontFamily.Name;
......
......@@ -1397,7 +1397,7 @@ CShape.prototype =
}
else
{
this.clipRect = {x: 0, y: 0, w: this.absExtX, h: this.absExtY};
this.clipRect = {x: 0, y: 0, w: this.extX, h: this.extY};
}
}
else
......@@ -1535,8 +1535,8 @@ CShape.prototype =
this.clipRect = {
x: -l_ins,
y: -_vertical_shift - t_ins,
w: this.contentWidth + (r_ins + l_ins),
h: this.contentHeight + (b_ins + t_ins)
w: this.txBody.contentWidth + (r_ins + l_ins),
h: this.txBody.contentHeight + (b_ins + t_ins)
};
}
this.invertTransformText = global_MatrixTransformer.Invert(this.transformText);
......@@ -1864,16 +1864,20 @@ CShape.prototype =
{
graphics.SetIntegerGrid(false);
graphics.transform3(this.transformText);
var clip_rect = this.clipRect;
//graphics.AddClipRect(clip_rect.x, clip_rect.y, clip_rect.w, clip_rect.h);
this.txBody.draw(graphics);
/* if (graphics.FreeFont !== undefined)
graphics.FreeFont(); */
graphics.reset();
// graphics.RestoreGrState();
graphics.SetIntegerGrid(true);
}
},
drawTextSelection: function()
{
if(isRealObject(this.txBody))
......
......@@ -653,6 +653,10 @@ CTextBody.prototype =
}
this.content.Reset(0, 0, _content_width, 20000);
this.content.Recalculate_Page(0, true );
for(var i = 0; i < this.content.Content.length; ++i)
{
this.content.Content[i].recalculateTextPr();
}
},
OnEndRecalculate_Page: function()
......
......@@ -2671,7 +2671,7 @@ function GroupState(drawingObjectsController, drawingObjects, group)
cur_grouped_object.selectionSetStart(e, x, y);
this.drawingObjectsController.changeCurrentState(new TextAddInGroup(this.drawingObjectsController, this.drawingObjects, this.group, cur_drawing));
if(e.ClickCount < 2)
cur_drawing.updateSelectionState(this.drawingObjects.drawingDocument);
cur_grouped_object.updateSelectionState(this.drawingObjects.drawingDocument);
return;
}
}
......@@ -2887,8 +2887,8 @@ function TextAddInGroup(drawingObjectsController, drawingObjects, group, textObj
};
this.drawSelection = function(drawingDocument)
{
drawingDocument.DrawTrack(TYPE_TRACK_GROUP_PASSIVE, this.group.getTransform(), 0, 0, this.group.extX, this.group.extY, false/*, selected_objects[i].canRotate()TODO*/);
drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.textObject.getTransform(), 0, 0, this.textObject.extX, this.textObject.extY, false/*, selected_objects[i].canRotate()TODO*/)
drawingDocument.DrawTrack(TYPE_TRACK_GROUP_PASSIVE, this.group.getTransform(), 0, 0, this.group.extX, this.group.extY, false, this.group.canRotate());
drawingDocument.DrawTrack(TYPE_TRACK_TEXT, this.textObject.getTransform(), 0, 0, this.textObject.extX, this.textObject.extY, false, this.textObject.canRotate());
this.textObject.drawAdjustments(drawingDocument);
};
......
......@@ -2587,7 +2587,12 @@ UndoRedoGraphicObjects.prototype =
{
target_object.Undo(Type, Data.drawingData);
if(typeof target_object.Refresh_RecalcData === "function")
target_object.Refresh_RecalcData(Type, Data);
{
if(!(target_object instanceof CDocumentContent && (Type ===historyitem_AutoShapes_AddDrawingDocument
|| Type ===historyitem_AutoShapes_AddParent || Type ===historyitem_AutoShapes_AddParagraph)))
target_object.Refresh_RecalcData(Type, Data);
}
}
}
else
......
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