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

git-svn-id:...

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@49398 954022d7-b5bf-4e40-9824-e11837661b57
parent 83c51d45
......@@ -1419,6 +1419,24 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_result_shape_prop.type = null;
}
if(shapeProp1.h === shapeProp2.h)
{
_result_shape_prop.h = shapeProp1.h;
}
else
{
_result_shape_prop.h = null;
}
if(shapeProp1.w === shapeProp2.w)
{
_result_shape_prop.w = shapeProp1.w;
}
else
{
_result_shape_prop.w = null;
}
if(shapeProp1.stroke === null || shapeProp2.stroke === null)
{
_result_shape_prop.stroke = null;
......@@ -1434,6 +1452,14 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_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 CPaddings();
_result_shape_prop.paddings.Left = isRealNumber(shapeProp1.paddings.Left) ? (shapeProp1.paddings.Left === shapeProp2.paddings.Left ? shapeProp1.paddings.Left : undefined) : undefined;
_result_shape_prop.paddings.Top = isRealNumber(shapeProp1.paddings.Top) ? (shapeProp1.paddings.Top === shapeProp2.paddings.Top ? shapeProp1.paddings.Top : undefined) : undefined;
_result_shape_prop.paddings.Right = isRealNumber(shapeProp1.paddings.Right) ? (shapeProp1.paddings.Right === shapeProp2.paddings.Right ? shapeProp1.paddings.Right : undefined) : undefined;
_result_shape_prop.paddings.Bottom = isRealNumber(shapeProp1.paddings.Bottom) ? (shapeProp1.paddings.Bottom === shapeProp2.paddings.Bottom ? shapeProp1.paddings.Bottom : undefined) : undefined;
}
return _result_shape_prop;
}
......
......@@ -5157,6 +5157,16 @@ CPresentation.prototype =
this.Document_UpdateCanAddHyperlinkState();
},
changeBackground: function(bg, arr_ind)
{
for(var i = 0; i <arr_ind.length; ++i)
{
this.Slides[arr_ind[i]].changeBackground(bg);
this.DrawingDocument.OnRecalculatePage(arr_ind[i], this.Slides[arr_ind[i]]);
}
this.DrawingDocument.OnEndRecalculate(true, false);
},
// Обновляем линейки
Document_UpdateRulersState : function()
{
......
......@@ -357,6 +357,37 @@ CShape.prototype =
return this.compiledStyle;
},
getPaddings: function()
{
var paddings = null;
var shape = this;
if(shape.txBody)
{
var body_pr = shape.txBody.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;
},
getParentObjects: function()
{
var parents = {slide: null, layout: null, master: null, theme: null};
......@@ -560,6 +591,46 @@ CShape.prototype =
this.txBody.calculateContent();
},
setTextVerticalAlign: function(align)
{
if(this.txBody)
{
this.txBody.bodyPr.anchor = align;
this.recalculateContent();
this.recalculateTransformText();
}
},
setPaddings: function(paddings)
{
if(paddings)
{
if(this.txBody)
{
if(isRealNumber(paddings.Left))
{
this.txBody.bodyPr.lIns = paddings.Left;
}
if(isRealNumber(paddings.Top))
{
this.txBody.bodyPr.tIns = paddings.Top;
}
if(isRealNumber(paddings.Right))
{
this.txBody.bodyPr.rIns = paddings.Right;
}
if(isRealNumber(paddings.Bottom))
{
this.txBody.bodyPr.bIns = paddings.Bottom;
}
this.txBody.recalcInfo.recalculateBodyPr = true;
this.recalculateContent();
this.recalculateTransformText();
}
}
},
recalculate: function()
{
if(this.recalcInfo.recalculateBrush)
......
......@@ -958,6 +958,12 @@ function Slide(presentation, slideLayout, slideNum)
Slide.prototype =
{
changeBackground: function(bg)
{
this.cSld.Bg = bg.createFullCopy();
this.recalculateBackground();
},
setLocks: function(deleteLock, backgroundLock, timingLock, transitionLock, layoutLock)
{
this.deleteLock = deleteLock;
......
This diff is collapsed.
......@@ -3564,6 +3564,9 @@ asc_docs_api.prototype.sync_shapePropCallback = function(pr)
obj.fill = CreateAscFill(pr.fill);
obj.stroke = CreateAscStroke(pr.stroke, pr.canChangeArrows);
obj.Locked = pr.IsLocked;
obj.paddings = pr.paddings;
obj.w = pr.w;
obj.h = pr.h;
if (pr.fill != null && pr.fill.fill != null && pr.fill.fill.type == FILL_TYPE_BLIP)
{
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId);
......
......@@ -941,6 +941,9 @@ function CAscShapeProp()
this.fill = null;
this.stroke = null;
this.Locked = null;
this.w = null;
this.h = null;
this.paddings = null;
}
CAscShapeProp.prototype.get_Locked = function(){return this.Locked}
CAscShapeProp.prototype.put_Locked = function(v){this.Locked = v;}
......@@ -950,6 +953,12 @@ CAscShapeProp.prototype.get_fill = function(){return this.fill}
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_Width = function(){return this.w}
CAscShapeProp.prototype.put_Width = function(v){this.w = v;}
CAscShapeProp.prototype.get_Height = function(){return this.h}
CAscShapeProp.prototype.put_Height = function(v){this.h = v;}
CAscShapeProp.prototype.get_paddings = function(){return this.paddings}
CAscShapeProp.prototype.put_paddings = function(v){this.paddings = v;}
// эта функция ДОЛЖНА минимизироваться
function CreateAscShapeProp(shape)
......
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