Commit 5b267a8e 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@49645 954022d7-b5bf-4e40-9824-e11837661b57
parent d9ca6c73
This diff is collapsed.
......@@ -42,6 +42,7 @@ function CChartAsGroup(parent/*(WordGraphicObject)*/, document, drawingDocument,
[];
this.selected = false;
this.mainGroup = null;
this.Lock = new CLock();
this.Id = g_oIdCounter.Get_NewId();
g_oTableId.Add(this, this.Id);
......@@ -356,32 +357,114 @@ CChartAsGroup.prototype =
recalculatePosExt: function()
{
var xfrm;
xfrm = this.spPr.xfrm;
if(!isRealObject(this.group))
{
/* if(isRealObject(this.parent))
{
var ext = this.parent.Extent;
this.extX = ext.W;
this.extY = ext.H;
}
else
{ */
//this.x = 0;
//this.y = 0;
this.extX = xfrm.extX;
this.extY = xfrm.extY;
//}
if(this.spPr.xfrm.isNotNull())
{
var xfrm = this.spPr.xfrm;
this.x = xfrm.offX;
this.y = xfrm.offY;
this.extX = xfrm.extX;
this.extY = xfrm.extY;
this.rot = isRealNumber(xfrm.rot) ? xfrm.rot : 0;
this.flipH = xfrm.flipH === true;
this.flipV = xfrm.flipV === true;
}
else
{
if(this.isPlaceholder())
{
var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i)
{
var hierarchy_sp = hierarchy[i];
if(isRealObject(hierarchy_sp) && hierarchy_sp.spPr.xfrm.isNotNull())
{
var xfrm = hierarchy_sp.spPr.xfrm;
this.x = xfrm.offX;
this.y = xfrm.offY;
this.extX = xfrm.extX;
this.extY = xfrm.extY;
this.rot = isRealNumber(xfrm.rot) ? xfrm.rot : 0;
this.flipH = xfrm.flipH === true;
this.flipV = xfrm.flipV === true;
break;
}
}
if(i === hierarchy.length)
{
this.x = 0;
this.y = 0;
this.extX = 5;
this.extY = 5;
this.rot = 0;
this.flipH = false;
this.flipV = false;
}
}
else
{
this.x = 0;
this.y = 0;
this.extX = 5;
this.extY = 5;
this.rot = 0;
this.flipH = false;
this.flipV = false;
}
}
}
else
{
var xfrm;
if(this.spPr.xfrm.isNotNull())
{
xfrm = this.spPr.xfrm;
}
else
{
if(this.isPlaceholder())
{
var hierarchy = this.getHierarchy();
for(var i = 0; i < hierarchy.length; ++i)
{
var hierarchy_sp = hierarchy[i];
if(isRealObject(hierarchy_sp) && hierarchy_sp.spPr.xfrm.isNotNull())
{
xfrm = hierarchy_sp.spPr.xfrm;
break;
}
}
if(i === hierarchy.length)
{
xfrm = new CXfrm();
xfrm.offX = 0;
xfrm.offX = 0;
xfrm.extX = 5;
xfrm.extY = 5;
}
}
else
{
xfrm = new CXfrm();
xfrm.offX = 0;
xfrm.offY = 0;
xfrm.extX = 5;
xfrm.extY = 5;
}
}
var scale_scale_coefficients = this.group.getResultScaleCoefficients();
this.x = scale_scale_coefficients.cx*(xfrm.offX - this.group.spPr.xfrm.chOffX);
this.y = scale_scale_coefficients.cy*(xfrm.offY - this.group.spPr.xfrm.chOffY);
this.extX = scale_scale_coefficients.cx*xfrm.extX;
this.extY = scale_scale_coefficients.cy*xfrm.extY;
this.rot = isRealNumber(xfrm.rot) ? xfrm.rot : 0;
this.flipH = xfrm.flipH === true;
this.flipV = xfrm.flipV === true;
}
this.transform.Reset();
var hc = this.extX*0.5;
var vc = this.extY*0.5;
this.spPr.geometry.Recalculate(this.extX, this.extY);
},
......@@ -396,19 +479,24 @@ CChartAsGroup.prototype =
return this.transform;
},
recalculateMatrix: function()
{
this.transform.Reset();
var hc, vc;
hc = this.extX*0.5;
vc = this.extY*0.5;
this.spPr.geometry.Recalculate(this.extX, this.extY);
var hc = this.extX*0.5;
var vc = this.extY*0.5;
global_MatrixTransformer.TranslateAppend(this.transform, -hc, -vc);
if(this.flipH)
global_MatrixTransformer.ScaleAppend(this.transform, -1, 1);
if(this.flipV)
global_MatrixTransformer.ScaleAppend(this.transform, 1, -1);
global_MatrixTransformer.RotateRadAppend(this.transform, -this.rot);
global_MatrixTransformer.TranslateAppend(this.transform, this.x + hc, this.y + vc);
if(isRealObject(this.group))
{
global_MatrixTransformer.MultiplyAppend(this.transform, this.group.getTransform());
global_MatrixTransformer.MultiplyAppend(this.transform, this.group.getTransformMatrix());
}
this.invertTransform = global_MatrixTransformer.Invert(this.transform);
......@@ -1061,7 +1149,7 @@ CChartAsGroup.prototype =
{
var options = {theme: parents.theme, slide: parents.slide, layout: parents.layout, master: parents.master};
this.brush.fill.canvas = (new ChartRender(options)).insertChart(this.chart, null, editor.WordControl.m_oDrawingDocument.GetDotsPerMM(this.extX), editor.WordControl.m_oDrawingDocument.GetDotsPerMM(this.extY), undefined, undefined, parents.theme, colorMap);
this.brush.fill.canvas = (new ChartRender(options)).insertChart(this.chart, null, editor.WordControl.m_oDrawingDocument.GetDotsPerMM(this.extX), editor.WordControl.m_oDrawingDocument.GetDotsPerMM(this.extY), undefined, undefined, options);
this.brush.fill.RasterImageId = "";
//editor.WordControl.m_oLogicDocument.DrawingObjects.urlMap.push(this.brush.fill.RasterImageId);
}
......
......@@ -76,6 +76,17 @@ CChartTitle.prototype =
return CHART_TITLE_TYPE_V_AXIS;
},
getParentObjects: function()
{
return this.chartGroup.getParentObjects();
},
isPlaceholder: function()
{
return false;
},
isEmpty: function()
{
return isRealObject(this.txBody) ? this.txBody.isEmpty() : true;
......
......@@ -1530,6 +1530,7 @@ CPresentation.prototype =
{
this.Slides[this.CurPage].graphicObjects.shapeApply(shapeProps);
this.Recalculate();
this.Document_UpdateInterfaceState();
},
changeShapeType : function(shapeType)
......
This diff is collapsed.
......@@ -389,5 +389,37 @@ CTextBody.prototype =
{},
Refresh_RecalcData2: function()
{}
{},
getRectWidth: function(maxWidth)
{
var body_pr = this.getBodyPr();
var r_ins = body_pr.rIns;
var l_ins = body_pr.lIns;
var max_content_width = maxWidth - r_ins - l_ins;
this.content.Reset(0, 0, max_content_width, 20000);
this.content.Recalculate_Page(0, true);
var max_width = 0;
for(var i = 0; i < this.content.Content.length; ++i)
{
var par = this.content.Content[i];
for(var j = 0; j < par.Lines.length; ++j)
{
if(par.Lines[j].Ranges[0].W + 1> max_width)
{
max_width = par.Lines[j].Ranges[0].W;
}
}
}
return max_width + r_ins + l_ins;
},
getRectHeight: function(maxHeight, width)
{
this.content.Reset(0, 0, width, 20000);
this.content.Recalculate_Page(0, true);
var content_height = this.getSummaryHeight();
var t_ins = isRealNumber(this.bodyPr.tIns) ? this.bodyPr.tIns : 1.27;
var b_ins = isRealNumber(this.bodyPr.bIns) ? this.bodyPr.bIns : 1.27;
return content_height + t_ins + b_ins;
}
};
......@@ -267,6 +267,14 @@ var historyitem_SetShapeFlips = 3;
var historyitem_SetShapeParent = 4;
var historyitem_SetShapeChildOffset = 5;
var historyitem_SetShapeChildExtents = 6;
var historyitem_SetShapeSetFill = 7;
var historyitem_SetShapeSetLine= 8;
var historyitem_SetShapeSetGeometry = 9;
var historyitem_SetShapeBodyPr = 10;
......
......@@ -67,8 +67,8 @@ function asc_docs_api(name)
this.isPasteFonts_Images = false;
this.isLoadNoCutFonts = false;
// На этапе сборки значение переменной ASC_DOCS_API_USE_EMBEDDED_FONTS может менятся.
// На этапе сборки значение переменной ASC_DOCS_API_USE_EMBEDDED_FONTS может менятся.
// По дефолту встроенные шрифты использоваться не будут, как и при любом значении
// ASC_DOCS_API_USE_EMBEDDED_FONTS, кроме "true"(написание от регистра не зависит).
this.isUseEmbeddedCutFonts = ("true" == ASC_DOCS_API_USE_EMBEDDED_FONTS.toLowerCase());
......@@ -108,6 +108,8 @@ function asc_docs_api(name)
this.chartStyleManager = new ChartStyleManager();
this.chartPreviewManager = new ChartPreviewManager();
this.chartTranslate = new asc_CChartTranslate();
// объекты, нужные для отправки в тулбар (шрифты, стили)
this._gui_fonts = null;
this._gui_editor_themes = null;
......@@ -1906,13 +1908,14 @@ asc_docs_api.prototype.ShapeApply = function(prop)
}
else
{
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
if(!this.noCreatePoint)
this.WordControl.m_oLogicDocument.Create_NewHistoryPoint();
this.WordControl.m_oLogicDocument.ShapeApply(prop);
}
}
asc_docs_api.prototype.setStartPointHistory = function(){this.noCreatePoint = true; History.Create_NewPoint();};
asc_docs_api.prototype.setEndPointHistory = function(){this.noCreatePoint = false;};
asc_docs_api.prototype.setEndPointHistory = function(){this.noCreatePoint = false; };
asc_docs_api.prototype.SetSlideProps = function(prop)
{
if (null == prop)
......@@ -3509,6 +3512,7 @@ asc_docs_api.prototype.AddShape = function(shapetype)
}
asc_docs_api.prototype.ChangeShapeType = function(shapetype)
{
History.Create_NewPoint();
this.WordControl.m_oLogicDocument.changeShapeType(shapetype);
}
asc_docs_api.prototype.AddText = function()
......@@ -3517,16 +3521,19 @@ asc_docs_api.prototype.AddText = function()
asc_docs_api.prototype.groupShapes = function()
{
History.Create_NewPoint();
this.WordControl.m_oLogicDocument.groupShapes();
}
asc_docs_api.prototype.unGroupShapes = function()
{
History.Create_NewPoint();
this.WordControl.m_oLogicDocument.unGroupShapes();
}
asc_docs_api.prototype.setVerticalAlign = function(align)
{
History.Create_NewPoint();
this.WordControl.m_oLogicDocument.setVerticalAlign(align);
}
......
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