v1.4.6-patch3

This commit is contained in:
csh 2023-09-21 09:22:15 +08:00
parent 493691b930
commit 5f1064794d
4 changed files with 1190 additions and 7 deletions

1169
Demo/DocxHelp.tsl Normal file

File diff suppressed because it is too large Load Diff

View File

@ -14661,7 +14661,7 @@ Type TTable = Class(DocObject, TTableImpl)
cellObj.mergeSpan_ := c[1];
return cellObj;
End;
///设置列宽
Function ColumnWidth(n, wth);
Begin

View File

@ -21,7 +21,7 @@ Type TDocxCopy = class
Function Copy(posOpt);
Begin
// 复制所有的样式
style_copy_obj_.CopyStyle();
style_copy_obj_.CopyStyle(number_copy_obj_);
parts := new_docx_obj_.Body().Parts();
pos := old_docx_obj_.GetPosNode(posOpt);
@ -222,7 +222,7 @@ private
begin
id := numpr.GetAttribute('w:val');
numberid := number_copy_obj_.CopyNumbering(id);
numpr.SetAttribute('w:val', id);
numpr.SetAttribute('w:val', numberid);
end
DeleteComment(paragraph); // 删除批注
End;
@ -326,11 +326,12 @@ Type TDocxStyleCopy = class
end
End;
Function CopyStyle();
Function CopyStyle(numberobj);
Begin
for id, obj in id_map_ do
begin
SetBasedOn(obj);
SetNumId(obj, numberobj);
SetLink(obj);
old_style_obj_.CopyStyle(obj);
end;
@ -382,11 +383,23 @@ private
end
End;
Function SetNumId(obj, numberobj);
Begin
if not ifObj(numberobj) then return;
numPr := class(TSXml).GetNode(obj.node_, 'w:pPr/w:numPr/w:numId');
if ifObj(numPr) then
begin
id := numpr.GetAttribute('w:val');
numberid := numberobj.CopyNumbering(id);
numpr.SetAttribute('w:val', numberid);
end
End;
Function GetNewName(name);
Begin
new_name := name;
count := 0;
while ifObj(old_style_obj_.GetStyle(new_name)) or style_name_map2_[new_name] do
while ifObj(old_style_obj_.GetStyle(class(TSXml).Utf8ToCurCodePage(new_name))) or style_name_map2_[new_name] do
new_name := new_name $ count++;
return new_name;
End;
@ -437,9 +450,9 @@ Type TDocxNumberCopy = class
begin
number_obj := old_number_obj_.CopyNumber(obj);
id_map_[number] := number_obj;
return number_obj;
end
end;
return id_map_[number];
end
End;
private

View File

@ -8,6 +8,7 @@
1. 修复表格存在合并单元格,生成目录报错问题
2. 修复单元格添加run对象设置样式不生效问题
3. 修复插入word后中文样式重复问题
### excel