58 lines
1.1 KiB
Plaintext
58 lines
1.1 KiB
Plaintext
Type TSDocxTables = Class
|
|
|
|
public
|
|
Function Create(application, docx);
|
|
Function Init();
|
|
Function Operator[](index);
|
|
|
|
private
|
|
application_;
|
|
docx_;
|
|
|
|
public
|
|
Function Add(Range, NumRows, NumColumns, DefaultTableBehavior, AutoFitBehavior);
|
|
Function Item(Index);
|
|
|
|
property Application read ReadApplication;
|
|
property Count read ReadCount;
|
|
property Creator read ReadCreator;
|
|
property NestingLevel read ReadNestingLevel;
|
|
property Parent read ReadParent;
|
|
Function ReadParent();
|
|
Function ReadNestingLevel();
|
|
Function ReadCreator();
|
|
Function ReadCount();
|
|
Function ReadApplication();
|
|
|
|
End;
|
|
|
|
// ============== 实现 ================= //
|
|
Function TSDocxTables.Create(application, docx);
|
|
Begin
|
|
application_ := application;
|
|
docx_ := docx;
|
|
Init();
|
|
End;
|
|
|
|
Function TSDocxTables.Init();
|
|
Begin
|
|
End;
|
|
|
|
Function Operator TSDocxTables.[](index);
|
|
Begin
|
|
table := docx_.GetTable(index - 1);
|
|
return table ? new TSDocxTable(application_, docx_, table) : nil;
|
|
End;
|
|
|
|
// function
|
|
Function TSDocxTables.Item(Index);
|
|
Begin
|
|
return self[Index];
|
|
End;
|
|
|
|
// property
|
|
Function TSDocxTables.ReadCount();
|
|
Begin
|
|
return docx_.TablesCount();
|
|
End;
|