Commit 7cc796de authored by Dmitry.Shahtanov's avatar Dmitry.Shahtanov Committed by Alexander.Trofimov

fix: частично поправлен Bug 29926 - [NamedRanges] Создание именованного...

fix: частично поправлен Bug 29926 - [NamedRanges] Создание именованного диапазона, начинающегося с цифры, допустимо и не вызывает ошибку (http://bugzserver/show_bug.cgi?id=29926)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@64345 954022d7-b5bf-4e40-9824-e11837661b57
parent 823d1aef
...@@ -400,6 +400,31 @@ function test_ws_name2() { ...@@ -400,6 +400,31 @@ function test_ws_name2() {
} }
function test_defName(){
var self = this, nameRangeRE = new RegExp("(^(["+str_namedRanges+"_])(["+str_namedRanges+"_0-9]*)$)","i" );
this.test = function(str){
var res = null, match, m0, m1, m2;
if( !nameRangeRE.test(str) ){
return false;
}
match = str.match( rx_ref );
if (match != null) {
m0 = match[0];
m1 = match[1];
m2 = match[2];
if ( match.length >= 3 && g_oCellAddressUtils.colstrToColnum( m1.substr( 0, (m1.length - m2.length) ) ) <= gc_nMaxCol && parseInt( m2 ) <= gc_nMaxRow ) {
return false;
}
}
return true;
}
return this;
}
var c_oEditorId = { var c_oEditorId = {
Word:0, Word:0,
Spreadsheet:1, Spreadsheet:1,
...@@ -580,7 +605,8 @@ var str_namedRanges = "A-Za-z\u005F\u0080-\u0081\u0083\u0085-\u0087\u0089-\u008A ...@@ -580,7 +605,8 @@ var str_namedRanges = "A-Za-z\u005F\u0080-\u0081\u0083\u0085-\u0087\u0089-\u008A
rg_validOCTNumber = /^[0-7]{1,10}$/, rg_validOCTNumber = /^[0-7]{1,10}$/,
rg_complex_number = new XRegExp( "^(?<real>[-+]?(?:\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?))?(?<img>([-+]?(\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?)?[ij])?)", "g" ), rg_complex_number = new XRegExp( "^(?<real>[-+]?(?:\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?))?(?<img>([-+]?(\\d*(?:\\.\\d+)?(?:[Ee][+-]?\\d+)?)?[ij])?)", "g" ),
rx_name = new XRegExp( "^(?<name>" + "[" + str_namedRanges + "]" + "[" + str_namedRanges + "\\d.]*)([-+*\\/^&%<=>: ;),]|$)" ), rx_name = new XRegExp( "^(?<name>" + "[" + str_namedRanges + "]" + "[" + str_namedRanges + "\\d.]*)([-+*\\/^&%<=>: ;),]|$)" ),
rx_defName = new RegExp("(^(["+str_namedRanges+"_\\])(["+str_namedRanges+"_0-9]*)$)","i" ), // rx_defName = new RegExp("(^(["+str_namedRanges+"_])(["+str_namedRanges+"_0-9]*)$)","i" ),
rx_defName = new test_defName(),
rx_arraySeparatorsDef = /^ *[,;] */, rx_arraySeparatorsDef = /^ *[,;] */,
rx_numberDef = /^ *[+-]?\d*(\d|\.)\d*([eE][+-]?\d+)?/, rx_numberDef = /^ *[+-]?\d*(\d|\.)\d*([eE][+-]?\d+)?/,
rx_CommaDef = /^ *[,;] */, rx_CommaDef = /^ *[,;] */,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment