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)
this.oNegativeFormat = aParsedFormats[1];
this.oNullFormat = aParsedFormats[2];
this.oTextFormat = this.oPositiveFormat;
if (this.oNullFormat.bTextFormat) {
this.oTextFormat = this.oNullFormat;
this.oNullFormat = this.oPositiveFormat;
}
}
else if(2 == nFormatsLength)
{
......@@ -2074,6 +2078,10 @@ function CellFormat(format)
this.oNegativeFormat = aParsedFormats[1];
this.oNullFormat = this.oPositiveFormat;
this.oTextFormat = this.oPositiveFormat;
if (this.oNegativeFormat.bTextFormat) {
this.oTextFormat = this.oNegativeFormat;
this.oNegativeFormat = this.oPositiveFormat;
}
}
else
{
......@@ -2112,6 +2120,25 @@ CellFormat.prototype =
return this.aComporationFormats[0].bDateTime;
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)
{
var oRes = null;
......
......@@ -2918,17 +2918,15 @@ CCellValue.prototype =
}
else if(CellValueType.String == this.type)
{
if(null != this.text)
{
var oTextFormat = oNumFormat.getTextFormat();
if (null != oTextFormat && "@" != oTextFormat.formatString) {
if (null != this.text) {
aText = oNumFormat.format(this.text, this.type, dDigitsCount, oAdditionalResult);
sText = null;
}
else if(null != this.multiText)
{
if("@" != oNumFormat.sFormat)
{
else if (null != this.multiText) {
var sSimpleString = "";
for(var i = 0, length = this.multiText.length; i < length; ++i)
for (var i = 0, length = this.multiText.length; i < length; ++i)
sSimpleString += this.multiText[i].text;
aText = oNumFormat.format(sSimpleString, this.type, dDigitsCount, oAdditionalResult);
sText = null;
......
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