Commit f5299c04 authored by Alexander.Trofimov's avatar Alexander.Trofimov Committed by Alexander.Trofimov

На getSelectionInfo возвращаю имя стиля ячейки

asc_getStyleName

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@47942 954022d7-b5bf-4e40-9824-e11837661b57
parent 371a3f99
...@@ -151,6 +151,7 @@ ...@@ -151,6 +151,7 @@
this.hyperlink = null; this.hyperlink = null;
this.isLocked = false; this.isLocked = false;
this.isFormatTable = false; this.isFormatTable = false;
this.styleName = null;
} }
asc_CCellInfo.prototype = { asc_CCellInfo.prototype = {
...@@ -167,7 +168,8 @@ ...@@ -167,7 +168,8 @@
asc_getNumFormat: function(){ return this.numFormat; }, asc_getNumFormat: function(){ return this.numFormat; },
asc_getHyperlink: function(){ return this.hyperlink; }, asc_getHyperlink: function(){ return this.hyperlink; },
asc_getLocked: function(){ return this.isLocked; }, asc_getLocked: function(){ return this.isLocked; },
asc_getIsFormatTable: function () { return this.isFormatTable; } asc_getIsFormatTable: function () { return this.isFormatTable; },
asc_getStyleName: function () { return this.styleName; }
}; };
window["Asc"].asc_CCellInfo = asc_CCellInfo; window["Asc"].asc_CCellInfo = asc_CCellInfo;
...@@ -188,6 +190,7 @@ ...@@ -188,6 +190,7 @@
prot["asc_getHyperlink"] = prot.asc_getHyperlink; prot["asc_getHyperlink"] = prot.asc_getHyperlink;
prot["asc_getLocked"] = prot.asc_getLocked; prot["asc_getLocked"] = prot.asc_getLocked;
prot["asc_getIsFormatTable"] = prot.asc_getIsFormatTable; prot["asc_getIsFormatTable"] = prot.asc_getIsFormatTable;
prot["asc_getStyleName"] = prot.asc_getStyleName;
// Класс точки // Класс точки
function asc_CCellRect (x, y, width, height) { function asc_CCellRect (x, y, width, height) {
......
...@@ -5992,6 +5992,9 @@ Range.prototype.getXfId=function(){ ...@@ -5992,6 +5992,9 @@ Range.prototype.getXfId=function(){
} }
return g_oDefaultXfId; return g_oDefaultXfId;
}; };
Range.prototype.getStyleName=function(){
return this.worksheet.workbook.CellStyles.getStyleNameByXfId(this.getXfId());
};
Range.prototype.getNumFormat=function(){ Range.prototype.getNumFormat=function(){
return oNumFormatCache.get(this.getNumFormatStr()); return oNumFormatCache.get(this.getNumFormatStr());
}; };
......
...@@ -1229,6 +1229,38 @@ CCellStyles.prototype = { ...@@ -1229,6 +1229,38 @@ CCellStyles.prototype = {
if (null != oStyle.xfs && null != oStyle.xfs.font && null != oStyle.xfs.font.fn) if (null != oStyle.xfs && null != oStyle.xfs.font && null != oStyle.xfs.font.fn)
oFontMap[oStyle.xfs.font.fn] = 1; oFontMap[oStyle.xfs.font.fn] = 1;
} }
},
getStyleNameByXfId: function (oXfId) {
var styleName = null;
if (null === oXfId)
return styleName;
var style = null;
for (var i = 0, length = this.CustomStyles.length; i < length; ++i) {
style = this.CustomStyles[i];
if (oXfId === style.XfId) {
if (null !== style.BuiltinId) {
styleName = this.getDefaultStyleNameByBuiltinId(style.BuiltinId);
if (null === styleName)
styleName = style.Name;
break;
} else {
styleName = style.Name;
break;
}
}
}
return styleName;
},
getDefaultStyleNameByBuiltinId: function (oBuiltinId) {
var style = null;
for (var i = 0, length = this.DefaultStyles.length; i < length; ++i) {
style = this.DefaultStyles[i];
if (style.BuiltinId === oBuiltinId)
return style.Name;
}
return null;
} }
}; };
/** @constructor */ /** @constructor */
......
...@@ -5771,6 +5771,7 @@ ...@@ -5771,6 +5771,7 @@
cell_info.halign = c.getAlignHorizontalByValue().toLowerCase(); cell_info.halign = c.getAlignHorizontalByValue().toLowerCase();
cell_info.valign = c.getAlignVertical().toLowerCase(); cell_info.valign = c.getAlignVertical().toLowerCase();
cell_info.isFormatTable = this.autoFilters.searchRangeInTableParts(activeCell, this); cell_info.isFormatTable = this.autoFilters.searchRangeInTableParts(activeCell, this);
cell_info.styleName = c.getStyleName();
cell_info.flags = new asc_CCellFlag(); cell_info.flags = new asc_CCellFlag();
cell_info.flags.merge = !!this._getMergedCellsRange(c1, r1); cell_info.flags.merge = !!this._getMergedCellsRange(c1, r1);
......
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