Commit ef221014 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@49398 954022d7-b5bf-4e40-9824-e11837661b57
parent 83c51d45
...@@ -1419,6 +1419,24 @@ function CompareShapeProperties(shapeProp1, shapeProp2) ...@@ -1419,6 +1419,24 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_result_shape_prop.type = null; _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) if(shapeProp1.stroke === null || shapeProp2.stroke === null)
{ {
_result_shape_prop.stroke = null; _result_shape_prop.stroke = null;
...@@ -1434,6 +1452,14 @@ function CompareShapeProperties(shapeProp1, shapeProp2) ...@@ -1434,6 +1452,14 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
_result_shape_prop.fill = CompareUniFill(shapeProp1.fill, shapeProp2.fill); _result_shape_prop.fill = CompareUniFill(shapeProp1.fill, shapeProp2.fill);
_result_shape_prop.IsLocked = shapeProp1.IsLocked === true || shapeProp2.IsLocked === true; _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; return _result_shape_prop;
} }
......
...@@ -5157,6 +5157,16 @@ CPresentation.prototype = ...@@ -5157,6 +5157,16 @@ CPresentation.prototype =
this.Document_UpdateCanAddHyperlinkState(); 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() Document_UpdateRulersState : function()
{ {
......
...@@ -357,6 +357,37 @@ CShape.prototype = ...@@ -357,6 +357,37 @@ CShape.prototype =
return this.compiledStyle; 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() getParentObjects: function()
{ {
var parents = {slide: null, layout: null, master: null, theme: null}; var parents = {slide: null, layout: null, master: null, theme: null};
...@@ -560,6 +591,46 @@ CShape.prototype = ...@@ -560,6 +591,46 @@ CShape.prototype =
this.txBody.calculateContent(); 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() recalculate: function()
{ {
if(this.recalcInfo.recalculateBrush) if(this.recalcInfo.recalculateBrush)
......
...@@ -958,6 +958,12 @@ function Slide(presentation, slideLayout, slideNum) ...@@ -958,6 +958,12 @@ function Slide(presentation, slideLayout, slideNum)
Slide.prototype = Slide.prototype =
{ {
changeBackground: function(bg)
{
this.cSld.Bg = bg.createFullCopy();
this.recalculateBackground();
},
setLocks: function(deleteLock, backgroundLock, timingLock, transitionLock, layoutLock) setLocks: function(deleteLock, backgroundLock, timingLock, transitionLock, layoutLock)
{ {
this.deleteLock = deleteLock; this.deleteLock = deleteLock;
......
...@@ -105,7 +105,7 @@ CGraphicObjects.prototype = { ...@@ -105,7 +105,7 @@ CGraphicObjects.prototype = {
if(selected_objects[0].canChangeAdjustments()) if(selected_objects[0].canChangeAdjustments())
{ {
drawingDocument.SetCursorType("crosshair"); drawingDocument.SetCursorType("crosshair");
selected_objects[0].seendMouseData(); selected_objects[0].sendMouseData();
} }
return; return;
} }
...@@ -503,6 +503,8 @@ CGraphicObjects.prototype = { ...@@ -503,6 +503,8 @@ CGraphicObjects.prototype = {
switch(this.State.id) switch(this.State.id)
{ {
case STATES_ID_NULL: case STATES_ID_NULL:
case STATES_ID_TEXT_ADD:
// case STATES_ID_TEXT_ADD_IN_GROUP:
{ {
var images = by_types.images; var images = by_types.images;
for(var i = 0; i < images.length; ++i) for(var i = 0; i < images.length; ++i)
...@@ -530,7 +532,11 @@ CGraphicObjects.prototype = { ...@@ -530,7 +532,11 @@ CGraphicObjects.prototype = {
fill: _current_object.getFill(), fill: _current_object.getFill(),
stroke: _current_object.getStroke(), stroke: _current_object.getStroke(),
canChangeArrows: _current_object.canChangeArrows(), canChangeArrows: _current_object.canChangeArrows(),
IsLocked: !(_current_object.Lock.Type === locktype_None || _current_object.Lock.Type === locktype_Mine) IsLocked: !(_current_object.Lock.Type === locktype_None || _current_object.Lock.Type === locktype_Mine),
verticalTextAlign: _current_object.txBody ? _current_object.txBody.getCompiledBodyPr().anchor : undefined,
paddings: _current_object.getPaddings(),
w:_current_object.extX,
h:_current_object.extY
}; };
if(shape_props === null) if(shape_props === null)
...@@ -540,6 +546,7 @@ CGraphicObjects.prototype = { ...@@ -540,6 +546,7 @@ CGraphicObjects.prototype = {
else else
{ {
shape_props = CompareShapeProperties(shape_props, _cur_shape_prop); shape_props = CompareShapeProperties(shape_props, _cur_shape_prop);
shape_props.verticalTextAlign = undefined;
} }
var _cur_paragraph_para_pr = _current_object.getParagraphParaPr(); var _cur_paragraph_para_pr = _current_object.getParagraphParaPr();
...@@ -593,6 +600,7 @@ CGraphicObjects.prototype = { ...@@ -593,6 +600,7 @@ CGraphicObjects.prototype = {
} }
} }
} }
var shapes = cur_group.shapes; var shapes = cur_group.shapes;
for(var i = 0; i < shapes.length; ++i) for(var i = 0; i < shapes.length; ++i)
{ {
...@@ -602,7 +610,12 @@ CGraphicObjects.prototype = { ...@@ -602,7 +610,12 @@ CGraphicObjects.prototype = {
type: _current_object.getPresetGeom(), type: _current_object.getPresetGeom(),
fill: _current_object.getFill(), fill: _current_object.getFill(),
stroke: _current_object.getStroke(), stroke: _current_object.getStroke(),
canChangeArrows: _current_object.canChangeArrows() canChangeArrows: _current_object.canChangeArrows(),
IsLocked: cur_group.Lock.Is_Locked(),
verticalTextAlign: _current_object.txBody ? _current_object.txBody.getCompiledBodyPr().anchor : undefined,
paddings: _current_object.getPaddings(),
w:_current_object.extX,
h:_current_object.extY
}; };
if(shape_props === null) if(shape_props === null)
...@@ -612,6 +625,7 @@ CGraphicObjects.prototype = { ...@@ -612,6 +625,7 @@ CGraphicObjects.prototype = {
else else
{ {
shape_props = CompareShapeProperties(shape_props, _cur_shape_prop); shape_props = CompareShapeProperties(shape_props, _cur_shape_prop);
shape_props.verticalTextAlign = undefined;
} }
var _cur_paragraph_para_pr = _current_object.getParagraphParaPr(); var _cur_paragraph_para_pr = _current_object.getParagraphParaPr();
...@@ -639,6 +653,28 @@ CGraphicObjects.prototype = { ...@@ -639,6 +653,28 @@ CGraphicObjects.prototype = {
} }
} }
} }
if(image_props)
{
if(cur_group.Lock.Is_Locked())
{
image_props.IsLocked = true;
}
}
if(shape_props)
{
if(cur_group.Lock.Is_Locked())
{
shape_props.IsLocked = true;
}
}
if(para_props)
{
if(cur_group.Lock.Is_Locked())
{
para_props.Locked = true;
}
}
} }
var tables = by_types.tables; var tables = by_types.tables;
...@@ -673,19 +709,11 @@ CGraphicObjects.prototype = { ...@@ -673,19 +709,11 @@ CGraphicObjects.prototype = {
} }
break; break;
} }
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{
this.State.textObject.updateInterfaceTextState();
if(this.State.textObject.isTable && this.State.textObject.isTable())
{
editor.sync_TblPropCallback(this.State.textObject.graphicObject.Get_Props());
this.slide.presentation.DrawingDocument.CheckTableStyles(this.State.textObject.graphicObject.Get_TableLook(), this.State.textObject);
}
break;
}
} }
if(this.State.id === STATES_ID_TEXT_ADD || this.State.id === STATES_ID_TEXT_ADD_IN_GROUP)
{
if(image_props !== null) if(image_props !== null)
{ {
editor.sync_ImgPropCallback(image_props); editor.sync_ImgPropCallback(image_props);
...@@ -696,6 +724,15 @@ CGraphicObjects.prototype = { ...@@ -696,6 +724,15 @@ CGraphicObjects.prototype = {
editor.sync_shapePropCallback(shape_props); editor.sync_shapePropCallback(shape_props);
} }
this.State.textObject.updateInterfaceTextState();
if(this.State.textObject.isTable && this.State.textObject.isTable())
{
editor.sync_TblPropCallback(this.State.textObject.graphicObject.Get_Props());
this.slide.presentation.DrawingDocument.CheckTableStyles(this.State.textObject.graphicObject.Get_TableLook(), this.State.textObject);
}
}
else
{
if(para_props != null) if(para_props != null)
{ {
editor.UpdateParagraphProp( para_props ); editor.UpdateParagraphProp( para_props );
...@@ -734,7 +771,18 @@ CGraphicObjects.prototype = { ...@@ -734,7 +771,18 @@ CGraphicObjects.prototype = {
// editor.UpdateTextPr(_empty_text_pr); // editor.UpdateTextPr(_empty_text_pr);
} }
editor.sync_VerticalTextAlign(this.getVerticalAlign()); if(image_props !== null)
{
editor.sync_ImgPropCallback(image_props);
}
if(shape_props !== null)
{
editor.sync_shapePropCallback(shape_props);
}
}
// editor.sync_VerticalTextAlign(this.getVerticalAlign());
}, },
getPropsArrays: function() getPropsArrays: function()
...@@ -1032,10 +1080,12 @@ CGraphicObjects.prototype = { ...@@ -1032,10 +1080,12 @@ CGraphicObjects.prototype = {
{ {
case STATES_ID_NULL: case STATES_ID_NULL:
case STATES_ID_GROUP: case STATES_ID_GROUP:
case STATES_ID_TEXT_ADD:
case STATES_ID_TEXT_ADD_IN_GROUP:
{ {
var selectedObjects = this.State.id === STATES_ID_NULL ? this.selectedObjects : this.State.group.selectedObjects; var selectedObjects = this.State.id === STATES_ID_NULL || this.State.id === STATES_ID_TEXT_ADD ? this.selectedObjects : this.State.group.selectedObjects;
for(var i = 0; i < this.selectedObjects.length; ++i) for(var i = 0; i < selectedObjects.length; ++i)
{ {
if(properties.type != undefined && properties.type != -1 && typeof selectedObjects[i].changePresetGeom === "function") if(properties.type != undefined && properties.type != -1 && typeof selectedObjects[i].changePresetGeom === "function")
...@@ -1050,10 +1100,46 @@ CGraphicObjects.prototype = { ...@@ -1050,10 +1100,46 @@ CGraphicObjects.prototype = {
{ {
selectedObjects[i].changeLine(properties.stroke); selectedObjects[i].changeLine(properties.stroke);
} }
if(properties.paddings && typeof selectedObjects[i].setPaddings === "function")
{
selectedObjects[i].setPaddings(properties.paddings);
}
}
if(typeof properties.verticalTextAlign === "number")
{
if(this.State.id === STATES_ID_TEXT_ADD)
{
if(typeof this.State.textObject.setTextVerticalAlign === "function")
this.State.textObject.GraphicObj.setTextVerticalAlign(properties.verticalTextAlign);
}
if(this.State.id === STATES_ID_TEXT_ADD_IN_GROUP)
{
if(typeof this.State.setTextVerticalAlign === "function")
this.State.textObject.setTextVerticalAlign(properties.verticalTextAlign);
}
}
if(this.State.id !==STATES_ID_GROUP && this.State.id !==STATES_ID_TEXT_ADD_IN_GROUP && isRealNumber(properties.w) && isRealNumber(properties.h))
{
for(var i = 0; i < selectedObjects.length; ++i)
{
if(selectedObjects[i].setXfrm)
{
selectedObjects[i].setXfrm(null, null, properties.w, properties.h, null, null, null);
}
}
} }
break; break;
} }
} }
editor.WordControl.m_oLogicDocument.Recalculate();
},
imageApply: function(props)
{
}, },
canGroup: function() canGroup: function()
......
...@@ -3564,6 +3564,9 @@ asc_docs_api.prototype.sync_shapePropCallback = function(pr) ...@@ -3564,6 +3564,9 @@ asc_docs_api.prototype.sync_shapePropCallback = function(pr)
obj.fill = CreateAscFill(pr.fill); obj.fill = CreateAscFill(pr.fill);
obj.stroke = CreateAscStroke(pr.stroke, pr.canChangeArrows); obj.stroke = CreateAscStroke(pr.stroke, pr.canChangeArrows);
obj.Locked = pr.IsLocked; 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) if (pr.fill != null && pr.fill.fill != null && pr.fill.fill.type == FILL_TYPE_BLIP)
{ {
this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId); this.WordControl.m_oDrawingDocument.DrawImageTextureFillShape(pr.fill.fill.RasterImageId);
......
...@@ -941,6 +941,9 @@ function CAscShapeProp() ...@@ -941,6 +941,9 @@ function CAscShapeProp()
this.fill = null; this.fill = null;
this.stroke = null; this.stroke = null;
this.Locked = null; this.Locked = null;
this.w = null;
this.h = null;
this.paddings = null;
} }
CAscShapeProp.prototype.get_Locked = function(){return this.Locked} CAscShapeProp.prototype.get_Locked = function(){return this.Locked}
CAscShapeProp.prototype.put_Locked = function(v){this.Locked = v;} CAscShapeProp.prototype.put_Locked = function(v){this.Locked = v;}
...@@ -950,6 +953,12 @@ CAscShapeProp.prototype.get_fill = function(){return this.fill} ...@@ -950,6 +953,12 @@ CAscShapeProp.prototype.get_fill = function(){return this.fill}
CAscShapeProp.prototype.put_fill = function(v){this.fill = v;} CAscShapeProp.prototype.put_fill = function(v){this.fill = v;}
CAscShapeProp.prototype.get_stroke = function(){return this.stroke} CAscShapeProp.prototype.get_stroke = function(){return this.stroke}
CAscShapeProp.prototype.put_stroke = function(v){this.stroke = v;} 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) 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