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
f4d14e1b
Commit
f4d14e1b
authored
Mar 23, 2016
by
dmitry.shahtanov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
локализация ошибок
parent
17358774
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
156 additions
and
18 deletions
+156
-18
Common/editorscommon.js
Common/editorscommon.js
+3
-2
Excel/model/FormulaObjects/parserFormula.js
Excel/model/FormulaObjects/parserFormula.js
+78
-11
Excel/model/WorkbookElems.js
Excel/model/WorkbookElems.js
+75
-5
No files found.
Common/editorscommon.js
View file @
f4d14e1b
...
...
@@ -22,7 +22,7 @@
* Pursuant to Section 7 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"
use strict
"
;
"
use strict
"
;
if
(
typeof
String
.
prototype
.
startsWith
!=
'
function
'
)
{
String
.
prototype
.
startsWith
=
function
(
str
){
...
...
@@ -583,6 +583,7 @@ function test_defName(){
var
cStrucTableLocalColumns
=
{
"
h
"
:
"
Headers
"
,
"
d
"
:
"
Data
"
,
"
a
"
:
"
All
"
,
"
tr
"
:
"
This row
"
,
"
t
"
:
"
Totals
"
},
cBoolLocal
=
{
"
t
"
:
"
TRUE
"
,
"
f
"
:
"
FALSE
"
},
cErrorOrigin
=
{
"
nil
"
:
"
#NULL!
"
,
"
div
"
:
"
#DIV
\
/0!
"
,
"
value
"
:
"
#VALUE!
"
,
"
ref
"
:
"
#REF!
"
,
"
name
"
:
"
#NAME
\\
?
"
,
"
num
"
:
"
#NUM!
"
,
"
na
"
:
"
#N
\
/A
"
,
"
getdata
"
:
"
#GETTING_DATA
"
,
"
uf
"
:
"
#UNSUPPORTED_FUNCTION!
"
},
cErrorLocal
=
{
"
nil
"
:
"
#NULL!
"
,
"
div
"
:
"
#DIV
\
/0!
"
,
"
value
"
:
"
#VALUE!
"
,
"
ref
"
:
"
#REF!
"
,
"
name
"
:
"
#NAME
\\
?
"
,
"
num
"
:
"
#NUM!
"
,
"
na
"
:
"
#N
\
/A
"
,
"
getdata
"
:
"
#GETTING_DATA
"
,
"
uf
"
:
"
#UNSUPPORTED_FUNCTION!
"
};
...
...
@@ -636,7 +637,7 @@ function build_rx_bool(local){
}
function
build_rx_error_local
(
local
){
rx_error_local
=
build_rx_error
(
null
/*local*/
);
rx_error_local
=
build_rx_error
(
local
);
}
function
build_rx_error
(
local
){
cErrorLocal
=
(
local
?
local
:
{
"
nil
"
:
"
#NULL!
"
,
"
div
"
:
"
#DIV
\
/0!
"
,
"
value
"
:
"
#VALUE!
"
,
"
ref
"
:
"
#REF!
"
,
"
name
"
:
"
#NAME
\\
?
"
,
"
num
"
:
"
#NUM!
"
,
"
na
"
:
"
#N
\
/A
"
,
"
getdata
"
:
"
#GETTING_DATA
"
,
"
uf
"
:
"
#UNSUPPORTED_FUNCTION!
"
}
);
...
...
Excel/model/FormulaObjects/parserFormula.js
View file @
f4d14e1b
...
...
@@ -464,7 +464,7 @@ function cError( val ) {
switch
(
val
)
{
case
cErrorLocal
[
"
value
"
]:
case
"
#VALUE!
"
:
case
cErrorOrigin
[
"
value
"
]
:
case
cErrorType
.
wrong_value_type
:
{
this
.
value
=
"
#VALUE!
"
;
...
...
@@ -472,7 +472,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
nil
"
]:
case
"
#NULL!
"
:
case
cErrorOrigin
[
"
nil
"
]
:
case
cErrorType
.
null_value
:
{
this
.
value
=
"
#NULL!
"
;
...
...
@@ -480,7 +480,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
div
"
]:
case
"
#DIV/0!
"
:
case
cErrorOrigin
[
"
div
"
]
:
case
cErrorType
.
division_by_zero
:
{
this
.
value
=
"
#DIV/0!
"
;
...
...
@@ -488,7 +488,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
ref
"
]:
case
"
#REF!
"
:
case
cErrorOrigin
[
"
ref
"
]
:
case
cErrorType
.
bad_reference
:
{
this
.
value
=
"
#REF!
"
;
...
...
@@ -496,7 +496,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
name
"
]:
case
"
#NAME?
"
:
case
cErrorOrigin
[
"
name
"
]
:
case
cErrorType
.
wrong_name
:
{
this
.
value
=
"
#NAME?
"
;
...
...
@@ -504,7 +504,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
num
"
]:
case
"
#NUM!
"
:
case
cErrorOrigin
[
"
num
"
]
:
case
cErrorType
.
not_numeric
:
{
this
.
value
=
"
#NUM!
"
;
...
...
@@ -512,7 +512,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
na
"
]:
case
"
#N/A
"
:
case
cErrorOrigin
[
"
na
"
]
:
case
cErrorType
.
not_available
:
{
this
.
value
=
"
#N/A
"
;
...
...
@@ -520,7 +520,7 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
getdata
"
]:
case
"
#GETTING_DATA
"
:
case
cErrorOrigin
[
"
getdata
"
]
:
case
cErrorType
.
getting_data
:
{
this
.
value
=
"
#GETTING_DATA
"
;
...
...
@@ -528,14 +528,13 @@ function cError( val ) {
break
;
}
case
cErrorLocal
[
"
uf
"
]:
case
"
#UNSUPPORTED_FUNCTION!
"
:
case
cErrorOrigin
[
"
uf
"
]
:
case
cErrorType
.
unsupported_function
:
{
this
.
value
=
"
#UNSUPPORTED_FUNCTION!
"
;
this
.
errorType
=
cErrorType
.
unsupported_function
;
break
;
}
}
return
this
;
...
...
@@ -545,6 +544,74 @@ cError.prototype = Object.create( cBaseType.prototype );
cError
.
prototype
.
tocNumber
=
cError
.
prototype
.
tocString
=
cError
.
prototype
.
tocBool
=
cError
.
prototype
.
tocEmpty
=
function
()
{
return
this
;
};
cError
.
prototype
.
toLocaleString
=
function
()
{
switch
(
this
.
value
)
{
case
cErrorOrigin
[
"
value
"
]:
case
cErrorType
.
wrong_value_type
:
{
return
cErrorLocal
[
"
value
"
];
break
;
}
case
cErrorOrigin
[
"
nil
"
]:
case
cErrorType
.
null_value
:
{
return
cErrorLocal
[
"
nil
"
];
break
;
}
case
cErrorOrigin
[
"
div
"
]:
case
cErrorType
.
division_by_zero
:
{
return
cErrorLocal
[
"
div
"
];
break
;
}
case
cErrorOrigin
[
"
ref
"
]:
case
cErrorType
.
bad_reference
:
{
return
cErrorLocal
[
"
ref
"
];
break
;
}
case
cErrorOrigin
[
"
name
"
]:
case
cErrorType
.
wrong_name
:
{
return
cErrorLocal
[
"
name
"
];
break
;
}
case
cErrorOrigin
[
"
num
"
]:
case
cErrorType
.
not_numeric
:
{
return
cErrorLocal
[
"
num
"
];
break
;
}
case
cErrorOrigin
[
"
na
"
]:
case
cErrorType
.
not_available
:
{
return
cErrorLocal
[
"
na
"
];
break
;
}
case
cErrorOrigin
[
"
getdata
"
]:
case
cErrorType
.
getting_data
:
{
return
cErrorLocal
[
"
getdata
"
];
break
;
}
case
cErrorOrigin
[
"
uf
"
]:
case
cErrorType
.
unsupported_function
:
{
return
cErrorLocal
[
"
uf
"
];
break
;
}
}
return
cErrorLocal
[
"
na
"
];
};
/*cError.prototype.toString = function () {
return new cString( this.value ? cBoolLocal["t"].toUpperCase() : cBoolLocal["f"].toUpperCase() );
};*/
/** @constructor */
function
cArea
(
val
,
ws
)
{
/*Area means "A1:E5" for example*/
...
...
@@ -4333,7 +4400,7 @@ parserFormula.prototype = {
}
/* Errors */
else
if
(
parserHelp
.
isError
.
call
(
this
,
this
.
Formula
,
this
.
pCurrPos
)
)
{
else
if
(
parserHelp
.
isError
.
call
(
this
,
this
.
Formula
,
this
.
pCurrPos
,
local
)
)
{
found_operand
=
new
cError
(
this
.
operand_str
);
}
...
...
Excel/model/WorkbookElems.js
View file @
f4d14e1b
...
...
@@ -22,7 +22,7 @@
* Pursuant to Section 7 3(e) we decline to grant you any rights under trademark law for use of our trademarks.
*
*/
"
use strict
"
;
"
use strict
"
;
var
g_oColorManager
=
null
;
var
g_nNumsMaxId
=
160
;
...
...
@@ -2911,6 +2911,9 @@ CCellValue.prototype =
for
(
var
i
=
0
,
length
=
this
.
textValueForEdit2
.
length
;
i
<
length
;
++
i
)
this
.
textValueForEdit
+=
this
.
textValueForEdit2
[
i
].
text
;
}
if
(
CellValueType
.
Error
==
this
.
type
){
return
this
.
_getValueTypeError
(
this
.
textValueForEdit
);
}
return
this
.
textValueForEdit
;
},
getValue2
:
function
(
cell
,
dDigitsCount
,
fIsFitMeasurer
)
...
...
@@ -3018,7 +3021,7 @@ CCellValue.prototype =
else
if
(
CellValueType
.
Error
==
this
.
type
)
{
if
(
null
!=
this
.
text
)
sText
=
this
.
text
;
sText
=
this
.
_getValueTypeError
(
this
.
text
)
;
}
if
(
bNeedMeasure
)
{
...
...
@@ -3216,6 +3219,40 @@ CCellValue.prototype =
setValue
:
function
(
cell
,
val
)
{
this
.
clean
();
function
checkCellValueTypeError
(
sUpText
){
switch
(
sUpText
){
case
cErrorLocal
[
"
nil
"
]:
return
cErrorOrigin
[
"
nil
"
];
break
;
case
cErrorLocal
[
"
div
"
]:
return
cErrorOrigin
[
"
div
"
];
break
;
case
cErrorLocal
[
"
value
"
]:
return
cErrorOrigin
[
"
value
"
];
break
;
case
cErrorLocal
[
"
ref
"
]:
return
cErrorOrigin
[
"
ref
"
];
break
;
case
cErrorLocal
[
"
name
"
]:
return
cErrorOrigin
[
"
name
"
];
break
;
case
cErrorLocal
[
"
num
"
]:
return
cErrorOrigin
[
"
num
"
];
break
;
case
cErrorLocal
[
"
na
"
]:
return
cErrorOrigin
[
"
na
"
];
break
;
case
cErrorLocal
[
"
getdata
"
]:
return
cErrorOrigin
[
"
getdata
"
];
break
;
case
cErrorLocal
[
"
uf
"
]:
return
cErrorOrigin
[
"
uf
"
];
break
;
}
return
false
;
}
if
(
""
==
val
)
return
;
var
oNumFormat
;
...
...
@@ -3244,11 +3281,12 @@ CCellValue.prototype =
this
.
type
=
CellValueType
.
Bool
;
this
.
number
=
(
cBoolLocal
[
"
t
"
].
toUpperCase
()
==
sUpText
)
?
1
:
0
;
}
else
if
(
"
#NULL!
"
==
sUpText
||
"
#DIV/0!
"
==
sUpText
||
"
#NAME?
"
==
sUpText
||
"
#NUM!
"
==
sUpText
||
"
#N/A
"
==
sUpText
||
"
#REF!
"
==
sUpText
||
"
#VALUE!
"
==
sUpText
)
// else if( "#NULL!" == sUpText || "#DIV/0!" == sUpText || "#NAME?" == sUpText || "#NUM!" == sUpText ||
// "#N/A" == sUpText || "#REF!" == sUpText || "#VALUE!" == sUpText )
else
if
(
checkCellValueTypeError
(
sUpText
))
{
this
.
type
=
CellValueType
.
Error
;
this
.
text
=
sUpText
;
this
.
text
=
checkCellValueTypeError
(
sUpText
)
;
}
else
{
...
...
@@ -3518,6 +3556,38 @@ CCellValue.prototype =
case
this
.
Properties
.
number
:
this
.
number
=
value
;
break
;
case
this
.
Properties
.
type
:
this
.
type
=
value
;
break
;
}
},
_getValueTypeError
:
function
(
text
){
switch
(
text
){
case
cErrorOrigin
[
"
nil
"
]:
return
cErrorLocal
[
"
nil
"
];
break
;
case
cErrorOrigin
[
"
div
"
]:
return
cErrorLocal
[
"
div
"
];
break
;
case
cErrorOrigin
[
"
value
"
]:
return
cErrorLocal
[
"
value
"
];
break
;
case
cErrorOrigin
[
"
ref
"
]:
return
cErrorLocal
[
"
ref
"
];
break
;
case
cErrorOrigin
[
"
name
"
]:
return
cErrorLocal
[
"
name
"
];
break
;
case
cErrorOrigin
[
"
num
"
]:
return
cErrorLocal
[
"
num
"
];
break
;
case
cErrorOrigin
[
"
na
"
]:
return
cErrorLocal
[
"
na
"
];
break
;
case
cErrorOrigin
[
"
getdata
"
]:
return
cErrorLocal
[
"
getdata
"
];
break
;
case
cErrorOrigin
[
"
uf
"
]:
return
cErrorLocal
[
"
uf
"
];
break
;
}
return
cErrorLocal
[
"
nil
"
];
}
};
...
...
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