Commit ea0c84ae authored by Alexander.Trofimov's avatar Alexander.Trofimov

Реализовал чтение SheetPr (в частности TabColor)

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48490 954022d7-b5bf-4e40-9824-e11837661b57
parent 0f4e7820
...@@ -173,7 +173,8 @@ var c_oSerWorksheetsTypes = ...@@ -173,7 +173,8 @@ var c_oSerWorksheetsTypes =
Comment: 20, Comment: 20,
ConditionalFormatting: 21, ConditionalFormatting: 21,
SheetViews: 22, SheetViews: 22,
SheetView: 23 SheetView: 23,
SheetPr: 24
}; };
/** @enum */ /** @enum */
var c_oSerWorksheetPropTypes = var c_oSerWorksheetPropTypes =
...@@ -300,17 +301,6 @@ var c_oSer_ColorType = ...@@ -300,17 +301,6 @@ var c_oSer_ColorType =
Auto: 0 Auto: 0
}; };
/** @enum */ /** @enum */
var c_oSer_CalcChainType =
{
CalcChainItem: 0,
Array: 1,
SheetId: 2,
DependencyLevel: 3,
Ref: 4,
ChildChain: 5,
NewThread: 6
};
/** @enum */
var c_oSer_PageMargins = var c_oSer_PageMargins =
{ {
Left: 0, Left: 0,
...@@ -576,6 +566,7 @@ var c_oSer_SheetView = { ...@@ -576,6 +566,7 @@ var c_oSer_SheetView = {
ZoomScalePageLayoutView : 17, ZoomScalePageLayoutView : 17,
ZoomScaleSheetLayoutView : 18 ZoomScaleSheetLayoutView : 18
}; };
/** @enum */
var c_oSer_CellStyle = { var c_oSer_CellStyle = {
BuiltinId : 0, BuiltinId : 0,
CustomBuiltin : 1, CustomBuiltin : 1,
...@@ -585,6 +576,20 @@ var c_oSer_CellStyle = { ...@@ -585,6 +576,20 @@ var c_oSer_CellStyle = {
XfId : 5 XfId : 5
}; };
/** @enum */ /** @enum */
var c_oSer_SheetPr = {
CodeName : 0,
EnableFormatConditionsCalculation : 1,
FilterMode : 2,
Published : 3,
SyncHorizontal : 4,
SyncRef : 5,
SyncVertical : 6,
TransitionEntry : 7,
TransitionEvaluation : 8,
TabColor : 9
};
/** @enum */
var EBorderStyle = var EBorderStyle =
{ {
borderstyleDashDot: 0, borderstyleDashDot: 0,
...@@ -5105,6 +5110,11 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -5105,6 +5110,11 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
res = this.bcr.Read1(length, function (t, l) { res = this.bcr.Read1(length, function (t, l) {
return oThis.ReadSheetViews(t, l, oWorksheet.sheetViews); return oThis.ReadSheetViews(t, l, oWorksheet.sheetViews);
}); });
} else if (c_oSerWorksheetsTypes.SheetPr === type) {
oWorksheet.sheetPr = new Asc.asc_CSheetPr();
res = this.bcr.Read1(length, function (t, l) {
return oThis.ReadSheetPr(t, l, oWorksheet.sheetPr);
});
} else } else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
...@@ -5923,6 +5933,42 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -5923,6 +5933,42 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ReadSheetPr = function (type, length, oSheetPr) {
var oThis = this;
var res = c_oSerConstants.ReadOk;
if (c_oSer_SheetPr.CodeName === type)
oSheetPr.CodeName = this.stream.GetString2LE(length);
else if (c_oSer_SheetPr.EnableFormatConditionsCalculation === type)
oSheetPr.EnableFormatConditionsCalculation = this.stream.GetBool();
else if (c_oSer_SheetPr.FilterMode === type)
oSheetPr.FilterMode = this.stream.GetBool();
else if (c_oSer_SheetPr.Published === type)
oSheetPr.Published = this.stream.GetBool();
else if (c_oSer_SheetPr.SyncHorizontal === type)
oSheetPr.SyncHorizontal = this.stream.GetBool();
else if (c_oSer_SheetPr.SyncRef === type)
oSheetPr.SyncRef = this.stream.GetString2LE(length);
else if (c_oSer_SheetPr.SyncVertical === type)
oSheetPr.SyncVertical = this.stream.GetBool();
else if (c_oSer_SheetPr.TransitionEntry === type)
oSheetPr.TransitionEntry = this.stream.GetBool();
else if (c_oSer_SheetPr.TransitionEvaluation === type)
oSheetPr.TransitionEvaluation = this.stream.GetBool();
else if (c_oSer_SheetPr.TabColor === type) {
var oObject = new OpenColor();
res = this.bcr.Read2Spreadsheet(length, function(t,l){
return oThis.bcr.ReadColorSpreadsheet(t,l, oObject);
});
if(null != oObject.theme)
oSheetPr.TabColor = g_oColorManager.getThemeColor(oObject.theme, oObject.tint);
else if(null != oObject.rgb)
oSheetPr.TabColor = new RgbColor(0x00ffffff & oObject.rgb);
}
else
res = c_oSerConstants.ReadUnknown;
return res;
};
this.Iso8601ToDate = function(sDate) this.Iso8601ToDate = function(sDate)
{ {
var numericKeys = [ 1, 4, 5, 6, 7, 10, 11 ]; var numericKeys = [ 1, 4, 5, 6, 7, 10, 11 ];
......
...@@ -2113,6 +2113,7 @@ function Woorksheet(wb, _index, bAddUserId, sId){ ...@@ -2113,6 +2113,7 @@ function Woorksheet(wb, _index, bAddUserId, sId){
this.sheetViews = []; this.sheetViews = [];
this.aConditionalFormatting = []; this.aConditionalFormatting = [];
this.sheetPr = null;
this.nActionNested = 0; this.nActionNested = 0;
this.bUpdateHyperlinks = false; this.bUpdateHyperlinks = false;
......
...@@ -916,6 +916,27 @@ ...@@ -916,6 +916,27 @@
} }
}; };
/** @constructor */
function asc_CSheetPr() {
if (!(this instanceof asc_CSheetPr)) {
return new asc_CSheetPr();
}
this.CodeName = null;
this.EnableFormatConditionsCalculation = null;
this.FilterMode = null;
this.Published = null;
this.SyncHorizontal = null;
this.SyncRef = null;
this.SyncVertical = null;
this.TransitionEntry = null;
this.TransitionEvaluation = null;
this.TabColor = null;
return this;
}
/* /*
* Export * Export
* ----------------------------------------------------------------------------- * -----------------------------------------------------------------------------
...@@ -1058,5 +1079,7 @@ ...@@ -1058,5 +1079,7 @@
prot["asc_getDefaultStylesImage"] = prot.asc_getDefaultStylesImage; prot["asc_getDefaultStylesImage"] = prot.asc_getDefaultStylesImage;
prot["asc_getDocStylesImage"] = prot.asc_getDocStylesImage; prot["asc_getDocStylesImage"] = prot.asc_getDocStylesImage;
window["Asc"]["asc_CSheetPr"] = window["Asc"].asc_CSheetPr = asc_CSheetPr;
} }
)(jQuery, window); )(jQuery, window);
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