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

Bug 19668 - [Copy&Paste] При копировании таблицы, которая содержит другую...

Bug 19668 - [Copy&Paste] При копировании таблицы, которая содержит другую таблицу, вставляются лишние строки

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@48884 954022d7-b5bf-4e40-9824-e11837661b57
parent 94699801
......@@ -1452,18 +1452,18 @@ CopyProcessor.prototype =
elem.after = nMaxGrid - elem.gridEnd;
}
this.oBinaryFileWriter.CopyTable(Item, aSelectedRows, nMinGrid, nMaxGrid);
this.oBinaryFileWriter.copyParams.bLockCopyPar = true;
this.oBinaryFileWriter.copyParams.bLockCopyElems++;
this.CopyTable(oDomTarget, Item, aSelectedRows);
this.oBinaryFileWriter.copyParams.bLockCopyPar = null;
this.oBinaryFileWriter.copyParams.bLockCopyElems--;
}
}
}
else
{
this.oBinaryFileWriter.CopyTable(Item, null);
this.oBinaryFileWriter.copyParams.bLockCopyPar = true;
this.oBinaryFileWriter.copyParams.bLockCopyElems++;
this.CopyTable(oDomTarget, Item, null);
this.oBinaryFileWriter.copyParams.bLockCopyPar = null;
this.oBinaryFileWriter.copyParams.bLockCopyElems--;
}
}
else if ( type_Paragraph === Item.GetType() )
......
......@@ -525,7 +525,7 @@ function BinaryFileWriter(doc)
this.nStart = 0;
this.bs = new BinaryCommonWriter(this.memory);
this.copyParams = {
bLockCopyPar: null,
bLockCopyElems: null,
itemCount: null,
bdtw: null,
oUsedNumIdMap: null,
......@@ -602,6 +602,7 @@ function BinaryFileWriter(doc)
this.CopyStart = function()
{
window.global_pptx_content_writer._Start();
this.copyParams.bLockCopyElems = 0;
this.copyParams.itemCount = 0;
this.copyParams.oUsedNumIdMap = new Object();
this.copyParams.nNumIdIndex = 1;
......@@ -641,7 +642,7 @@ function BinaryFileWriter(doc)
}
}
//сами параграфы скопируются в методе CopyTable, нужно только проанализировать стили
if(true == this.copyParams.bLockCopyPar)
if(this.copyParams.bLockCopyElems > 0)
return;
this.bs.WriteItem(c_oSerParType.Par, function(){oThis.copyParams.bdtw.WriteParapraph(Item, bUseSelection);});
this.copyParams.itemCount++;
......@@ -653,6 +654,9 @@ function BinaryFileWriter(doc)
var sTableStyle = Item.Get_TableStyle();
if(null != sTableStyle)
this.copyParams.oUsedStyleMap[sTableStyle] = 1;
//сама таблица скопируются в методе CopyTable у родительской таблицы, нужно только проанализировать стили
if(this.copyParams.bLockCopyElems > 0)
return;
this.bs.WriteItem(c_oSerParType.Table, function(){oThis.copyParams.bdtw.WriteDocTable(Item, aRowElems, nMinGrid, nMaxGrid);});
this.copyParams.itemCount++;
}
......
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