Commit 1722b97e authored by konovalovsergey's avatar konovalovsergey

open/save docx tblCaption,tblDescription and xlsx altText, altTextSummary

parent 1d6f2317
...@@ -377,7 +377,8 @@ ...@@ -377,7 +377,8 @@
SortState:5, SortState:5,
TableColumns:6, TableColumns:6,
TableStyleInfo:7, TableStyleInfo:7,
HeaderRowCount:8 HeaderRowCount:8,
AltTextTable: 9
}; };
/** @enum */ /** @enum */
var c_oSer_TableStyleInfo = var c_oSer_TableStyleInfo =
...@@ -699,7 +700,12 @@ ...@@ -699,7 +700,12 @@
SparklineRef: 29, SparklineRef: 29,
SparklineSqRef: 30 SparklineSqRef: 30
}; };
/** @enum */ /** @enum */
var c_oSer_AltTextTable = {
AltText: 0,
AltTextSummary: 1
};
/** @enum */
var EBorderStyle = var EBorderStyle =
{ {
borderstyleDashDot: 0, borderstyleDashDot: 0,
...@@ -1164,7 +1170,21 @@ ...@@ -1164,7 +1170,21 @@
//TableStyleInfo //TableStyleInfo
if(null != table.TableStyleInfo) if(null != table.TableStyleInfo)
this.bs.WriteItem(c_oSer_TablePart.TableStyleInfo, function(){oThis.WriteTableStyleInfo(table.TableStyleInfo);}); this.bs.WriteItem(c_oSer_TablePart.TableStyleInfo, function(){oThis.WriteTableStyleInfo(table.TableStyleInfo);});
if(null != table.altText || null != table.altTextSummary)
this.bs.WriteItem(c_oSer_TablePart.AltTextTable, function(){oThis.WriteAltTextTable(table);});
}; };
this.WriteAltTextTable = function(table)
{
var oThis = this;
if (null != table.altText) {
this.memory.WriteByte(c_oSer_AltTextTable.AltText);
this.memory.WriteString2(table.altText);
}
if (null != table.altTextSummary) {
this.memory.WriteByte(c_oSer_AltTextTable.AltTextSummary);
this.memory.WriteString2(table.altTextSummary);
}
};
this.WriteAutoFilter = function(autofilter) this.WriteAutoFilter = function(autofilter)
{ {
var oThis = this; var oThis = this;
...@@ -3938,10 +3958,28 @@ ...@@ -3938,10 +3958,28 @@
return oThis.ReadTableStyleInfo(t,l, oTable.TableStyleInfo); return oThis.ReadTableStyleInfo(t,l, oTable.TableStyleInfo);
}); });
} }
else if ( c_oSer_TablePart.AltTextTable == type )
{
res = this.bcr.Read1(length, function(t,l){
return oThis.ReadAltTextTable(t,l, oTable);
});
}
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
}; };
this.ReadAltTextTable = function(type, length, oTable)
{
var res = c_oSerConstants.ReadOk;
var oThis = this;
if (c_oSer_AltTextTable.AltText == type) {
oTable.altText = this.stream.GetString2LE(length);
} else if ( c_oSer_AltTextTable.AltTextSummary == type ) {
oTable.altTextSummary = this.stream.GetString2LE(length);
} else
res = c_oSerConstants.ReadUnknown;
return res;
};
this.ReadAutoFilter = function(type, length, oAutoFilter) this.ReadAutoFilter = function(type, length, oAutoFilter)
{ {
var res = c_oSerConstants.ReadOk; var res = c_oSerConstants.ReadOk;
......
...@@ -186,7 +186,9 @@ var c_oSerProp_tblPrType = { ...@@ -186,7 +186,9 @@ var c_oSerProp_tblPrType = {
tblPrChange: 13, tblPrChange: 13,
TableCellSpacing: 14, TableCellSpacing: 14,
RowBandSize: 15, RowBandSize: 15,
ColBandSize: 16 ColBandSize: 16,
tblCaption: 17,
tblDescription: 18
}; };
var c_oSer_tblpPrType = { var c_oSer_tblpPrType = {
Page:0, Page:0,
...@@ -3520,6 +3522,16 @@ Binary_tblPrWriter.prototype = ...@@ -3520,6 +3522,16 @@ Binary_tblPrWriter.prototype =
{ {
this.bs.WriteItem(c_oSerProp_tblPrType.TableCellSpacing, function(){oThis.memory.WriteDouble(tblPr.TableCellSpacing);}); this.bs.WriteItem(c_oSerProp_tblPrType.TableCellSpacing, function(){oThis.memory.WriteDouble(tblPr.TableCellSpacing);});
} }
if(null != tblPr.TableCaption)
{
this.memory.WriteByte(c_oSerProp_tblPrType.tblCaption);
this.memory.WriteString2(tblPr.TableCaption);
}
if(null != tblPr.TableDescription)
{
this.memory.WriteByte(c_oSerProp_tblPrType.tblDescription);
this.memory.WriteString2(tblPr.TableDescription);
}
}, },
WriteCellMar: function(cellMar) WriteCellMar: function(cellMar)
{ {
...@@ -7766,6 +7778,14 @@ Binary_tblPrReader.prototype = ...@@ -7766,6 +7778,14 @@ Binary_tblPrReader.prototype =
{ {
Pr.TableCellSpacing = this.bcr.ReadDouble(); Pr.TableCellSpacing = this.bcr.ReadDouble();
} }
else if( c_oSerProp_tblPrType.tblCaption === type )
{
Pr.TableCaption = this.stream.GetString2LE(length);
}
else if( c_oSerProp_tblPrType.tblDescription === type )
{
Pr.TableDescription = this.stream.GetString2LE(length);
}
else if(null != table) else if(null != table)
{ {
if( c_oSerProp_tblPrType.tblpPr === type ) if( c_oSerProp_tblPrType.tblpPr === type )
......
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