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

View File

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

View File

@ -68,16 +68,3 @@ Begin
return table_.Cols(); return table_.Cols();
End; 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; return table;
end 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(); paragraph := self.InsertNewParagraph();
return array(flag, paragraph); node := paragraph.Object().Root();
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;
data := nils(numRows, numColumns); data := nils(numRows, numColumns);
ttable := docx_.CreateTable(data); ttable := docx_.CreateTable(data);
if flag then table := ##padd_table(ttable, node);
begin document_.Paragraphs.AddTableToParagraphs(node, table);
table := ##padd_table(ttable, paragraph);
document_.Paragraphs.AddTableToParagraphs(paragraph, table);
end
else begin
table := ##padd_table(ttable, paragraph.Object().Root());
paragraph.Range.Clear(true); paragraph.Range.Clear(true);
end if ifnil(collapse_) then self.Clear(true);
if clear_flag then self.Clear(true);
return table; return table;
End; End;
@ -552,11 +521,12 @@ Begin
else begin else begin
range_obj_.Clear(); range_obj_.Clear();
index := 0; index := 0;
flag := 1;
end end
end; end;
range_obj_.SplitRun(index); range_obj_.SplitRun(index);
tparagraph := range_obj_[index].TParagraph; 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.Type := t;
run.Br.Clear := c; run.Br.Clear := c;
run.Apply(); run.Apply();

View File

@ -166,7 +166,7 @@ End;
Function TSDocxTable.Cell(Row, Column); Function TSDocxTable.Cell(Row, Column);
Begin 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); cell_obj.Init(docx_, table_, Row, Column);
return cell_obj; return cell_obj;
End; End;

View File

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