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
dfaea425
Commit
dfaea425
authored
Dec 07, 2016
by
Alexey.Musinov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
table styles
parent
1207aec9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
311 additions
and
226 deletions
+311
-226
cell/native/native.js
cell/native/native.js
+311
-226
No files found.
cell/native/native.js
View file @
dfaea425
...
...
@@ -2336,6 +2336,7 @@ function asc_ReadAutoFiltersOptions(s, p) {
}
filter
.
asc_setValues
(
values
);
break
;
}
case
255
:
default
:
...
...
@@ -2348,6 +2349,112 @@ function asc_ReadAutoFiltersOptions(s, p) {
return
filter
;
}
function
asc_ReadFormatTableInfo
(
s
,
p
)
{
var
fmt
=
new
AscCommonExcel
.
asc_CFormatTableInfo
();
var
isNull
=
true
;
var
next
=
true
;
while
(
next
)
{
var
_attr
=
s
[
p
.
pos
++
];
switch
(
_attr
)
{
case
0
:
{
fmt
.
tableStyleName
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
1
:
{
fmt
.
tableRange
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
2
:
{
fmt
.
tableStyleName
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
3
:
{
fmt
.
bandHor
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
4
:
{
fmt
.
bandVer
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
5
:
{
fmt
.
filterButton
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
6
:
{
fmt
.
firstCol
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
7
:
{
fmt
.
firstRow
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
8
:
{
fmt
.
isDeleteColumn
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
9
:
{
fmt
.
isDeleteRow
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
10
:
{
fmt
.
isDeleteTable
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
11
:
{
fmt
.
isInsertColumnLeft
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
12
:
{
fmt
.
isInsertColumnRight
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
13
:
{
fmt
.
IsInsertRowAbove
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
14
:
{
fmt
.
isInsertRowBelow
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
15
:
{
fmt
.
lastCol
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
16
:
{
fmt
.
lastRow
=
s
[
p
.
pos
++
];
isNull
=
false
;
break
;
}
case
255
:
default
:
{
next
=
false
;
break
;
}
}
}
return
isNull
?
null
:
fmt
;
}
function
asc_WriteCBorder
(
i
,
c
,
s
)
{
if
(
!
c
)
return
;
...
...
@@ -4755,7 +4862,7 @@ function OfflineEditor () {
AscCommonExcel
.
WorkbookView
.
prototype
=
Object
.
create
(
AscCommonExcel
.
WorkbookView
.
prototype
);
AscCommonExcel
.
WorkbookView
.
prototype
.
constructor
=
AscCommonExcel
.
WorkbookView
;
AscCommonExcel
.
WorkbookView
.
prototype
.
af_getTablePictures
=
function
(
wb
,
fmgrGraphics
,
oFont
)
{
AscCommonExcel
.
WorkbookView
.
prototype
.
af_getTablePictures
=
function
(
wb
,
fmgrGraphics
,
oFont
,
props
)
{
window
[
"
native
"
][
"
SetStylesType
"
](
1
);
...
...
@@ -4771,53 +4878,53 @@ function OfflineEditor () {
var
result
=
[];
var
options
;
var
n
=
0
;
if
(
customStyles
)
{
for
(
var
i
in
customStyles
)
{
if
(
customStyles
[
i
].
table
)
{
if
(
customStyles
)
{
for
(
var
i
in
customStyles
)
{
if
(
customStyles
[
i
].
table
)
{
window
[
"
native
"
][
"
BeginDrawDocumentStyle
"
](
customStyles
[
i
].
name
,
n
);
this
.
af_getSmallIconTable
(
canvas
,
customStyles
[
i
],
fmgrGraphics
,
oFont
);
n
++
;
this
.
af_getSmallIconTable
(
canvas
,
customStyles
[
i
],
fmgrGraphics
,
oFont
,
props
);
window
[
"
native
"
][
"
EndDrawStyle
"
]();
n
++
;
}
}
}
var
defaultStyles
=
wb
.
TableStyles
.
DefaultStyles
;
if
(
defaultStyles
)
{
for
(
var
i
in
defaultStyles
)
{
if
(
defaultStyles
[
i
].
table
)
{
if
(
defaultStyles
)
{
for
(
var
i
in
defaultStyles
)
{
if
(
defaultStyles
[
i
].
table
)
{
window
[
"
native
"
][
"
BeginDrawDefaultStyle
"
](
defaultStyles
[
i
].
name
,
n
);
this
.
af_getSmallIconTable
(
canvas
,
defaultStyles
[
i
],
fmgrGraphics
,
oFont
);
n
++
;
this
.
af_getSmallIconTable
(
canvas
,
defaultStyles
[
i
],
fmgrGraphics
,
oFont
,
props
);
window
[
"
native
"
][
"
EndDrawStyle
"
]();
n
++
;
}
}
}
return
result
;
};
AscCommonExcel
.
WorkbookView
.
prototype
.
af_getSmallIconTable
=
function
(
canvas
,
style
,
fmgrGraphics
,
oFont
)
{
AscCommonExcel
.
WorkbookView
.
prototype
.
af_getSmallIconTable
=
function
(
canvas
,
style
,
fmgrGraphics
,
oFont
,
props
)
{
var
ctx
=
new
Asc
.
DrawingContext
({
canvas
:
canvas
,
units
:
0
/*pt*/
,
fmgrGraphics
:
fmgrGraphics
,
font
:
oFont
});
var
styleOptions
=
style
;
//по умолчанию ставим строку заголовка и чередующиеся строки, позже нужно будет получать параметр
var
styleInfo
=
false
;
if
(
!
styleInfo
)
{
var
styleInfo
;
if
(
props
)
{
styleInfo
=
{
ShowColumnStripes
:
props
.
asc_getBandVer
(),
ShowFirstColumn
:
props
.
asc_getFirstCol
(),
ShowLastColumn
:
props
.
asc_getLastCol
(),
ShowRowStripes
:
props
.
asc_getBandHor
(),
HeaderRowCount
:
props
.
asc_getFirstRow
(),
TotalsRowCount
:
props
.
asc_getLastRow
()
};
}
else
{
styleInfo
=
{
ShowColumnStripes
:
false
,
ShowFirstColumn
:
false
,
ShowLastColumn
:
false
,
ShowRowStripes
:
true
,
TotalsRowCount
:
0
}
HeaderRowCount
:
true
,
TotalsRowCount
:
false
};
}
var
xSize
=
styleThumbnailWidth
*
pxToMM
;
//61 * pxToMM;
...
...
@@ -4830,198 +4937,184 @@ function OfflineEditor () {
//**draw background**
var
defaultColorBackground
;
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
)
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
)
{
defaultColorBackground
=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
;
else
}
else
{
defaultColorBackground
=
whiteColor
;
}
var
color
;
if
(
styleOptions
!=
undefined
)
{
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
{
if
(
styleOptions
!=
undefined
)
{
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
{
ctx
.
setFillStyle
(
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
);
ctx
.
fillRect
(
0
,
0
,
xSize
,
ySize
);
}
else
{
ctx
.
fillRect
(
0
,
0
,
xSize
,
ySize
);
}
else
{
ctx
.
setFillStyle
(
whiteColor
);
ctx
.
fillRect
(
0
,
0
,
xSize
,
ySize
);
ctx
.
fillRect
(
0
,
0
,
xSize
,
ySize
);
}
if
(
styleInfo
.
ShowColumnStripes
)
//column stripes
{
for
(
k
=
0
;
k
<
6
;
k
++
)
if
(
styleInfo
.
ShowColumnStripes
)
//column stripes
{
for
(
k
=
0
;
k
<
6
;
k
++
)
{
color
=
defaultColorBackground
;
if
((
k
)
%
2
==
0
)
{
if
(
styleOptions
.
firstColumnStripe
&&
styleOptions
.
firstColumnStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstColumnStripe
.
dxf
.
fill
.
bg
)
if
(
k
%
2
==
0
)
{
if
(
styleOptions
.
firstColumnStripe
&&
styleOptions
.
firstColumnStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstColumnStripe
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
firstColumnStripe
.
dxf
.
fill
.
bg
;
else
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
}
else
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
;
}
else
{
if
(
styleOptions
.
secondColumnStripe
&&
styleOptions
.
secondColumnStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
secondColumnStripe
.
dxf
.
fill
.
bg
)
}
else
{
if
(
styleOptions
.
secondColumnStripe
&&
styleOptions
.
secondColumnStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
secondColumnStripe
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
secondColumnStripe
.
dxf
.
fill
.
bg
;
else
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
}
else
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
;
}
}
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
k
*
stepX
,
0
,
stepX
,
ySize
);
ctx
.
fillRect
(
k
*
stepX
,
0
,
stepX
,
ySize
);
}
}
if
(
styleInfo
.
ShowRowStripes
)
//row stripes
{
for
(
k
=
0
;
k
<
6
;
k
++
)
if
(
styleInfo
.
ShowRowStripes
)
//row stripes
{
for
(
var
k
=
0
;
k
<
6
;
k
++
)
{
color
=
null
;
if
(
styleOptions
)
//styleOptions.headerRow
{
if
(
k
==
0
)
k
++
;
if
((
k
)
%
2
!=
0
)
{
if
(
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstRowStripe
.
dxf
.
fill
.
bg
)
if
(
k
==
0
&&
styleInfo
.
HeaderRowCount
)
{
continue
;
}
if
(
styleInfo
.
HeaderRowCount
)
{
if
(
k
%
2
!=
0
)
{
if
(
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstRowStripe
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
firstRowStripe
.
dxf
.
fill
.
bg
;
}
else
{
if
(
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
)
}
else
{
if
(
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
;
else
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
color
=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
;
}
if
(
color
!=
null
)
{
ctx
.
setFillStyle
(
color
);
if
(
k
==
1
)
ctx
.
fillRect
(
0
,
k
*
stepY
,
xSize
,
stepY
);
else
if
(
k
==
3
)
ctx
.
fillRect
(
0
,
k
*
stepY
,
xSize
,
stepY
);
else
ctx
.
fillRect
(
0
,
k
*
stepY
,
xSize
,
stepY
);
//else
//ctx.fillRect(0,k*stepY,xSize,stepY);
}
}
else
{
if
(
k
%
2
!=
0
)
{
if
(
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
;
}
else
{
color
=
null
;
if
((
k
+
1
)
%
2
!=
0
)
{
if
(
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstRowStripe
.
dxf
.
fill
.
bg
)
}
else
{
if
(
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstRowStripe
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
firstRowStripe
.
dxf
.
fill
.
bg
;
}
else
{
if
(
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
fill
&&
null
!=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
)
color
=
styleOptions
.
secondRowStripe
.
dxf
.
fill
.
bg
;
else
if
(
styleOptions
.
wholeTable
&&
styleOptions
.
wholeTable
.
dxf
.
fill
&&
null
!=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
)
color
=
styleOptions
.
wholeTable
.
dxf
.
fill
.
bg
;
}
}
if
(
color
!=
null
)
{
if
(
color
!=
null
)
{
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
0
,
k
*
stepY
,
xSize
,
stepY
);
ctx
.
fillRect
(
0
,
k
*
stepY
,
xSize
,
stepY
);
}
}
}
if
(
styleInfo
.
ShowFirstColumn
&&
styleOptions
.
firstColumn
)
//first column
{
color
=
null
;
if
(
styleOptions
.
firstColumn
&&
styleOptions
.
firstColumn
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstColumn
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
firstColumn
.
dxf
.
fill
.
bg
;
}
if
(
color
!=
null
)
{
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
0
,
0
,
stepX
,
ySize
);
}
if
(
styleInfo
.
ShowFirstColumn
&&
styleOptions
.
firstColumn
)
//first column
{
if
(
styleOptions
.
firstColumn
&&
styleOptions
.
firstColumn
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstColumn
.
dxf
.
fill
.
bg
)
ctx
.
setFillStyle
(
styleOptions
.
firstColumn
.
dxf
.
fill
.
bg
);
else
ctx
.
setFillStyle
(
defaultColorBackground
);
ctx
.
fillRect
(
0
,
0
,
stepX
,
ySize
);
}
if
(
styleInfo
.
ShowLastColumn
)
//last column
if
(
styleInfo
.
ShowLastColumn
)
//last column
{
color
=
null
;
if
(
styleOptions
.
lastColumn
&&
styleOptions
.
lastColumn
.
dxf
.
fill
&&
null
!=
styleOptions
.
lastColumn
.
dxf
.
fill
.
bg
)
color
=
styleOptions
.
lastColumn
.
dxf
.
fill
.
bg
;
if
(
styleOptions
.
lastColumn
&&
styleOptions
.
lastColumn
.
dxf
.
fill
&&
null
!=
styleOptions
.
lastColumn
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
lastColumn
.
dxf
.
fill
.
bg
;
}
if
(
color
!=
null
)
{
if
(
color
!=
null
)
{
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
4
*
stepX
,
0
,
stepX
,
ySize
);
ctx
.
fillRect
(
4
*
stepX
+
1
,
0
,
stepX
,
ySize
);
}
}
if
(
styleOptions
)
//header row
{
if
(
styleOptions
.
headerRow
&&
styleOptions
.
headerRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
headerRow
.
dxf
.
fill
.
bg
)
if
(
styleInfo
.
HeaderRowCount
)
//header row
{
if
(
styleOptions
.
headerRow
&&
styleOptions
.
headerRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
headerRow
.
dxf
.
fill
.
bg
)
{
ctx
.
setFillStyle
(
styleOptions
.
headerRow
.
dxf
.
fill
.
bg
);
}
else
{
}
else
{
ctx
.
setFillStyle
(
defaultColorBackground
);
}
ctx
.
fillRect
(
0
,
0
,
xSize
,
stepY
);
}
if
(
styleInfo
.
TotalsRowCount
)
//total row
if
(
styleInfo
.
TotalsRowCount
)
//total row
{
color
=
null
;
if
(
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
)
if
(
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
fill
&&
null
!=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
)
{
color
=
styleOptions
.
totalRow
.
dxf
.
fill
.
bg
;
else
color
=
defaultColorBackground
;
}
if
(
color
!==
null
)
{
ctx
.
setFillStyle
(
color
);
ctx
.
fillRect
(
0
,
stepY
*
4
,
xSize
,
stepY
);
ctx
.
fillRect
(
0
,
stepY
*
4
,
xSize
,
stepY
);
}
}
//первая ячейка
if
(
styleOptions
.
firstHeaderCell
&&
styleInfo
.
ShowFirstColumn
)
{
if
(
styleOptions
.
firstHeaderCell
&&
styleOptions
.
firstHeaderCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstHeaderCell
.
dxf
.
fill
.
bg
)
if
(
styleOptions
.
firstHeaderCell
&&
styleInfo
.
ShowFirstColumn
)
{
if
(
styleOptions
.
firstHeaderCell
&&
styleOptions
.
firstHeaderCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstHeaderCell
.
dxf
.
fill
.
bg
)
{
ctx
.
setFillStyle
(
styleOptions
.
firstHeaderCell
.
dxf
.
fill
.
bg
);
else
}
else
{
ctx
.
setFillStyle
(
defaultColorBackground
);
ctx
.
fillRect
(
0
,
0
,
stepX
,
stepY
);
}
ctx
.
fillRect
(
0
,
0
,
stepX
,
stepY
);
}
//последняя в первой строке
if
(
styleOptions
.
lastHeaderCell
&&
styleInfo
.
ShowLastColumn
)
{
if
(
styleOptions
.
lastHeaderCell
&&
styleOptions
.
lastHeaderCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
lastHeaderCell
.
dxf
.
fill
.
bg
)
if
(
styleOptions
.
lastHeaderCell
&&
styleInfo
.
ShowLastColumn
)
{
if
(
styleOptions
.
lastHeaderCell
&&
styleOptions
.
lastHeaderCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
lastHeaderCell
.
dxf
.
fill
.
bg
)
{
ctx
.
setFillStyle
(
styleOptions
.
lastHeaderCell
.
dxf
.
fill
.
bg
);
else
}
else
{
ctx
.
setFillStyle
(
defaultColorBackground
);
ctx
.
fillRect
(
4
*
stepX
,
0
,
stepX
,
stepY
);
}
ctx
.
fillRect
(
4
*
stepX
,
0
,
stepX
,
stepY
);
}
//первая в последней строке
if
(
styleOptions
.
firstTotalCell
&&
styleInfo
.
TotalsRowCount
&&
styleInfo
.
ShowFirstColumn
)
{
if
(
styleOptions
.
firstTotalCell
&&
styleOptions
.
firstTotalCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstTotalCell
.
dxf
.
fill
.
bg
)
if
(
styleOptions
.
firstTotalCell
&&
styleInfo
.
TotalsRowCount
&&
styleInfo
.
ShowFirstColumn
)
{
if
(
styleOptions
.
firstTotalCell
&&
styleOptions
.
firstTotalCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
firstTotalCell
.
dxf
.
fill
.
bg
)
{
ctx
.
setFillStyle
(
styleOptions
.
firstTotalCell
.
dxf
.
fill
.
bg
);
else
}
else
{
ctx
.
setFillStyle
(
defaultColorBackground
);
ctx
.
fillRect
(
0
,
4
*
stepY
,
stepX
,
stepY
);
}
ctx
.
fillRect
(
0
,
4
*
stepY
,
stepX
,
stepY
);
}
//последняя ячейка
if
(
styleOptions
.
lastTotalCell
&&
styleInfo
.
TotalsRowCount
&&
styleInfo
.
ShowLastColumn
)
{
if
(
styleOptions
.
lastTotalCell
&&
styleOptions
.
lastTotalCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
lastTotalCell
.
dxf
.
fill
.
bg
)
if
(
styleOptions
.
lastTotalCell
&&
styleInfo
.
TotalsRowCount
&&
styleInfo
.
ShowLastColumn
)
{
if
(
styleOptions
.
lastTotalCell
&&
styleOptions
.
lastTotalCell
.
dxf
.
fill
&&
null
!=
styleOptions
.
lastTotalCell
.
dxf
.
fill
.
bg
)
{
ctx
.
setFillStyle
(
styleOptions
.
lastTotalCell
.
dxf
.
fill
.
bg
);
else
}
else
{
ctx
.
setFillStyle
(
defaultColorBackground
);
ctx
.
fillRect
(
4
*
stepX
,
4
*
stepY
,
stepX
,
ySize
);
}
ctx
.
fillRect
(
4
*
stepX
,
4
*
stepY
,
stepX
,
ySize
);
}
else
{
}
else
{
ctx
.
setFillStyle
(
whiteColor
);
ctx
.
fillRect
(
0
,
0
,
xSize
,
ySize
);
ctx
.
fillRect
(
0
,
0
,
xSize
,
ySize
);
}
//**draw vertical and horizontal lines**
...
...
@@ -5080,41 +5173,35 @@ function OfflineEditor () {
}
var
border
;
if
(
styleInfo
.
ShowRowStripes
)
{
if
(
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
border
)
if
(
styleInfo
.
ShowRowStripes
)
{
if
(
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
border
)
{
border
=
styleOptions
.
firstRowStripe
.
dxf
.
border
;
else
if
(
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
border
)
}
else
if
(
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
border
)
{
border
=
styleOptions
.
secondRowStripe
.
dxf
.
border
;
}
if
(
border
)
{
for
(
n
=
1
;
n
<
5
;
n
++
)
{
ctx
.
lineHor
(
0
,
stepY
*
n
,
xSize
);
if
(
border
)
{
for
(
n
=
1
;
n
<
5
;
n
++
)
{
ctx
.
lineHor
(
0
,
stepY
*
n
,
xSize
);
}
ctx
.
stroke
();
}
}
if
(
styleOptions
.
totalRow
&&
styleInfo
.
TotalsRowCount
&&
styleOptions
.
totalRow
.
dxf
.
border
)
{
if
(
styleOptions
.
totalRow
&&
styleInfo
.
TotalsRowCount
&&
styleOptions
.
totalRow
.
dxf
.
border
)
{
border
=
styleOptions
.
totalRow
.
dxf
.
border
;
if
(
border
.
t
.
s
!==
AscCommon
.
c_oAscBorderStyles
.
None
)
{
if
(
border
.
t
.
s
!==
AscCommon
.
c_oAscBorderStyles
.
None
)
{
ctx
.
setStrokeStyle
(
border
.
t
.
c
);
ctx
.
lineVer
(
0
,
xSize
,
ySize
);
}
}
if
(
styleOptions
.
headerRow
&&
styleOptions
.
headerRow
.
dxf
.
border
)
//header row
if
(
styleOptions
.
headerRow
&&
styleOptions
.
headerRow
.
dxf
.
border
&&
styleInfo
.
HeaderRowCount
)
//header row
{
border
=
styleOptions
.
headerRow
.
dxf
.
border
;
if
(
border
.
t
.
s
!==
AscCommon
.
c_oAscBorderStyles
.
None
)
{
if
(
border
.
t
.
s
!==
AscCommon
.
c_oAscBorderStyles
.
None
)
{
ctx
.
setStrokeStyle
(
border
.
t
.
c
);
ctx
.
lineHor
(
0
,
0
,
xSize
);
}
if
(
border
.
b
.
s
!==
AscCommon
.
c_oAscBorderStyles
.
None
)
{
if
(
border
.
b
.
s
!==
AscCommon
.
c_oAscBorderStyles
.
None
)
{
ctx
.
setStrokeStyle
(
border
.
b
.
c
);
ctx
.
lineHor
(
0
,
stepY
,
xSize
);
}
...
...
@@ -5125,46 +5212,43 @@ function OfflineEditor () {
//**draw marks line**
var
defaultColor
;
if
(
!
styleOptions
||
!
styleOptions
.
wholeTable
||
!
styleOptions
.
wholeTable
.
dxf
.
font
)
if
(
!
styleOptions
||
!
styleOptions
.
wholeTable
||
!
styleOptions
.
wholeTable
.
dxf
.
font
)
{
defaultColor
=
blackColor
;
else
}
else
{
defaultColor
=
styleOptions
.
wholeTable
.
dxf
.
font
.
getColor
();
for
(
var
n
=
1
;
n
<
6
;
n
++
)
{
}
for
(
var
n
=
1
;
n
<
6
;
n
++
)
{
ctx
.
beginPath
();
color
=
null
;
if
(
n
==
1
&&
styleOptions
&&
styleOptions
.
headerRow
&&
styleOptions
.
headerRow
.
dxf
.
font
)
if
(
n
==
1
&&
styleOptions
&&
styleOptions
.
headerRow
&&
styleOptions
.
headerRow
.
dxf
.
font
)
{
color
=
styleOptions
.
headerRow
.
dxf
.
font
.
getColor
();
else
if
(
n
==
5
&&
styleOptions
&&
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
font
)
}
else
if
(
n
==
5
&&
styleOptions
&&
styleOptions
.
totalRow
&&
styleOptions
.
totalRow
.
dxf
.
font
)
{
color
=
styleOptions
.
totalRow
.
dxf
.
font
.
getColor
();
else
if
(
styleOptions
&&
styleOptions
.
headerRow
&&
styleInfo
.
ShowRowStripes
)
{
if
((
n
==
2
||
(
n
==
5
&&
!
styleOptions
.
totalRow
))
&&
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
font
)
}
else
if
(
styleOptions
&&
styleOptions
.
headerRow
&&
styleInfo
.
ShowRowStripes
)
{
if
((
n
==
2
||
(
n
==
5
&&
!
styleOptions
.
totalRow
))
&&
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
font
)
{
color
=
styleOptions
.
firstRowStripe
.
dxf
.
font
.
getColor
();
else
if
(
n
==
3
&&
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
font
)
}
else
if
(
n
==
3
&&
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
font
)
{
color
=
styleOptions
.
secondRowStripe
.
dxf
.
font
.
getColor
();
else
}
else
{
color
=
defaultColor
}
else
if
(
styleOptions
&&
!
styleOptions
.
headerRow
&&
styleInfo
.
ShowRowStripes
)
{
if
((
n
==
1
||
n
==
3
||
(
n
==
5
&&
!
styleOptions
.
totalRow
))
&&
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
font
)
}
else
if
(
styleOptions
&&
!
styleOptions
.
headerRow
&&
styleInfo
.
ShowRowStripes
)
{
if
((
n
==
1
||
n
==
3
||
(
n
==
5
&&
!
styleOptions
.
totalRow
))
&&
styleOptions
.
firstRowStripe
&&
styleOptions
.
firstRowStripe
.
dxf
.
font
)
{
color
=
styleOptions
.
firstRowStripe
.
dxf
.
font
.
getColor
();
else
if
((
n
==
2
||
n
==
4
)
&&
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
font
)
}
else
if
((
n
==
2
||
n
==
4
)
&&
styleOptions
.
secondRowStripe
&&
styleOptions
.
secondRowStripe
.
dxf
.
font
)
{
color
=
styleOptions
.
secondRowStripe
.
dxf
.
font
.
getColor
();
else
}
else
{
color
=
defaultColor
}
else
}
else
{
color
=
defaultColor
;
}
ctx
.
setStrokeStyle
(
color
);
var
k
=
0
;
var
strY
=
n
*
stepY
-
stepY
/
2
;
while
(
k
<
6
)
{
//ctx.lineHor(k*stepX + 3 * pxToMM, strY, (k + 1)*stepX - 2 * pxToMM);
var
strY
=
n
*
stepY
-
stepY
/
2
;
while
(
k
<
6
)
{
window
[
"
native
"
][
"
PD_PathMoveTo
"
](
k
*
stepX
+
stepX
*
0.25
,
strY
);
window
[
"
native
"
][
"
PD_PathLineTo
"
]((
k
+
1
)
*
stepX
-
stepX
*
0.25
,
strY
);
k
++
;
...
...
@@ -6444,8 +6528,9 @@ window["native"]["offline_apply_event"] = function(type,params) {
case
12
:
// ASC_MENU_EVENT_TYPE_TABLESTYLES
{
var
wb
=
_api
.
wb
;
wb
.
getTablePictures
();
var
props
=
asc_ReadFormatTableInfo
(
params
,
_current
);
// console.log(JSON.stringify(props));
_api
.
wb
.
getTablePictures
(
props
);
break
;
}
...
...
@@ -7004,7 +7089,7 @@ window["native"]["offline_apply_event"] = function(type,params) {
break
;
}
case
3010
:
// ASC_SPREADSHEETS_EVENT_TYPE_
FILTER_CHANGE_AUTO
case
3010
:
// ASC_SPREADSHEETS_EVENT_TYPE_
AUTO_FILTER_CHANGE
{
var
changeFilter
=
asc_ReadAutoFilter
(
params
,
_current
);
...
...
@@ -7024,7 +7109,7 @@ window["native"]["offline_apply_event"] = function(type,params) {
break
;
}
case
3040
:
// ASC_SPREADSHEETS_EVENT_TYPE_FILTER_FORMAT_TABLE_OPTIONS
case
3040
:
// ASC_SPREADSHEETS_EVENT_TYPE_
AUTO_
FILTER_FORMAT_TABLE_OPTIONS
{
var
formatOptions
=
_api
.
asc_getAddFormatTableOptions
(
params
);
_stream
=
global_memory_stream_menu
;
...
...
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