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

(2.0.0.135): AVSOfficeDocxFile2

Не учитываем параметры table.Rows, table.Cols при открытии и сохранении.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48313 954022d7-b5bf-4e40-9824-e11837661b57
parent d94a914b
...@@ -1219,16 +1219,6 @@ Binary_tblPrWriter.prototype = ...@@ -1219,16 +1219,6 @@ Binary_tblPrWriter.prototype =
WriteTbl: function(table) WriteTbl: function(table)
{ {
var oThis = this; var oThis = this;
//Rows
if(null != table.Rows)
{
this.bs.WriteItem(c_oSerProp_tblPrType.Rows, function(){oThis.memory.WriteLong(table.Rows);});
}
//Cols
if(null != table.Cols)
{
this.bs.WriteItem(c_oSerProp_tblPrType.Cols, function(){oThis.memory.WriteLong(table.Cols);});
}
this.WriteTblPr(table.Pr, table); this.WriteTblPr(table.Pr, table);
//Look //Look
var oLook = table.Get_TableLook(); var oLook = table.Get_TableLook();
...@@ -2338,9 +2328,9 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap) ...@@ -2338,9 +2328,9 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = Content.length; i < length; ++i) for(var i = 0, length = Content.length; i < length; ++i)
this.bs.WriteItem(c_oSerDocTableType.Row, function(){oThis.WriteRow(Content[i]);}); this.bs.WriteItem(c_oSerDocTableType.Row, function(){oThis.WriteRow(Content[i], i);});
}; };
this.WriteRow = function(Row) this.WriteRow = function(Row, nRowIndex)
{ {
var oThis = this; var oThis = this;
//Pr //Pr
...@@ -2351,18 +2341,18 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap) ...@@ -2351,18 +2341,18 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap)
//Content //Content
if(null != Row.Content) if(null != Row.Content)
{ {
this.bs.WriteItem(c_oSerDocTableType.Row_Content, function(){oThis.WriteRowContent(Row.Content);}); this.bs.WriteItem(c_oSerDocTableType.Row_Content, function(){oThis.WriteRowContent(Row.Content, nRowIndex);});
} }
}; };
this.WriteRowContent = function(Content) this.WriteRowContent = function(Content, nRowIndex)
{ {
var oThis = this; var oThis = this;
for(var i = 0, length = Content.length; i < length; i++) for(var i = 0, length = Content.length; i < length; i++)
{ {
this.bs.WriteItem(c_oSerDocTableType.Cell, function(){oThis.WriteCell(Content[i]);}); this.bs.WriteItem(c_oSerDocTableType.Cell, function(){oThis.WriteCell(Content[i], nRowIndex, i);});
} }
}; };
this.WriteCell = function(cell) this.WriteCell = function(cell, nRowIndex, nColIndex)
{ {
var oThis = this; var oThis = this;
//Pr //Pr
...@@ -2373,7 +2363,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap) ...@@ -2373,7 +2363,7 @@ function BinaryDocumentTableWriter(memory, doc, oMapCommentId, oNumIdMap)
{ {
var row = cell.Row; var row = cell.Row;
var table = row.Table; var table = row.Table;
if(table.Internal_GetVertMergeCount( row.Index, row.Get_CellInfo( cell.Index ).StartGridCol, cell.Get_GridSpan() ) > 1) if(table.Internal_GetVertMergeCount( nRowIndex, row.Get_CellInfo( nColIndex ).StartGridCol, cell.Get_GridSpan() ) > 1)
vMerge = vmerge_Restart; vMerge = vmerge_Restart;
} }
this.bs.WriteItem(c_oSerDocTableType.Cell_Pr, function(){oThis.btblPrs.WriteCellPr(cell.Pr, vMerge);}); this.bs.WriteItem(c_oSerDocTableType.Cell_Pr, function(){oThis.btblPrs.WriteCellPr(cell.Pr, vMerge);});
...@@ -3913,15 +3903,7 @@ Binary_tblPrReader.prototype = ...@@ -3913,15 +3903,7 @@ Binary_tblPrReader.prototype =
} }
else if(null != table) else if(null != table)
{ {
if( c_oSerProp_tblPrType.Rows === type ) if( c_oSerProp_tblPrType.tblpPr === type )
{
table.Rows = this.stream.GetULongLE();
}
else if( c_oSerProp_tblPrType.Cols === type )
{
table.Cols = this.stream.GetULongLE();
}
else if( c_oSerProp_tblPrType.tblpPr === type )
{ {
table.Inline = false; table.Inline = false;
var oAdditionalPr = {PageNum: null, X: null, Y: null, Paddings: null}; var oAdditionalPr = {PageNum: null, X: null, Y: null, Paddings: null};
...@@ -5666,14 +5648,11 @@ function Binary_DocumentTableReader(doc, openParams, ImageMap, stream, bAllowFlo ...@@ -5666,14 +5648,11 @@ function Binary_DocumentTableReader(doc, openParams, ImageMap, stream, bAllowFlo
} }
else if( c_oSerDocTableType.Content === type ) else if( c_oSerDocTableType.Content === type )
{ {
if(table.Cols > 0 && table.Rows > 0) table.Content = new Array();
{ res = this.bcr.Read1(length, function(t, l){
table.Content = new Array(); return oThis.Read_TableContent(t, l, table);
res = this.bcr.Read1(length, function(t, l){ });
return oThis.Read_TableContent(t, l, table); table.CurCell = table.Content[0].Get_Cell( 0 );
});
table.CurCell = table.Content[0].Get_Cell( 0 );
}
} }
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
......
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