1. 修复tables.add位置错误

2. 修复insertbreak行为
3. 修复帮助文档错误
This commit is contained in:
csh 2024-02-26 14:04:52 +08:00
parent dbebc2805c
commit 1f7d5f403b
7 changed files with 14 additions and 57 deletions

Binary file not shown.

View File

@ -394,7 +394,7 @@ End;
Function TSDocxCell.WriteBottomPadding(value);
Begin
tcpr_.CellMar.Bottom := 20 * bottom;
tcpr_.CellMar.Bottom := 20 * value;
tcpr_.CellMar.BottomType := "dxa";
tcpr_.Update();
End;
@ -517,7 +517,7 @@ Function TSDocxCell.ReadHeight();
Begin
trpr_obj := GetTrPrObject();
value := trpr_obj.Value("Height");
return ifnil(value) ? 0 : value;
return ifnil(value) ? 0 : value / 20;
End;
Function TSDocxCell.WriteHeightRule(value);

View File

@ -13,14 +13,14 @@ private
cells_;
public
// Properties
// Methods
Function AutoFit();
Function Delete();
Function Select();
Function SetWidth(ColumnWidth, RulerStyle);
Function Sort(ExcludeHeader, SortFieldType, SortOrder, CaseSensitive, BidiSort, IgnoreThe, IgnoreKashida, IgnoreDiacritics, IgnoreHe, LanguageID);
// Methods
// Properties
property Borders read ReadBorders;
property Cells read ReadCells;
property Index read ReadIndex;

View File

@ -68,16 +68,3 @@ Begin
return table_.Cols();
End;
Function TSDocxColumns.WritePreferredWidthType(value);
Begin
End;
Function TSDocxColumns.ReadPreferredWidthType();
Begin
End;
Function TSDocxColumns.WritePreferredWidth(value);
Begin
End;
Function TSDocxColumns.ReadPreferredWidth();
Begin
End;

View File

@ -399,45 +399,14 @@ Begin
return table;
end
psplit := function(direction);
begin
[flag, last_node, new_node] := self.BreakIntoParagraphs(direction);
if flag then
begin
document_.Paragraphs.AddParagraph(last_node, new_node, direction);
return array(flag, new_node);
end
else begin
paragraph := self.InsertNewParagraph();
return array(flag, paragraph);
end
end
case collapse_ of
TSDocxEnumerations.wdCollapseStart():
[flag, paragraph] := ##psplit("before");
TSDocxEnumerations.wdCollapseEnd():
[flag, paragraph] := ##psplit("after");
else begin
flag := true;
paragraph := range_obj_[range_obj_.Size()-1].TParagraph.Root();
clear_flag := true;
end
end;
node := paragraph.Object().Root();
data := nils(numRows, numColumns);
ttable := docx_.CreateTable(data);
if flag then
begin
table := ##padd_table(ttable, paragraph);
document_.Paragraphs.AddTableToParagraphs(paragraph, table);
end
else begin
table := ##padd_table(ttable, paragraph.Object().Root());
table := ##padd_table(ttable, node);
document_.Paragraphs.AddTableToParagraphs(node, table);
paragraph.Range.Clear(true);
end
if clear_flag then self.Clear(true);
if ifnil(collapse_) then self.Clear(true);
return table;
End;
@ -552,11 +521,12 @@ Begin
else begin
range_obj_.Clear();
index := 0;
flag := 1;
end
end;
range_obj_.SplitRun(index);
tparagraph := range_obj_[index].TParagraph;
run := tparagraph.PrependRun(range_obj_[index].TRun);
run := flag = 1 ? range_obj_[0].TRun : tparagraph.PrependRun(range_obj_[index].TRun);
run.Br.Type := t;
run.Br.Clear := c;
run.Apply();

View File

@ -166,7 +166,7 @@ End;
Function TSDocxTable.Cell(Row, Column);
Begin
cell_obj := new TSDocxCell(self.Application, self.Creator, self.Parent);
cell_obj := new TSDocxCell(self.Application, self.Creator, self);
cell_obj.Init(docx_, table_, Row, Column);
return cell_obj;
End;

View File

@ -145,7 +145,7 @@ End;
Function TSWdRange.Refresh();
Begin
if target_node_ then self.FindRangeByNode(target_node_);
self.Init();
End;
Function TSWdRange.Size();