v1.4.6-patch3
This commit is contained in:
parent
493691b930
commit
5f1064794d
File diff suppressed because it is too large
Load Diff
|
|
@ -21,7 +21,7 @@ Type TDocxCopy = class
|
||||||
Function Copy(posOpt);
|
Function Copy(posOpt);
|
||||||
Begin
|
Begin
|
||||||
// 复制所有的样式
|
// 复制所有的样式
|
||||||
style_copy_obj_.CopyStyle();
|
style_copy_obj_.CopyStyle(number_copy_obj_);
|
||||||
|
|
||||||
parts := new_docx_obj_.Body().Parts();
|
parts := new_docx_obj_.Body().Parts();
|
||||||
pos := old_docx_obj_.GetPosNode(posOpt);
|
pos := old_docx_obj_.GetPosNode(posOpt);
|
||||||
|
|
@ -222,7 +222,7 @@ private
|
||||||
begin
|
begin
|
||||||
id := numpr.GetAttribute('w:val');
|
id := numpr.GetAttribute('w:val');
|
||||||
numberid := number_copy_obj_.CopyNumbering(id);
|
numberid := number_copy_obj_.CopyNumbering(id);
|
||||||
numpr.SetAttribute('w:val', id);
|
numpr.SetAttribute('w:val', numberid);
|
||||||
end
|
end
|
||||||
DeleteComment(paragraph); // 删除批注
|
DeleteComment(paragraph); // 删除批注
|
||||||
End;
|
End;
|
||||||
|
|
@ -326,11 +326,12 @@ Type TDocxStyleCopy = class
|
||||||
end
|
end
|
||||||
End;
|
End;
|
||||||
|
|
||||||
Function CopyStyle();
|
Function CopyStyle(numberobj);
|
||||||
Begin
|
Begin
|
||||||
for id, obj in id_map_ do
|
for id, obj in id_map_ do
|
||||||
begin
|
begin
|
||||||
SetBasedOn(obj);
|
SetBasedOn(obj);
|
||||||
|
SetNumId(obj, numberobj);
|
||||||
SetLink(obj);
|
SetLink(obj);
|
||||||
old_style_obj_.CopyStyle(obj);
|
old_style_obj_.CopyStyle(obj);
|
||||||
end;
|
end;
|
||||||
|
|
@ -382,11 +383,23 @@ private
|
||||||
end
|
end
|
||||||
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);
|
Function GetNewName(name);
|
||||||
Begin
|
Begin
|
||||||
new_name := name;
|
new_name := name;
|
||||||
count := 0;
|
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++;
|
new_name := new_name $ count++;
|
||||||
return new_name;
|
return new_name;
|
||||||
End;
|
End;
|
||||||
|
|
@ -437,9 +450,9 @@ Type TDocxNumberCopy = class
|
||||||
begin
|
begin
|
||||||
number_obj := old_number_obj_.CopyNumber(obj);
|
number_obj := old_number_obj_.CopyNumber(obj);
|
||||||
id_map_[number] := number_obj;
|
id_map_[number] := number_obj;
|
||||||
return number_obj;
|
|
||||||
end
|
end
|
||||||
end;
|
return id_map_[number];
|
||||||
|
end
|
||||||
End;
|
End;
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue