Commit 2a5cfab9 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

Чтение XfId

Чтение CellStyleXfs и CellStyles
Чтение дефалтовых стилей ячеек

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47839 954022d7-b5bf-4e40-9824-e11837661b57
parent 89cb7a47
This diff is collapsed.
...@@ -1366,6 +1366,7 @@ function Workbook(sUrlPath, eventsHandlers, oApi){ ...@@ -1366,6 +1366,7 @@ function Workbook(sUrlPath, eventsHandlers, oApi){
this.DefinedNames = new Object(); this.DefinedNames = new Object();
this.oRealDefinedNames = new Object(); this.oRealDefinedNames = new Object();
this.oNameGenerator = new NameGenerator(this); this.oNameGenerator = new NameGenerator(this);
this.CellStyles = new CCellStyles();
this.TableStyles = new CTableStyles(); this.TableStyles = new CTableStyles();
this.oStyleManager = new StyleManager(this); this.oStyleManager = new StyleManager(this);
this.calcChain = new Array(); this.calcChain = new Array();
...@@ -5971,6 +5972,25 @@ Range.prototype.getValue2=function(dDigitsCount, fIsFitMeasurer){ ...@@ -5971,6 +5972,25 @@ Range.prototype.getValue2=function(dDigitsCount, fIsFitMeasurer){
return oTempCell.getValue2(dDigitsCount, fIsFitMeasurer); return oTempCell.getValue2(dDigitsCount, fIsFitMeasurer);
} }
}; };
Range.prototype.getXfId=function(){
var nRow = this.bbox.r1;
var nCol = this.bbox.c1;
var cell = this.worksheet._getCellNoEmpty(nRow, nCol);
if(null != cell) {
var xfs = cell.getStyle();
if(null != xfs && null != xfs.XfId)
return xfs.XfId;
} else {
//стили столбов и колонок
var row = this.worksheet._getRowNoEmpty(nRow);
if(null != row && null != row.xfs && null != row.xfs.XfId)
return row.xfs.XfId;
var col = this.worksheet._getColNoEmptyWithAll(nCol);
if(null != col && null != col.xfs && null != col.xfs.XfId)
return col.xfs.XfId;
}
return g_oDefaultXfId;
};
Range.prototype.getNumFormat=function(){ Range.prototype.getNumFormat=function(){
return oNumFormatCache.get(this.getNumFormatStr()); return oNumFormatCache.get(this.getNumFormatStr());
}; };
......
var g_nNumsMaxId = 160; var g_nNumsMaxId = 160;
var g_oDefaultXfId = null;
var g_oDefaultFont = null; var g_oDefaultFont = null;
var g_oDefaultFill = null; var g_oDefaultFill = null;
var g_oDefaultNum = null; var g_oDefaultNum = null;
...@@ -955,15 +956,15 @@ Num.prototype = ...@@ -955,15 +956,15 @@ Num.prototype =
} }
}; };
/** @constructor */ /** @constructor */
function CellXfs() function CellXfs() {
{
this.Properties = { this.Properties = {
border: 0, border: 0,
fill: 1, fill: 1,
font: 2, font: 2,
num: 3, num: 3,
align: 4, align: 4,
QuotePrefix: 5 QuotePrefix: 5,
XfId: 6
}; };
this.border = null; this.border = null;
this.fill = null; this.fill = null;
...@@ -971,7 +972,8 @@ function CellXfs() ...@@ -971,7 +972,8 @@ function CellXfs()
this.num = null; this.num = null;
this.align = null; this.align = null;
this.QuotePrefix = null; this.QuotePrefix = null;
}; this.XfId = null;
}
CellXfs.prototype = CellXfs.prototype =
{ {
_mergeProperty : function(first, second) _mergeProperty : function(first, second)
...@@ -1019,6 +1021,8 @@ CellXfs.prototype = ...@@ -1019,6 +1021,8 @@ CellXfs.prototype =
res.align = this.align.clone(); res.align = this.align.clone();
if(null != this.QuotePrefix) if(null != this.QuotePrefix)
res.QuotePrefix = this.QuotePrefix; res.QuotePrefix = this.QuotePrefix;
if (null !== this.XfId)
res.XfId = this.XfId;
return res; return res;
}, },
isEqual : function(xfs) isEqual : function(xfs)
...@@ -1035,6 +1039,8 @@ CellXfs.prototype = ...@@ -1035,6 +1039,8 @@ CellXfs.prototype =
return false; return false;
if(this.QuotePrefix != xfs.QuotePrefix) if(this.QuotePrefix != xfs.QuotePrefix)
return false; return false;
if (this.XfId != xfs.XfId)
return false;
return true; return true;
}, },
getType : function() getType : function()
...@@ -1055,6 +1061,7 @@ CellXfs.prototype = ...@@ -1055,6 +1061,7 @@ CellXfs.prototype =
case this.Properties.num: return this.num;break; case this.Properties.num: return this.num;break;
case this.Properties.align: return this.align;break; case this.Properties.align: return this.align;break;
case this.Properties.QuotePrefix: return this.QuotePrefix;break; case this.Properties.QuotePrefix: return this.QuotePrefix;break;
case this.Properties.XfId: return this.XfId; break;
} }
}, },
setProperty : function(nType, value) setProperty : function(nType, value)
...@@ -1067,6 +1074,7 @@ CellXfs.prototype = ...@@ -1067,6 +1074,7 @@ CellXfs.prototype =
case this.Properties.num: this.num = value;break; case this.Properties.num: this.num = value;break;
case this.Properties.align: this.align = value;break; case this.Properties.align: this.align = value;break;
case this.Properties.QuotePrefix: this.QuotePrefix = value;break; case this.Properties.QuotePrefix: this.QuotePrefix = value;break;
case this.Properties.XfId: this.XfId = value; break;
} }
} }
}; };
...@@ -1204,6 +1212,23 @@ Align.prototype = ...@@ -1204,6 +1212,23 @@ Align.prototype =
} }
}; };
/** @constructor */ /** @constructor */
function CCellStyles() {
this.CustomStyles = [];
this.DefaultStyles = [];
this.AllStyles = {};
}
/** @constructor */
function CCellStyle() {
this.BuiltinId = null;
this.CustomBuiltin = null;
this.Hidden = null;
this.ILevel = null;
this.Name = null;
this.XfId = null;
this.xfs = null;
}
/** @constructor */
function StyleManager(){ function StyleManager(){
//содержат все свойства по умолчанию //содержат все свойства по умолчанию
this.oDefaultFont = null; this.oDefaultFont = null;
...@@ -1226,6 +1251,10 @@ StyleManager.prototype = ...@@ -1226,6 +1251,10 @@ StyleManager.prototype =
g_oDefaultNum = oDefaultXfs.num.clone(); g_oDefaultNum = oDefaultXfs.num.clone();
if(null != oDefaultXfs.align) if(null != oDefaultXfs.align)
g_oDefaultAlign = oDefaultXfs.align.clone(); g_oDefaultAlign = oDefaultXfs.align.clone();
if (null !== oDefaultXfs.XfId) {
this.oDefaultXfs.XfId = oDefaultXfs.XfId;
g_oDefaultXfId = oDefaultXfs.XfId;
}
}, },
_prepareSet : function(oItemWithXfs) _prepareSet : function(oItemWithXfs)
{ {
......
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