Commit 0357075f authored by Sergey.Konovalov's avatar Sergey.Konovalov Committed by Alexander.Trofimov

Bug 28541 - Не прокручивается ячейка после вставки большого числа и смена формата ячейки

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@61292 954022d7-b5bf-4e40-9824-e11837661b57
parent 63a59bb6
...@@ -1400,7 +1400,7 @@ NumFormat.prototype = ...@@ -1400,7 +1400,7 @@ NumFormat.prototype =
if(null != numFormat) if(null != numFormat)
return numFormat.format(number, nValType, dDigitsCount, oAdditionalResult) return numFormat.format(number, nValType, dDigitsCount, oAdditionalResult)
} }
return [{text: number}]; return [{text: number.toString()}];
} }
var aDec = []; var aDec = [];
var aFrac = []; var aFrac = [];
...@@ -1709,8 +1709,20 @@ NumFormat.prototype = ...@@ -1709,8 +1709,20 @@ NumFormat.prototype =
else else
{ {
if(0 == res.length) if(0 == res.length)
res = [{text: number}]; res = [{text: number.toString()}];
} }
//длина результирующей строки не должна быть длиннее c_oAscMaxColumnWidth
var nLen = 0;
for(var i = 0; i < res.length; ++i){
var elem = res[i];
if(elem.text)
nLen += elem.text.length;
}
if(nLen > c_oAscMaxColumnWidth){
var oNewFont = new NumFormatFont();
oNewFont.repeat = true;
res = [{text: "#", format: oNewFont}];
}
return res; return res;
}, },
toString : function(output, nShift) toString : function(output, nShift)
...@@ -2214,7 +2226,7 @@ CellFormat.prototype = ...@@ -2214,7 +2226,7 @@ CellFormat.prototype =
} }
} }
} }
res = [{text: number}]; res = [{text: number.toString()}];
var dNumber = number - 0; var dNumber = number - 0;
var oFormat = null; var oFormat = null;
if(CellValueType.String != nValType && number == dNumber) if(CellValueType.String != nValType && number == dNumber)
......
...@@ -311,3 +311,4 @@ var c_oAscFormulaRangeBorderColor = [ ...@@ -311,3 +311,4 @@ var c_oAscFormulaRangeBorderColor = [
var c_oAscLockNameFrozenPane = "frozenPane"; var c_oAscLockNameFrozenPane = "frozenPane";
var c_oAscLockNameTabColor = "tabColor"; var c_oAscLockNameTabColor = "tabColor";
var c_oAscMaxColumnWidth = 255;
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