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
30622193
Commit
30622193
authored
Aug 15, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
inserting drawings in cell-builder
parent
781cb930
Changes
11
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
805 additions
and
1400 deletions
+805
-1400
build/configs/webexcel.json
build/configs/webexcel.json
+2
-0
build/configs/webpowerpoint.json
build/configs/webpowerpoint.json
+1
-0
cell/apiBuilder.js
cell/apiBuilder.js
+292
-205
common/Drawings/Format/ChartSpace.js
common/Drawings/Format/ChartSpace.js
+75
-0
common/Drawings/Format/Constants.js
common/Drawings/Format/Constants.js
+3
-0
common/Drawings/Format/GraphicObjectBase.js
common/Drawings/Format/GraphicObjectBase.js
+25
-0
common/Drawings/Format/GroupShape.js
common/Drawings/Format/GroupShape.js
+78
-0
common/Drawings/Format/Image.js
common/Drawings/Format/Image.js
+82
-1
common/Drawings/Format/Shape.js
common/Drawings/Format/Shape.js
+78
-0
slide/apiBuilder.js
slide/apiBuilder.js
+63
-1147
word/apiBuilder.js
word/apiBuilder.js
+106
-47
No files found.
build/configs/webexcel.json
View file @
30622193
...
...
@@ -174,6 +174,8 @@
"../word/Math/borderBox.js"
,
"../word/apiCommon.js"
,
"../word/apiBuilder.js"
,
"../slide/apiBuilder.js"
,
"../cell/apiBuilder.js"
,
"../common/clipboard_base.js"
,
...
...
build/configs/webpowerpoint.json
View file @
30622193
...
...
@@ -163,6 +163,7 @@
"../slide/apiCommon.js"
,
"../word/apiCommon.js"
,
"../word/apiBuilder.js"
,
"../slide/apiBuilder.js"
,
"../common/clipboard_base.js"
,
"../common/text_input.js"
,
...
...
cell/apiBuilder.js
View file @
30622193
This diff is collapsed.
Click to expand it.
common/Drawings/Format/ChartSpace.js
View file @
30622193
...
...
@@ -9690,6 +9690,26 @@ CChartSpace.prototype.Undo = function(data)
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
OldPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
OldPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
OldPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
OldPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
data
.
OldPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
oldPr
;
...
...
@@ -9826,6 +9846,26 @@ CChartSpace.prototype.Redo = function(data)
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
NewPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
NewPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
NewPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
NewPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
data
.
NewPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
newPr
;
...
...
@@ -9964,6 +10004,21 @@ CChartSpace.prototype.Save_Changes = function(data, w)
w
.
WriteLong
(
data
.
Type
);
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
w
.
WriteDouble
(
data
.
NewPr
.
X
);
w
.
WriteDouble
(
data
.
NewPr
.
Y
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
w
.
WriteDouble
(
data
.
NewPr
.
cx
);
w
.
WriteDouble
(
data
.
NewPr
.
cy
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
w
.
WriteLong
(
data
.
NewPr
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
w
.
WriteLong
(
data
.
newPr
);
...
...
@@ -10108,6 +10163,26 @@ CChartSpace.prototype.Load_Changes = function(r)
var
type
=
r
.
GetLong
();
switch
(
type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
r
.
GetDouble
();
this
.
drawingBase
.
Pos
.
Y
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
r
.
GetDouble
();
this
.
drawingBase
.
ext
.
cy
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
r
.
GetLong
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
r
.
GetLong
();
...
...
common/Drawings/Format/Constants.js
View file @
30622193
...
...
@@ -1010,6 +1010,9 @@
window
[
'
AscDFH
'
].
historyitem_AutoShapes_RemoveFromDrawingObjects
=
1004
;
window
[
'
AscDFH
'
].
historyitem_AutoShapes_SetBFromSerialize
=
1009
;
window
[
'
AscDFH
'
].
historyitem_AutoShapes_SetLocks
=
1010
;
window
[
'
AscDFH
'
].
historyitem_AutoShapes_SetDrawingBaseType
=
1011
;
window
[
'
AscDFH
'
].
historyitem_AutoShapes_SetDrawingBaseExt
=
1012
;
window
[
'
AscDFH
'
].
historyitem_AutoShapes_SetDrawingBasePos
=
1013
;
window
[
'
AscDFH
'
].
historyitem_CommonChart_RemoveSeries
=
1005
;
window
[
'
AscDFH
'
].
historyitem_CommonSeries_RemoveDPt
=
1006
;
window
[
'
AscDFH
'
].
historyitem_CommonLit_RemoveDPt
=
1007
;
...
...
common/Drawings/Format/GraphicObjectBase.js
View file @
30622193
...
...
@@ -391,6 +391,31 @@
CGraphicObjectBase
.
prototype
.
getAllFonts
=
function
(
mapUrl
){
};
CGraphicObjectBase
.
prototype
.
getAllRasterImages
=
function
(
mapUrl
){
};
CGraphicObjectBase
.
prototype
.
setDrawingBaseType
=
function
(
nType
){
if
(
this
.
drawingBase
){
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
,
OldPr
:
this
.
drawingBase
.
Type
,
NewPr
:
nType
});
this
.
drawingBase
.
Type
=
nType
;
}
};
CGraphicObjectBase
.
prototype
.
setDrawingBasePos
=
function
(
fPosX
,
fPosY
){
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
,
OldPr
:
{
X
:
this
.
drawingBase
.
Pos
.
X
,
Y
:
this
.
drawingBase
.
Pos
.
Y
},
NewPr
:
{
X
:
fPosX
,
Y
:
fPosY
}});
this
.
drawingBase
.
Pos
.
X
=
fPosX
;
this
.
drawingBase
.
Pos
.
Y
=
fPosY
;
}
};
CGraphicObjectBase
.
prototype
.
setDrawingBaseExt
=
function
(
fExtX
,
fExtY
){
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
History
.
Add
(
this
,
{
Type
:
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
,
OldPr
:
{
cx
:
this
.
drawingBase
.
ext
.
cx
,
cy
:
this
.
drawingBase
.
ext
.
cy
},
NewPr
:
{
cx
:
fExtX
,
cy
:
fExtY
}});
this
.
drawingBase
.
ext
.
cx
=
fExtX
;
this
.
drawingBase
.
ext
.
cy
=
fExtY
;
}
};
window
[
'
AscFormat
'
]
=
window
[
'
AscFormat
'
]
||
{};
window
[
'
AscFormat
'
].
CGraphicObjectBase
=
CGraphicObjectBase
;
window
[
'
AscFormat
'
].
CGraphicBounds
=
CGraphicBounds
;
...
...
common/Drawings/Format/GroupShape.js
View file @
30622193
...
...
@@ -1764,6 +1764,26 @@ AscCommon.extendClass(CGroupShape, AscFormat.CGraphicObjectBase);
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
OldPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
OldPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
OldPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
OldPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
data
.
OldPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
oldPr
;
...
...
@@ -1861,6 +1881,26 @@ AscCommon.extendClass(CGroupShape, AscFormat.CGraphicObjectBase);
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
NewPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
NewPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
NewPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
NewPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
data
.
NewPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
newPr
;
...
...
@@ -1961,6 +2001,22 @@ AscCommon.extendClass(CGroupShape, AscFormat.CGraphicObjectBase);
w
.
WriteLong
(
data
.
Type
);
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
w
.
WriteDouble
(
data
.
NewPr
.
X
);
w
.
WriteDouble
(
data
.
NewPr
.
Y
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
w
.
WriteDouble
(
data
.
NewPr
.
cx
);
w
.
WriteDouble
(
data
.
NewPr
.
cy
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
w
.
WriteLong
(
data
.
NewPr
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
w
.
WriteLong
(
data
.
newPr
);
...
...
@@ -2037,6 +2093,28 @@ AscCommon.extendClass(CGroupShape, AscFormat.CGraphicObjectBase);
var
type
=
r
.
GetLong
();
switch
(
type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
r
.
GetDouble
();
this
.
drawingBase
.
Pos
.
Y
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
r
.
GetDouble
();
this
.
drawingBase
.
ext
.
cy
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
if
(
this
.
drawingBase
)
{
this
.
drawingBase
.
Type
=
r
.
GetLong
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
r
.
GetLong
();
...
...
common/Drawings/Format/Image.js
View file @
30622193
...
...
@@ -695,6 +695,28 @@ CImageShape.prototype.Undo = function(data)
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
OldPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
OldPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
OldPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
OldPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
if
(
this
.
drawingBase
)
{
this
.
drawingBase
.
Type
=
data
.
OldPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
oldPr
;
...
...
@@ -797,7 +819,28 @@ CImageShape.prototype.Redo = function(data)
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
NewPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
NewPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
NewPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
NewPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
if
(
this
.
drawingBase
)
{
this
.
drawingBase
.
Type
=
data
.
NewPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
newPr
;
...
...
@@ -902,6 +945,22 @@ CImageShape.prototype.Save_Changes = function(data, w)
w
.
WriteLong
(
data
.
Type
);
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
w
.
WriteDouble
(
data
.
NewPr
.
X
);
w
.
WriteDouble
(
data
.
NewPr
.
Y
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
w
.
WriteDouble
(
data
.
NewPr
.
cx
);
w
.
WriteDouble
(
data
.
NewPr
.
cy
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
w
.
WriteLong
(
data
.
NewPr
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
w
.
WriteLong
(
data
.
newPr
);
...
...
@@ -998,6 +1057,28 @@ CImageShape.prototype.Load_Changes = function(r)
var
type
=
r
.
GetLong
();
switch
(
type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
r
.
GetDouble
();
this
.
drawingBase
.
Pos
.
Y
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
r
.
GetDouble
();
this
.
drawingBase
.
ext
.
cy
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
if
(
this
.
drawingBase
)
{
this
.
drawingBase
.
Type
=
r
.
GetLong
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
r
.
GetLong
();
...
...
common/Drawings/Format/Shape.js
View file @
30622193
...
...
@@ -4999,6 +4999,26 @@ CShape.prototype.Undo = function (data)
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
OldPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
OldPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
OldPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
OldPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
data
.
OldPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
oldPr
;
...
...
@@ -5111,6 +5131,26 @@ CShape.prototype.Redo = function (data)
{
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
data
.
NewPr
.
X
;
this
.
drawingBase
.
Pos
.
Y
=
data
.
NewPr
.
Y
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
data
.
NewPr
.
cx
;
this
.
drawingBase
.
ext
.
cy
=
data
.
NewPr
.
cy
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:{
if
(
this
.
drawingBase
){
this
.
drawingBase
.
Type
=
data
.
NewPr
;
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
data
.
newPr
;
...
...
@@ -5223,6 +5263,22 @@ CShape.prototype.Save_Changes = function (data, w)
w
.
WriteLong
(
data
.
Type
);
switch
(
data
.
Type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
w
.
WriteDouble
(
data
.
NewPr
.
X
);
w
.
WriteDouble
(
data
.
NewPr
.
Y
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
w
.
WriteDouble
(
data
.
NewPr
.
cx
);
w
.
WriteDouble
(
data
.
NewPr
.
cy
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
w
.
WriteLong
(
data
.
NewPr
);
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
w
.
WriteLong
(
data
.
newPr
);
...
...
@@ -5307,6 +5363,28 @@ CShape.prototype.Load_Changes = function (r)
var
type
=
r
.
GetLong
();
switch
(
type
)
{
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBasePos
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
Pos
){
this
.
drawingBase
.
Pos
.
X
=
r
.
GetDouble
();
this
.
drawingBase
.
Pos
.
Y
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseExt
:{
if
(
this
.
drawingBase
&&
this
.
drawingBase
.
ext
){
this
.
drawingBase
.
ext
.
cx
=
r
.
GetDouble
();
this
.
drawingBase
.
ext
.
cy
=
r
.
GetDouble
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetDrawingBaseType
:
{
if
(
this
.
drawingBase
)
{
this
.
drawingBase
.
Type
=
r
.
GetLong
();
}
break
;
}
case
AscDFH
.
historyitem_AutoShapes_SetLocks
:
{
this
.
locks
=
r
.
GetLong
();
...
...
slide/apiBuilder.js
View file @
30622193
This diff is collapsed.
Click to expand it.
word/apiBuilder.js
View file @
30622193
...
...
@@ -38,7 +38,7 @@
* @class
* @name Api
*/
var
Api
=
window
[
"
Asc
"
][
"
asc_docs_api
"
];
var
Api
=
window
[
"
Asc
"
][
"
asc_docs_api
"
]
||
window
[
"
Asc
"
][
"
spreadsheet_api
"
]
;
/**
* Class representing a container for paragraphs and tables.
...
...
@@ -71,6 +71,16 @@
this
.
ParaPr
=
ParaPr
;
}
/*
* Class representing paragraph bullet
* @constructor
* */
function
ApiBullet
(
Bullet
)
{
this
.
Bullet
=
Bullet
;
}
/**
* Class representing a paragraph.
* @constructor
...
...
@@ -347,7 +357,7 @@
*/
function
ApiStroke
(
oLn
)
{
this
.
Ln
=
oLn
;
this
.
Ln
=
oLn
;
}
...
...
@@ -861,17 +871,10 @@
*/
Api
.
prototype
.
CreateLinearGradientFill
=
function
(
aGradientStop
,
Angle
)
{
var
oUniFill
=
new
AscFormat
.
CUniFill
();
oUniFill
.
fill
=
new
AscFormat
.
CGradFill
();
for
(
var
i
=
0
;
i
<
aGradientStop
.
length
;
++
i
)
{
oUniFill
.
fill
.
colors
.
push
(
aGradientStop
[
i
].
Gs
);
}
oUniFill
.
fill
.
lin
=
new
AscFormat
.
GradLin
();
oUniFill
.
fill
.
lin
.
angle
=
Angle
;
return
new
ApiFill
(
oUniFill
);
return
new
ApiFill
(
AscFormat
.
builder_CreateLinearGradient
(
aGradientStop
,
Angle
));
};
/**
* Create a radial gradient fill
* @memberof Api
...
...
@@ -880,14 +883,7 @@
*/
Api
.
prototype
.
CreateRadialGradientFill
=
function
(
aGradientStop
)
{
var
oUniFill
=
new
AscFormat
.
CUniFill
();
oUniFill
.
fill
=
new
AscFormat
.
CGradFill
();
for
(
var
i
=
0
;
i
<
aGradientStop
.
length
;
++
i
)
{
oUniFill
.
fill
.
colors
.
push
(
aGradientStop
[
i
].
Gs
);
}
oUniFill
.
fill
.
path
=
new
AscFormat
.
GradPath
();
return
new
ApiFill
(
oUniFill
);
return
new
ApiFill
(
AscFormat
.
builder_CreateRadialGradient
(
aGradientStop
));
};
/**
...
...
@@ -898,14 +894,9 @@
* @param {ApiUniColor} FgColor
* @returns {ApiFill}
*/
Api
.
prototype
.
CreatePatternFill
=
function
(
sPatternType
,
BgColor
,
FgColor
)
Api
.
prototype
.
CreatePatternFill
=
function
(
sPatternType
,
BgColor
,
FgColor
)
{
var
oUniFill
=
new
AscFormat
.
CUniFill
();
oUniFill
.
fill
=
new
AscFormat
.
CPattFill
();
oUniFill
.
fill
.
ftype
=
AscCommon
.
global_hatch_offsets
[
sPatternType
];
oUniFill
.
fill
.
fgClr
=
FgColor
.
Unicolor
;
oUniFill
.
fill
.
bgClr
=
BgColor
.
Unicolor
;
return
new
ApiFill
(
oUniFill
);
return
new
ApiFill
(
AscFormat
.
builder_CreatePatternFill
(
sPatternType
,
BgColor
,
FgColor
));
};
/**
...
...
@@ -915,20 +906,9 @@
* @param {BlipFillType} sBlipFillType
* @returns {ApiFill}
* */
Api
.
prototype
.
CreateBlipFill
=
function
(
sImageUrl
,
sBlipFillType
)
Api
.
prototype
.
CreateBlipFill
=
function
(
sImageUrl
,
sBlipFillType
)
{
var
oUniFill
=
new
AscFormat
.
CUniFill
();
oUniFill
.
fill
=
new
AscFormat
.
CBlipFill
();
oUniFill
.
fill
.
RasterImageId
=
sImageUrl
;
if
(
sBlipFillType
===
"
tile
"
)
{
oUniFill
.
fill
.
tile
=
new
AscFormat
.
CBlipFillTile
();
}
else
if
(
sBlipFillType
===
"
stretch
"
)
{
oUniFill
.
fill
.
stretch
=
true
;
}
return
new
ApiFill
(
oUniFill
);
return
new
ApiFill
(
AscFormat
.
builder_CreateBlipFill
(
sImageUrl
,
sBlipFillType
));
};
/**
...
...
@@ -950,14 +930,7 @@
* */
Api
.
prototype
.
CreateStroke
=
function
(
nWidth
,
oFill
)
{
if
(
nWidth
===
0
)
{
return
new
ApiStroke
(
AscFormat
.
CreateNoFillLine
());
}
var
oLn
=
new
AscFormat
.
CLn
();
oLn
.
w
=
nWidth
;
oLn
.
Fill
=
oFill
.
UniFill
;
return
new
ApiStroke
(
oLn
);
return
new
ApiStroke
(
AscFormat
.
builder_CreateLine
(
nWidth
,
oFill
));
};
/**
...
...
@@ -972,6 +945,81 @@
return
new
ApiGradientStop
(
oUniColor
,
nPos
);
};
/**
* Create a new bullet
* @memberof Api
* @returns {ApiBullet}
* */
Api
.
CreateBullet
=
function
(
sSymbol
){
var
oBullet
=
new
AscFormat
.
CBullet
();
oBullet
.
bulletType
=
new
AscFormat
.
CBulletType
();
if
(
typeof
sSymbol
===
"
string
"
&&
sSymbol
.
length
>
0
){
oBullet
.
bulletType
.
type
=
AscFormat
.
BULLET_TYPE_BULLET_CHAR
;
oBullet
.
bulletType
.
Char
=
sSymbol
[
0
];
}
else
{
oBullet
.
bulletType
.
type
=
AscFormat
.
BULLET_TYPE_BULLET_NONE
;
}
};
/**
* Create a new numbering
* @memberof Api
* @param {BulletType} sType
* @param {number} nStartAt
* @returns {ApiBullet}
* */
Api
.
CreateNumbering
=
function
(
sType
,
nStartAt
){
var
oBullet
=
new
AscFormat
.
CBullet
();
oBullet
.
bulletType
=
new
AscFormat
.
CBulletType
();
oBullet
.
bulletType
.
type
=
AscFormat
.
BULLET_TYPE_BULLET_AUTONUM
;
switch
(
sType
){
case
"
ArabicPeriod
"
:{
oBullet
.
bulletType
.
AutoNumType
=
12
;
break
;
}
case
"
ArabicParenR
"
:{
oBullet
.
bulletType
.
AutoNumType
=
11
;
break
;
}
case
"
RomanUcPeriod
"
:{
oBullet
.
bulletType
.
AutoNumType
=
34
;
break
;
}
case
"
RomanLcPeriod
"
:{
oBullet
.
bulletType
.
AutoNumType
=
31
;
break
;
}
case
"
AlphaLcParenR
"
:{
oBullet
.
bulletType
.
AutoNumType
=
1
;
break
;
}
case
"
AlphaLcPeriod
"
:{
oBullet
.
bulletType
.
AutoNumType
=
2
;
break
;
}
case
"
AlphaUcParenR
"
:{
oBullet
.
bulletType
.
AutoNumType
=
4
;
break
;
}
case
"
AlphaUcPeriod
"
:{
oBullet
.
bulletType
.
AutoNumType
=
5
;
break
;
}
case
"
None
"
:{
oBullet
.
bulletType
.
type
=
AscFormat
.
BULLET_TYPE_BULLET_NONE
;
break
;
}
}
if
(
oBullet
.
bulletType
.
type
===
AscFormat
.
BULLET_TYPE_BULLET_AUTONUM
){
if
(
AscFormat
.
isRealNumber
(
nStartAt
)){
oBullet
.
bulletType
.
startAt
=
nStartAt
;
}
}
return
new
ApiBullet
(
oBullet
);
};
//------------------------------------------------------------------------------------------------------------------
//
...
...
@@ -2746,6 +2794,10 @@
this
.
private_OnChange
();
};
//------------------------------------------------------------------------------------------------------------------
//
// ApiNumbering
...
...
@@ -4726,4 +4778,11 @@
this
.
private_OnChange
();
};
Api
.
prototype
.
private_CreateApiParagraph
=
function
(
oParagraph
){
return
new
ApiParagraph
(
oParagraph
);
};
Api
.
prototype
.
private_CreateApiDocContent
=
function
(
oDocContent
){
return
new
ApiDocumentContent
(
oDocContent
);
};
}(
window
,
null
));
\ No newline at end of file
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