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

FormatType перенесен из NumFormat.js в commonDefines.js

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48437 954022d7-b5bf-4e40-9824-e11837661b57
parent eca0a4a9
...@@ -27,19 +27,6 @@ var oNumFormatCache; ...@@ -27,19 +27,6 @@ var oNumFormatCache;
var FormatStates = {Decimal: 1, Frac: 2, Scientific: 3, Slash: 4}; var FormatStates = {Decimal: 1, Frac: 2, Scientific: 3, Slash: 4};
var SignType = {Positive: 1, Negative: 2, Null:3}; var SignType = {Positive: 1, Negative: 2, Null:3};
var FormatType = {
General : 0,
Custom : 1,
Text : 2,
Number : 3,
Integer : 4,
Scientific : 5,
Currency : 6,
Date : 7,
Time : 8,
Percent : 9,
Fraction : 10
}
var monthCut = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec']; var monthCut = ['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];
var monthShort = ['J','F','M','A','M','J','J','A','S','O','N','D']; var monthShort = ['J','F','M','A','M','J','J','A','S','O','N','D'];
...@@ -1834,30 +1821,30 @@ NumFormat.prototype = ...@@ -1834,30 +1821,30 @@ NumFormat.prototype =
}, },
getType : function() getType : function()
{ {
var nType = FormatType.Custom; var nType = c_oAscNumFormatType.Custom;
if(this.bGeneral) if(this.bGeneral)
nType = FormatType.General; nType = c_oAscNumFormatType.General;
else if(this.bTextFormat) else if(this.bTextFormat)
nType = FormatType.Text; nType = c_oAscNumFormatType.Text;
else if(this.bDateTime) else if(this.bDateTime)
{ {
if(this.bDate) if(this.bDate)
nType = FormatType.Date; nType = c_oAscNumFormatType.Date;
else else
nType = FormatType.Time; nType = c_oAscNumFormatType.Time;
} }
else if(this.nPercent > 0) else if(this.nPercent > 0)
nType = FormatType.Percent; nType = c_oAscNumFormatType.Percent;
else if(this.bScientific) else if(this.bScientific)
nType = FormatType.Scientific; nType = c_oAscNumFormatType.Scientific;
else if(this.bCurrency) else if(this.bCurrency)
nType = FormatType.Currency; nType = c_oAscNumFormatType.Currency;
else if(this.bSlash) else if(this.bSlash)
nType = FormatType.Fraction; nType = c_oAscNumFormatType.Fraction;
else if(this.bNumber) else if(this.bNumber)
nType = FormatType.Number; nType = c_oAscNumFormatType.Number;
else if(this.bInteger) else if(this.bInteger)
nType = FormatType.Integer; nType = c_oAscNumFormatType.Integer;
return nType; return nType;
} }
}; };
...@@ -2197,7 +2184,7 @@ CellFormat.prototype = ...@@ -2197,7 +2184,7 @@ CellFormat.prototype =
return this.oPositiveFormat.getType(); return this.oPositiveFormat.getType();
else if(null != this.aComporationFormats && this.aComporationFormats.length > 0) else if(null != this.aComporationFormats && this.aComporationFormats.length > 0)
return this.aComporationFormats[0].getType(); return this.aComporationFormats[0].getType();
return FormatType.General; return c_oAscNumFormatType.General;
} }
}; };
var oDecodeGeneralFormatCache = new Object(); var oDecodeGeneralFormatCache = new Object();
......
...@@ -9,6 +9,21 @@ var CellValueType = ...@@ -9,6 +9,21 @@ var CellValueType =
Error:3 Error:3
} }
//NumFormat defines
var c_oAscNumFormatType = {
General : 0,
Custom : 1,
Text : 2,
Number : 3,
Integer : 4,
Scientific : 5,
Currency : 6,
Date : 7,
Time : 8,
Percent : 9,
Fraction : 10
}
// Chart defines // Chart defines
var c_oAscChartType = { var c_oAscChartType = {
line: "Line", line: "Line",
......
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