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
c03c94d2
Commit
c03c94d2
authored
Aug 24, 2016
by
konovalovsergey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
totalRowTable change formula string to parserFormula, renameSheetCopy for copy sheet
parent
d6bb24b1
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
365 additions
and
182 deletions
+365
-182
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+90
-23
cell/model/Serialize.js
cell/model/Serialize.js
+19
-14
cell/model/Workbook.js
cell/model/Workbook.js
+122
-102
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+114
-32
cell/model/autofilters.js
cell/model/autofilters.js
+19
-10
cell/view/WorksheetView.js
cell/view/WorksheetView.js
+1
-1
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
c03c94d2
This diff is collapsed.
Click to expand it.
cell/model/Serialize.js
View file @
c03c94d2
...
...
@@ -1486,7 +1486,7 @@
if
(
null
!=
tableColumn
.
TotalsRowFormula
)
{
this
.
memory
.
WriteByte
(
c_oSer_TableColumns
.
TotalsRowFormula
);
this
.
memory
.
WriteString2
(
tableColumn
.
TotalsRowFormula
);
this
.
memory
.
WriteString2
(
tableColumn
.
TotalsRowFormula
.
Formula
);
}
if
(
null
!=
tableColumn
.
dxf
)
{
...
...
@@ -3380,7 +3380,7 @@
// this.memory.WriteByte(c_oSerPropLenType.Byte);
// this.memory.WriteBool(oFormula.bx);
// }
if
(
null
!
=
formulaParsed
.
ca
)
if
(
true
==
=
formulaParsed
.
ca
)
{
this
.
memory
.
WriteByte
(
c_oSerFormulaTypes
.
Ca
);
this
.
memory
.
WriteByte
(
c_oSerPropLenType
.
Byte
);
...
...
@@ -3906,12 +3906,13 @@
};
}
/** @constructor */
function
Binary_TableReader
(
stream
,
ws
,
Dxfs
)
function
Binary_TableReader
(
stream
,
oReadResult
,
ws
,
Dxfs
)
{
this
.
stream
=
stream
;
this
.
ws
=
ws
;
this
.
Dxfs
=
Dxfs
;
this
.
bcr
=
new
Binary_CommonReader
(
this
.
stream
);
this
.
oReadResult
=
oReadResult
;
this
.
Read
=
function
(
length
,
aTables
)
{
var
res
=
c_oSerConstants
.
ReadOk
;
...
...
@@ -3932,7 +3933,7 @@
return
oThis
.
ReadTable
(
t
,
l
,
oNewTable
);
});
if
(
null
!=
oNewTable
.
Ref
&&
null
!=
oNewTable
.
DisplayName
)
this
.
ws
.
workbook
.
dependencyFormulas
.
addTableName
(
this
.
ws
,
oNewTable
);
this
.
ws
.
workbook
.
dependencyFormulas
.
addTableName
(
this
.
ws
,
oNewTable
,
true
);
aTables
.
push
(
oNewTable
);
}
else
...
...
@@ -4288,10 +4289,10 @@
oTableColumn
.
TotalsRowLabel
=
this
.
stream
.
GetString2LE
(
length
);
else
if
(
c_oSer_TableColumns
.
TotalsRowFunction
==
type
)
oTableColumn
.
TotalsRowFunction
=
this
.
stream
.
GetUChar
();
else
if
(
c_oSer_TableColumns
.
TotalsRowFormula
==
type
)
oTableColumn
.
TotalsRowF
ormula
=
this
.
stream
.
GetString2LE
(
length
);
else
if
(
c_oSer_TableColumns
.
DataDxfId
==
type
)
{
else
if
(
c_oSer_TableColumns
.
TotalsRowFormula
==
type
)
{
var
f
ormula
=
this
.
stream
.
GetString2LE
(
length
);
this
.
oReadResult
.
tableCustomFunc
.
push
({
formula
:
formula
,
column
:
oTableColumn
,
ws
:
this
.
ws
});
}
else
if
(
c_oSer_TableColumns
.
DataDxfId
==
type
)
{
var
DxfId
=
this
.
stream
.
GetULongLE
();
oTableColumn
.
dxf
=
this
.
Dxfs
[
DxfId
];
}
...
...
@@ -5400,7 +5401,7 @@
};
}
/** @constructor */
function
Binary_WorksheetTableReader
(
stream
,
wb
,
aSharedStrings
,
aCellXfs
,
Dxfs
,
oMediaArray
,
copyPasteObj
)
function
Binary_WorksheetTableReader
(
stream
,
oReadResult
,
wb
,
aSharedStrings
,
aCellXfs
,
Dxfs
,
oMediaArray
,
copyPasteObj
)
{
this
.
stream
=
stream
;
this
.
wb
=
wb
;
...
...
@@ -5413,6 +5414,7 @@
this
.
aHyperlinks
=
[];
this
.
copyPasteObj
=
copyPasteObj
;
this
.
curWorksheet
=
null
;
this
.
oReadResult
=
oReadResult
;
this
.
Read
=
function
()
{
var
oThis
=
this
;
...
...
@@ -5604,7 +5606,7 @@
}
else
if
(
c_oSerWorksheetsTypes
.
Autofilter
==
type
)
{
oBinary_TableReader
=
new
Binary_TableReader
(
this
.
stream
,
oWorksheet
,
this
.
Dxfs
);
oBinary_TableReader
=
new
Binary_TableReader
(
this
.
stream
,
this
.
oReadResult
,
oWorksheet
,
this
.
Dxfs
);
oWorksheet
.
AutoFilter
=
new
AscCommonExcel
.
AutoFilter
();
res
=
this
.
bcr
.
Read1
(
length
,
function
(
t
,
l
){
return
oBinary_TableReader
.
ReadAutoFilter
(
t
,
l
,
oWorksheet
.
AutoFilter
);
...
...
@@ -5612,7 +5614,7 @@
}
else
if
(
c_oSerWorksheetsTypes
.
TableParts
==
type
)
{
oBinary_TableReader
=
new
Binary_TableReader
(
this
.
stream
,
oWorksheet
,
this
.
Dxfs
);
oBinary_TableReader
=
new
Binary_TableReader
(
this
.
stream
,
this
.
oReadResult
,
oWorksheet
,
this
.
Dxfs
);
oBinary_TableReader
.
Read
(
length
,
oWorksheet
.
TableParts
);
}
else
if
(
c_oSerWorksheetsTypes
.
Comments
==
type
&&
!
(
typeof
editor
!==
"
undefined
"
&&
editor
.
WordControl
&&
editor
.
WordControl
.
m_oLogicDocument
&&
Array
.
isArray
(
editor
.
WordControl
.
m_oLogicDocument
.
Slides
)))
{
...
...
@@ -6961,6 +6963,9 @@
isCopyPaste
:
isCopyPaste
,
activeRange
:
null
};
this
.
oReadResult
=
{
tableCustomFunc
:
[]
};
this
.
getbase64DecodedData
=
function
(
szSrc
)
{
var
nType
=
0
;
...
...
@@ -7195,7 +7200,7 @@
// res = (new Binary_WorkbookTableReader(this.stream, wb)).Read();
// break;
case
c_oSerTableTypes
.
Worksheets
:
res
=
(
new
Binary_WorksheetTableReader
(
this
.
stream
,
wb
,
aSharedStrings
,
aCellXfs
,
aDxfs
,
oMediaArray
,
this
.
copyPasteObj
)).
Read
();
res
=
(
new
Binary_WorksheetTableReader
(
this
.
stream
,
this
.
oReadResult
,
wb
,
aSharedStrings
,
aCellXfs
,
aDxfs
,
oMediaArray
,
this
.
copyPasteObj
)).
Read
();
break
;
// case c_oSerTableTypes.CalcChain:
// res = (new Binary_CalcChainTableReader(this.stream, wb.calcChain)).Read();
...
...
@@ -7218,9 +7223,9 @@
if
(
c_oSerConstants
.
ReadOk
==
res
)
res
=
(
new
Binary_WorkbookTableReader
(
this
.
stream
,
wb
)).
Read
();
}
wb
.
init
();
wb
.
init
(
this
.
oReadResult
.
tableCustomFunc
);
}
else
if
(
window
[
"
Asc
"
]
&&
window
[
"
Asc
"
][
"
editor
"
]
!==
undefined
){
wb
.
init
(
true
);
wb
.
init
(
t
his
.
oReadResult
.
tableCustomFunc
,
t
rue
);
}
return
res
;
};
...
...
cell/model/Workbook.js
View file @
c03c94d2
This diff is collapsed.
Click to expand it.
cell/model/WorkbookElems.js
View file @
c03c94d2
This diff is collapsed.
Click to expand it.
cell/model/autofilters.js
View file @
c03c94d2
...
...
@@ -898,9 +898,12 @@
if
(
!
undoData
)
return
;
if
(
undoData
.
clone
)
if
(
undoData
.
clone
)
{
cloneData
=
undoData
.
clone
(
null
);
else
if
(
cloneData
.
buildDependencies
)
{
cloneData
.
buildDependencies
();
}
}
else
cloneData
=
undoData
;
if
(
!
cloneData
)
...
...
@@ -1066,7 +1069,10 @@
{
this
.
_cleanStyleTable
(
cloneData
.
Ref
);
worksheet
.
workbook
.
dependencyFormulas
.
delTableName
(
worksheet
.
TableParts
[
l
].
DisplayName
);
worksheet
.
TableParts
.
splice
(
l
,
1
);
var
deleted
=
worksheet
.
TableParts
.
splice
(
l
,
1
);
for
(
var
delIndex
=
0
;
i
<
deleted
.
length
;
++
i
)
{
deleted
[
delIndex
].
removeDependencies
();
}
}
}
}
...
...
@@ -1153,7 +1159,7 @@
if
(
isTablePart
)
worksheet
.
workbook
.
dependencyFormulas
.
delTableName
(
oldFilter
.
DisplayName
)
}
else
return
oldF
ilter
;
return
f
ilter
;
};
if
(
worksheet
.
AutoFilter
)
...
...
@@ -1163,14 +1169,17 @@
if
(
worksheet
.
TableParts
)
{
var
newTableParts
=
[];
for
(
var
i
=
0
;
i
<
worksheet
.
TableParts
.
length
;
i
++
)
{
var
filter
=
changeFilter
(
worksheet
.
TableParts
[
i
],
true
);
if
(
filter
)
var
tablePart
=
worksheet
.
TableParts
[
i
];
var
filter
=
changeFilter
(
tablePart
,
true
);
if
(
filter
){
newTableParts
.
push
(
filter
);
}
else
{
tablePart
.
removeDependencies
();
}
}
worksheet
.
TableParts
=
newTableParts
;
}
...
...
@@ -2435,7 +2444,7 @@
if
(
val
===
true
)
{
tablePart
.
generateTotalsRowLabel
();
tablePart
.
generateTotalsRowLabel
(
worksheet
);
}
}
...
...
@@ -2912,7 +2921,7 @@
if
(
cell
.
isFormula
())
{
var
val
=
cell
.
getFormula
();
tableColumn
.
setTotalsRowFormula
(
val
);
tableColumn
.
setTotalsRowFormula
(
val
,
worksheet
);
}
else
{
...
...
cell/view/WorksheetView.js
View file @
c03c94d2
...
...
@@ -12445,7 +12445,7 @@
for
(
var
i
=
0
;
i
<
tableParts
.
length
;
i
++
)
{
this
.
model
.
autoFilters
.
_setColorStyleTable
(
tableParts
[
i
].
Ref
,
tableParts
[
i
]);
//TODO пока заменяем при открытии на TotalsRowFormula
tableParts
[
i
].
checkTotalRowFormula
();
tableParts
[
i
].
checkTotalRowFormula
(
worksheet
);
}
}
...
...
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