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

убрал activeRange из worksheet

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@52317 954022d7-b5bf-4e40-9824-e11837661b57
parent b6aad9c7
...@@ -2246,10 +2246,6 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF ...@@ -2246,10 +2246,6 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF
this.WriteWorksheet = function(ws, index) this.WriteWorksheet = function(ws, index)
{ {
var oThis = this; var oThis = this;
//add new var in ws
if(oThis.isCopyPaste)
ws.activeRange = (new CellAddress(oThis.isCopyPaste.r1, oThis.isCopyPaste.c1, 0)).getID() + ":" + (new CellAddress(oThis.isCopyPaste.r2, oThis.isCopyPaste.c2, 0)).getID();
this.bs.WriteItem(c_oSerWorksheetsTypes.WorksheetProp, function(){oThis.WriteWorksheetProp(ws, index);}); this.bs.WriteItem(c_oSerWorksheetsTypes.WorksheetProp, function(){oThis.WriteWorksheetProp(ws, index);});
if(ws.aCols.length > 0 || null != ws.oAllCol) if(ws.aCols.length > 0 || null != ws.oAllCol)
...@@ -2320,11 +2316,12 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF ...@@ -2320,11 +2316,12 @@ function BinaryWorksheetsTableWriter(memory, wb, oSharedStrings, aDxfs, aXfs, aF
this.memory.WriteByte(EVisibleType.visibleVisible); this.memory.WriteByte(EVisibleType.visibleVisible);
} }
//activeRange(serialize activeRange) //activeRange(serialize activeRange)
if(oThis.isCopyPaste && ws.activeRange) if(oThis.isCopyPaste)
{ {
var activeRange = (new CellAddress(oThis.isCopyPaste.r1, oThis.isCopyPaste.c1, 0)).getID() + ":" + (new CellAddress(oThis.isCopyPaste.r2, oThis.isCopyPaste.c2, 0)).getID()
this.memory.WriteByte(c_oSerWorksheetPropTypes.Ref); this.memory.WriteByte(c_oSerWorksheetPropTypes.Ref);
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.memory.WriteString2(ws.activeRange); this.memory.WriteString2(activeRange);
} }
}; };
this.WriteWorksheetCols = function(ws) this.WriteWorksheetCols = function(ws)
...@@ -3428,8 +3425,6 @@ function BinaryFileWriter(wb, isCopyPaste) ...@@ -3428,8 +3425,6 @@ function BinaryFileWriter(wb, isCopyPaste)
//seek в конец, потому что GetBase64Memory заканчивает запись на текущей позиции. //seek в конец, потому что GetBase64Memory заканчивает запись на текущей позиции.
this.Memory.Seek(this.nLastFilePos); this.Memory.Seek(this.nLastFilePos);
if(this.isCopyPaste)
return this.Memory.GetBase64Memory()
} }
this.WriteTable = function(type, oTableSer) this.WriteTable = function(type, oTableSer)
{ {
...@@ -5009,7 +5004,7 @@ function Binary_WorkbookTableReader(stream, oWorkbook) ...@@ -5009,7 +5004,7 @@ function Binary_WorkbookTableReader(stream, oWorkbook)
}; };
}; };
/** @constructor */ /** @constructor */
function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, oMediaArray, isCopyPaste) function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, oMediaArray, copyPasteObj)
{ {
this.stream = stream; this.stream = stream;
this.wb = wb; this.wb = wb;
...@@ -5021,7 +5016,7 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -5021,7 +5016,7 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
this.aMerged = new Array(); this.aMerged = new Array();
this.aHyperlinks = new Array(); this.aHyperlinks = new Array();
this.oPPTXContentLoader = new CPPTXContentLoader(); this.oPPTXContentLoader = new CPPTXContentLoader();
this.isCopyPaste = isCopyPaste; this.copyPasteObj = copyPasteObj;
this.Read = function() this.Read = function()
{ {
var oThis = this; var oThis = this;
...@@ -5252,8 +5247,8 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs, ...@@ -5252,8 +5247,8 @@ function Binary_WorksheetTableReader(stream, wb, aSharedStrings, aCellXfs, Dxfs,
case EVisibleType.visibleVisible: oWorksheet.bHidden = false;break; case EVisibleType.visibleVisible: oWorksheet.bHidden = false;break;
} }
} }
else if(c_oSerWorksheetPropTypes.Ref == type) else if(this.copyPasteObj.isCopyPaste && c_oSerWorksheetPropTypes.Ref == type)
oWorksheet.activeRange = this.stream.GetString2LE(length); this.copyPasteObj.activeRange = this.stream.GetString2LE(length);
else else
res = c_oSerConstants.ReadUnknown; res = c_oSerConstants.ReadUnknown;
return res; return res;
...@@ -6371,7 +6366,11 @@ function BinaryFileReader(sUrlPath, isCopyPaste) ...@@ -6371,7 +6366,11 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
{ {
this.stream; this.stream;
this.sUrlPath = sUrlPath; this.sUrlPath = sUrlPath;
this.isCopyPaste = isCopyPaste; this.copyPasteObj =
{
isCopyPaste: isCopyPaste,
activeRange: null
};
this.getbase64DecodedData = function(szSrc, stream) this.getbase64DecodedData = function(szSrc, stream)
{ {
var nType = 0; var nType = 0;
...@@ -6493,9 +6492,9 @@ function BinaryFileReader(sUrlPath, isCopyPaste) ...@@ -6493,9 +6492,9 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
{ {
this.stream = this.getbase64DecodedData(data); this.stream = this.getbase64DecodedData(data);
History.TurnOff(); History.TurnOff();
this.ReadFile(wb); this.ReadFile(wb);
if(!this.isCopyPaste) if(!this.copyPasteObj.isCopyPaste)
{ {
ReadDefCellStyles(wb, wb.CellStyles.DefaultStyles); ReadDefCellStyles(wb, wb.CellStyles.DefaultStyles);
ReadDefTableStyles(wb, wb.TableStyles.DefaultStyles); ReadDefTableStyles(wb, wb.TableStyles.DefaultStyles);
...@@ -6584,7 +6583,16 @@ function BinaryFileReader(sUrlPath, isCopyPaste) ...@@ -6584,7 +6583,16 @@ 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:
{
if(this.copyPasteObj.isCopyPaste)
{
var oBinary_WorksheetTableReader = new Binary_WorksheetTableReader(this.stream, wb, aSharedStrings, aCellXfs, aDxfs, oMediaArray, this.copyPasteObj);
res = oBinary_WorksheetTableReader.Read();
this.copyPasteObj = oBinary_WorksheetTableReader.copyPasteObj;
}
else
res = (new Binary_WorksheetTableReader(this.stream, wb, aSharedStrings, aCellXfs, aDxfs, oMediaArray)).Read(); res = (new Binary_WorksheetTableReader(this.stream, wb, aSharedStrings, aCellXfs, aDxfs, oMediaArray)).Read();
}
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();
...@@ -6597,7 +6605,7 @@ function BinaryFileReader(sUrlPath, isCopyPaste) ...@@ -6597,7 +6605,7 @@ function BinaryFileReader(sUrlPath, isCopyPaste)
break; break;
} }
} }
if(!this.isCopyPaste) if(!this.copyPasteObj.isCopyPaste)
{ {
if(null != nWorkbookTableOffset) if(null != nWorkbookTableOffset)
{ {
......
...@@ -169,6 +169,7 @@ ...@@ -169,6 +169,7 @@
this.ppix = 96; this.ppix = 96;
this.ppiy = 96; this.ppiy = 96;
this.Api = null; this.Api = null;
this.activeRange = null;
return this; return this;
} }
...@@ -1442,6 +1443,7 @@ ...@@ -1442,6 +1443,7 @@
var oBinaryFileReader = new BinaryFileReader(null, true); var oBinaryFileReader = new BinaryFileReader(null, true);
var tempWorkbook = new Workbook; var tempWorkbook = new Workbook;
oBinaryFileReader.Read(base64, tempWorkbook); oBinaryFileReader.Read(base64, tempWorkbook);
this.activeRange = oBinaryFileReader.copyPasteObj.activeRange;
var pasteData = null; var pasteData = null;
if(tempWorkbook) if(tempWorkbook)
pasteData = tempWorkbook.aWorksheets[0] pasteData = tempWorkbook.aWorksheets[0]
...@@ -2811,7 +2813,7 @@ ...@@ -2811,7 +2813,7 @@
_insertImagesFromBinary: function(ws, data) _insertImagesFromBinary: function(ws, data)
{ {
var pasteRange = ws.autoFilters._refToRange(data.activeRange); var pasteRange = ws.autoFilters._refToRange(this.activeRange);
var activeRange = Asc.clone(ws.activeRange); var activeRange = Asc.clone(ws.activeRange);
var curCol; var curCol;
var curRow; var curRow;
......
...@@ -7859,7 +7859,8 @@ ...@@ -7859,7 +7859,8 @@
var arrFormula = []; var arrFormula = [];
var numFor = 0; var numFor = 0;
var activeCellsPasteFragment = this.autoFilters._refToRange(val.activeRange); var pasteRange = window["Asc"]["editor"].wb.clipboard.activeRange;
var activeCellsPasteFragment = this.autoFilters._refToRange(pasteRange);
var rMax = (activeCellsPasteFragment.r2 - activeCellsPasteFragment.r1) + arn.r1 + 1; var rMax = (activeCellsPasteFragment.r2 - activeCellsPasteFragment.r1) + arn.r1 + 1;
var cMax = (activeCellsPasteFragment.c2 - activeCellsPasteFragment.c1) + arn.c1 + 1; var cMax = (activeCellsPasteFragment.c2 - activeCellsPasteFragment.c1) + arn.c1 + 1;
......
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