Commit 2f749e6a authored by konovalovsergey's avatar konovalovsergey

for bug

fix bug 33092
parent fa76edbc
......@@ -1717,7 +1717,7 @@ cTEXT.prototype.Calculate = function ( arg ) {
var oFormat = oNumFormatCache.get( arg1.toString() );
var a = g_oFormatParser.parse(arg0.getValue()+""), aText;
aText = oFormat.format( a ? a.value : arg0.getValue(), (arg0 instanceof cNumber || a) ? CellValueType.Number : CellValueType.String, AscCommon.gc_nMaxDigCountView, null );
aText = oFormat.format( a ? a.value : arg0.getValue(), (arg0 instanceof cNumber || a) ? CellValueType.Number : CellValueType.String, AscCommon.gc_nMaxDigCountView );
var text = "";
for ( var i = 0, length = aText.length; i < length; ++i ) {
......
......@@ -5993,35 +5993,25 @@ Cell.prototype.setNumFormat=function(val){
};
Cell.prototype.shiftNumFormat=function(nShift, dDigitsCount){
var bRes = false;
var bGeneral = true;
var sNumFormat;
if(null != this.xfs && null != this.xfs.num)
sNumFormat = this.xfs.num.getFormat();
else
sNumFormat = g_oDefaultFormat.Num.getFormat();
if("General" != sNumFormat)
{
var oCurNumFormat = oNumFormatCache.get(sNumFormat);
if(null != oCurNumFormat && false == oCurNumFormat.isGeneralFormat())
{
bGeneral = false;
if (null != oCurNumFormat && false == oCurNumFormat.isGeneralFormat()) {
var output = {};
bRes = oCurNumFormat.shiftFormat(output, nShift);
if(true == bRes)
if (true == bRes) {
this.setNumFormat(output.format);
}
}
if(bGeneral)
{
if(CellValueType.Number == this.oValue.type)
{
} else if (CellValueType.Number == this.oValue.type) {
var sGeneral = AscCommon.DecodeGeneralFormat(this.oValue.number, this.oValue.type, dDigitsCount);
var oGeneral = oNumFormatCache.get(sGeneral);
if(null != oGeneral && false == oGeneral.isGeneralFormat())
{
if (null != oGeneral && false == oGeneral.isGeneralFormat()) {
var output = {};
bRes = oGeneral.shiftFormat(output, nShift);
if(true == bRes)
if (true == bRes) {
this.setNumFormat(output.format);
}
}
......
......@@ -3065,10 +3065,9 @@ CCellValue.prototype =
oNumFormat = oNumFormatCache.get(g_oDefaultFormat.Num.getFormat());
if(false == oNumFormat.isGeneralFormat())
{
var oAdditionalResult = {};
if(null != this.number)
{
aText = oNumFormat.format(this.number, this.type, dDigitsCount, oAdditionalResult);
aText = oNumFormat.format(this.number, this.type, dDigitsCount);
sText = null;
}
else if(CellValueType.String == this.type)
......@@ -3076,12 +3075,12 @@ CCellValue.prototype =
var oTextFormat = oNumFormat.getTextFormat();
if (null != oTextFormat && "@" != oTextFormat.formatString) {
if (null != this.text) {
aText = oNumFormat.format(this.text, this.type, dDigitsCount, oAdditionalResult);
aText = oNumFormat.format(this.text, this.type, dDigitsCount);
sText = null;
}
else if (null != this.multiText) {
var sSimpleString = this.getStringFromMultiText();
aText = oNumFormat.format(sSimpleString, this.type, dDigitsCount, oAdditionalResult);
aText = oNumFormat.format(sSimpleString, this.type, dDigitsCount);
sText = null;
}
}
......
This diff is collapsed.
......@@ -39,6 +39,7 @@
function(window, undefined)
{
var g_cCharDelimiter = String.fromCharCode(5);
var g_cGeneralFormat = 'General';
var FONT_THUMBNAIL_HEIGHT = (7 * 96.0 / 25.4) >> 0;
var c_oAscMaxColumnWidth = 255;
var c_oAscMaxRowHeight = 409;
......@@ -1418,6 +1419,7 @@
window['AscCommon'] = window['AscCommon'] || {};
window["AscCommon"].g_cCharDelimiter = g_cCharDelimiter;
window["AscCommon"].g_cGeneralFormat = g_cGeneralFormat;
window["AscCommon"].bDate1904 = false;
window["AscCommon"].c_oAscAdvancedOptionsAction = c_oAscAdvancedOptionsAction;
window["AscCommon"].DownloadType = DownloadType;
......
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