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

прокинул свойство vert отвечающее за поворот контента в автофигурах.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62499 954022d7-b5bf-4e40-9824-e11837661b57
parent bce8a023
......@@ -1437,7 +1437,25 @@ DrawingObjectsController.prototype =
setCellAngle: function (angle) {
//TODO:this.checkSelectedObjectsAndCallback(this.setCellAngleCallBack, [angle]);
switch (angle)
{
case 0 :
{
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{vert: null}], false, historydescription_Spreadsheet_SetCellVertAlign);
break;
}
case 90 :
{
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{vert: nVertTTvert}], false, historydescription_Spreadsheet_SetCellVertAlign);
break;
}
case 270:
{
this.checkSelectedObjectsAndCallback(this.applyDrawingProps, [{vert: nVertTTvert270}], false, historydescription_Spreadsheet_SetCellVertAlign);
break;
}
}
},
setCellStyle: function (name) {
......@@ -1736,6 +1754,17 @@ DrawingObjectsController.prototype =
objects_by_type.groups[i].setVerticalAlign(props.verticalTextAlign);
}
}
if(isRealNumber(props.vert))
{
for(i = 0; i < objects_by_type.shapes.length; ++i)
{
objects_by_type.shapes[i].setVert(props.vert);
}
for(i = 0; i < objects_by_type.groups.length; ++i)
{
objects_by_type.groups[i].setVert(props.vert);
}
}
if(isRealObject(props.paddings))
{
for(i = 0; i < objects_by_type.shapes.length; ++i)
......@@ -4695,6 +4724,34 @@ DrawingObjectsController.prototype =
chart_selection.recalcInfo.bRecalculatedTitle = false;
}
}
else {
var oTargetTextObject = getTargetTextObject(this);
if (oTargetTextObject) {
if (oTargetTextObject.recalcInfo.bRecalculatedTitle) {
oTargetTextObject.recalcInfo.recalcTitle = null;
oTargetTextObject.handleContent && oTargetTextObject.handleContent();
if (this.document) {
oTargetTextObject.recalculate();
this.document.DrawingDocument.OnRecalculatePage(oTargetTextObject.selectStartPage, this.document.Pages[oTargetTextObject.selectStartPage]);
this.document.DrawingDocument.OnEndRecalculate(false, true);
}
else if (this.drawingObjects.cSld) {
oTargetTextObject.recalculate();
if (!(bNoRedraw === true)) {
editor.WordControl.m_oDrawingDocument.OnRecalculatePage(this.drawingObjects.num, this.drawingObjects);
editor.WordControl.m_oDrawingDocument.OnEndRecalculate(false, true);
}
}
else {
oTargetTextObject.addToRecalculate();
this.startRecalculate();
}
oTargetTextObject.recalcInfo.bRecalculatedTitle = false;
}
}
}
},
resetSelection: function(noResetContentSelect)
......@@ -5234,6 +5291,7 @@ DrawingObjectsController.prototype =
stroke: drawing.getStroke(),
paddings: drawing.getPaddings(),
verticalTextAlign: drawing.getBodyPr().anchor,
vert: drawing.getBodyPr().vert,
w: drawing.extX,
h: drawing.extY ,
canChangeArrows: drawing.canChangeArrows(),
......@@ -5329,6 +5387,7 @@ DrawingObjectsController.prototype =
stroke: drawing.getStroke(),
paddings: null,
verticalTextAlign: null,
vert: null,
w: drawing.extX,
h: drawing.extY ,
canChangeArrows: false,
......@@ -5538,6 +5597,7 @@ DrawingObjectsController.prototype =
shape_props.ShapeProperties.paddings = new asc_CPaddings(props.shapeChartProps.paddings);
}
shape_props.verticalTextAlign = props.shapeChartProps.verticalTextAlign;
shape_props.vert = props.shapeChartProps.vert;
shape_props.ShapeProperties.canFill = props.shapeChartProps.canFill;
shape_props.Width = props.shapeChartProps.w;
shape_props.Height = props.shapeChartProps.h;
......@@ -5581,6 +5641,7 @@ DrawingObjectsController.prototype =
shape_props.ShapeProperties.paddings = new asc_CPaddings(props.shapeProps.paddings);
}
shape_props.verticalTextAlign = props.shapeProps.verticalTextAlign;
shape_props.vert = props.shapeProps.vert;
shape_props.ShapeProperties.canFill = props.shapeProps.canFill;
shape_props.Width = props.shapeProps.w;
shape_props.Height = props.shapeProps.h;
......
......@@ -1561,6 +1561,7 @@ var historydescription_Presentation_TableMoveFromRulersInline = 0x011e;
var historydescription_Presentation_PasteOnThumbnails = 0x011f;
var historydescription_Presentation_PasteOnThumbnailsSafari = 0x0120;
var historydescription_Document_ConvertOldEquation = 0x0121;
var historydescription_Presentation_SetVert = 0x0122;
......
......@@ -2224,15 +2224,19 @@ CUniColor.prototype =
IsIdentical : function(unicolor)
{
if(unicolor == null)
if(!isRealObject(unicolor))
{
return false;
}
if(!this.color.IsIdentical(unicolor.color))
if(!isRealObject(unicolor.color) && isRealObject(this.color)
|| !isRealObject(this.color) && isRealObject(unicolor.color)
|| isRealObject(this.color) && !this.color.IsIdentical(unicolor.color))
{
return false;
}
if(!this.Mods.IsIdentical(unicolor.Mods))
if(!isRealObject(unicolor.Mods) && isRealObject(this.Mods)
|| !isRealObject(this.Mods) && isRealObject(unicolor.Mods)
|| isRealObject(this.Mods) && !this.Mods.IsIdentical(unicolor.Mods))
{
return false;
}
......@@ -5130,6 +5134,7 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
else */
{
_result_shape_prop.verticalTextAlign = null;
_result_shape_prop.vert = null;
}
if(shapeProp1.canChangeArrows !== true || shapeProp2.canChangeArrows !== true)
......@@ -11115,7 +11120,6 @@ CTextFit.prototype =
{}
};
// ----------------------------------
......@@ -11178,6 +11182,7 @@ function CBodyPr()
this.vertOverflow = null;
this.wrap = null;
this.textFit = null;
this.prstTxWarp = null;
this.parent = null;
......@@ -11217,7 +11222,8 @@ CBodyPr.prototype =
this.vert !== null ||
this.vertOverflow !== null ||
this.wrap !== null ||
this.textFit !== null;
this.textFit !== null ||
this.prstTxWarp !== null;
},
setAnchor: function(val)
......@@ -11258,9 +11264,51 @@ CBodyPr.prototype =
this.vertOverflow = null;
this.wrap = null;
this.textFit = null;
this.prstTxWarp = null;
},
WritePrstTxWarp: function(w)
{
w.WriteBool(isRealObject(this.prstTxWarp));
if(isRealObject(this.prstTxWarp))
{
writeString(w, this.prstTxWarp.preset);
var startPos = w.GetCurPosition(), countAv = 0;
w.Skip(4);
for(var key in this.prstTxWarp.avLst)
{
if(this.prstTxWarp.avLst.hasOwnProperty(key))
{
++countAv;
w.WriteString(key);
w.WriteLong(this.prstTxWarp.gdLst[key]);
}
}
var endPos = w.GetCurPosition();
w.Seek(startPos);
w.WriteLong(countAv);
w.Seek(endPos);
}
},
ReadPrstTxWarp: function(r)
{
ExecuteNoHistory(function(){
if(r.GetBool())
{
this.prstTxWarp = CreatePrstTxWarpGeometry(readString(r));
var count = r.GetLong();
for(var i = 0; i < count; ++i)
{
var sAdj = r.GetString2();
var nVal = r.GetLong();
this.prstTxWarp.AddAdj(sAdj, 15, nVal + "", undefined, undefined);
}
}
}, this, []);
},
Write_ToBinary2: function(w)
{
var flag = this.flatTx != null;
......@@ -11404,6 +11452,8 @@ CBodyPr.prototype =
{
w.WriteLong(this.wrap);
}
this.WritePrstTxWarp(w);
},
Read_FromBinary2: function(r)
......@@ -11549,6 +11599,7 @@ CBodyPr.prototype =
{
this.wrap = r.GetLong();
}
this.ReadPrstTxWarp(r);
},
setDefault: function()
......@@ -11573,6 +11624,7 @@ CBodyPr.prototype =
this.vert = nVertTThorz;
this.vertOverflow = nOTOwerflow;
this.wrap = nTWTSquare;
this.prstTxWarp = null;
},
createDuplicate: function()
......@@ -11598,7 +11650,10 @@ CBodyPr.prototype =
duplicate.vert = this.vert;
duplicate.vertOverflow = this.vertOverflow;
duplicate.wrap = this.wrap;
if(this.prstTxWarp)
{
duplicate.prstTxWarp = ExecuteNoHistory(function(){return this.prstTxWarp.createDuplicate();}, this, []);
}
return duplicate;
},
......@@ -11690,6 +11745,10 @@ CBodyPr.prototype =
{
this.wrap = bodyPr.wrap;
}
if(bodyPr.prstTxWarp)
{
this.prstTxWarp = ExecuteNoHistory(function(){return bodyPr.prstTxWarp.createDuplicate();}, this, []);
}
return this;
},
......@@ -11836,6 +11895,7 @@ CBodyPr.prototype =
{
w.WriteLong(this.wrap);
}
this.WritePrstTxWarp(w);
},
Read_FromBinary: function(r)
......@@ -11981,6 +12041,7 @@ CBodyPr.prototype =
{
this.wrap = r.GetLong();
}
this.ReadPrstTxWarp(r);
}
};
......
......@@ -310,22 +310,6 @@ CGroupShape.prototype =
return c;
},
isSimpleObject: function()
{
return false;
},
setDiagram: function(chartPr)
{
var bRecalc = false;
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setDiagram)
{
this.spTree[i].setDiagram(chartPr);
}
}
},
getAllFonts: function(fonts)
{
......@@ -1063,6 +1047,17 @@ CGroupShape.prototype =
}
},
setVert : function(vert)
{
for(var _shape_index = 0; _shape_index < this.spTree.length; ++_shape_index)
{
if(this.spTree[_shape_index].setVert)
{
this.spTree[_shape_index].setVert(vert);
}
}
},
setPaddings: function(paddings)
{
for(var i = 0; i < this.spTree.length; ++i)
......
This diff is collapsed.
......@@ -140,7 +140,7 @@ StartAddNewShape.prototype =
function checkEmptyPlaceholderContent(content)
{
if(!content || content.Is_Empty() && content.Parent && content.Parent.parent && content.Parent.parent.isPlaceholder && content.Parent.parent.isPlaceholder())
if(!content || content.Parent && content.Parent.parent && (content.Is_Empty() && content.Parent.parent.isPlaceholder && content.Parent.parent.isPlaceholder() || content.Parent.parent.txWarpStruct) )
return content;
return null;
}
......
......@@ -1783,6 +1783,7 @@
this.Locked = false;
this.w = null;
this.h = null;
this.vert = null;
}
asc_CShapeProperty.prototype = {
......@@ -1809,7 +1810,9 @@
asc_getHeight: function(){return this.h},
asc_putHeight: function(v){this.h = v;},
asc_getVerticalTextAlign: function(){return this.verticalTextAlign},
asc_putVerticalTextAlign: function(v){this.verticalTextAlign = v;}
asc_putVerticalTextAlign: function(v){this.verticalTextAlign = v;},
asc_getVert: function(){return this.vert},
asc_putVert: function(v){this.vert = v;}
};
//{ asc_CShapeProperty export
......@@ -1838,6 +1841,8 @@
prot["put_Height"] = prot["asc_putHeight"] = prot.asc_putHeight;
prot["get_VerticalTextAlign"] = prot["asc_getVerticalTextAlign"] = prot.asc_getVerticalTextAlign;
prot["put_VerticalTextAlign"] = prot["asc_putVerticalTextAlign"] = prot.asc_putVerticalTextAlign;
prot["get_Vert"] = prot["asc_getVert"] = prot.asc_getVert;
prot["put_Vert"] = prot["asc_putVert"] = prot.asc_putVert;
// ---------------------------------------------------------------
......@@ -1876,6 +1881,7 @@
this.severalChartTypes = obj.severalChartTypes != undefined ? obj.severalChartTypes : undefined;
this.severalChartStyles = obj.severalChartStyles != undefined ? obj.severalChartStyles : undefined;
this.verticalTextAlign = obj.verticalTextAlign != undefined ? obj.verticalTextAlign : undefined;
this.vert = obj.vert != undefined ? obj.vert : undefined;
}
else {
this.CanBeFlow = true;
......@@ -1901,6 +1907,7 @@
this.severalChartTypes = undefined;
this.severalChartStyles = undefined;
this.verticalTextAlign = undefined;
this.vert = undefined;
}
}
......@@ -1953,6 +1960,8 @@
asc_getVerticalTextAlign: function() { return this.verticalTextAlign; },
asc_putVerticalTextAlign: function(v) { this.verticalTextAlign = v; },
asc_getVert: function() { return this.vert; },
asc_putVert: function(v) { this.vert = v; },
asc_getLocked: function() { return this.Locked; },
asc_getChartProperties: function() { return this.ChartProperties; },
......@@ -2053,6 +2062,8 @@
prot["put_SeveralChartStyles"] = prot["asc_putSeveralChartStyles"] = prot.asc_putSeveralChartStyles;
prot["get_VerticalTextAlign"] = prot["asc_getVerticalTextAlign"] = prot.asc_getVerticalTextAlign;
prot["put_VerticalTextAlign"] = prot["asc_putVerticalTextAlign"] = prot.asc_putVerticalTextAlign;
prot["get_Vert"] = prot["asc_getVert"] = prot.asc_getVert;
prot["put_Vert"] = prot["asc_putVert"] = prot.asc_putVert;
prot["get_Locked"] = prot["asc_getLocked"] = prot.asc_getLocked;
prot["get_ChartProperties"] = prot["asc_getChartProperties"] = prot.asc_getChartProperties;
prot["put_ChartProperties"] = prot["asc_putChartProperties"] = prot.asc_putChartProperties;
......
......@@ -562,6 +562,13 @@ var c_oAscVerticalTextAlign = {
TEXT_ALIGN_JUST : 3, // (Text Anchor Enum ( Justified ))
TEXT_ALIGN_TOP : 4 // Top
};
var c_oAscVertDrawingText =
{
normal : 1,
vert : 3,
vert270: 4
};
var c_oAscLineJoinType = {
Round : 1,
Bevel : 2,
......
......@@ -6677,6 +6677,7 @@
}
var vertAlign = "center";
var shape_props = this.objectRender.controller.getDrawingProps().shapeProps;
var angle = null;
if(shape_props)
{
switch (shape_props.verticalTextAlign) {
......@@ -6687,10 +6688,17 @@
case VERTICAL_ANCHOR_TYPE_DISTRIBUTED:
case VERTICAL_ANCHOR_TYPE_JUSTIFIED: vertAlign = "top"; break;
}
switch (shape_props.vert) {
case nVertTTvert: angle = 90; break;
case nVertTTvert270: angle = 270; break;
default: angle = 0; break;
}
}
objectInfo.halign = horAlign;
objectInfo.valign = vertAlign;
objectInfo.angle = angle;
objectInfo.font = new asc_CFont();
objectInfo.font.name = textPr.FontFamily ? textPr.FontFamily.Name : "";
......
......@@ -1420,6 +1420,14 @@ CPresentation.prototype =
this.Document_UpdateInterfaceState();
}
},
setVert: function(align)
{
if(this.Slides[this.CurPage])
{
this.Slides[this.CurPage].graphicObjects.checkSelectedObjectsAndCallback(this.Slides[this.CurPage].graphicObjects.applyDrawingProps, [{vert: align}], false, historydescription_Presentation_SetVert);
this.Document_UpdateInterfaceState();
}
},
Get_Styles: function()
{
......@@ -2873,6 +2881,7 @@ CPresentation.prototype =
{
editor.sync_shapePropCallback(drawing_props.shapeProps);
editor.sync_VerticalTextAlign(drawing_props.shapeProps.verticalTextAlign);
editor.sync_Vert(drawing_props.shapeProps.vert);
}
if(drawing_props.chartProps && drawing_props.chartProps.chartProps)
......
......@@ -1308,6 +1308,10 @@ asc_docs_api.prototype.sync_VerticalTextAlign = function(align)
{
this.asc_fireCallback("asc_onVerticalTextAlign", align);
};
asc_docs_api.prototype.sync_Vert = function(vert)
{
this.asc_fireCallback("asc_onVert", vert);
};
asc_docs_api.prototype.UpdateParagraphProp = function(ParaPr, bParaPr){
......@@ -4265,6 +4269,11 @@ asc_docs_api.prototype.setVerticalAlign = function(align)
this.WordControl.m_oLogicDocument.setVerticalAlign(align);
};
asc_docs_api.prototype.setVert = function(vert)
{
this.WordControl.m_oLogicDocument.setVert(vert);
};
asc_docs_api.prototype.sync_MouseMoveStartCallback = function()
{
this.asc_fireCallback("asc_onMouseMoveStart");
......
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