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