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
74848889
Commit
74848889
authored
Oct 31, 2017
by
Alexander.Trofimov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/ONLYOFFICE/sdkjs
into develop
parents
8853411e
1602d4b9
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
79 additions
and
40 deletions
+79
-40
cell/model/FormulaObjects/parserFormula.js
cell/model/FormulaObjects/parserFormula.js
+68
-17
cell/model/Serialize.js
cell/model/Serialize.js
+2
-2
cell/model/Workbook.js
cell/model/Workbook.js
+1
-1
cell/model/WorkbookElems.js
cell/model/WorkbookElems.js
+8
-20
No files found.
cell/model/FormulaObjects/parserFormula.js
View file @
74848889
...
...
@@ -2664,11 +2664,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cRangeUnionOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
:
'
,
50
,
2
]);
//
cBaseOperator.apply(this, [':', 50, 2]);
}
cRangeUnionOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cRangeUnionOperator
.
prototype
.
constructor
=
cRangeUnionOperator
;
cRangeUnionOperator
.
prototype
.
name
=
'
:
'
;
cRangeUnionOperator
.
prototype
.
priority
=
50
;
cRangeUnionOperator
.
prototype
.
argumentsCurrent
=
2
;
cRangeUnionOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
],
ws0
,
ws1
,
ws
,
res
;
if
((
cElementType
.
cell
===
arg0
.
type
||
cElementType
.
cellsRange
===
arg0
.
type
||
...
...
@@ -2714,11 +2717,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cRangeIntersectionOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
'
,
50
,
2
]);
//
cBaseOperator.apply(this, [' ', 50, 2]);
}
cRangeIntersectionOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cRangeIntersectionOperator
.
prototype
.
constructor
=
cRangeIntersectionOperator
;
cRangeIntersectionOperator
.
prototype
.
name
=
'
'
;
cRangeIntersectionOperator
.
prototype
.
priority
=
50
;
cRangeIntersectionOperator
.
prototype
.
argumentsCurrent
=
2
;
cRangeIntersectionOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
],
ws0
,
ws1
,
ws
,
res
;
if
((
cElementType
.
cell
===
arg0
.
type
||
cElementType
.
cellsRange
===
arg0
.
type
||
...
...
@@ -2769,11 +2775,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cUnarMinusOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
un_minus
'
/**name operator*/
,
49
/**priority of operator*/
,
1
/**count arguments*/
]);
//
cBaseOperator.apply(this, ['un_minus'/**name operator*/, 49/**priority of operator*/, 1/**count arguments*/]);
}
cUnarMinusOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cUnarMinusOperator
.
prototype
.
constructor
=
cUnarMinusOperator
;
cUnarMinusOperator
.
prototype
.
name
=
'
un_minus
'
;
cUnarMinusOperator
.
prototype
.
priority
=
49
;
cUnarMinusOperator
.
prototype
.
argumentsCurrent
=
1
;
cUnarMinusOperator
.
prototype
.
rightAssociative
=
true
;
cUnarMinusOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
];
...
...
@@ -2806,11 +2815,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cUnarPlusOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
un_plus
'
,
49
,
1
]);
//
cBaseOperator.apply(this, ['un_plus', 49, 1]);
}
cUnarPlusOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cUnarPlusOperator
.
prototype
.
constructor
=
cUnarPlusOperator
;
cUnarPlusOperator
.
prototype
.
name
=
'
un_plus
'
;
cUnarPlusOperator
.
prototype
.
priority
=
49
;
cUnarPlusOperator
.
prototype
.
argumentsCurrent
=
1
;
cUnarPlusOperator
.
prototype
.
rightAssociative
=
true
;
cUnarPlusOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
];
...
...
@@ -2838,11 +2850,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cAddOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
+
'
,
20
]);
//
cBaseOperator.apply(this, ['+', 20]);
}
cAddOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cAddOperator
.
prototype
.
constructor
=
cAddOperator
;
cAddOperator
.
prototype
.
name
=
'
+
'
;
cAddOperator
.
prototype
.
priority
=
20
;
cAddOperator
.
prototype
.
argumentsCurrent
=
2
;
cAddOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -2872,11 +2887,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cMinusOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
-
'
,
20
]);
//
cBaseOperator.apply(this, ['-', 20]);
}
cMinusOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cMinusOperator
.
prototype
.
constructor
=
cMinusOperator
;
cMinusOperator
.
prototype
.
name
=
'
-
'
;
cMinusOperator
.
prototype
.
priority
=
20
;
cMinusOperator
.
prototype
.
argumentsCurrent
=
2
;
cMinusOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -2906,11 +2924,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cPercentOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
%
'
,
45
,
1
]);
//
cBaseOperator.apply(this, ['%', 45, 1]);
}
cPercentOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cPercentOperator
.
prototype
.
constructor
=
cPercentOperator
;
cPercentOperator
.
prototype
.
name
=
'
%
'
;
cPercentOperator
.
prototype
.
priority
=
45
;
cPercentOperator
.
prototype
.
argumentsCurrent
=
1
;
cPercentOperator
.
prototype
.
rightAssociative
=
true
;
cPercentOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
res
,
arg0
=
arg
[
0
];
...
...
@@ -2942,12 +2963,15 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cPowOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
^
'
,
40
]);
//
cBaseOperator.apply(this, ['^', 40]);
}
cPowOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cPowOperator
.
prototype
.
numFormat
=
cNumFormatNone
;
cPowOperator
.
prototype
.
constructor
=
cPowOperator
;
cPowOperator
.
prototype
.
name
=
'
^
'
;
cPowOperator
.
prototype
.
priority
=
40
;
cPowOperator
.
prototype
.
argumentsCurrent
=
2
;
cPowOperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
if
(
arg0
instanceof
cArea
)
{
...
...
@@ -2983,12 +3007,15 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cMultOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
*
'
,
30
]);
//
cBaseOperator.apply(this, ['*', 30]);
}
cMultOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cMultOperator
.
prototype
.
numFormat
=
cNumFormatNone
;
cMultOperator
.
prototype
.
constructor
=
cMultOperator
;
cMultOperator
.
prototype
.
name
=
'
*
'
;
cMultOperator
.
prototype
.
priority
=
30
;
cMultOperator
.
prototype
.
argumentsCurrent
=
2
;
cMultOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3018,12 +3045,15 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cDivOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
/
'
,
30
]);
//
cBaseOperator.apply(this, ['/', 30]);
}
cDivOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cDivOperator
.
prototype
.
numFormat
=
cNumFormatNone
;
cDivOperator
.
prototype
.
constructor
=
cDivOperator
;
cDivOperator
.
prototype
.
name
=
'
/
'
;
cDivOperator
.
prototype
.
priority
=
30
;
cDivOperator
.
prototype
.
argumentsCurrent
=
2
;
cDivOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3053,11 +3083,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cConcatSTROperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
&
'
,
15
]);
//
cBaseOperator.apply(this, ['&', 15]);
}
cConcatSTROperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cConcatSTROperator
.
prototype
.
constructor
=
cConcatSTROperator
;
cConcatSTROperator
.
prototype
.
name
=
'
&
'
;
cConcatSTROperator
.
prototype
.
priority
=
15
;
cConcatSTROperator
.
prototype
.
argumentsCurrent
=
2
;
cConcatSTROperator
.
prototype
.
numFormat
=
cNumFormatNone
;
cConcatSTROperator
.
prototype
.
Calculate
=
function
(
arg
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3083,11 +3116,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cEqualsOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
=
'
,
10
]);
//
cBaseOperator.apply(this, ['=', 10]);
}
cEqualsOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cEqualsOperator
.
prototype
.
constructor
=
cEqualsOperator
;
cEqualsOperator
.
prototype
.
name
=
'
=
'
;
cEqualsOperator
.
prototype
.
priority
=
10
;
cEqualsOperator
.
prototype
.
argumentsCurrent
=
2
;
cEqualsOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3119,11 +3155,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cNotEqualsOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
<>
'
,
10
]);
//
cBaseOperator.apply(this, ['<>', 10]);
}
cNotEqualsOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cNotEqualsOperator
.
prototype
.
constructor
=
cNotEqualsOperator
;
cNotEqualsOperator
.
prototype
.
name
=
'
<>
'
;
cNotEqualsOperator
.
prototype
.
priority
=
10
;
cNotEqualsOperator
.
prototype
.
argumentsCurrent
=
2
;
cNotEqualsOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3156,11 +3195,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cLessOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
<
'
,
10
]);
//
cBaseOperator.apply(this, ['<', 10]);
}
cLessOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cLessOperator
.
prototype
.
constructor
=
cLessOperator
;
cLessOperator
.
prototype
.
name
=
'
<
'
;
cLessOperator
.
prototype
.
priority
=
10
;
cLessOperator
.
prototype
.
argumentsCurrent
=
2
;
cLessOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3193,11 +3235,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cLessOrEqualOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
<=
'
,
10
]);
//
cBaseOperator.apply(this, ['<=', 10]);
}
cLessOrEqualOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cLessOrEqualOperator
.
prototype
.
constructor
=
cLessOrEqualOperator
;
cLessOrEqualOperator
.
prototype
.
name
=
'
<=
'
;
cLessOrEqualOperator
.
prototype
.
priority
=
10
;
cLessOrEqualOperator
.
prototype
.
argumentsCurrent
=
2
;
cLessOrEqualOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3229,11 +3274,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cGreaterOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
>
'
,
10
]);
//
cBaseOperator.apply(this, ['>', 10]);
}
cGreaterOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cGreaterOperator
.
prototype
.
constructor
=
cGreaterOperator
;
cGreaterOperator
.
prototype
.
name
=
'
>
'
;
cGreaterOperator
.
prototype
.
priority
=
10
;
cGreaterOperator
.
prototype
.
argumentsCurrent
=
2
;
cGreaterOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
@@ -3265,11 +3313,14 @@ parserHelp.setDigitSeparator(AscCommon.g_oDefaultCultureInfo.NumberDecimalSepara
* @extends {cBaseOperator}
*/
function
cGreaterOrEqualOperator
()
{
cBaseOperator
.
apply
(
this
,
[
'
>=
'
,
10
]);
//
cBaseOperator.apply(this, ['>=', 10]);
}
cGreaterOrEqualOperator
.
prototype
=
Object
.
create
(
cBaseOperator
.
prototype
);
cGreaterOrEqualOperator
.
prototype
.
constructor
=
cGreaterOrEqualOperator
;
cGreaterOrEqualOperator
.
prototype
.
name
=
'
>=
'
;
cGreaterOrEqualOperator
.
prototype
.
priority
=
10
;
cGreaterOrEqualOperator
.
prototype
.
argumentsCurrent
=
2
;
cGreaterOrEqualOperator
.
prototype
.
Calculate
=
function
(
arg
,
opt_bbox
,
opt_defName
,
ws
,
bIsSpecialFunction
)
{
var
arg0
=
arg
[
0
],
arg1
=
arg
[
1
];
...
...
cell/model/Serialize.js
View file @
74848889
...
...
@@ -6034,14 +6034,14 @@
oTo
.
BestFit
=
oFrom
.
BestFit
;
oTo
.
setHidden
(
oFrom
.
hd
);
if
(
null
!=
oFrom
.
xfs
)
oTo
.
xfs
=
oFrom
.
xfs
.
clone
(
);
oTo
.
setStyle
(
oFrom
.
xfs
);
else
if
(
null
!=
oFrom
.
xfsid
)
{
var
xfs
=
oThis
.
aCellXfs
[
oFrom
.
xfsid
];
if
(
null
!=
xfs
)
{
oFrom
.
xfs
=
xfs
;
oTo
.
xfs
=
xfs
.
clone
(
);
oTo
.
setStyle
(
xfs
);
}
}
if
(
null
!=
oFrom
.
width
)
...
...
cell/model/Workbook.js
View file @
74848889
...
...
@@ -6192,7 +6192,7 @@
}
};
Cell
.
prototype
.
setStyleInternal
=
function
(
xfs
)
{
this
.
xfs
=
xfs
;
this
.
xfs
=
g_StyleCache
.
addXf
(
xfs
)
;
this
.
_hasChanged
=
true
;
};
Cell
.
prototype
.
getFormula
=
function
(){
...
...
cell/model/WorkbookElems.js
View file @
74848889
...
...
@@ -2805,7 +2805,7 @@ StyleManager.prototype =
return
this
.
xfs
.
list
.
length
;
};
StyleCache
.
prototype
.
_add
=
function
(
container
,
newVal
)
{
if
(
undefined
===
newVal
.
getIndexNumber
())
{
if
(
newVal
&&
undefined
===
newVal
.
getIndexNumber
())
{
var
hash
=
newVal
.
getHash
();
var
res
=
container
.
vals
[
hash
];
if
(
!
res
)
{
...
...
@@ -3211,25 +3211,14 @@ Col.prototype =
setStyle
:
function
(
xfs
)
{
var
oldVal
=
this
.
xfs
;
var
newVal
=
null
;
this
.
xfs
=
null
;
if
(
null
!=
xfs
)
{
this
.
xfs
=
xfs
.
clone
();
newVal
=
xfs
;
}
if
(
History
.
Is_On
()
&&
false
==
((
null
==
oldVal
&&
null
==
newVal
)
||
(
null
!=
oldVal
&&
null
!=
newVal
&&
true
==
oldVal
.
isEqual
(
newVal
))))
{
if
(
null
!=
oldVal
)
oldVal
=
oldVal
.
clone
();
if
(
null
!=
newVal
)
newVal
=
newVal
.
clone
();
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoCol
,
AscCH
.
historyitem_RowCol_SetStyle
,
this
.
ws
.
getId
(),
this
.
_getUpdateRange
(),
new
UndoRedoData_IndexSimpleProp
(
this
.
index
,
false
,
oldVal
,
newVal
));
this
.
setStyleInternal
(
xfs
);
if
(
History
.
Is_On
()
&&
oldVal
!==
this
.
xfs
)
{
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoCol
,
AscCH
.
historyitem_RowCol_SetStyle
,
this
.
ws
.
getId
(),
this
.
_getUpdateRange
(),
new
UndoRedoData_IndexSimpleProp
(
this
.
index
,
false
,
oldVal
,
this
.
xfs
));
}
},
setStyleInternal
:
function
(
xfs
)
{
this
.
xfs
=
xfs
;
this
.
xfs
=
g_StyleCache
.
addXf
(
xfs
)
;
},
setCellStyle
:
function
(
val
)
{
...
...
@@ -3524,15 +3513,14 @@ Row.prototype =
setStyle
:
function
(
xfs
)
{
var
oldVal
=
this
.
xfs
;
this
.
xfs
=
xfs
;
this
.
_hasChanged
=
true
;
if
(
History
.
Is_On
()
&&
oldVal
!=
this
.
xfs
)
{
this
.
setStyleInternal
(
xfs
);
if
(
History
.
Is_On
()
&&
oldVal
!==
this
.
xfs
)
{
History
.
Add
(
AscCommonExcel
.
g_oUndoRedoRow
,
AscCH
.
historyitem_RowCol_SetStyle
,
this
.
ws
.
getId
(),
this
.
_getUpdateRange
(),
new
UndoRedoData_IndexSimpleProp
(
this
.
index
,
true
,
oldVal
,
this
.
xfs
));
}
},
setStyleInternal
:
function
(
xfs
)
{
this
.
xfs
=
xfs
;
this
.
xfs
=
g_StyleCache
.
addXf
(
xfs
)
;
this
.
_hasChanged
=
true
;
},
setCellStyle
:
function
(
val
)
...
...
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