修复bugs

This commit is contained in:
csh 2024-02-07 16:01:32 +08:00
parent 4cac47522a
commit f685fdced1
3 changed files with 25 additions and 20 deletions

View File

@ -405,30 +405,38 @@ Begin
if flag then
begin
document_.Paragraphs.AddParagraph(last_node, new_node, direction);
return array(flag, new_node);
end
else begin
index := direction = "before" ? 0 : range_obj_.Size()-1;
new_node := range_obj_[index].TParagraph.Root();
paragraph := self.InsertNewParagraph();
return array(flag, paragraph);
end
return new_node;
end
case collapse_ of
TSDocxEnumerations.wdCollapseStart():
new_node := ##psplit("before");
[flag, paragraph] := ##psplit("before");
TSDocxEnumerations.wdCollapseEnd():
new_node := ##psplit("after");
[flag, paragraph] := ##psplit("after");
else begin
new_node := range_obj_[range_obj_.Size()-1].TParagraph.Root();
flag := true;
paragraph := range_obj_[range_obj_.Size()-1].TParagraph.Root();
clear_flag := true;
end
end;
data := nils(numRows, numColumns);
ttable := docx_.CreateTable(data);
table := ##padd_table(ttable, new_node);
document_.Paragraphs.AddTableToParagraphs(new_node, table);
if flag then
begin
table := ##padd_table(ttable, paragraph);
document_.Paragraphs.AddTableToParagraphs(paragraph, table);
end
else begin
table := ##padd_table(ttable, paragraph.Object().Root());
paragraph.Range.Clear(true);
end
if clear_flag then self.Clear(true);
return table;
End;
@ -793,7 +801,7 @@ Function TSDocxRange.InsertFile(FileName, Range, ConfirmConversions, Link, Attac
Begin
alias := "";
paragraph := self.InsertNewParagraph();
docx_.InsertFile(alias, FileName, paragraph.Root());
docx_.InsertFile(alias, FileName, paragraph.Object().Root());
paragraph.Range.Delete();
document_.Paragraphs.Init(docx_);
End;

View File

@ -203,17 +203,17 @@ End;
Function TSDocxParagraphFormat.Space1();virtual;
Begin
self.LineSpacingRule := TSDocxEnumerations.wdLineSpaceSingle();
self.LineSpacing := 12;
End;
Function TSDocxParagraphFormat.Space15();virtual;
Begin
self.LineSpacingRule := TSDocxEnumerations.wdLineSpace1pt5();
self.LineSpacing := 18;
End;
Function TSDocxParagraphFormat.Space2();virtual;
Begin
self.LineSpacingRule := TSDocxEnumerations.wdLineSpaceDouble();
self.LineSpacing := 24;
End;
// property

View File

@ -125,7 +125,7 @@ Begin
End;
Function TSDocxShadingRange.ReadTexture();override;
Begin
CallFunction("ReadTexture");
return CallFunction("ReadTexture");
End;
Function TSDocxShadingRange.WriteForegroundPatternColorIndex(value);override;
@ -134,36 +134,33 @@ Begin
End;
Function TSDocxShadingRange.ReadForegroundPatternColorIndex();override;
Begin
CallFunction("ReadForegroundPatternColorIndex");
return CallFunction("ReadForegroundPatternColorIndex");
End;
Function TSDocxShadingRange.WriteForegroundPatternColor(value);override;
Begin
CallFunction("WriteForegroundPatternColor", value);
End;
Function TSDocxShadingRange.ReadForegroundPatternColor();override;
Begin
CallFunction("ReadForegroundPatternColor");
return CallFunction("ReadForegroundPatternColor");
End;
Function TSDocxShadingRange.WriteBackgroundPatternColorIndex(value);override;
Begin
CallFunction("WriteBackgroundPatternColorIndex", value);
End;
Function TSDocxShadingRange.ReadBackgroundPatternColorIndex();override;
Begin
CallFunction("ReadBackgroundPatternColorIndex");
return CallFunction("ReadBackgroundPatternColorIndex");
End;
Function TSDocxShadingRange.WriteBackgroundPatternColor(value);override;
Begin
CallFunction("WriteBackgroundPatternColor", value);
End;
Function TSDocxShadingRange.ReadBackgroundPatternColor();override;
Begin
CallFunction("ReadBackgroundPatternColor");
return CallFunction("ReadBackgroundPatternColor");
End;