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

Bug 24585 - При открытии таблицы меняется символ и начертания текста в ячейки

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@56511 954022d7-b5bf-4e40-9824-e11837661b57
parent 090d4ee7
...@@ -2067,6 +2067,10 @@ function CellFormat(format) ...@@ -2067,6 +2067,10 @@ function CellFormat(format)
this.oNegativeFormat = aParsedFormats[1]; this.oNegativeFormat = aParsedFormats[1];
this.oNullFormat = aParsedFormats[2]; this.oNullFormat = aParsedFormats[2];
this.oTextFormat = this.oPositiveFormat; this.oTextFormat = this.oPositiveFormat;
if (this.oNullFormat.bTextFormat) {
this.oTextFormat = this.oNullFormat;
this.oNullFormat = this.oPositiveFormat;
}
} }
else if(2 == nFormatsLength) else if(2 == nFormatsLength)
{ {
...@@ -2074,6 +2078,10 @@ function CellFormat(format) ...@@ -2074,6 +2078,10 @@ function CellFormat(format)
this.oNegativeFormat = aParsedFormats[1]; this.oNegativeFormat = aParsedFormats[1];
this.oNullFormat = this.oPositiveFormat; this.oNullFormat = this.oPositiveFormat;
this.oTextFormat = this.oPositiveFormat; this.oTextFormat = this.oPositiveFormat;
if (this.oNegativeFormat.bTextFormat) {
this.oTextFormat = this.oNegativeFormat;
this.oNegativeFormat = this.oPositiveFormat;
}
} }
else else
{ {
...@@ -2112,6 +2120,25 @@ CellFormat.prototype = ...@@ -2112,6 +2120,25 @@ CellFormat.prototype =
return this.aComporationFormats[0].bDateTime; return this.aComporationFormats[0].bDateTime;
return false; return false;
}, },
getTextFormat: function () {
var oRes = null;
if (null == this.aComporationFormats) {
if (null != this.oTextFormat && this.oTextFormat.bTextFormat)
oRes = this.oTextFormat;
}
else {
var nLength = this.aComporationFormats.length;
var oDefaultComporationFormat = null;
for (var i = 0, length = this.aComporationFormats.length; i < length ; ++i) {
var oCurFormat = this.aComporationFormats[i];
if (null == oCurFormat.ComporationOperator && oCurFormat.bTextFormat) {
oRes = oCurFormat;
break;
}
}
}
return oRes;
},
getFormatByValue : function(dNumber) getFormatByValue : function(dNumber)
{ {
var oRes = null; var oRes = null;
......
...@@ -2918,22 +2918,20 @@ CCellValue.prototype = ...@@ -2918,22 +2918,20 @@ CCellValue.prototype =
} }
else if(CellValueType.String == this.type) else if(CellValueType.String == this.type)
{ {
if(null != this.text) var oTextFormat = oNumFormat.getTextFormat();
{ if (null != oTextFormat && "@" != oTextFormat.formatString) {
aText = oNumFormat.format(this.text, this.type, dDigitsCount, oAdditionalResult); if (null != this.text) {
sText = null; aText = oNumFormat.format(this.text, this.type, dDigitsCount, oAdditionalResult);
} sText = null;
else if(null != this.multiText) }
{ else if (null != this.multiText) {
if("@" != oNumFormat.sFormat) var sSimpleString = "";
{ for (var i = 0, length = this.multiText.length; i < length; ++i)
var sSimpleString = ""; sSimpleString += this.multiText[i].text;
for(var i = 0, length = this.multiText.length; i < length; ++i) aText = oNumFormat.format(sSimpleString, this.type, dDigitsCount, oAdditionalResult);
sSimpleString += this.multiText[i].text; sText = null;
aText = oNumFormat.format(sSimpleString, this.type, dDigitsCount, oAdditionalResult); }
sText = null; }
}
}
} }
} }
else if(CellValueType.Number == this.type && null != this.number) else if(CellValueType.Number == this.type && null != this.number)
......
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