Commit adbe5534 authored by Sergey.Konovalov's avatar Sergey.Konovalov

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