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
fd14c473
Commit
fd14c473
authored
Nov 21, 2016
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add method insertSparkline
add method setWorksheet
parent
30a7fd0c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
29 deletions
+43
-29
cell/model/Serialize.js
cell/model/Serialize.js
+4
-3
cell/model/Workbook.js
cell/model/Workbook.js
+35
-26
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+4
-0
No files found.
cell/model/Serialize.js
View file @
fd14c473
...
@@ -5605,7 +5605,7 @@
...
@@ -5605,7 +5605,7 @@
});
});
}
else
if
(
c_oSerWorksheetsTypes
.
SparklineGroups
===
type
)
{
}
else
if
(
c_oSerWorksheetsTypes
.
SparklineGroups
===
type
)
{
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
)
{
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
)
{
return
oThis
.
ReadSparklineGroups
(
t
,
l
,
oWorksheet
.
aSparklineGroups
);
return
oThis
.
ReadSparklineGroups
(
t
,
l
,
oWorksheet
);
});
});
}
else
}
else
res
=
c_oSerConstants
.
ReadUnknown
;
res
=
c_oSerConstants
.
ReadUnknown
;
...
@@ -6620,15 +6620,16 @@
...
@@ -6620,15 +6620,16 @@
return
res
;
return
res
;
};
};
this
.
ReadSparklineGroups
=
function
(
type
,
length
,
aSparklineGroups
)
{
this
.
ReadSparklineGroups
=
function
(
type
,
length
,
oWorksheet
)
{
var
oThis
=
this
;
var
oThis
=
this
;
var
res
=
c_oSerConstants
.
ReadOk
;
var
res
=
c_oSerConstants
.
ReadOk
;
if
(
c_oSer_Sparkline
.
SparklineGroup
===
type
)
{
if
(
c_oSer_Sparkline
.
SparklineGroup
===
type
)
{
var
newSparklineGroup
=
new
AscCommonExcel
.
sparklineGroup
(
true
);
var
newSparklineGroup
=
new
AscCommonExcel
.
sparklineGroup
(
true
);
newSparklineGroup
.
setWorksheet
(
oWorksheet
);
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
)
{
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
)
{
return
oThis
.
ReadSparklineGroup
(
t
,
l
,
newSparklineGroup
);
return
oThis
.
ReadSparklineGroup
(
t
,
l
,
newSparklineGroup
);
});
});
aSparklineGroups
.
push
(
newSparklineGroup
);
oWorksheet
.
aSparklineGroups
.
push
(
newSparklineGroup
);
}
else
}
else
res
=
c_oSerConstants
.
ReadUnknown
;
res
=
c_oSerConstants
.
ReadUnknown
;
return
res
;
return
res
;
...
...
cell/model/Workbook.js
View file @
fd14c473
...
@@ -3479,9 +3479,6 @@ Woorksheet.prototype.clone=function(sNewId, sName, tableNames){
...
@@ -3479,9 +3479,6 @@ Woorksheet.prototype.clone=function(sNewId, sName, tableNames){
for
(
i
=
0
;
i
<
this
.
aConditionalFormatting
.
length
;
++
i
)
{
for
(
i
=
0
;
i
<
this
.
aConditionalFormatting
.
length
;
++
i
)
{
oNewWs
.
aConditionalFormatting
.
push
(
this
.
aConditionalFormatting
[
i
].
clone
());
oNewWs
.
aConditionalFormatting
.
push
(
this
.
aConditionalFormatting
[
i
].
clone
());
}
}
for
(
i
=
0
;
i
<
this
.
aSparklineGroups
.
length
;
++
i
)
{
oNewWs
.
aSparklineGroups
.
push
(
this
.
aSparklineGroups
[
i
].
clone
());
}
if
(
this
.
sheetPr
)
if
(
this
.
sheetPr
)
oNewWs
.
sheetPr
=
this
.
sheetPr
.
clone
();
oNewWs
.
sheetPr
=
this
.
sheetPr
.
clone
();
...
@@ -3489,28 +3486,37 @@ Woorksheet.prototype.clone=function(sNewId, sName, tableNames){
...
@@ -3489,28 +3486,37 @@ Woorksheet.prototype.clone=function(sNewId, sName, tableNames){
return
oNewWs
;
return
oNewWs
;
};
};
Woorksheet
.
prototype
.
copyDrawingObjects
=
function
(
oNewWs
,
wsFrom
)
Woorksheet
.
prototype
.
copyDrawingObjects
=
function
(
oNewWs
,
wsFrom
)
{
{
var
i
;
if
(
null
!=
this
.
Drawings
&&
this
.
Drawings
.
length
>
0
)
if
(
null
!=
this
.
Drawings
&&
this
.
Drawings
.
length
>
0
)
{
{
var
drawingObjects
=
new
AscFormat
.
DrawingObjects
();
var
drawingObjects
=
new
AscFormat
.
DrawingObjects
();
oNewWs
.
Drawings
=
[];
oNewWs
.
Drawings
=
[];
AscFormat
.
NEW_WORKSHEET_DRAWING_DOCUMENT
=
oNewWs
.
DrawingDocument
;
AscFormat
.
NEW_WORKSHEET_DRAWING_DOCUMENT
=
oNewWs
.
DrawingDocument
;
for
(
var
i
=
0
;
i
<
this
.
Drawings
.
length
;
++
i
)
for
(
i
=
0
;
i
<
this
.
Drawings
.
length
;
++
i
)
{
{
var
drawingObject
=
drawingObjects
.
cloneDrawingObject
(
this
.
Drawings
[
i
]);
var
drawingObject
=
drawingObjects
.
cloneDrawingObject
(
this
.
Drawings
[
i
]);
drawingObject
.
graphicObject
=
this
.
Drawings
[
i
].
graphicObject
.
copy
();
drawingObject
.
graphicObject
=
this
.
Drawings
[
i
].
graphicObject
.
copy
();
drawingObject
.
graphicObject
.
setWorksheet
(
oNewWs
);
drawingObject
.
graphicObject
.
setWorksheet
(
oNewWs
);
drawingObject
.
graphicObject
.
addToDrawingObjects
();
drawingObject
.
graphicObject
.
addToDrawingObjects
();
var
drawingBase
=
this
.
Drawings
[
i
];
var
drawingBase
=
this
.
Drawings
[
i
];
drawingObject
.
graphicObject
.
setDrawingBaseCoords
(
drawingBase
.
from
.
col
,
drawingBase
.
from
.
colOff
,
drawingBase
.
from
.
row
,
drawingBase
.
from
.
rowOff
,
drawingBase
.
to
.
col
,
drawingBase
.
to
.
colOff
,
drawingBase
.
to
.
row
,
drawingBase
.
to
.
rowOff
,
drawingBase
.
Pos
.
X
,
drawingBase
.
Pos
.
Y
,
drawingBase
.
ext
.
cx
,
drawingBase
.
ext
.
cy
);
drawingObject
.
graphicObject
.
setDrawingBaseCoords
(
drawingBase
.
from
.
col
,
drawingBase
.
from
.
colOff
,
drawingBase
.
from
.
row
,
drawingBase
.
from
.
rowOff
,
drawingBase
.
to
.
col
,
drawingBase
.
to
.
colOff
,
drawingBase
.
to
.
row
,
drawingBase
.
to
.
rowOff
,
drawingBase
.
Pos
.
X
,
drawingBase
.
Pos
.
Y
,
drawingBase
.
ext
.
cx
,
drawingBase
.
ext
.
cy
);
oNewWs
.
Drawings
[
oNewWs
.
Drawings
.
length
-
1
]
=
drawingObject
;
oNewWs
.
Drawings
[
oNewWs
.
Drawings
.
length
-
1
]
=
drawingObject
;
}
}
AscFormat
.
NEW_WORKSHEET_DRAWING_DOCUMENT
=
null
;
AscFormat
.
NEW_WORKSHEET_DRAWING_DOCUMENT
=
null
;
drawingObjects
.
pushToAObjects
(
oNewWs
.
Drawings
);
drawingObjects
.
pushToAObjects
(
oNewWs
.
Drawings
);
drawingObjects
.
updateChartReferences2
(
parserHelp
.
getEscapeSheetName
(
wsFrom
.
sName
),
parserHelp
.
getEscapeSheetName
(
oNewWs
.
sName
));
drawingObjects
.
updateChartReferences2
(
parserHelp
.
getEscapeSheetName
(
wsFrom
.
sName
),
parserHelp
.
getEscapeSheetName
(
oNewWs
.
sName
));
}
}
};
var
newSparkline
;
for
(
i
=
0
;
i
<
this
.
aSparklineGroups
.
length
;
++
i
)
{
newSparkline
=
this
.
aSparklineGroups
[
i
].
clone
();
newSparkline
.
setWorksheet
(
oNewWs
);
oNewWs
.
aSparklineGroups
.
push
(
newSparkline
);
}
};
Woorksheet
.
prototype
.
initPostOpen
=
function
(
handlers
)
{
Woorksheet
.
prototype
.
initPostOpen
=
function
(
handlers
)
{
var
cwf
=
this
.
workbook
.
cwf
[
this
.
Id
]
=
{};
var
cwf
=
this
.
workbook
.
cwf
[
this
.
Id
]
=
{};
if
(
this
.
aFormulaExt
)
{
if
(
this
.
aFormulaExt
)
{
...
@@ -5693,11 +5699,14 @@ Woorksheet.prototype.updateSparklineCache = function(sheet, ranges) {
...
@@ -5693,11 +5699,14 @@ Woorksheet.prototype.updateSparklineCache = function(sheet, ranges) {
Woorksheet
.
prototype
.
getSparklineGroup
=
function
(
c
,
r
)
{
Woorksheet
.
prototype
.
getSparklineGroup
=
function
(
c
,
r
)
{
for
(
var
i
=
0
;
i
<
this
.
aSparklineGroups
.
length
;
++
i
)
{
for
(
var
i
=
0
;
i
<
this
.
aSparklineGroups
.
length
;
++
i
)
{
if
(
-
1
!==
this
.
aSparklineGroups
[
i
].
contains
(
c
,
r
))
{
if
(
-
1
!==
this
.
aSparklineGroups
[
i
].
contains
(
c
,
r
))
{
return
this
.
aSparklineGroups
[
i
]
.
clone
(
true
)
;
return
this
.
aSparklineGroups
[
i
];
}
}
}
}
return
null
;
return
null
;
};
};
Woorksheet
.
prototype
.
insertSparkline
=
function
(
sparkline
)
{
this
.
aSparklineGroups
.
push
(
sparkline
);
};
//-------------------------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------------
/**
/**
* @constructor
* @constructor
...
...
cell/model/WorkbookElems.js
View file @
fd14c473
...
@@ -4721,6 +4721,7 @@ CellArea.prototype = {
...
@@ -4721,6 +4721,7 @@ CellArea.prototype = {
//for drawing preview
//for drawing preview
this
.
canvas
=
null
;
this
.
canvas
=
null
;
this
.
worksheet
=
null
;
this
.
Id
=
null
;
this
.
Id
=
null
;
if
(
addId
)
{
if
(
addId
)
{
this
.
Id
=
AscCommon
.
g_oIdCounter
.
Get_NewId
();
this
.
Id
=
AscCommon
.
g_oIdCounter
.
Get_NewId
();
...
@@ -5077,6 +5078,9 @@ CellArea.prototype = {
...
@@ -5077,6 +5078,9 @@ CellArea.prototype = {
this
.
colorHigh
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorHigh
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorLow
=
new
RgbColor
(
defaultOtherColor
);
this
.
colorLow
=
new
RgbColor
(
defaultOtherColor
);
};
};
sparklineGroup
.
prototype
.
setWorksheet
=
function
(
worksheet
)
{
this
.
worksheet
=
worksheet
;
};
sparklineGroup
.
prototype
.
set
=
function
(
val
)
{
sparklineGroup
.
prototype
.
set
=
function
(
val
)
{
var
t
=
this
;
var
t
=
this
;
var
checkProperty
=
function
(
propOld
,
propNew
,
type
)
{
var
checkProperty
=
function
(
propOld
,
propNew
,
type
)
{
...
...
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