Commit 3d1434b1 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@48813 954022d7-b5bf-4e40-9824-e11837661b57
parent a6e9bb74
......@@ -388,7 +388,8 @@ CGraphicObjects.prototype =
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
canChangeArrows: c_obj.canChangeArrows(),
paddings: c_obj.getPaddings()
};
shape_props.verticalTextAlign = c_obj.bodyPr.anchor;
}
......@@ -399,7 +400,8 @@ CGraphicObjects.prototype =
type: c_obj.getPresetGeom(),
fill: c_obj.getFill(),
stroke: c_obj.getStroke(),
canChangeArrows: c_obj.canChangeArrows()
canChangeArrows: c_obj.canChangeArrows(),
paddings: c_obj.getPaddings()
};
shape_props = s_arr[i].Get_Props(shape_props);
shape_props.ShapeProperties = CompareShapeProperties(ShapeProperties, shape_props.ShapeProperties);
......
......@@ -219,6 +219,35 @@ WordGroupShapes.prototype =
return _ret;
},
getPaddings: function()
{
var paddings = null;
var cur_paddings;
for(var i = 0; i < this.arrGraphicObjects.length; ++i)
{
cur_paddings = null;
if(typeof this.arrGraphicObjects[i].getPaddings === "function")
{
cur_paddings = this.arrGraphicObjects[i].getPaddings();
}
if(cur_paddings)
{
if(!paddings)
{
paddings = cur_paddings;
}
else
{
paddings.Left = isRealNumber(paddings.Left) ? (paddings.Left === cur_paddings.Left ? paddings.Left : undefined) : undefined;
paddings.Top = isRealNumber(paddings.Top) ? (paddings.Top === cur_paddings.Top ? paddings.Top : undefined) : undefined;
paddings.Right = isRealNumber(paddings.Right) ? (paddings.Right === cur_paddings.Right ? paddings.Right : undefined) : undefined;
paddings.Bottom = isRealNumber(paddings.Bottom) ? (paddings.Bottom === cur_paddings.Bottom ? paddings.Bottom : undefined) : undefined;
}
}
}
return paddings;
},
canChangeArrows: function()
{
var _ret = false;
......@@ -371,7 +400,8 @@ WordGroupShapes.prototype =
type: this.getPresetGeom(),
fill: this.getFill(),
stroke: this.getStroke(),
canChangeArrows: this.canChangeArrows()
canChangeArrows: this.canChangeArrows(),
paddings: this.getPaddings()
}}
}
return null;
......@@ -5481,4 +5511,9 @@ function ShapeForResizeInGroup(originalShape, parentTrack)
if(this.parentTrack)
global_MatrixTransformer.MultiplyAppend(t, this.parentTrack.transform);
};
}
function isRealNumber(number)
{
return number === number && typeof number === "number";
}
\ No newline at end of file
......@@ -5179,6 +5179,37 @@ WordShape.prototype =
}
},
getPaddings: function()
{
var paddings = null;
var shape = this;
if(shape.textBoxContent)
{
var body_pr = shape.bodyPr;
paddings = new CPaddings();
if(typeof body_pr.lIns === "number")
paddings.Left = body_pr.lIns;
else
paddings.Left = 2.54;
if(typeof body_pr.tIns === "number")
paddings.Top = body_pr.tIns;
else
paddings.Top = 1.27;
if(typeof body_pr.rIns === "number")
paddings.Right = body_pr.rIns;
else
paddings.Right = 2.54;
if(typeof body_pr.bIns === "number")
paddings.Bottom = body_pr.bIns;
else
paddings.Bottom = 1.27;
}
return paddings;
},
documentUpdateRulersState: function()
{
if(!isRealObject(this.textBoxContent) || !isRealObject(this.transform))
......
......@@ -627,6 +627,7 @@ function CAscShapeProp()
this.type = null; // custom
this.fill = null;
this.stroke = null;
this.paddings = null;
}
CAscShapeProp.prototype.get_type = function(){return this.type}
CAscShapeProp.prototype.put_type = function(v){this.type = v;}
......@@ -635,6 +636,9 @@ CAscShapeProp.prototype.put_fill = function(v){this.fill = v;}
CAscShapeProp.prototype.get_stroke = function(){return this.stroke}
CAscShapeProp.prototype.put_stroke = function(v){this.stroke = v;}
CAscShapeProp.prototype.get_paddings = function(){return this.paddings}
CAscShapeProp.prototype.put_paddings = function(v){this.paddings = v;}
// эта функция ДОЛЖНА минимизироваться
function CreateAscShapeProp(shape)
{
......@@ -644,6 +648,31 @@ function CreateAscShapeProp(shape)
var ret = new CAscShapeProp();
ret.fill = CreateAscFill(shape.brush);
ret.stroke = CreateAscStroke(shape.pen);
var paddings = null;
if(shape.textBoxContent)
{
var body_pr = shape.bodyPr;
paddings = new CPaddings();
if(typeof body_pr.lIns === "number")
paddings.Left = body_pr.lIns;
else
paddings.Left = 2.54;
if(typeof body_pr.tIns === "number")
paddings.Top = body_pr.tIns;
else
paddings.Top = 1.27;
if(typeof body_pr.rIns === "number")
paddings.Right = body_pr.rIns;
else
paddings.Right = 2.54;
if(typeof body_pr.bIns === "number")
paddings.Bottom = body_pr.bIns;
else
paddings.Bottom = 1.27;
}
return ret;
}
......@@ -659,6 +688,8 @@ function CreateAscShapePropFromProp(shapeProp)
obj.fill = CreateAscFill(shapeProp.fill);
if(isRealObject(shapeProp.stroke))
obj.stroke = CreateAscStroke(shapeProp.stroke, shapeProp.canChangeArrows);
if(isRealObject(shapeProp.paddings))
obj.paddings = shapeProp.paddings;
return obj;
}
......
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