Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
419e1ab1
Commit
419e1ab1
authored
Apr 21, 2017
by
SergeyLuzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
import/applying column properties
parent
eb45af5d
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
168 additions
and
2 deletions
+168
-2
common/Drawings/CommonController.js
common/Drawings/CommonController.js
+31
-1
common/Drawings/Format/Format.js
common/Drawings/Format/Format.js
+9
-0
common/Drawings/Format/GroupShape.js
common/Drawings/Format/GroupShape.js
+20
-0
common/Drawings/Format/Shape.js
common/Drawings/Format/Shape.js
+59
-1
common/apiCommon.js
common/apiCommon.js
+49
-0
No files found.
common/Drawings/CommonController.js
View file @
419e1ab1
...
@@ -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
;
...
...
common/Drawings/Format/Format.js
View file @
419e1ab1
...
@@ -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
;
}
}
...
...
common/Drawings/Format/GroupShape.js
View file @
419e1ab1
...
@@ -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
;
...
...
common/Drawings/Format/Shape.js
View file @
419e1ab1
...
@@ -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
)
{
{
...
...
common/apiCommon.js
View file @
419e1ab1
...
@@ -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
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment