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

Bug 23957 - Ошибка в консоли "Font is not defined " при открытии docx документа

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@55845 954022d7-b5bf-4e40-9824-e11837661b57
parent a4fc2085
......@@ -76,6 +76,15 @@ function getNumberParts(x)
return {mantissa: man, exponent: exp, sign: sig};//для 0,123 exponent == - gc_nMaxDigCount
}
function NumFormatFont() {
this.skip = null;
this.repeat = null;
this.c = null;
}
NumFormatFont.prototype.isEqual = function (val) {
return this.skip == val.skip && this.repeat == val.repeat && this.c == val.c;
};
function FormatObj(type, val)
{
this.type = type;
......@@ -1235,8 +1244,7 @@ NumFormat.prototype =
}
else if(numFormat_DigitSpace == item.type)
{
var oNewFont = new Font();
oNewFont.clean();
var oNewFont = new NumFormatFont();
oNewFont.skip = true;
this._CommitText(res, oCurText, "0", oNewFont);
if(null != item.val)
......@@ -1263,10 +1271,7 @@ NumFormat.prototype =
if(-1 != this.Color)
{
if(null == format)
{
format = new Font();
format.clean();
}
format = new NumFormatFont();
format.c = new RgbColor(this.Color);
}
if(null != prev && ((null == prev.format && null == format) || (null != prev.format && null != format && format.isEqual(prev.format))))
......@@ -1362,8 +1367,7 @@ NumFormat.prototype =
{
if(this.isInvalidDateValue(number))
{
var oNewFont = new Font();
oNewFont.clean();
var oNewFont = new NumFormatFont();
oNewFont.repeat = true;
this._CommitText(res, null, "#", oNewFont);
return res;
......@@ -1556,15 +1560,13 @@ NumFormat.prototype =
}
else if(numFormat_Repeat == item.type)
{
var oNewFont = new Font();
oNewFont.clean();
var oNewFont = new NumFormatFont();
oNewFont.repeat = true;
this._CommitText(res, oCurText, item.val, oNewFont);
}
else if(numFormat_Skip == item.type)
{
var oNewFont = new Font();
oNewFont.clean();
var oNewFont = new NumFormatFont();
oNewFont.skip = true;
this._CommitText(res, oCurText, item.val, oNewFont);
}
......@@ -2159,8 +2161,7 @@ CellFormat.prototype =
res = oFormat.format(number, nValType, dDigitsCount, oAdditionalResult);
else if(null != this.aComporationFormats)
{
var oNewFont = new Font();
oNewFont.clean();
var oNewFont = new NumFormatFont();
oNewFont.repeat = true;
res = [{text: "#", format: oNewFont}];
}
......
......@@ -2969,8 +2969,11 @@ CCellValue.prototype =
{
aRes = null;
sText = null;
if(dDigitsCount > 1)
aText = [{text: "#", format: {repeat: true}}];
if (dDigitsCount > 1){
var oNumFormatFont = new NumFormatFont();
oNumFormatFont.repeat = true;
aText = [{ text: "#", format: oNumFormatFont }];
}
else
aText = [{text: "", format: {}}];
}
......@@ -2994,7 +2997,9 @@ CCellValue.prototype =
{
aRes = null;
sText = null;
aText = [{text: "#", format: {repeat: true}}];
var oNumFormatFont = new NumFormatFont();
oNumFormatFont.repeat = true;
aText = [{ text: "#", format: oNumFormatFont }];
}
}
if(null == aRes)
......
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