Commit b6aad9c7 authored by Igor.Zotov's avatar Igor.Zotov Committed by Alexander.Trofimov

для чтения из бинарника теперь создаю временный Workbook и заполняю его данными.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52304 954022d7-b5bf-4e40-9824-e11837661b57
parent 4bf86497
......@@ -5028,8 +5028,6 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
return this.bcr.ReadTable(function(t, l){
return oThis.ReadWorksheetsContent(t,l);
});
if(this.isCopyPaste)
return this.isCopyPaste;
};
this.ReadWorksheetsContent = function(type, length)
{
......@@ -5061,8 +5059,6 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
hyperlink.Ref.setHyperlinkOpen(hyperlink);
}
oNewWorksheet.init();
if(this.isCopyPaste)
return oNewWorksheet;
this.wb.aWorksheets.push(oNewWorksheet);
this.wb.aWorksheetsById[oNewWorksheet.getId()] = oNewWorksheet;
}
......@@ -6497,10 +6493,7 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
{
this.stream = this.getbase64DecodedData(data);
History.TurnOff();
if(this.isCopyPaste)
return this.ReadFile(wb)
else
this.ReadFile(wb);
this.ReadFile(wb);
if(!this.isCopyPaste)
{
......@@ -6527,7 +6520,6 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
var nSharedStringTableOffset = null;
var nStyleTableOffset = null;
var nWorkbookTableOffset = null;
var worksheet;
for(var i = 0; i < mtLen; ++i)
{
//mtItem
......@@ -6551,9 +6543,7 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
var aCellXfs = new Array();
var aDxfs = new Array();
var oMediaArray = new Object();
if(!this.isCopyPaste)
wb.aWorksheets = new Array();
wb.aWorksheets = new Array();
if(null != nOtherTableOffset)
{
res = this.stream.Seek(nOtherTableOffset);
......@@ -6594,13 +6584,8 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
// res = (new Binary_WorkbookTableReader(this.stream, wb)).Read();
// break;
case c_oSerTableTypes.Worksheets:
{
res = (new Binary_WorksheetTableReader(this.stream, wb, aSharedStrings, aCellXfs, aDxfs, oMediaArray, this.isCopyPaste)).Read();
if(this.isCopyPaste)
worksheet = res;
}
res = (new Binary_WorksheetTableReader(this.stream, wb, aSharedStrings, aCellXfs, aDxfs, oMediaArray)).Read();
break;
case c_oSerTableTypes.CalcChain:
res = (new Binary_CalcChainTableReader(this.stream, wb.calcChain)).Read();
break;
......@@ -6612,15 +6597,16 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
break;
}
}
if(this.isCopyPaste)
return worksheet;
if(null != nWorkbookTableOffset)
{
res = this.stream.Seek(nWorkbookTableOffset);
if(c_oSerConstants.ReadOk == res)
res = (new Binary_WorkbookTableReader(this.stream, wb)).Read();
}
wb.init();
if(!this.isCopyPaste)
{
if(null != nWorkbookTableOffset)
{
res = this.stream.Seek(nWorkbookTableOffset);
if(c_oSerConstants.ReadOk == res)
res = (new Binary_WorkbookTableReader(this.stream, wb)).Read();
}
wb.init();
}
return res;
};
};
......
......@@ -1440,7 +1440,11 @@
if(base64 != null)
{
var oBinaryFileReader = new BinaryFileReader(null, true);
var pasteData = oBinaryFileReader.Read(base64, worksheet.model.workbook);
var tempWorkbook = new Workbook;
oBinaryFileReader.Read(base64, tempWorkbook);
var pasteData = null;
if(tempWorkbook)
pasteData = tempWorkbook.aWorksheets[0]
if(pasteData)
{
History.TurnOn();
......
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