Skip to content

Commit

Permalink
[Feature]Recognize the percentage measure when pasting a table from a…
Browse files Browse the repository at this point in the history
…n external word
  • Loading branch information
fernfei authored and GoshaZotov committed Oct 26, 2023
1 parent 787bc91 commit 626e2eb
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion common/wordcopypaste.js
Original file line number Diff line number Diff line change
Expand Up @@ -8465,6 +8465,8 @@ PasteProcessor.prototype =
var oDocument = this.oDocument;
var tableNode = node, newNode, headNode;
var bPresentation = !PasteElementsId.g_bIsDocumentCopyPaste;
var bPercentWidth = node.style.width.indexOf('%') !== -1 || node.width.indexOf('%') !== -1;
var nPercentWidth = bPercentWidth ? parseInt(node.style.width || node.width) : 0;

//Ищем если есть tbody
var i, length, j, length2;
Expand Down Expand Up @@ -8678,7 +8680,10 @@ PasteProcessor.prototype =
//набиваем content
this._ExecuteTable(tableNode, node, table, aSumGrid, nMaxColCount !== nMinColCount ? aColsCountByRow : null, pPr, bUseScaleKoef, dScaleKoef, arrShapes, arrImages, arrTables);
table.MoveCursorToStartPos();


if (bPercentWidth) {
table.SetTableProps({TableWidth:-nPercentWidth});
}
if (!bPresentation) {
this.aContent.push(table);
}
Expand Down

0 comments on commit 626e2eb

Please sign in to comment.