Commit a409cd22 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix copy (write to binary)

parent d4ee817d
...@@ -3063,45 +3063,43 @@ ...@@ -3063,45 +3063,43 @@
this.memory.WriteByte(c_oSerPropLenType.Variable); this.memory.WriteByte(c_oSerPropLenType.Variable);
this.bs.WriteItemWithLength(function(){oThis.WriteCells(oRow);}); this.bs.WriteItemWithLength(function(){oThis.WriteCells(oRow);});
}; };
this.WriteCells = function(row) this.WriteCells = function (row) {
{
var oThis = this; var oThis = this;
var aIndexes = []; var aIndexes = [];
var bIsTablePartContainActiveRange; var bIsTablePartContainActiveRange;
if(oThis.isCopyPaste) if (oThis.isCopyPaste) {
{ for (var i = oThis.isCopyPaste.c1; i <= oThis.isCopyPaste.c2; i++) {
for(var i = oThis.isCopyPaste.c1; i <= oThis.isCopyPaste.c2; i++)
aIndexes.push(i); aIndexes.push(i);
}
var api = window["Asc"]["editor"]; var api = window["Asc"]["editor"];
var ws = api.wb.getWorksheet(); var ws = api.wb.getWorksheet();
bIsTablePartContainActiveRange = ws.model.autoFilters.isTablePartContainActiveRange(ws.activeRange); bIsTablePartContainActiveRange = ws.model.autoFilters.isTablePartContainActiveRange(ws.model.selectionRange.getLast());
} } else {
else for (var i in row.c) {
{
for(var i in row.c)
aIndexes.push(i - 0); aIndexes.push(i - 0);
} }
}
aIndexes.sort(AscCommon.fSortAscending); aIndexes.sort(AscCommon.fSortAscending);
for(var i = 0, length = aIndexes.length; i < length; ++i) for (var i = 0, length = aIndexes.length; i < length; ++i) {
{
var cell = row.c[aIndexes[i]]; var cell = row.c[aIndexes[i]];
//готовим ячейку к записи //готовим ячейку к записи
if(!oThis.isCopyPaste || (oThis.isCopyPaste && cell)) if (!oThis.isCopyPaste || (oThis.isCopyPaste && cell)) {
{
var nXfsId; var nXfsId;
var cellXfs = cell.xfs; var cellXfs = cell.xfs;
if(oThis.isCopyPaste && bIsTablePartContainActiveRange) if (oThis.isCopyPaste && bIsTablePartContainActiveRange) {
{
nXfsId = this.prepareXfs(cell.compiledXfs); nXfsId = this.prepareXfs(cell.compiledXfs);
cellXfs = cell.compiledXfs; cellXfs = cell.compiledXfs;
} } else {
else
nXfsId = this.prepareXfs(cell.xfs); nXfsId = this.prepareXfs(cell.xfs);
}
//сохраняем как и Excel даже пустой стиль(нужно чтобы убрать стиль строки/колонки) //сохраняем как и Excel даже пустой стиль(нужно чтобы убрать стиль строки/колонки)
if(null != cellXfs || false == cell.isEmptyText()) if (null != cellXfs || false == cell.isEmptyText()) {
this.bs.WriteItem(c_oSerRowTypes.Cell, function(){oThis.WriteCell(cell, nXfsId, row.index);}); this.bs.WriteItem(c_oSerRowTypes.Cell, function () {
oThis.WriteCell(cell, nXfsId, row.index);
});
}
} }
} }
}; };
......
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