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

правка бага 21431 - Невозможно установить отступы для внутреннего текста...

правка бага 21431 - Невозможно установить отступы для внутреннего текста автофигур в расширенных настройках 

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@50797 954022d7-b5bf-4e40-9824-e11837661b57
parent 1a499c63
......@@ -1297,6 +1297,20 @@ CGraphicObjects.prototype =
this.curState.textObject.setTextVerticalAlign(props.verticalTextAlign);
}
}
if(isRealObject(props.paddings))
{
if(this.curState.id === STATES_ID_TEXT_ADD)
{
if(typeof this.curState.textObject.GraphicObj.setPaddings === "function")
this.curState.textObject.GraphicObj.setPaddings(props.paddings);
}
if(this.curState.id === STATES_ID_TEXT_ADD_IN_GROUP)
{
if(typeof this.curState.textObject.setPaddings === "function")
this.curState.textObject.setPaddings(props.paddings);
}
}
if(!(this.curState.id === STATES_ID_GROUP || this.curState.id === STATES_ID_TEXT_ADD_IN_GROUP) && isRealObject(properties))
{
var ArrGlyph = this.selectionInfo.selectionArray;
......@@ -1326,6 +1340,10 @@ CGraphicObjects.prototype =
{
ArrGlyph[i].GraphicObj.changeLine(properties.stroke);
}
if(isRealObject(properties.paddings))
{
ArrGlyph[i].GraphicObj.setPaddings(properties.paddings);
}
}
}
......@@ -1370,6 +1388,10 @@ CGraphicObjects.prototype =
{
ArrGlyph[i].changeLine(properties.stroke);
}
if(isRealObject(properties.paddings))
{
ArrGlyph[i].setPaddings(properties.paddings);
}
}
else if(isRealObject(props) && typeof props.ImageUrl === "string" && ArrGlyph[i].isImage() && ArrGlyph[i].chart == null)
{
......
......@@ -151,6 +151,16 @@ WordGroupShapes.prototype =
},
setPaddings: function(paddings)
{
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setPaddings)
{
this.spTree[i].setPaddings(paddings);
}
}
},
setGroup: function(group)
{
......
......@@ -1398,6 +1398,31 @@ WordShape.prototype =
this.calculateTransformTextMatrix();
},
setPaddings: function(paddings)
{
if(isRealObject(paddings))
{
var history_obj = {Type:historyitem_AutoShapes_SetTextPaddings};
history_obj.oldL = this.bodyPr.lIns;
history_obj.oldT = this.bodyPr.tIns;
history_obj.oldR = this.bodyPr.rIns;
history_obj.oldB = this.bodyPr.bIns;
history_obj.newL = isRealNumber(paddings.Left) ? paddings.Left : this.bodyPr.lIns;
history_obj.newT = isRealNumber(paddings.Top) ? paddings.Top : this.bodyPr.tIns;
history_obj.newR = isRealNumber(paddings.Right) ? paddings.Right : this.bodyPr.rIns;
history_obj.newB = isRealNumber(paddings.Bottom) ? paddings.Bottom : this.bodyPr.bIns;
History.Add(this, history_obj);
this.bodyPr.lIns = isRealNumber(paddings.Left) ? paddings.Left : this.bodyPr.lIns
this.bodyPr.tIns = isRealNumber(paddings.Top) ? paddings.Top : this.bodyPr.tIns
this.bodyPr.rIns = isRealNumber(paddings.Right) ? paddings.Right : this.bodyPr.rIns
this.bodyPr.bIns = isRealNumber(paddings.Bottom) ? paddings.Bottom : this.bodyPr.bIns
this.calculateContent();
this.calculateTransformTextMatrix();
}
},
canAddComment: function()
{
if(isRealObject(this.textBoxContent))
......@@ -4275,6 +4300,14 @@ WordShape.prototype =
this.bodyPr.anchor = data.oldAlign;
break;
}
case historyitem_AutoShapes_SetTextPaddings:
{
this.bodyPr.lIns = data.oldL;
this.bodyPr.tIns = data.oldT;
this.bodyPr.rIns = data.oldR;
this.bodyPr.bIns = data.oldB;
break;
}
case historyitem_SetParent:
{
if(data.oldParent == null)
......@@ -4543,6 +4576,14 @@ WordShape.prototype =
this.bodyPr.anchor = data.newAlign;
break;
}
case historyitem_AutoShapes_SetTextPaddings:
{
this.bodyPr.lIns = data.newL;
this.bodyPr.tIns = data.newT;
this.bodyPr.rIns = data.newR;
this.bodyPr.bIns = data.newB;
break;
}
case historyitem_SetParent:
{
......@@ -4866,6 +4907,31 @@ WordShape.prototype =
writer.WriteLong(data.newAlign);
break;
}
case historyitem_AutoShapes_SetTextPaddings:
{
var w = writer;
w.WriteBool(isRealNumber(data.newL));
if(isRealNumber(data.newL))
{
w.WriteDouble(data.newL);
}
w.WriteBool(isRealNumber(data.newT));
if(isRealNumber(data.newT))
{
w.WriteDouble(data.newT);
}
w.WriteBool(isRealNumber(data.newR));
if(isRealNumber(data.newR))
{
w.WriteDouble(data.newR);
}
w.WriteBool(isRealNumber(data.newB));
if(isRealNumber(data.newB))
{
w.WriteDouble(data.newB);
}
break;
}
case historyitem_SetParent:
{
writer.WriteBool(data.newParent != null);
......@@ -5377,6 +5443,43 @@ WordShape.prototype =
this.bodyPr.anchor = reader.GetLong();
break;
}
case historyitem_AutoShapes_SetTextPaddings:
{
var r = reader;
if(r.GetBool())
{
this.bodyPr.lIns = r.GetDouble();
}
else
{
this.bodyPr.lIns = undefined;
}
if(r.GetBool())
{
this.bodyPr.tIns = r.GetDouble();
}
else
{
this.bodyPr.tIns = undefined;
}
if(r.GetBool())
{
this.bodyPr.rIns = r.GetDouble();
}
else
{
this.bodyPr.rIns = undefined;
}
if(r.GetBool())
{
this.bodyPr.bIns = r.GetDouble();
}
else
{
this.bodyPr.bIns = undefined;
}
break;
}
case historyitem_SetParent:
{
if(reader.GetBool())
......
......@@ -267,6 +267,7 @@ var historyitem_AutoShapes_SetChartTitleType = 45;
var historyitem_SetSetSpPr = 46;
var historyitem_AutoShapes_SetChartTitleTxBody = 47;
var historyitem_AutoShapes_RecalculateAfterResize = 48;
var historyitem_AutoShapes_SetTextPaddings = 49;
//Типы изменений в классе GraphicObjects
......
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