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