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
f2c65d52
Commit
f2c65d52
authored
Aug 24, 2016
by
Sergey Luzyanin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix bugs in builder
parent
ebd9a87d
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
5 deletions
+54
-5
cell/apiBuilder.js
cell/apiBuilder.js
+32
-3
common/Drawings/Format/Format.js
common/Drawings/Format/Format.js
+20
-2
slide/apiBuilder.js
slide/apiBuilder.js
+2
-0
No files found.
cell/apiBuilder.js
View file @
f2c65d52
...
...
@@ -73,6 +73,7 @@
*/
function
ApiShape
(
oShape
){
ApiShape
.
superclass
.
constructor
.
call
(
this
,
oShape
);
this
.
Shape
=
oShape
;
}
AscCommon
.
extendClass
(
ApiShape
,
ApiDrawing
);
...
...
@@ -91,6 +92,7 @@
*/
function
ApiChart
(
oChart
){
ApiChart
.
superclass
.
constructor
.
call
(
this
,
oChart
);
this
.
Chart
=
oChart
;
}
AscCommon
.
extendClass
(
ApiChart
,
ApiDrawing
);
...
...
@@ -316,7 +318,16 @@
settings
.
inColumns
=
!
bInRows
;
settings
.
range
=
sDataRange
;
var
oChart
=
AscFormat
.
DrawingObjectsController
.
prototype
.
getChartSpace
(
this
.
worksheet
,
settings
);
if
(
arguments
.
length
===
8
){
//support old variant
oChart
.
setBDeleted
(
false
);
oChart
.
setWorksheet
(
this
.
worksheet
);
oChart
.
setBFromSerialize
(
true
);
oChart
.
addToDrawingObjects
();
oChart
.
setDrawingBaseCoords
(
arguments
[
4
],
0
,
arguments
[
5
],
0
,
arguments
[
6
],
0
,
arguments
[
7
],
0
,
0
,
0
,
0
,
0
);
}
else
{
private_SetCoords
(
oChart
,
this
.
worksheet
,
nExtX
,
nExtY
,
nFromCol
,
nColOffset
,
nFromRow
,
nRowOffset
);
}
if
(
AscFormat
.
isRealNumber
(
nStyleIndex
))
{
oChart
.
setStyle
(
nStyleIndex
);
}
...
...
@@ -475,8 +486,26 @@
* @param {EMU} nRowOffset
* */
ApiDrawing
.
prototype
.
SetPosition
=
function
(
nFromCol
,
nColOffset
,
nFromRow
,
nRowOffset
){
var
extX
=
null
,
extY
=
null
;
if
(
this
.
Drawing
.
drawingBase
){
if
(
this
.
Drawing
.
drawingBase
.
Type
===
AscCommon
.
c_oAscCellAnchorType
.
cellanchorOneCell
||
this
.
Drawing
.
drawingBase
.
Type
===
AscCommon
.
c_oAscCellAnchorType
.
cellanchorAbsolute
){
extX
=
this
.
Drawing
.
drawingBase
.
ext
.
cx
;
extY
=
this
.
Drawing
.
drawingBase
.
ext
.
cy
;
}
}
if
(
!
AscFormat
.
isRealNumber
(
extX
)
||
!
AscFormat
.
isRealNumber
(
extY
)){
if
(
this
.
Drawing
.
spPr
&&
this
.
Drawing
.
spPr
.
xfrm
){
extX
=
this
.
Drawing
.
spPr
.
xfrm
.
extX
;
extY
=
this
.
Drawing
.
spPr
.
xfrm
.
extY
;
}
else
{
extX
=
5
;
extY
=
5
;
}
}
this
.
Drawing
.
setDrawingBaseType
(
AscCommon
.
c_oAscCellAnchorType
.
cellanchorOneCell
);
this
.
Drawing
.
setDrawingBaseCoords
(
nFromCol
,
nColOffset
/
36000.0
,
nFromRow
,
nRowOffset
/
36000.0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
);
this
.
Drawing
.
setDrawingBaseCoords
(
nFromCol
,
nColOffset
/
36000.0
,
nFromRow
,
nRowOffset
/
36000.0
,
0
,
0
,
0
,
0
,
0
,
0
,
extX
,
extY
);
};
...
...
@@ -517,7 +546,7 @@
*/
ApiShape
.
prototype
.
GetDocContent
=
function
()
{
var
oApi
=
Asc
.
editor
;
var
oApi
=
Asc
[
"
editor
"
]
;
if
(
oApi
&&
this
.
Drawing
&&
this
.
Drawing
.
txBody
&&
this
.
Drawing
.
txBody
.
content
)
{
return
oApi
.
private_CreateApiDocContent
(
this
.
Drawing
.
txBody
.
content
);
...
...
common/Drawings/Format/Format.js
View file @
f2c65d52
...
...
@@ -12314,6 +12314,24 @@ function CorrectUniColor(asc_color, unicolor, flag)
}
function
builder_CreateTitle
(
sTitle
,
nFontSize
,
oChartSpace
)
{
if
(
typeof
sTitle
===
"
string
"
&&
sTitle
.
length
>
0
){
var
oTitle
=
new
AscFormat
.
CTitle
();
oTitle
.
setOverlay
(
false
);
oTitle
.
setTx
(
new
AscFormat
.
CChartText
());
var
oTextBody
=
AscFormat
.
CreateTextBodyFromString
(
sTitle
,
oChartSpace
.
getDrawingDocument
(),
oTitle
.
tx
);
if
(
AscFormat
.
isRealNumber
(
nFontSize
)){
oTextBody
.
content
.
Set_ApplyToAll
(
true
);
oTextBody
.
content
.
Paragraph_Add
(
new
ParaTextPr
({
FontSize
:
nFontSize
}));
oTextBody
.
content
.
Set_ApplyToAll
(
false
);
}
oTitle
.
tx
.
setRich
(
oTextBody
);
return
oTitle
;
}
return
null
;
}
function
builder_SetChartTitle
(
oChartSpace
,
sTitle
,
nFontSize
){
if
(
oChartSpace
){
oChartSpace
.
chart
.
setTitle
(
builder_CreateChartTitle
(
sTitle
,
nFontSize
,
oChartSpace
.
getDrawingDocument
()));
...
...
@@ -12324,7 +12342,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
if
(
oChartSpace
){
var
horAxis
=
oChartSpace
.
chart
.
plotArea
.
getHorizontalAxis
();
if
(
horAxis
){
horAxis
.
setTitle
(
this
.
CreateTitle
(
sTitle
,
nFontSiz
e
));
horAxis
.
setTitle
(
builder_CreateTitle
(
sTitle
,
nFontSize
,
oChartSpac
e
));
}
}
}
...
...
@@ -12336,7 +12354,7 @@ function CorrectUniColor(asc_color, unicolor, flag)
{
if
(
typeof
sTitle
===
"
string
"
&&
sTitle
.
length
>
0
)
{
verAxis
.
setTitle
(
this
.
CreateTitle
(
sTitle
,
nFontSiz
e
));
verAxis
.
setTitle
(
builder_CreateTitle
(
sTitle
,
nFontSize
,
oChartSpac
e
));
if
(
verAxis
.
title
){
var
_body_pr
=
new
AscFormat
.
CBodyPr
();
_body_pr
.
reset
();
...
...
slide/apiBuilder.js
View file @
f2c65d52
...
...
@@ -71,6 +71,7 @@
*/
function
ApiShape
(
oShape
){
ApiShape
.
superclass
.
constructor
.
call
(
this
,
oShape
);
this
.
Shape
=
oShape
;
}
AscCommon
.
extendClass
(
ApiShape
,
ApiDrawing
);
...
...
@@ -89,6 +90,7 @@
*/
function
ApiChart
(
oChart
){
ApiChart
.
superclass
.
constructor
.
call
(
this
,
oChart
);
this
.
Chart
=
oChart
;
}
AscCommon
.
extendClass
(
ApiChart
,
ApiDrawing
);
...
...
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