Commit 419e1ab1 authored by SergeyLuzyanin's avatar SergeyLuzyanin

import/applying column properties

parent eb45af5d
...@@ -2470,6 +2470,31 @@ DrawingObjectsController.prototype = ...@@ -2470,6 +2470,31 @@ DrawingObjectsController.prototype =
editor.WordControl.m_oLogicDocument.Check_GraphicFrameRowHeight(objects_by_type.tables[0]); editor.WordControl.m_oLogicDocument.Check_GraphicFrameRowHeight(objects_by_type.tables[0]);
} }
} }
if(AscFormat.isRealNumber(props.columnNumber))
{
for(i = 0; i < objects_by_type.shapes.length; ++i)
{
objects_by_type.shapes[i].setColumnNumber(props.columnNumber);
}
for(i = 0; i < objects_by_type.groups.length; ++i)
{
objects_by_type.groups[i].setColumnNumber(props.columnNumber);
}
}
if(AscFormat.isRealNumber(props.columnSpace))
{
for(i = 0; i < objects_by_type.shapes.length; ++i)
{
objects_by_type.shapes[i].setColumnSpace(props.columnSpace);
}
for(i = 0; i < objects_by_type.groups.length; ++i)
{
objects_by_type.groups[i].setColumnSpace(props.columnSpace);
}
}
if(AscFormat.isRealNumber(props.vert)) if(AscFormat.isRealNumber(props.vert))
{ {
for(i = 0; i < objects_by_type.shapes.length; ++i) for(i = 0; i < objects_by_type.shapes.length; ++i)
...@@ -6960,7 +6985,9 @@ DrawingObjectsController.prototype = ...@@ -6960,7 +6985,9 @@ DrawingObjectsController.prototype =
textArtProperties: drawing.getTextArtProperties(), textArtProperties: drawing.getTextArtProperties(),
lockAspect: lockAspect, lockAspect: lockAspect,
title: drawing.getTitle(), title: drawing.getTitle(),
description: drawing.getDescription() description: drawing.getDescription(),
columnNumber: drawing.getColumnNumber(),
columnSpace: drawing.getColumnSpace()
}; };
if(!shape_props) if(!shape_props)
shape_props = new_shape_props; shape_props = new_shape_props;
...@@ -7462,6 +7489,9 @@ DrawingObjectsController.prototype = ...@@ -7462,6 +7489,9 @@ DrawingObjectsController.prototype =
shape_props.title = props.shapeProps.title; shape_props.title = props.shapeProps.title;
shape_props.ShapeProperties.textArtProperties = AscFormat.CreateAscTextArtProps(props.shapeProps.textArtProperties); shape_props.ShapeProperties.textArtProperties = AscFormat.CreateAscTextArtProps(props.shapeProps.textArtProperties);
shape_props.lockAspect = props.shapeProps.lockAspect; shape_props.lockAspect = props.shapeProps.lockAspect;
shape_props.ShapeProperties.columnNumber = props.shapeProps.columnNumber;
shape_props.ShapeProperties.columnSpace = props.shapeProps.columnSpace;
if(props.shapeProps.textArtProperties) if(props.shapeProps.textArtProperties)
{ {
oTextArtProperties = props.shapeProps.textArtProperties; oTextArtProperties = props.shapeProps.textArtProperties;
......
...@@ -3981,6 +3981,13 @@ function CompareShapeProperties(shapeProp1, shapeProp2) ...@@ -3981,6 +3981,13 @@ function CompareShapeProperties(shapeProp1, shapeProp2)
if(shapeProp1.description === shapeProp2.description){ if(shapeProp1.description === shapeProp2.description){
_result_shape_prop.description = shapeProp1.description; _result_shape_prop.description = shapeProp1.description;
} }
if(shapeProp1.columnNumber === shapeProp2.columnNumber){
_result_shape_prop.columnNumber = shapeProp1.columnNumber;
}
if(shapeProp1.columnSpace === shapeProp2.columnSpace){
_result_shape_prop.columnSpace = shapeProp1.columnSpace;
}
return _result_shape_prop; return _result_shape_prop;
} }
...@@ -9515,6 +9522,8 @@ function CreateAscShapePropFromProp(shapeProp) ...@@ -9515,6 +9522,8 @@ function CreateAscShapePropFromProp(shapeProp)
} }
obj.title = shapeProp.title; obj.title = shapeProp.title;
obj.description = shapeProp.description; obj.description = shapeProp.description;
obj.columnNumber = shapeProp.columnNumber;
obj.columnSpace = shapeProp.columnSpace;
return obj; return obj;
} }
......
...@@ -1280,6 +1280,26 @@ function CGroupShape() ...@@ -1280,6 +1280,26 @@ function CGroupShape()
} }
}; };
CGroupShape.prototype.setColumnNumber = function(num){
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setColumnNumber)
{
this.spTree[i].setColumnNumber(num);
}
}
};
CGroupShape.prototype.setColumnSpace = function(spcCol){
for(var i = 0; i < this.spTree.length; ++i)
{
if(this.spTree[i].setColumnSpace)
{
this.spTree[i].setColumnSpace(spcCol);
}
}
};
CGroupShape.prototype.getResizeCoefficients = function(numHandle, x, y) CGroupShape.prototype.getResizeCoefficients = function(numHandle, x, y)
{ {
var cx, cy; var cx, cy;
......
...@@ -5287,7 +5287,65 @@ CShape.prototype.checkTypeCorrect = function(){ ...@@ -5287,7 +5287,65 @@ CShape.prototype.checkTypeCorrect = function(){
return false; return false;
} }
return true; return true;
} };
CShape.prototype.getColumnNumber = function(){
if(this.bWordShape){
return 1;
}
var oBodyPr = this.getBodyPr();
if(AscFormat.isRealNumber(oBodyPr.numCol))
{
return oBodyPr.numCol;
}
return 1;
};
CShape.prototype.getColumnSpace = function(){
if(this.bWordShape){
return 0;
}
var oBodyPr = this.getBodyPr();
if(AscFormat.isRealNumber(oBodyPr.spcCol))
{
return oBodyPr.spcCol;
}
return 0;
};
CShape.prototype.setColumnNumber = function(num){
var new_body_pr = this.getBodyPr();
if (new_body_pr) {
new_body_pr = new_body_pr.createDuplicate();
new_body_pr.numCol = num;
if (this.bWordShape) {
this.setBodyPr(new_body_pr);
}
else {
if (this.txBody) {
this.txBody.setBodyPr(new_body_pr);
}
}
}
};
CShape.prototype.setColumnSpace = function(spcCol){
var new_body_pr = this.getBodyPr();
if (new_body_pr) {
new_body_pr = new_body_pr.createDuplicate();
new_body_pr.spcCol = spcCol;
if (this.bWordShape) {
this.setBodyPr(new_body_pr);
}
else {
if (this.txBody) {
this.txBody.setBodyPr(new_body_pr);
}
}
}
};
function CreateBinaryReader(szSrc, offset, srcLen) function CreateBinaryReader(szSrc, offset, srcLen)
{ {
......
...@@ -1902,6 +1902,9 @@ ...@@ -1902,6 +1902,9 @@
this.lockAspect = null; this.lockAspect = null;
this.title = null; this.title = null;
this.description = null; this.description = null;
this.columnNumber = null;
this.columnSpace = null;
} }
asc_CShapeProperty.prototype = { asc_CShapeProperty.prototype = {
...@@ -1971,6 +1974,22 @@ ...@@ -1971,6 +1974,22 @@
return this.description; return this.description;
}, asc_putDescription: function (v) { }, asc_putDescription: function (v) {
this.description = v; this.description = v;
},
asc_getColumnNumber: function(){
return this.columnNumber;
},
asc_putColumnNumber: function(v){
this.columnNumber = v;
},
asc_getColumnSpace: function(){
return this.columnSpace;
},
asc_putColumnSpace: function(v){
this.columnSpace = v;
} }
}; };
...@@ -2219,6 +2238,9 @@ ...@@ -2219,6 +2238,9 @@
this.title = obj.title != undefined ? obj.title : undefined; this.title = obj.title != undefined ? obj.title : undefined;
this.description = obj.description != undefined ? obj.description : undefined; this.description = obj.description != undefined ? obj.description : undefined;
this.columnNumber = obj.columnNumber != undefined ? obj.columnNumber : undefined;
this.columnSpace = obj.columnSpace != undefined ? obj.columnSpace : undefined;
} else { } else {
this.CanBeFlow = true; this.CanBeFlow = true;
this.Width = undefined; this.Width = undefined;
...@@ -2257,6 +2279,9 @@ ...@@ -2257,6 +2279,9 @@
this.oleHeight = undefined; this.oleHeight = undefined;
this.title = undefined; this.title = undefined;
this.description = undefined; this.description = undefined;
this.columnNumber = undefined;
this.columnSpace = undefined;
} }
} }
...@@ -2479,6 +2504,22 @@ ...@@ -2479,6 +2504,22 @@
asc_putDescription: function(v){ asc_putDescription: function(v){
this.description = v; this.description = v;
},
asc_getColumnNumber: function(){
return this.columnNumber;
},
asc_putColumnNumber: function(v){
this.columnNumber = v;
},
asc_getColumnSpace: function(){
return this.columnSpace;
},
asc_putColumnSpace: function(v){
this.columnSpace = v;
} }
}; };
...@@ -3573,6 +3614,10 @@ ...@@ -3573,6 +3614,10 @@
prot["put_Title"] = prot["asc_putTitle"] = prot.asc_putTitle; prot["put_Title"] = prot["asc_putTitle"] = prot.asc_putTitle;
prot["get_Description"] = prot["asc_getDescription"] = prot.asc_getDescription; prot["get_Description"] = prot["asc_getDescription"] = prot.asc_getDescription;
prot["put_Description"] = prot["asc_putDescription"] = prot.asc_putDescription; prot["put_Description"] = prot["asc_putDescription"] = prot.asc_putDescription;
prot["get_ColumnNumber"] = prot["asc_getColumnNumber"] = prot.asc_getColumnNumber;
prot["put_ColumnNumber"] = prot["asc_putColumnNumber"] = prot.asc_putColumnNumber;
prot["get_ColumnSpace"] = prot["asc_getColumnSpace"] = prot.asc_getColumnSpace;
prot["put_ColumnSpace"] = prot["asc_putColumnSpace"] = prot.asc_putColumnSpace;
window["Asc"]["asc_TextArtProperties"] = window["Asc"].asc_TextArtProperties = asc_TextArtProperties; window["Asc"]["asc_TextArtProperties"] = window["Asc"].asc_TextArtProperties = asc_TextArtProperties;
prot = asc_TextArtProperties.prototype; prot = asc_TextArtProperties.prototype;
...@@ -3695,6 +3740,10 @@ ...@@ -3695,6 +3740,10 @@
prot["put_Title"] = prot["asc_putTitle"] = prot.asc_putTitle; prot["put_Title"] = prot["asc_putTitle"] = prot.asc_putTitle;
prot["get_Description"] = prot["asc_getDescription"] = prot.asc_getDescription; prot["get_Description"] = prot["asc_getDescription"] = prot.asc_getDescription;
prot["put_Description"] = prot["asc_putDescription"] = prot.asc_putDescription; prot["put_Description"] = prot["asc_putDescription"] = prot.asc_putDescription;
prot["get_ColumnNumber"] = prot["asc_getColumnNumber"] = prot.asc_getColumnNumber;
prot["put_ColumnNumber"] = prot["asc_putColumnNumber"] = prot.asc_putColumnNumber;
prot["get_ColumnSpace"] = prot["asc_getColumnSpace"] = prot.asc_getColumnSpace;
prot["put_ColumnSpace"] = prot["asc_putColumnSpace"] = prot.asc_putColumnSpace;
......
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