parent
cdf4b39350
commit
7283b7ac28
|
|
@ -29,7 +29,7 @@ public
|
|||
Function GoForward();
|
||||
Function Help(HelpType);
|
||||
Function InchesToPoints(Inches);
|
||||
Function Keyboard(LangId)
|
||||
Function Keyboard(LangId);
|
||||
Function KeyboardBidi();
|
||||
Function KeyboardLatin();
|
||||
Function KeyString(KeyCode, KeyCode2);
|
||||
|
|
@ -283,7 +283,7 @@ public
|
|||
Function ReadEmailOptions();
|
||||
Function WriteDontResetInsertionPointProperties(value);
|
||||
Function ReadDontResetInsertionPointProperties();
|
||||
Function ReadDocuments();
|
||||
Function ReadDocuments(Index);
|
||||
Function WriteDisplayScrollBars(value);
|
||||
Function ReadDisplayScrollBars();
|
||||
Function WriteDisplayScreenTips(value);
|
||||
|
|
@ -346,13 +346,14 @@ End;
|
|||
// ============== 实现 ================= //
|
||||
Function TSDocxApplication.Create();
|
||||
Begin
|
||||
Class(TSVbaBase).Create(self, self, random(10000000));
|
||||
Class(TSVbaBase).Create(self, random(10000000), self);
|
||||
Init();
|
||||
End;
|
||||
|
||||
Function TSDocxApplication.Init();
|
||||
Begin
|
||||
documents_ := new TSDocxDocuments(application_, self, creator_);
|
||||
documents_ := new TSDocxDocuments(self.Application, self.Creator, self);
|
||||
documents_.Init();
|
||||
End;
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,33 +1,28 @@
|
|||
Type TSDocxBorder = Class
|
||||
Type TSDocxBorder = Class(TSVbaBase)
|
||||
Uses TSDocxEnumerations;
|
||||
|
||||
public
|
||||
Function Create(application, borders, borderType);
|
||||
Function Init(borders, borderType);
|
||||
|
||||
private
|
||||
application_;
|
||||
border_;
|
||||
|
||||
public
|
||||
property Application read ReadApplication;
|
||||
property ArtStyle read ReadArtStyle write WriteArtStyle;
|
||||
property ArtWidth read ReadArtWidth write WriteArtWidth;
|
||||
property Color read ReadColor write WriteColor;
|
||||
property ColorIndex read ReadColorIndex write WriteColorIndex;
|
||||
property Creator read ReadCreator;
|
||||
property Inside read ReadInside;
|
||||
property LineStyle read ReadLineStyle write WriteLineStyle;
|
||||
property LineWidth read ReadLineWidth write WriteLineWidth;
|
||||
property Parent read ReadParent;
|
||||
property Visible read ReadVisible write WriteVisible;
|
||||
Function WriteVisible();
|
||||
Function ReadVisible();
|
||||
Function ReadParent();
|
||||
Function WriteLineWidth();
|
||||
Function ReadLineWidth();
|
||||
Function WriteLineStyle(value);virtual;
|
||||
Function ReadLineStyle();
|
||||
Function ReadInside();
|
||||
Function ReadCreator();
|
||||
Function WriteColorIndex();
|
||||
Function ReadColorIndex();
|
||||
Function WriteColor();
|
||||
|
|
@ -36,32 +31,30 @@ public
|
|||
Function ReadArtWidth();
|
||||
Function WriteArtStyle();
|
||||
Function ReadArtStyle();
|
||||
Function ReadApplication();
|
||||
|
||||
End;
|
||||
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxBorder.Create(application, borders, borderType);
|
||||
Function TSDocxBorder.Init(borders, borderType);
|
||||
Begin
|
||||
application_ := application;
|
||||
|
||||
case borderType of
|
||||
Class(TSDocxEnumerations).wdBorderBottom():
|
||||
TSDocxEnumerations.wdBorderBottom():
|
||||
border_ := borders.Bottom;
|
||||
Class(TSDocxEnumerations).wdBorderDiagonalDown():
|
||||
TSDocxEnumerations.wdBorderDiagonalDown():
|
||||
border_ := borders.tl2br;
|
||||
Class(TSDocxEnumerations).wdBorderDiagonalUp():
|
||||
TSDocxEnumerations.wdBorderDiagonalUp():
|
||||
border_ := borders.tr2bl;
|
||||
Class(TSDocxEnumerations).wdBorderHorizontal():
|
||||
TSDocxEnumerations.wdBorderHorizontal():
|
||||
border_ := borders.InsideH;
|
||||
Class(TSDocxEnumerations).wdBorderLeft():
|
||||
TSDocxEnumerations.wdBorderLeft():
|
||||
border_ := borders.Left;
|
||||
Class(TSDocxEnumerations).wdBorderRight():
|
||||
TSDocxEnumerations.wdBorderRight():
|
||||
border_ := borders.Right;
|
||||
Class(TSDocxEnumerations).wdBorderTop():
|
||||
TSDocxEnumerations.wdBorderTop():
|
||||
border_ := borders.Top;
|
||||
Class(TSDocxEnumerations).wdBorderVertical():
|
||||
TSDocxEnumerations.wdBorderVertical():
|
||||
border_ := borders.InsideV;
|
||||
end;
|
||||
End;
|
||||
|
|
@ -70,79 +63,79 @@ End;
|
|||
Function TSDocxBorder.WriteLineStyle(value);virtual;
|
||||
Begin
|
||||
case value of
|
||||
class(TSDocxEnumerations).wdLineStyleDashDot():
|
||||
TSDocxEnumerations.wdLineStyleDashDot():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDashDotDot():
|
||||
TSDocxEnumerations.wdLineStyleDashDotDot():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDashDotStroked():
|
||||
TSDocxEnumerations.wdLineStyleDashDotStroked():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDashLargeGap():
|
||||
TSDocxEnumerations.wdLineStyleDashLargeGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDashSmallGap():
|
||||
TSDocxEnumerations.wdLineStyleDashSmallGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDot():
|
||||
TSDocxEnumerations.wdLineStyleDot():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDouble():
|
||||
TSDocxEnumerations.wdLineStyleDouble():
|
||||
border_.Val := "double";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleDoubleWavy():
|
||||
TSDocxEnumerations.wdLineStyleDoubleWavy():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleEmboss3D():
|
||||
TSDocxEnumerations.wdLineStyleEmboss3D():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleEngrave3D():
|
||||
TSDocxEnumerations.wdLineStyleEngrave3D():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleInset():
|
||||
TSDocxEnumerations.wdLineStyleInset():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleNone():
|
||||
TSDocxEnumerations.wdLineStyleNone():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleOutset():
|
||||
TSDocxEnumerations.wdLineStyleOutset():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleSingle():
|
||||
TSDocxEnumerations.wdLineStyleSingle():
|
||||
border_.Val := "single";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleSingleWavy():
|
||||
TSDocxEnumerations.wdLineStyleSingleWavy():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThickThinLargeGap():
|
||||
TSDocxEnumerations.wdLineStyleThickThinLargeGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThickThinMedGap():
|
||||
TSDocxEnumerations.wdLineStyleThickThinMedGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThickThinSmallGap():
|
||||
TSDocxEnumerations.wdLineStyleThickThinSmallGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThinThickLargeGap():
|
||||
TSDocxEnumerations.wdLineStyleThinThickLargeGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThinThickMedGap():
|
||||
TSDocxEnumerations.wdLineStyleThinThickMedGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThinThickSmallGap():
|
||||
TSDocxEnumerations.wdLineStyleThinThickSmallGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThinThickThinLargeGap():
|
||||
TSDocxEnumerations.wdLineStyleThinThickThinLargeGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThinThickThinMedGap():
|
||||
TSDocxEnumerations.wdLineStyleThinThickThinMedGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleThinThickThinSmallGap():
|
||||
TSDocxEnumerations.wdLineStyleThinThickThinSmallGap():
|
||||
border_.Val := "nil";
|
||||
|
||||
class(TSDocxEnumerations).wdLineStyleTriple():
|
||||
TSDocxEnumerations.wdLineStyleTriple():
|
||||
border_.Val := "nil";
|
||||
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -1,13 +1,12 @@
|
|||
Type TSDocxBorderTable = Class(TSDocxBorder)
|
||||
|
||||
public
|
||||
Function Create(application, table, borderType);
|
||||
Function Init(table, borderType);
|
||||
|
||||
public
|
||||
Function WriteLineStyle(value);override;
|
||||
|
||||
private
|
||||
application_;
|
||||
table_;
|
||||
border_type_;
|
||||
|
||||
|
|
@ -15,9 +14,8 @@ End;
|
|||
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxBorderTable.Create(application, table, borderType);
|
||||
Function TSDocxBorderTable.Init(table, borderType);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
border_type_ := borderType;
|
||||
End;
|
||||
|
|
@ -30,7 +28,8 @@ Begin
|
|||
begin
|
||||
for c:=1 to table_.Cols() do
|
||||
begin
|
||||
cell := new TSDocxCell(application_, table_, r, c);
|
||||
cell := new TSDocxCell(self.Application, self.Creator, self.Parent);
|
||||
cell.Init(table_, r, c);
|
||||
cell.Borders(border_type_).LineStyle := value;
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
Type TSDocxBorders = Class
|
||||
Type TSDocxBorders = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, borders);
|
||||
Function Init(borders);
|
||||
Function Operator[](index);virtual;
|
||||
|
||||
private
|
||||
application_;
|
||||
borders_;
|
||||
|
||||
public
|
||||
|
|
@ -13,9 +12,7 @@ public
|
|||
Function Item(Index);
|
||||
|
||||
property AlwaysInFront read ReadAlwaysInFront write WriteAlwaysInFront;
|
||||
property Application read ReadApplication;
|
||||
property Count read ReadCount;
|
||||
property Creator read ReadCreator;
|
||||
property DistanceFrom read ReadDistanceFrom write WriteDistanceFrom;
|
||||
property DistanceFromBottom read ReadDistanceFromBottom write WriteDistanceFromBottom;
|
||||
property DistanceFromLeft read ReadDistanceFromLeft write WriteDistanceFromLeft;
|
||||
|
|
@ -35,7 +32,6 @@ public
|
|||
property OutsideColorIndex read ReadOutsideColorIndex write WriteOutsideColorIndex;
|
||||
property OutsideLineStyle read ReadOutsideLineStyle write WriteOutsideLineStyle;
|
||||
property OutsideLineWidth read ReadOutsideLineWidth write WriteOutsideLineWidth;
|
||||
property Parent read ReadParent;
|
||||
property Shadow read ReadShadow write WriteShadow;
|
||||
property SurroundFooter read ReadSurroundFooter write WriteSurroundFooter;
|
||||
property SurroundHeader read ReadSurroundHeader write WriteSurroundHeader;
|
||||
|
|
@ -45,7 +41,6 @@ public
|
|||
Function ReadSurroundFooter();
|
||||
Function WriteShadow();
|
||||
Function ReadShadow();
|
||||
Function ReadParent();
|
||||
Function WriteOutsideLineWidth();
|
||||
Function ReadOutsideLineWidth();
|
||||
Function WriteOutsideLineStyle();
|
||||
|
|
@ -82,9 +77,7 @@ public
|
|||
Function ReadDistanceFromBottom();
|
||||
Function WriteDistanceFrom();
|
||||
Function ReadDistanceFrom();
|
||||
Function ReadCreator();
|
||||
Function ReadCount();
|
||||
Function ReadApplication();
|
||||
Function WriteAlwaysInFront();
|
||||
Function ReadAlwaysInFront();
|
||||
|
||||
|
|
@ -92,15 +85,16 @@ End;
|
|||
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxBorders.Create(application, borders);
|
||||
Function TSDocxBorders.Init(borders);
|
||||
Begin
|
||||
application_ := application;
|
||||
borders_ := borders;
|
||||
End;
|
||||
|
||||
Function Operator TSDocxBorders.[](index);virtual;
|
||||
Begin
|
||||
return new TSDocxBorder(application_, borders_, index);
|
||||
border_obj := new TSDocxBorder(self.Application, self.Creator, self);
|
||||
border_obj.Init(borders_, index);
|
||||
return border_obj;
|
||||
End;
|
||||
|
||||
// function
|
||||
|
|
|
|||
|
|
@ -1,24 +1,24 @@
|
|||
Type TSDocxBordersTable = Class(TSDocxBorders)
|
||||
|
||||
public
|
||||
Function Create(application, table);
|
||||
Function Init(table);
|
||||
Function Operator[](index);overload;
|
||||
|
||||
private
|
||||
application_;
|
||||
table_;
|
||||
|
||||
End;
|
||||
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxBordersTable.Create(application, table);
|
||||
Function TSDocxBordersTable.Init(table);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
End;
|
||||
|
||||
Function Operator TSDocxBordersTable.[](index);overload;
|
||||
Begin
|
||||
return new TSDocxBorderTable(application_, table_, index);
|
||||
border_table_obj := new TSDocxBorderTable(self.Application, self.Creator, self.Parent);
|
||||
border_table_obj.Init(table_, index);
|
||||
return border_table_obj;
|
||||
End;
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
Type TSDocxCell = Class
|
||||
Type TSDocxCell = Class(TSVbaBase)
|
||||
Uses TSDocxEnumerations;
|
||||
|
||||
public
|
||||
Function Create(application, table, row, col);
|
||||
Function Init();
|
||||
Function Init(table, row, column);
|
||||
|
||||
private
|
||||
Function GetCell();
|
||||
Function SetCellTcPrWidth(row, col, widthValue, widthType);
|
||||
|
||||
private
|
||||
application_;
|
||||
table_; // TOfficeObj("TTable")
|
||||
row_;
|
||||
column_;
|
||||
|
|
@ -27,12 +26,10 @@ public
|
|||
Function SetWidth(ColumnWidth, RulerStyle);
|
||||
Function Split(NumRows, NumColumns);
|
||||
|
||||
property Application read ReadApplication;
|
||||
property Borders read ReadBorders;
|
||||
property BottomPadding read ReadBottomPadding write WriteBottomPadding;
|
||||
property Column read ReadColumn;
|
||||
property ColumnIndex read ReadColumnIndex;
|
||||
property Creator read ReadCreator;
|
||||
property FitText read ReadFitText write WriteFitText;
|
||||
property Height read ReadHeight write WriteHeight;
|
||||
property HeightRule read ReadHeightRule write WriteHeightRule;
|
||||
|
|
@ -40,7 +37,6 @@ public
|
|||
property LeftPadding read ReadLeftPadding write WriteLeftPadding;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Next read ReadNext;
|
||||
property Parent read ReadParent;
|
||||
property PreferredWidth read ReadPreferredWidth write WritePreferredWidth;
|
||||
property PreferredWidthType read ReadPreferredWidthType write WritePreferredWidthType;
|
||||
property Previous read ReadPrevious;
|
||||
|
|
@ -74,7 +70,6 @@ public
|
|||
Function ReadPreferredWidthType();
|
||||
Function WritePreferredWidth(value);
|
||||
Function ReadPreferredWidth();
|
||||
Function ReadParent();
|
||||
Function ReadNext();
|
||||
Function ReadNestingLevel();
|
||||
Function WriteLeftPadding(left);
|
||||
|
|
@ -87,29 +82,21 @@ public
|
|||
Function ReadHeight();
|
||||
Function WriteFitText();
|
||||
Function ReadFitText();
|
||||
Function ReadCreator();
|
||||
Function ReadColumnIndex();
|
||||
Function ReadColumn();
|
||||
Function WriteBottomPadding(bottom);
|
||||
Function ReadBottomPadding();
|
||||
Function ReadBorders(index);
|
||||
Function ReadApplication();
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxCell.Create(application, table, row, column);
|
||||
Function TSDocxCell.Init(table, row, column);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
row_ := row;
|
||||
column_ := column;
|
||||
min_dxa_width_ := 321;
|
||||
Init();
|
||||
End;
|
||||
|
||||
Function TSDocxCell.Init();
|
||||
Begin
|
||||
cell := table_.GetCells()[row_-1, column_-1];
|
||||
if not ifnil(cell) then
|
||||
begin
|
||||
|
|
@ -141,18 +128,18 @@ End;
|
|||
// function
|
||||
Function TSDocxCell.Delete(ShiftCells);
|
||||
Begin
|
||||
if ifnil(ShiftCells) then ShiftCells := class(TSDocxEnumerations).wdDeleteCellsShiftLeft();
|
||||
if ifnil(ShiftCells) then ShiftCells := TSDocxEnumerations.wdDeleteCellsShiftLeft();
|
||||
case ShiftCells of
|
||||
class(TSDocxEnumerations).wdDeleteCellsEntireColumn():
|
||||
TSDocxEnumerations.wdDeleteCellsEntireColumn():
|
||||
table_.DeleteCell(nil, column_);
|
||||
|
||||
class(TSDocxEnumerations).wdDeleteCellsEntireRow():
|
||||
TSDocxEnumerations.wdDeleteCellsEntireRow():
|
||||
table_.DeleteCell(row_, nil);
|
||||
|
||||
class(TSDocxEnumerations).wdDeleteCellsShiftLeft():
|
||||
TSDocxEnumerations.wdDeleteCellsShiftLeft():
|
||||
table_.DeleteCell(row_, column_);
|
||||
|
||||
class(TSDocxEnumerations).wdDeleteCellsShiftUp():
|
||||
TSDocxEnumerations.wdDeleteCellsShiftUp():
|
||||
table_.DeleteCell(row_, column_, 0);
|
||||
end;
|
||||
End;
|
||||
|
|
@ -170,7 +157,9 @@ End;
|
|||
|
||||
Function TSDocxCell.ReadColumn();
|
||||
Begin
|
||||
return new TSDocxColumn(application_, table_, column_);
|
||||
column_obj := new TSDocxColumn(self.Application, self.Creator, self);
|
||||
column_obj.Init(table_, column_);
|
||||
return column_obj;
|
||||
End;
|
||||
|
||||
Function TSDocxCell.ReadRowIndex();
|
||||
|
|
@ -203,19 +192,19 @@ End;
|
|||
Function TSDocxCell.WriteVerticalAlignment(alignment);
|
||||
Begin
|
||||
case alignment of
|
||||
class(TSDocxEnumerations).wdCellAlignVerticalBottom():
|
||||
TSDocxEnumerations.wdCellAlignVerticalBottom():
|
||||
begin
|
||||
tcpr_.vAlign := "bottom";
|
||||
tcpr_.Update();
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdCellAlignVerticalCenter():
|
||||
TSDocxEnumerations.wdCellAlignVerticalCenter():
|
||||
begin
|
||||
tcpr_.vAlign := "center";
|
||||
tcpr_.Update();
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdCellAlignVerticalTop():
|
||||
TSDocxEnumerations.wdCellAlignVerticalTop():
|
||||
begin
|
||||
tcpr_.vAlign := "top";
|
||||
tcpr_.Update();
|
||||
|
|
@ -227,9 +216,9 @@ Function TSDocxCell.ReadVerticalAlignment();
|
|||
Begin
|
||||
alignment := tcpr_.Value("vAlign");
|
||||
case alignment of
|
||||
"bottom": return class(TSDocxEnumerations).wdCellAlignVerticalBottom();
|
||||
"center": return class(TSDocxEnumerations).wdCellAlignVerticalCenter();
|
||||
else return class(TSDocxEnumerations).wdCellAlignVerticalTop();
|
||||
"bottom": return TSDocxEnumerations.wdCellAlignVerticalBottom();
|
||||
"center": return TSDocxEnumerations.wdCellAlignVerticalCenter();
|
||||
else return TSDocxEnumerations.wdCellAlignVerticalTop();
|
||||
end;
|
||||
End;
|
||||
|
||||
|
|
@ -279,18 +268,22 @@ End;
|
|||
|
||||
Function TSDocxCell.ReadTables(index);
|
||||
Begin
|
||||
tables_obj := new TSDocxTables(application_, GetCell());
|
||||
tables_obj := new TSDocxTables(self.Application, self.Creator, self);
|
||||
tables_obj.Init(GetCell());
|
||||
return ifnil(index) ? tables_obj : tables_obj[index];
|
||||
End;
|
||||
|
||||
Function TSDocxCell.ReadShading();
|
||||
Begin
|
||||
return new TSDocxShading(application_, tcpr_);
|
||||
shading_obj := new TSDocxShading(self.Application, self.Creator, self);
|
||||
shading_obj.Init(tcpr_);
|
||||
return shading_obj;
|
||||
End;
|
||||
|
||||
Function TSDocxCell.ReadBorders(index);
|
||||
Begin
|
||||
obj := new TSDocxBorders(application_, tcpr_.Borders);
|
||||
borders_obj := new TSDocxBorders(self.Application, self.Creator, self);
|
||||
borders_obj.Init(tcpr_.Borders);
|
||||
return ifnil(index) ? obj : obj[index];
|
||||
End;
|
||||
|
||||
|
|
@ -299,7 +292,7 @@ Begin
|
|||
width_value := nil;
|
||||
width_type := nil;
|
||||
case value of
|
||||
class(TSDocxEnumerations).wdPreferredWidthAuto():
|
||||
TSDocxEnumerations.wdPreferredWidthAuto():
|
||||
begin
|
||||
table_.TblPr.Width := 0;
|
||||
table_.TblPr.WidthType := "auto";
|
||||
|
|
@ -308,7 +301,7 @@ Begin
|
|||
width_type := "auto";
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdPreferredWidthPercent():
|
||||
TSDocxEnumerations.wdPreferredWidthPercent():
|
||||
begin
|
||||
table_.TblPr.Width := 5000;
|
||||
table_.TblPr.WidthType := "pct";
|
||||
|
|
@ -318,7 +311,7 @@ Begin
|
|||
width_type := "pct";
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdPreferredWidthPoints():
|
||||
TSDocxEnumerations.wdPreferredWidthPoints():
|
||||
begin
|
||||
width_value := nil;
|
||||
width_type := "dxa";
|
||||
|
|
@ -333,9 +326,9 @@ Function TSDocxCell.ReadPreferredWidthType();
|
|||
Begin
|
||||
width_type := tcpr_.Value("Type");
|
||||
case width_type of
|
||||
"auto": return class(TSDocxEnumerations).wdPreferredWidthAuto();
|
||||
"dxa": return class(TSDocxEnumerations).wdPreferredWidthPoints();
|
||||
"pct": return class(TSDocxEnumerations).wdPreferredWidthPercent();
|
||||
"auto": return TSDocxEnumerations.wdPreferredWidthAuto();
|
||||
"dxa": return TSDocxEnumerations.wdPreferredWidthPoints();
|
||||
"pct": return TSDocxEnumerations.wdPreferredWidthPercent();
|
||||
end;
|
||||
End;
|
||||
|
||||
|
|
@ -344,8 +337,8 @@ Begin
|
|||
width_type := self.PreferredWidthType;
|
||||
width_value := 0;
|
||||
case width_type of
|
||||
class(TSDocxEnumerations).wdPreferredWidthAuto(),
|
||||
class(TSDocxEnumerations).wdPreferredWidthPoints():
|
||||
TSDocxEnumerations.wdPreferredWidthAuto(),
|
||||
TSDocxEnumerations.wdPreferredWidthPoints():
|
||||
begin
|
||||
width_type := "dxa";
|
||||
width_value := 20 * value;
|
||||
|
|
@ -353,7 +346,7 @@ Begin
|
|||
SetCellTcPrWidth(row_, column_, width_value, width_type);
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdPreferredWidthPercent():
|
||||
TSDocxEnumerations.wdPreferredWidthPercent():
|
||||
begin
|
||||
width_type := "pct";
|
||||
if value < 0 or value > 100 then return;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
Type TSDocxCells = Class
|
||||
Type TSDocxCells = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, table);
|
||||
Function Init(table);
|
||||
|
||||
private
|
||||
application_;
|
||||
table_; // TOfficeObj("TTable")
|
||||
|
||||
public
|
||||
|
|
@ -19,14 +18,11 @@ public
|
|||
Function SetWidth(ColumnWidth, RulerStyle);
|
||||
Function Split(NumRows, NumColumns, MergeBeforeSplit);
|
||||
|
||||
property Application read ReadApplication;
|
||||
property Borders read ReadBorders;
|
||||
property Count read ReadCount;
|
||||
property Creator read ReadCreator;
|
||||
property Height read ReadHeight write WriteHeight;
|
||||
property HeightRule read ReadHeightRule write WriteHeightRule;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Parent read ReadParent;
|
||||
property PreferredWidth read ReadPreferredWidth write WritePreferredWidth;
|
||||
property PreferredWidthType read ReadPreferredWidthType write WritePreferredWidthType;
|
||||
property Shading read ReadShading;
|
||||
|
|
@ -41,16 +37,13 @@ public
|
|||
Function ReadPreferredWidthType();
|
||||
Function WritePreferredWidth();
|
||||
Function ReadPreferredWidth();
|
||||
Function ReadParent();
|
||||
Function ReadNestingLevel();
|
||||
Function WriteHeightRule();
|
||||
Function ReadHeightRule();
|
||||
Function WriteHeight();
|
||||
Function ReadHeight();
|
||||
Function ReadCreator();
|
||||
Function ReadCount();
|
||||
Function ReadBorders();
|
||||
Function ReadApplication();
|
||||
|
||||
End;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
Type TSDocxColumn = Class
|
||||
Type TSDocxColumn = Class(TSVbaBase)
|
||||
Uses TSDocxEnumerations;
|
||||
|
||||
public
|
||||
Function Create(application, table, column);
|
||||
Function Init(table, column);
|
||||
|
||||
private
|
||||
Function SetColumnWidth(column, wvalue, type);
|
||||
Function SerializeTblGrid();
|
||||
|
||||
private
|
||||
application_;
|
||||
table_;
|
||||
column_;
|
||||
min_dxa_width_; // 最小宽度 321
|
||||
|
|
@ -20,16 +20,13 @@ public
|
|||
Function SetWidth(ColumnWidth, RulerStyle);
|
||||
Function Sort(ExcludeHeader, SortFieldType, SortOrder, CaseSensitive, BidiSort, IgnoreThe, IgnoreKashida, IgnoreDiacritics, IgnoreHe, LanguageID);
|
||||
|
||||
property Application read ReadApplication;
|
||||
property Borders read ReadBorders;
|
||||
property Cells read ReadCells;
|
||||
property Creator read ReadCreator;
|
||||
property Index read ReadIndex;
|
||||
property IsFirst read ReadIsFirst;
|
||||
property IsLast read ReadIsLast;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Next read ReadNext;
|
||||
property Parent read ReadParent;
|
||||
property PreferredWidth read ReadPreferredWidth write WritePreferredWidth;
|
||||
property PreferredWidthType read ReadPreferredWidthType write WritePreferredWidthType;
|
||||
property Previous read ReadPrevious;
|
||||
|
|
@ -43,23 +40,19 @@ public
|
|||
Function ReadPreferredWidthType();
|
||||
Function WritePreferredWidth(value);
|
||||
Function ReadPreferredWidth();
|
||||
Function ReadParent();
|
||||
Function ReadNext();
|
||||
Function ReadNestingLevel();
|
||||
Function ReadIsLast();
|
||||
Function ReadIsFirst();
|
||||
Function ReadIndex();
|
||||
Function ReadCreator();
|
||||
Function ReadCells();
|
||||
Function ReadBorders();
|
||||
Function ReadApplication();
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxColumn.Create(application, table, column);
|
||||
Function TSDocxColumn.Init(table, column);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
column_ := column;
|
||||
min_dxa_width_ := 321;
|
||||
|
|
@ -100,7 +93,7 @@ End;
|
|||
// function
|
||||
Function TSDocxColumn.SetWidth(ColumnWidth, RulerStyle);
|
||||
Begin
|
||||
if ifnil(RulerStyle) then RulerStyle := class(TSDocxEnumerations).wdAdjustNone();
|
||||
if ifnil(RulerStyle) then RulerStyle := TSDocxEnumerations.wdAdjustNone();
|
||||
width_value := ColumnWidth * 20;
|
||||
[total_width, grid_col_arr] := SerializeTblGrid();
|
||||
// 设置w:tblPr的总宽度
|
||||
|
|
@ -109,7 +102,7 @@ Begin
|
|||
table_.TblPr.Update();
|
||||
|
||||
case RulerStyle of
|
||||
class(TSDocxEnumerations).wdAdjustFirstColumn():
|
||||
TSDocxEnumerations.wdAdjustFirstColumn():
|
||||
begin
|
||||
if column_ < length(grid_col_arr)-1 then
|
||||
begin
|
||||
|
|
@ -120,16 +113,16 @@ Begin
|
|||
end
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdAdjustNone():
|
||||
TSDocxEnumerations.wdAdjustNone():
|
||||
begin
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdAdjustProportional():
|
||||
TSDocxEnumerations.wdAdjustProportional():
|
||||
begin
|
||||
// TODO : 需要搞懂算法
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdAdjustSameWidth():
|
||||
TSDocxEnumerations.wdAdjustSameWidth():
|
||||
begin
|
||||
after_width := grid_col_arr[column_-1][1] - width_value;
|
||||
for i:=column_ to length(grid_col_arr)-1 do
|
||||
|
|
@ -161,7 +154,7 @@ End;
|
|||
Function TSDocxColumn.WritePreferredWidthType(value);
|
||||
Begin
|
||||
case value of
|
||||
class(TSDocxEnumerations).wdPreferredWidthAuto():
|
||||
TSDocxEnumerations.wdPreferredWidthAuto():
|
||||
begin
|
||||
table_.TblPr.Width := 0;
|
||||
table_.TblPr.WidthType := "auto";
|
||||
|
|
@ -170,7 +163,7 @@ Begin
|
|||
SetColumnWidth(c, 0, "auto");
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdPreferredWidthPercent():
|
||||
TSDocxEnumerations.wdPreferredWidthPercent():
|
||||
begin
|
||||
table_.TblPr.Width := 5000;
|
||||
table_.TblPr.WidthType := "pct";
|
||||
|
|
@ -181,7 +174,7 @@ Begin
|
|||
SetColumnWidth(c, width_value, "pct");
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdPreferredWidthPoints():
|
||||
TSDocxEnumerations.wdPreferredWidthPoints():
|
||||
begin
|
||||
for c:=1 to table_.Cols() do
|
||||
SetColumnWidth(c, nil, "dxa");
|
||||
|
|
@ -199,9 +192,9 @@ Begin
|
|||
width_type := obj.Value("Type");
|
||||
tcpr.print;
|
||||
case width_type of
|
||||
"auto": return class(TSDocxEnumerations).wdPreferredWidthAuto();
|
||||
"dxa": return class(TSDocxEnumerations).wdPreferredWidthPoints();
|
||||
"pct": return class(TSDocxEnumerations).wdPreferredWidthPercent();
|
||||
"auto": return TSDocxEnumerations.wdPreferredWidthAuto();
|
||||
"dxa": return TSDocxEnumerations.wdPreferredWidthPoints();
|
||||
"pct": return TSDocxEnumerations.wdPreferredWidthPercent();
|
||||
end;
|
||||
End;
|
||||
|
||||
|
|
@ -210,8 +203,8 @@ Begin
|
|||
width_type := self.PreferredWidthType;
|
||||
width_value := 0;
|
||||
case width_type of
|
||||
class(TSDocxEnumerations).wdPreferredWidthAuto(),
|
||||
class(TSDocxEnumerations).wdPreferredWidthPoints():
|
||||
TSDocxEnumerations.wdPreferredWidthAuto(),
|
||||
TSDocxEnumerations.wdPreferredWidthPoints():
|
||||
begin
|
||||
width_type := "dxa";
|
||||
width_value := 20 * value;
|
||||
|
|
@ -219,7 +212,7 @@ Begin
|
|||
SetColumnWidth(column_, width_value, width_type);
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdPreferredWidthPercent():
|
||||
TSDocxEnumerations.wdPreferredWidthPercent():
|
||||
begin
|
||||
width_type := "pct";
|
||||
if value < 0 or value > 100 then return;
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Type TSDocxColumns = Class
|
||||
Type TSDocxColumns = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, table);
|
||||
Function Init(table);
|
||||
Function Operator[](index);
|
||||
|
||||
private
|
||||
|
|
@ -17,14 +17,11 @@ public
|
|||
Function Select();
|
||||
Function SetWidth(ColumnWidth, RulerStyle);
|
||||
|
||||
property Application read ReadApplication;
|
||||
property Borders read ReadBorders;
|
||||
property Count read ReadCount;
|
||||
property Creator read ReadCreator;
|
||||
property First read ReadFirst;
|
||||
property Last read ReadLast;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Parent read ReadParent;
|
||||
property PreferredWidth read ReadPreferredWidth write WritePreferredWidth;
|
||||
property PreferredWidthType read ReadPreferredWidthType write WritePreferredWidthType;
|
||||
property Shading read ReadShading;
|
||||
|
|
@ -36,27 +33,25 @@ public
|
|||
Function ReadPreferredWidthType();
|
||||
Function WritePreferredWidth(value);
|
||||
Function ReadPreferredWidth();
|
||||
Function ReadParent();
|
||||
Function ReadNestingLevel();
|
||||
Function ReadLast();
|
||||
Function ReadFirst();
|
||||
Function ReadCreator();
|
||||
Function ReadCount();
|
||||
Function ReadBorders();
|
||||
Function ReadApplication();
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxColumns.Create(application, table);
|
||||
Function TSDocxColumns.Init(table);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
End;
|
||||
|
||||
Function Operator TSDocxColumns.[](index);
|
||||
Begin
|
||||
return new TSDocxColumn(application_, table_, index);
|
||||
column_obj := TSDocxColumn(self.Application, self.Creator, self);
|
||||
column_obj.Init(table_, index);
|
||||
return column_obj;
|
||||
End;
|
||||
|
||||
// function
|
||||
|
|
|
|||
|
|
@ -1,15 +1,14 @@
|
|||
Type TSDocxDocument = Class
|
||||
Type TSDocxDocument = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, docx, name, fullname);
|
||||
Function Init();
|
||||
Function Init(docx, name, fullname);
|
||||
|
||||
private
|
||||
application_;
|
||||
docx_;
|
||||
collection_;
|
||||
docx_;
|
||||
file_name_;
|
||||
full_name_;
|
||||
tables_;
|
||||
|
||||
public
|
||||
Function AcceptAllRevisions();
|
||||
|
|
@ -116,7 +115,6 @@ public
|
|||
property ActiveThemeDisplayName read ReadActiveThemeDisplayName;
|
||||
property ActiveWindow read ReadActiveWindow; // TODO
|
||||
property ActiveWritingStyle read ReadActiveWritingStyle write WriteActiveWritingStyle;
|
||||
property Application read ReadApplication;
|
||||
property AttachedTemplate read ReadAttachedTemplate write WriteAttachedTemplate;
|
||||
property AutoFormatOverride read ReadAutoFormatOverride write WriteAutoFormatOverride;
|
||||
property AutoHyphenation read ReadAutoHyphenation write WriteAutoHyphenation;
|
||||
|
|
@ -140,7 +138,6 @@ public
|
|||
property Content read ReadContent;
|
||||
property ContentControls read ReadContentControls;
|
||||
property ContentTypeProperties read ReadContentTypeProperties;
|
||||
property Creator read ReadCreator;
|
||||
property CurrentRsid read ReadCurrentRsid;
|
||||
property CustomTSDocxDocumentProperties read ReadCustomTSDocxDocumentProperties;
|
||||
property CustomXMLParts read ReadCustomXMLParts;
|
||||
|
|
@ -227,7 +224,6 @@ public
|
|||
property OriginalTSDocxDocumentTitle read ReadOriginalTSDocxDocumentTitle;
|
||||
property PageSetup read ReadPageSetup;
|
||||
property Paragraphs read ReadParagraphs;
|
||||
property Parent read ReadParent;
|
||||
property Password write WritePassword;
|
||||
property PasswordEncryptionAlgorithm read ReadPasswordEncryptionAlgorithm;
|
||||
property PasswordEncryptionFileProperties read ReadPasswordEncryptionFileProperties;
|
||||
|
|
@ -408,7 +404,6 @@ public
|
|||
Function ReadPasswordEncryptionFileProperties();
|
||||
Function ReadPasswordEncryptionAlgorithm();
|
||||
Function WritePassword(password);
|
||||
Function ReadParent();
|
||||
Function ReadParagraphs();
|
||||
Function ReadPageSetup();
|
||||
Function ReadOriginalTSDocxDocumentTitle();
|
||||
|
|
@ -542,7 +537,6 @@ public
|
|||
Function ReadCustomXMLParts();
|
||||
Function ReadCustomTSDocxDocumentProperties();
|
||||
Function ReadCurrentRsid();
|
||||
Function ReadCreator();
|
||||
Function ReadContentTypeProperties();
|
||||
Function ReadContentControls();
|
||||
Function ReadContent();
|
||||
|
|
@ -575,32 +569,23 @@ public
|
|||
Function ReadAutoFormatOverride();
|
||||
Function WriteAttachedTemplate();
|
||||
Function ReadAttachedTemplate();
|
||||
Function ReadApplication();
|
||||
Function WriteActiveWritingStyle();
|
||||
Function ReadActiveWritingStyle();
|
||||
Function ReadActiveWindow();
|
||||
Function ReadActiveThemeDisplayName();
|
||||
Function ReadActiveTheme();
|
||||
|
||||
private
|
||||
tables_;
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxDocument.Create(application, docx, name, fullname);
|
||||
Function TSDocxDocument.Init(docx, name, fullname);
|
||||
Begin
|
||||
application_ := application;
|
||||
docx_ := docx;
|
||||
file_name_ := name;
|
||||
full_name_ := fullname;
|
||||
collection_ := class(Collection).GetInstance('document');
|
||||
Init();
|
||||
End;
|
||||
|
||||
Function TSDocxDocument.Init();
|
||||
Begin
|
||||
tables_ := new TSDocxTables(application_, docx_);
|
||||
tables_ := new TSDocxTables(self.Application, self.Parent, self);
|
||||
tables.Init(docx);
|
||||
End;
|
||||
|
||||
// function
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Type TSDocxDocuments = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(app, par, cre);
|
||||
Function Init();
|
||||
Function Operator[](index);
|
||||
Function GetActivation();
|
||||
|
||||
|
|
@ -28,23 +28,22 @@ public
|
|||
Function Save(NoPrompt, OriginalFormat); // Completed
|
||||
|
||||
property Count read ReadCount;
|
||||
property Creator read ReadCreator;
|
||||
Function ReadCount(); // Completed
|
||||
Function ReadCreator();
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxDocuments.Create(app, par, cre);
|
||||
Function TSDocxDocuments.Init();
|
||||
Begin
|
||||
Class(TSVbaBase).Create(app, par, cre);
|
||||
collection_ := class(Collection).GetInstance('document');
|
||||
End;
|
||||
|
||||
Function TSDocxDocuments.AddDocument(docx, fullname);
|
||||
Begin
|
||||
name := ExtractFileName(fullname);
|
||||
collection_.AddCollection(new TSDocxDocument(application_, docx, name, fullname), name);
|
||||
document := new TSDocxDocument(self.Application, self.Creator, self);
|
||||
document.Init(docx, name, fullname);
|
||||
collection_.AddCollection(document, name);
|
||||
End;
|
||||
|
||||
Function Operator TSDocxDocuments.[](index);
|
||||
|
|
|
|||
|
|
@ -1,459 +1,593 @@
|
|||
Type TSDocxEnumerations = Class
|
||||
|
||||
Unit TSDocxEnumerations;
|
||||
Interface
|
||||
// WdSaveOptions enumeration
|
||||
Class Function wdDoNotSaveChanges();
|
||||
Function TEST123();
|
||||
Function wdDoNotSaveChanges();
|
||||
Function wdPromptToSaveChanges();
|
||||
Function wdSaveChanges();
|
||||
|
||||
// WdAutoFitBehavior enumeration
|
||||
Function wdAutoFitContent();
|
||||
Function wdAutoFitFixed();
|
||||
Function wdAutoFitWindow();
|
||||
|
||||
// WdDeleteCells enumeration
|
||||
Function wdDeleteCellsEntireColumn();
|
||||
Function wdDeleteCellsEntireRow();
|
||||
Function wdDeleteCellsShiftLeft();
|
||||
Function wdDeleteCellsShiftUp();
|
||||
|
||||
// WdCellVerticalAlignment
|
||||
Function wdCellAlignVerticalBottom();
|
||||
Function wdCellAlignVerticalCenter();
|
||||
Function wdCellAlignVerticalTop();
|
||||
|
||||
// WdTextureIndex
|
||||
Function wdTexture10Percent();
|
||||
Function wdTexture12Pt5Percent();
|
||||
Function wdTexture15Percent();
|
||||
Function wdTexture17Pt5Percent();
|
||||
Function wdTexture20Percent();
|
||||
Function wdTexture22Pt5Percent();
|
||||
Function wdTexture25Percent();
|
||||
Function wdTexture27Pt5Percent();
|
||||
Function wdTexture2Pt5Percent();
|
||||
Function wdTexture30Percent();
|
||||
Function wdTexture32Pt5Percent();
|
||||
Function wdTexture35Percent();
|
||||
Function wdTexture37Pt5Percent();
|
||||
Function wdTexture40Percent();
|
||||
Function wdTexture42Pt5Percent();
|
||||
Function wdTexture45Percent();
|
||||
Function wdTexture47Pt5Percent();
|
||||
Function wdTexture50Percent();
|
||||
Function wdTexture52Pt5Percent();
|
||||
Function wdTexture55Percent();
|
||||
Function wdTexture57Pt5Percent();
|
||||
Function wdTexture5Percent();
|
||||
Function wdTexture60Percent();
|
||||
Function wdTexture62Pt5Percent();
|
||||
Function wdTexture65Percent();
|
||||
Function wdTexture67Pt5Percent();
|
||||
Function wdTexture70Percent();
|
||||
Function wdTexture72Pt5Percent();
|
||||
Function wdTexture75Percent();
|
||||
Function wdTexture77Pt5Percent();
|
||||
Function wdTexture7Pt5Percent();
|
||||
Function wdTexture80Percent();
|
||||
Function wdTexture82Pt5Percent();
|
||||
Function wdTexture85Percent();
|
||||
Function wdTexture87Pt5Percent();
|
||||
Function wdTexture90Percent();
|
||||
Function wdTexture92Pt5Percent();
|
||||
Function wdTexture95Percent();
|
||||
Function wdTexture97Pt5Percent();
|
||||
Function wdTextureCross();
|
||||
Function wdTextureDarkCross();
|
||||
Function wdTextureDarkDiagonalCross();
|
||||
Function wdTextureDarkDiagonalDown();
|
||||
Function wdTextureDarkDiagonalUp();
|
||||
Function wdTextureDarkHorizontal();
|
||||
Function wdTextureDarkVertical();
|
||||
Function wdTextureDiagonalCross();
|
||||
Function wdTextureDiagonalDown();
|
||||
Function wdTextureDiagonalUp();
|
||||
Function wdTextureHorizontal();
|
||||
Function wdTextureNone();
|
||||
Function wdTextureSolid();
|
||||
Function wdTextureVertical();
|
||||
|
||||
// WdRowHeightRule
|
||||
Function wdRowHeightAtLeast();
|
||||
Function wdRowHeightAuto();
|
||||
Function wdRowHeightExactly();
|
||||
|
||||
// WdBorderType
|
||||
Function wdBorderBottom();
|
||||
Function wdBorderDiagonalDown();
|
||||
Function wdBorderDiagonalUp();
|
||||
Function wdBorderHorizontal();
|
||||
Function wdBorderLeft();
|
||||
Function wdBorderRight();
|
||||
Function wdBorderTop();
|
||||
Function wdBorderVertical();
|
||||
|
||||
// WdLineStyle
|
||||
Function wdLineStyleDashDot();
|
||||
Function wdLineStyleDashDotDot();
|
||||
Function wdLineStyleDashDotStroked();
|
||||
Function wdLineStyleDashLargeGap();
|
||||
Function wdLineStyleDashSmallGap();
|
||||
Function wdLineStyleDot();
|
||||
Function wdLineStyleDouble();
|
||||
Function wdLineStyleDoubleWavy();
|
||||
Function wdLineStyleEmboss3D();
|
||||
Function wdLineStyleEngrave3D();
|
||||
Function wdLineStyleInset();
|
||||
Function wdLineStyleNone();
|
||||
Function wdLineStyleOutset();
|
||||
Function wdLineStyleSingle();
|
||||
Function wdLineStyleSingleWavy();
|
||||
Function wdLineStyleThickThinLargeGap();
|
||||
Function wdLineStyleThickThinMedGap();
|
||||
Function wdLineStyleThickThinSmallGap();
|
||||
Function wdLineStyleThinThickLargeGap();
|
||||
Function wdLineStyleThinThickMedGap();
|
||||
Function wdLineStyleThinThickSmallGap();
|
||||
Function wdLineStyleThinThickThinLargeGap();
|
||||
Function wdLineStyleThinThickThinMedGap();
|
||||
Function wdLineStyleThinThickThinSmallGap();
|
||||
Function wdLineStyleTriple();
|
||||
|
||||
// WdRulerStyle
|
||||
Function wdAdjustFirstColumn();
|
||||
Function wdAdjustNone();
|
||||
Function wdAdjustProportional();
|
||||
Function wdAdjustSameWidth();
|
||||
|
||||
// WdPreferredWidthType
|
||||
Function wdPreferredWidthAuto();
|
||||
Function wdPreferredWidthPercent();
|
||||
Function wdPreferredWidthPoints();
|
||||
|
||||
Implementation
|
||||
Function wdDoNotSaveChanges();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
Class Function wdPromptToSaveChanges();
|
||||
Function wdPromptToSaveChanges();
|
||||
Begin
|
||||
return -2;
|
||||
End;
|
||||
Class Function wdSaveChanges();
|
||||
Function wdSaveChanges();
|
||||
Begin
|
||||
return -1;
|
||||
End;
|
||||
|
||||
// WdAutoFitBehavior enumeration
|
||||
Class Function wdAutoFitContent();
|
||||
Function wdAutoFitContent();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdAutoFitFixed();
|
||||
Function wdAutoFitFixed();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
Class Function wdAutoFitWindow();
|
||||
Function wdAutoFitWindow();
|
||||
Begin
|
||||
return 2;
|
||||
End;
|
||||
|
||||
// WdDeleteCells enumeration
|
||||
Class Function wdDeleteCellsEntireColumn();
|
||||
Function wdDeleteCellsEntireColumn();
|
||||
Begin
|
||||
return 3;
|
||||
End;
|
||||
Class Function wdDeleteCellsEntireRow();
|
||||
Function wdDeleteCellsEntireRow();
|
||||
Begin
|
||||
return 2;
|
||||
End;
|
||||
Class Function wdDeleteCellsShiftLeft();
|
||||
Function wdDeleteCellsShiftLeft();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdDeleteCellsShiftUp();
|
||||
Function wdDeleteCellsShiftUp();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
|
||||
// WdCellVerticalAlignment
|
||||
Class Function wdCellAlignVerticalBottom();
|
||||
Function wdCellAlignVerticalBottom();
|
||||
Begin
|
||||
return 3;
|
||||
End;
|
||||
Class Function wdCellAlignVerticalCenter();
|
||||
Function wdCellAlignVerticalCenter();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdCellAlignVerticalTop();
|
||||
Function wdCellAlignVerticalTop();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
|
||||
// WdTextureIndex
|
||||
Class Function wdTexture10Percent();
|
||||
Function wdTexture10Percent();
|
||||
Begin
|
||||
return 100;
|
||||
End;
|
||||
Class Function wdTexture12Pt5Percent();
|
||||
Function wdTexture12Pt5Percent();
|
||||
Begin
|
||||
return 125;
|
||||
End;
|
||||
Class Function wdTexture15Percent();
|
||||
Function wdTexture15Percent();
|
||||
Begin
|
||||
return 150;
|
||||
End;
|
||||
Class Function wdTexture17Pt5Percent();
|
||||
Function wdTexture17Pt5Percent();
|
||||
Begin
|
||||
return 175;
|
||||
End;
|
||||
Class Function wdTexture20Percent();
|
||||
Function wdTexture20Percent();
|
||||
Begin
|
||||
return 200;
|
||||
End;
|
||||
Class Function wdTexture22Pt5Percent();
|
||||
Function wdTexture22Pt5Percent();
|
||||
Begin
|
||||
return 225;
|
||||
End;
|
||||
Class Function wdTexture25Percent();
|
||||
Function wdTexture25Percent();
|
||||
Begin
|
||||
return 250;
|
||||
End;
|
||||
Class Function wdTexture27Pt5Percent();
|
||||
Function wdTexture27Pt5Percent();
|
||||
Begin
|
||||
return 275;
|
||||
End;
|
||||
Class Function wdTexture2Pt5Percent();
|
||||
Function wdTexture2Pt5Percent();
|
||||
Begin
|
||||
return 25;
|
||||
End;
|
||||
Class Function wdTexture30Percent();
|
||||
Function wdTexture30Percent();
|
||||
Begin
|
||||
return 300;
|
||||
End;
|
||||
Class Function wdTexture32Pt5Percent();
|
||||
Function wdTexture32Pt5Percent();
|
||||
Begin
|
||||
return 325;
|
||||
End;
|
||||
Class Function wdTexture35Percent();
|
||||
Function wdTexture35Percent();
|
||||
Begin
|
||||
return 350;
|
||||
End;
|
||||
Class Function wdTexture37Pt5Percent();
|
||||
Function wdTexture37Pt5Percent();
|
||||
Begin
|
||||
return 375;
|
||||
End;
|
||||
Class Function wdTexture40Percent();
|
||||
Function wdTexture40Percent();
|
||||
Begin
|
||||
return 400;
|
||||
End;
|
||||
Class Function wdTexture42Pt5Percent();
|
||||
Function wdTexture42Pt5Percent();
|
||||
Begin
|
||||
return 425;
|
||||
End;
|
||||
Class Function wdTexture45Percent();
|
||||
Function wdTexture45Percent();
|
||||
Begin
|
||||
return 450;
|
||||
End;
|
||||
Class Function wdTexture47Pt5Percent();
|
||||
Function wdTexture47Pt5Percent();
|
||||
Begin
|
||||
return 475;
|
||||
End;
|
||||
Class Function wdTexture50Percent();
|
||||
Function wdTexture50Percent();
|
||||
Begin
|
||||
return 500;
|
||||
End;
|
||||
Class Function wdTexture52Pt5Percent();
|
||||
Function wdTexture52Pt5Percent();
|
||||
Begin
|
||||
return 525;
|
||||
End;
|
||||
Class Function wdTexture55Percent();
|
||||
Function wdTexture55Percent();
|
||||
Begin
|
||||
return 550;
|
||||
End;
|
||||
Class Function wdTexture57Pt5Percent();
|
||||
Function wdTexture57Pt5Percent();
|
||||
Begin
|
||||
return 575;
|
||||
End;
|
||||
Class Function wdTexture5Percent();
|
||||
Function wdTexture5Percent();
|
||||
Begin
|
||||
return 50;
|
||||
End;
|
||||
Class Function wdTexture60Percent();
|
||||
Function wdTexture60Percent();
|
||||
Begin
|
||||
return 600;
|
||||
End;
|
||||
Class Function wdTexture62Pt5Percent();
|
||||
Function wdTexture62Pt5Percent();
|
||||
Begin
|
||||
return 625;
|
||||
End;
|
||||
Class Function wdTexture65Percent();
|
||||
Function wdTexture65Percent();
|
||||
Begin
|
||||
return 650;
|
||||
End;
|
||||
Class Function wdTexture67Pt5Percent();
|
||||
Function wdTexture67Pt5Percent();
|
||||
Begin
|
||||
return 675;
|
||||
End;
|
||||
Class Function wdTexture70Percent();
|
||||
Function wdTexture70Percent();
|
||||
Begin
|
||||
return 700;
|
||||
End;
|
||||
Class Function wdTexture72Pt5Percent();
|
||||
Function wdTexture72Pt5Percent();
|
||||
Begin
|
||||
return 725;
|
||||
End;
|
||||
Class Function wdTexture75Percent();
|
||||
Function wdTexture75Percent();
|
||||
Begin
|
||||
return 750;
|
||||
End;
|
||||
Class Function wdTexture77Pt5Percent();
|
||||
Function wdTexture77Pt5Percent();
|
||||
Begin
|
||||
return 775;
|
||||
End;
|
||||
Class Function wdTexture7Pt5Percent();
|
||||
Function wdTexture7Pt5Percent();
|
||||
Begin
|
||||
return 75;
|
||||
End;
|
||||
Class Function wdTexture80Percent();
|
||||
Function wdTexture80Percent();
|
||||
Begin
|
||||
return 800;
|
||||
End;
|
||||
Class Function wdTexture82Pt5Percent();
|
||||
Function wdTexture82Pt5Percent();
|
||||
Begin
|
||||
return 825;
|
||||
End;
|
||||
Class Function wdTexture85Percent();
|
||||
Function wdTexture85Percent();
|
||||
Begin
|
||||
return 850;
|
||||
End;
|
||||
Class Function wdTexture87Pt5Percent();
|
||||
Function wdTexture87Pt5Percent();
|
||||
Begin
|
||||
return 875;
|
||||
End;
|
||||
Class Function wdTexture90Percent();
|
||||
Function wdTexture90Percent();
|
||||
Begin
|
||||
return 900;
|
||||
End;
|
||||
Class Function wdTexture92Pt5Percent();
|
||||
Function wdTexture92Pt5Percent();
|
||||
Begin
|
||||
return 925;
|
||||
End;
|
||||
Class Function wdTexture95Percent();
|
||||
Function wdTexture95Percent();
|
||||
Begin
|
||||
return 950;
|
||||
End;
|
||||
Class Function wdTexture97Pt5Percent();
|
||||
Function wdTexture97Pt5Percent();
|
||||
Begin
|
||||
return 975;
|
||||
End;
|
||||
Class Function wdTextureCross();
|
||||
Function wdTextureCross();
|
||||
Begin
|
||||
return -11;
|
||||
End;
|
||||
Class Function wdTextureDarkCross();
|
||||
Function wdTextureDarkCross();
|
||||
Begin
|
||||
return -5;
|
||||
End;
|
||||
Class Function wdTextureDarkDiagonalCross();
|
||||
Function wdTextureDarkDiagonalCross();
|
||||
Begin
|
||||
return -6;
|
||||
End;
|
||||
Class Function wdTextureDarkDiagonalDown();
|
||||
Function wdTextureDarkDiagonalDown();
|
||||
Begin
|
||||
return -3;
|
||||
End;
|
||||
Class Function wdTextureDarkDiagonalUp();
|
||||
Function wdTextureDarkDiagonalUp();
|
||||
Begin
|
||||
return -4;
|
||||
End;
|
||||
Class Function wdTextureDarkHorizontal();
|
||||
Function wdTextureDarkHorizontal();
|
||||
Begin
|
||||
return -1;
|
||||
End;
|
||||
Class Function wdTextureDarkVertical();
|
||||
Function wdTextureDarkVertical();
|
||||
Begin
|
||||
return -2;
|
||||
End;
|
||||
Class Function wdTextureDiagonalCross();
|
||||
Function wdTextureDiagonalCross();
|
||||
Begin
|
||||
return -12;
|
||||
End;
|
||||
Class Function wdTextureDiagonalDown();
|
||||
Function wdTextureDiagonalDown();
|
||||
Begin
|
||||
return -9;
|
||||
End;
|
||||
Class Function wdTextureDiagonalUp();
|
||||
Function wdTextureDiagonalUp();
|
||||
Begin
|
||||
return -10;
|
||||
End;
|
||||
Class Function wdTextureHorizontal();
|
||||
Function wdTextureHorizontal();
|
||||
Begin
|
||||
return -7;
|
||||
End;
|
||||
Class Function wdTextureNone();
|
||||
Function wdTextureNone();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
Class Function wdTextureSolid();
|
||||
Function wdTextureSolid();
|
||||
Begin
|
||||
return 1000;
|
||||
End;
|
||||
Class Function wdTextureVertical();
|
||||
Function wdTextureVertical();
|
||||
Begin
|
||||
return -8;
|
||||
End;
|
||||
|
||||
// WdRowHeightRule
|
||||
Class Function wdRowHeightAtLeast();
|
||||
Function wdRowHeightAtLeast();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdRowHeightAuto();
|
||||
Function wdRowHeightAuto();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
Class Function wdRowHeightExactly();
|
||||
Function wdRowHeightExactly();
|
||||
Begin
|
||||
return 2;
|
||||
End;
|
||||
|
||||
// WdBorderType
|
||||
Class Function wdBorderBottom();
|
||||
Function wdBorderBottom();
|
||||
Begin
|
||||
return -3;
|
||||
End;
|
||||
Class Function wdBorderDiagonalDown();
|
||||
Function wdBorderDiagonalDown();
|
||||
Begin
|
||||
return -7;
|
||||
End;
|
||||
Class Function wdBorderDiagonalUp();
|
||||
Function wdBorderDiagonalUp();
|
||||
Begin
|
||||
return -8;
|
||||
End;
|
||||
Class Function wdBorderHorizontal();
|
||||
Function wdBorderHorizontal();
|
||||
Begin
|
||||
return -5;
|
||||
End;
|
||||
Class Function wdBorderLeft();
|
||||
Function wdBorderLeft();
|
||||
Begin
|
||||
return -2;
|
||||
End;
|
||||
Class Function wdBorderRight();
|
||||
Function wdBorderRight();
|
||||
Begin
|
||||
return -4;
|
||||
End;
|
||||
Class Function wdBorderTop();
|
||||
Function wdBorderTop();
|
||||
Begin
|
||||
return -1;
|
||||
End;
|
||||
Class Function wdBorderVertical();
|
||||
Function wdBorderVertical();
|
||||
Begin
|
||||
return -6;
|
||||
End;
|
||||
|
||||
// WdLineStyle
|
||||
Class Function wdLineStyleDashDot();
|
||||
Function wdLineStyleDashDot();
|
||||
Begin
|
||||
return 5;
|
||||
End;
|
||||
Class Function wdLineStyleDashDotDot();
|
||||
Function wdLineStyleDashDotDot();
|
||||
Begin
|
||||
return 6;
|
||||
End;
|
||||
Class Function wdLineStyleDashDotStroked();
|
||||
Function wdLineStyleDashDotStroked();
|
||||
Begin
|
||||
return 20;
|
||||
End;
|
||||
Class Function wdLineStyleDashLargeGap();
|
||||
Function wdLineStyleDashLargeGap();
|
||||
Begin
|
||||
return 4;
|
||||
End;
|
||||
Class Function wdLineStyleDashSmallGap();
|
||||
Function wdLineStyleDashSmallGap();
|
||||
Begin
|
||||
return 3;
|
||||
End;
|
||||
Class Function wdLineStyleDot();
|
||||
Function wdLineStyleDot();
|
||||
Begin
|
||||
return 2;
|
||||
End;
|
||||
Class Function wdLineStyleDouble();
|
||||
Function wdLineStyleDouble();
|
||||
Begin
|
||||
return 7;
|
||||
End;
|
||||
Class Function wdLineStyleDoubleWavy();
|
||||
Function wdLineStyleDoubleWavy();
|
||||
Begin
|
||||
return 19;
|
||||
End;
|
||||
Class Function wdLineStyleEmboss3D();
|
||||
Function wdLineStyleEmboss3D();
|
||||
Begin
|
||||
return 21;
|
||||
End;
|
||||
Class Function wdLineStyleEngrave3D();
|
||||
Function wdLineStyleEngrave3D();
|
||||
Begin
|
||||
return 22;
|
||||
End;
|
||||
Class Function wdLineStyleInset();
|
||||
Function wdLineStyleInset();
|
||||
Begin
|
||||
return 24;
|
||||
End;
|
||||
Class Function wdLineStyleNone();
|
||||
Function wdLineStyleNone();
|
||||
Begin
|
||||
return 0;
|
||||
End;
|
||||
Class Function wdLineStyleOutset();
|
||||
Function wdLineStyleOutset();
|
||||
Begin
|
||||
return 23;
|
||||
End;
|
||||
Class Function wdLineStyleSingle();
|
||||
Function wdLineStyleSingle();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdLineStyleSingleWavy();
|
||||
Function wdLineStyleSingleWavy();
|
||||
Begin
|
||||
return 18;
|
||||
End;
|
||||
Class Function wdLineStyleThickThinLargeGap();
|
||||
Function wdLineStyleThickThinLargeGap();
|
||||
Begin
|
||||
return 16;
|
||||
End;
|
||||
Class Function wdLineStyleThickThinMedGap();
|
||||
Function wdLineStyleThickThinMedGap();
|
||||
Begin
|
||||
return 13;
|
||||
End;
|
||||
Class Function wdLineStyleThickThinSmallGap();
|
||||
Function wdLineStyleThickThinSmallGap();
|
||||
Begin
|
||||
return 10;
|
||||
End;
|
||||
Class Function wdLineStyleThinThickLargeGap();
|
||||
Function wdLineStyleThinThickLargeGap();
|
||||
Begin
|
||||
return 15;
|
||||
End;
|
||||
Class Function wdLineStyleThinThickMedGap();
|
||||
Function wdLineStyleThinThickMedGap();
|
||||
Begin
|
||||
return 12;
|
||||
End;
|
||||
Class Function wdLineStyleThinThickSmallGap();
|
||||
Function wdLineStyleThinThickSmallGap();
|
||||
Begin
|
||||
return 9;
|
||||
End;
|
||||
Class Function wdLineStyleThinThickThinLargeGap();
|
||||
Function wdLineStyleThinThickThinLargeGap();
|
||||
Begin
|
||||
return 17;
|
||||
End;
|
||||
Class Function wdLineStyleThinThickThinMedGap();
|
||||
Function wdLineStyleThinThickThinMedGap();
|
||||
Begin
|
||||
return 14;
|
||||
End;
|
||||
Class Function wdLineStyleThinThickThinSmallGap();
|
||||
Function wdLineStyleThinThickThinSmallGap();
|
||||
Begin
|
||||
return 11;
|
||||
End;
|
||||
Class Function wdLineStyleTriple();
|
||||
Function wdLineStyleTriple();
|
||||
Begin
|
||||
return 8;
|
||||
End;
|
||||
|
||||
// WdRulerStyle
|
||||
Class Function wdAdjustFirstColumn();
|
||||
Function wdAdjustFirstColumn();
|
||||
Begin
|
||||
return 2;
|
||||
End;
|
||||
Class Function wdAdjustNone();
|
||||
Function wdAdjustNone();
|
||||
Begin
|
||||
return 0;
|
||||
return 11111111110;
|
||||
End;
|
||||
Class Function wdAdjustProportional();
|
||||
Function wdAdjustProportional();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdAdjustSameWidth();
|
||||
Function wdAdjustSameWidth();
|
||||
Begin
|
||||
return 3;
|
||||
End;
|
||||
|
||||
// WdPreferredWidthType
|
||||
Class Function wdPreferredWidthAuto();
|
||||
Function wdPreferredWidthAuto();
|
||||
Begin
|
||||
return 1;
|
||||
End;
|
||||
Class Function wdPreferredWidthPercent();
|
||||
Function wdPreferredWidthPercent();
|
||||
Begin
|
||||
return 2;
|
||||
End;
|
||||
Class Function wdPreferredWidthPoints();
|
||||
Function wdPreferredWidthPoints();
|
||||
Begin
|
||||
return 3;
|
||||
End;
|
||||
|
||||
Function TEST123();
|
||||
Begin
|
||||
println("123");
|
||||
End;
|
||||
End.
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,9 @@
|
|||
Type TSDocxRow = Class
|
||||
Type TSDocxRow = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, table, row);
|
||||
Function Init(table, row);
|
||||
|
||||
private
|
||||
application_;
|
||||
table_;
|
||||
row_;
|
||||
|
||||
|
|
@ -17,10 +16,8 @@ public
|
|||
|
||||
property Alignment read ReadAlignment write WriteAlignment;
|
||||
property AllowBreakAcrossPages read ReadAllowBreakAcrossPages write WriteAllowBreakAcrossPages;
|
||||
property Application read ReadApplication;
|
||||
property Borders read ReadBorders;
|
||||
property Cells read ReadCells;
|
||||
property Creator read ReadCreator;
|
||||
property HeadingFormat read ReadHeadingFormat write WriteHeadingFormat;
|
||||
property Height read ReadHeight write WriteHeight;
|
||||
property HeightRule read ReadHeightRule write WriteHeightRule;
|
||||
|
|
@ -31,7 +28,6 @@ public
|
|||
property LeftIndent read ReadLeftIndent write WriteLeftIndent;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Next read ReadNext;
|
||||
property Parent read ReadParent;
|
||||
property Previous read ReadPrevious;
|
||||
property Range read ReadRange;
|
||||
property Shading read ReadShading;
|
||||
|
|
@ -41,7 +37,6 @@ public
|
|||
Function ReadShading();
|
||||
Function ReadRange();
|
||||
Function ReadPrevious();
|
||||
Function ReadParent();
|
||||
Function ReadNext();
|
||||
Function ReadNestingLevel();
|
||||
Function WriteLeftIndent();
|
||||
|
|
@ -57,10 +52,8 @@ public
|
|||
Function ReadHeight();
|
||||
Function WriteHeadingFormat();
|
||||
Function ReadHeadingFormat();
|
||||
Function ReadCreator();
|
||||
Function ReadCells();
|
||||
Function ReadBorders();
|
||||
Function ReadApplication();
|
||||
Function WriteAllowBreakAcrossPages();
|
||||
Function ReadAllowBreakAcrossPages();
|
||||
Function WriteAlignment();
|
||||
|
|
@ -69,9 +62,8 @@ public
|
|||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxRow.Create(application, table, row);
|
||||
Function TSDocxRow.Init(table, row);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
row_ := row;
|
||||
End;
|
||||
|
|
@ -89,15 +81,15 @@ End;
|
|||
Function TSDocxRow.SetHeight(RowHeight, HeightRule);
|
||||
Begin
|
||||
case HeightRule of
|
||||
class(TSDocxEnumerations).wdRowHeightAtLeast:
|
||||
TSDocxEnumerations.wdRowHeightAtLeast:
|
||||
begin
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdRowHeightAuto:
|
||||
TSDocxEnumerations.wdRowHeightAuto:
|
||||
begin
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdRowHeightExactly:
|
||||
TSDocxEnumerations.wdRowHeightExactly:
|
||||
begin
|
||||
end
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
Type TSDocxRows = Class
|
||||
Type TSDocxRows = Class(TSVbaBase)
|
||||
Uses TSDocxEnumerations;
|
||||
|
||||
public
|
||||
Function Create(application, table);
|
||||
Function Init(table);
|
||||
Function Operator[](index);
|
||||
|
||||
private
|
||||
application_;
|
||||
table_;
|
||||
|
||||
public
|
||||
|
|
@ -21,10 +21,8 @@ public
|
|||
property Alignment read ReadAlignment write WriteAlignment;
|
||||
property AllowBreakAcrossPages read ReadAllowBreakAcrossPages write WriteAllowBreakAcrossPages;
|
||||
property AllowOverlap read ReadAllowOverlap write WriteAllowOverlap;
|
||||
property Application read ReadApplication;
|
||||
property Borders read ReadBorders;
|
||||
property Count read ReadCount;
|
||||
property Creator read ReadCreator;
|
||||
property DistanceBottom read ReadDistanceBottom write WriteDistanceBottom;
|
||||
property DistanceLeft read ReadDistanceLeft write WriteDistanceLeft;
|
||||
property DistanceRight read ReadDistanceRight write WriteDistanceRight;
|
||||
|
|
@ -37,7 +35,6 @@ public
|
|||
property Last read ReadLast;
|
||||
property LeftIndent read ReadLeftIndent write WriteLeftIndent;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Parent read ReadParent;
|
||||
property RelativeHorizontalPosition read ReadRelativeHorizontalPosition write WriteRelativeHorizontalPosition;
|
||||
property RelativeVerticalPosition read ReadRelativeVerticalPosition write WriteRelativeVerticalPosition;
|
||||
property Shading read ReadShading;
|
||||
|
|
@ -57,7 +54,6 @@ public
|
|||
Function ReadRelativeVerticalPosition();
|
||||
Function WriteRelativeHorizontalPosition();
|
||||
Function ReadRelativeHorizontalPosition();
|
||||
Function ReadParent();
|
||||
Function ReadNestingLevel();
|
||||
Function WriteLeftIndent();
|
||||
Function ReadLeftIndent();
|
||||
|
|
@ -79,10 +75,8 @@ public
|
|||
Function ReadDistanceLeft();
|
||||
Function WriteDistanceBottom();
|
||||
Function ReadDistanceBottom();
|
||||
Function ReadCreator();
|
||||
Function ReadCount();
|
||||
Function ReadBorders();
|
||||
Function ReadApplication();
|
||||
Function WriteAllowOverlap();
|
||||
Function ReadAllowOverlap();
|
||||
Function WriteAllowBreakAcrossPages();
|
||||
|
|
@ -93,15 +87,16 @@ public
|
|||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxRows.Create(application, table);
|
||||
Function TSDocxRows.Init(table);
|
||||
Begin
|
||||
application_ := application;
|
||||
table_ := table;
|
||||
End;
|
||||
|
||||
Function Operator TSDocxRows.[](index);
|
||||
Begin
|
||||
return new TSDocxRow(application_, table_, Index);
|
||||
row_obj := new TSDocxRow(self.Application, self.Creator, self);
|
||||
row_obj.Init(table_, index);
|
||||
return row_obj;
|
||||
End;
|
||||
|
||||
// function
|
||||
|
|
@ -117,15 +112,15 @@ End;
|
|||
Function TSDocxRows.SetHeight(RowHeight, HeightRule);
|
||||
Begin
|
||||
case HeightRule of
|
||||
class(TSDocxEnumerations).wdRowHeightAtLeast:
|
||||
TSDocxEnumerations.wdRowHeightAtLeast:
|
||||
begin
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdRowHeightAuto:
|
||||
TSDocxEnumerations.wdRowHeightAuto:
|
||||
begin
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdRowHeightExactly:
|
||||
TSDocxEnumerations.wdRowHeightExactly:
|
||||
begin
|
||||
end
|
||||
end;
|
||||
|
|
|
|||
|
|
@ -1,42 +1,34 @@
|
|||
Type TSDocxShading = Class
|
||||
Type TSDocxShading = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, pr);
|
||||
Function Init(pr);
|
||||
|
||||
private
|
||||
application_;
|
||||
pr_; // xxPr对象,比如Cell: tr.tcPr,或Paragraph: p.pPr
|
||||
|
||||
public
|
||||
property Application read ReadApplication;
|
||||
property BackgroundPatternColor read ReadBackgroundPatternColor write WriteBackgroundPatternColor;
|
||||
property BackgroundPatternColorIndex read ReadBackgroundPatternColorIndex write WriteBackgroundPatternColorIndex;
|
||||
property Creator read ReadCreator;
|
||||
property ForegroundPatternColor read ReadForegroundPatternColor write WriteForegroundPatternColor;
|
||||
property ForegroundPatternColorIndex read ReadForegroundPatternColorIndex write WriteForegroundPatternColorIndex;
|
||||
property Parent read ReadParent;
|
||||
property Texture read ReadTexture write WriteTexture;
|
||||
Function WriteTexture(texture);
|
||||
Function ReadTexture();
|
||||
Function ReadParent();
|
||||
Function WriteForegroundPatternColorIndex();
|
||||
Function ReadForegroundPatternColorIndex();
|
||||
Function WriteForegroundPatternColor();
|
||||
Function ReadForegroundPatternColor();
|
||||
Function ReadCreator();
|
||||
Function WriteBackgroundPatternColorIndex();
|
||||
Function ReadBackgroundPatternColorIndex();
|
||||
Function WriteBackgroundPatternColor();
|
||||
Function ReadBackgroundPatternColor();
|
||||
Function ReadApplication();
|
||||
|
||||
End;
|
||||
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxShading.Create(application, pr);
|
||||
Function TSDocxShading.Init(application, pr);
|
||||
Begin
|
||||
application_ := application;
|
||||
pr_ := pr;
|
||||
End;
|
||||
|
||||
|
|
@ -44,7 +36,7 @@ End;
|
|||
Function TSDocxShading.WriteTexture(texture);
|
||||
Begin
|
||||
case texture of
|
||||
class(TSDocxEnumerations).wdTextureHorizontal():
|
||||
TSDocxEnumerations.wdTextureHorizontal():
|
||||
begin
|
||||
pr_.Shading.Val := "thinHorzStripe";
|
||||
pr_.Update();
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
Type TSDocxTable = Class
|
||||
Type TSDocxTable = Class(TSVbaBase)
|
||||
Uses TSDocxEnumerations;
|
||||
|
||||
public
|
||||
Function Create(application, docx, table);
|
||||
Function Init(docx, table);
|
||||
|
||||
private
|
||||
application_;
|
||||
docx_;
|
||||
table_; // TOfficeObj('TTable') 对象
|
||||
|
||||
|
|
@ -23,7 +23,6 @@ public
|
|||
Function UpdateAutoFormat();
|
||||
|
||||
property AllowAutoFit read ReadAllowAutoFit write WriteAllowAutoFit;
|
||||
property Application read ReadApplication;
|
||||
property ApplyStyleColumnBands read ReadApplyStyleColumnBands write WriteApplyStyleColumnBands;
|
||||
property ApplyStyleFirstColumn read ReadApplyStyleFirstColumn write WriteApplyStyleFirstColumn;
|
||||
property ApplyStyleHeadingRows read ReadApplyStyleHeadingRows write WriteApplyStyleHeadingRows;
|
||||
|
|
@ -34,12 +33,10 @@ public
|
|||
property Borders read ReadBorders;
|
||||
property BottomPadding read ReadBottomPadding write WriteBottomPadding;
|
||||
property Columns read ReadColumns;
|
||||
property Creator read ReadCreator;
|
||||
property Descr read ReadDescr write WriteDescr;
|
||||
property ID read ReadID write WriteID;
|
||||
property LeftPadding read ReadLeftPadding write WriteLeftPadding;
|
||||
property NestingLevel read ReadNestingLevel;
|
||||
property Parent read ReadParent;
|
||||
property PreferredWidth read ReadPreferredWidth write WritePreferredWidth;
|
||||
property PreferredWidthType read ReadPreferredWidthType write WritePreferredWidthType;
|
||||
property Range read ReadRange;
|
||||
|
|
@ -74,7 +71,6 @@ public
|
|||
Function ReadPreferredWidthType();
|
||||
Function WritePreferredWidth(value);
|
||||
Function ReadPreferredWidth();
|
||||
Function ReadParent();
|
||||
Function ReadNestingLevel();
|
||||
Function WriteLeftPadding();
|
||||
Function ReadLeftPadding();
|
||||
|
|
@ -82,7 +78,6 @@ public
|
|||
Function ReadID();
|
||||
Function WriteDescr();
|
||||
Function ReadDescr();
|
||||
Function ReadCreator();
|
||||
Function ReadColumns(index);
|
||||
Function WriteBottomPadding();
|
||||
Function ReadBottomPadding();
|
||||
|
|
@ -100,16 +95,14 @@ public
|
|||
Function ReadApplyStyleFirstColumn();
|
||||
Function WriteApplyStyleColumnBands();
|
||||
Function ReadApplyStyleColumnBands();
|
||||
Function ReadApplication();
|
||||
Function WriteAllowAutoFit();
|
||||
Function ReadAllowAutoFit();
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSDocxTable.Create(application, docx, table);
|
||||
Function TSDocxTable.Init(docx, table);
|
||||
Begin
|
||||
application_ := application;
|
||||
docx_ := docx;
|
||||
table_ := table;
|
||||
End;
|
||||
|
|
@ -126,7 +119,7 @@ Begin
|
|||
// TODO : 这里应该使用递归去处理每个单元格
|
||||
// TODO : 等cell方法完善
|
||||
case Behavior of
|
||||
class(TSDocxEnumerations).wdAutoFitContent():
|
||||
TSDocxEnumerations.wdAutoFitContent():
|
||||
begin
|
||||
table_.TblPr.WidthType := "auto";
|
||||
table_.TblPr.Width := 0;
|
||||
|
|
@ -145,11 +138,11 @@ Begin
|
|||
end
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdAutoFitFixed():
|
||||
TSDocxEnumerations.wdAutoFitFixed():
|
||||
begin
|
||||
end
|
||||
|
||||
class(TSDocxEnumerations).wdAutoFitWindow():
|
||||
TSDocxEnumerations.wdAutoFitWindow():
|
||||
begin
|
||||
table_.TblPr.WidthType := "pct";
|
||||
table_.TblPr.Width := 5000;
|
||||
|
|
@ -160,25 +153,30 @@ End;
|
|||
|
||||
Function TSDocxTable.Cell(Row, Column);
|
||||
Begin
|
||||
return new TSDocxCell(application_, table_, Row, Column);
|
||||
cell_obj := new TSDocxCell(self.Application, self.Creator, self);
|
||||
cell_obj.Init(table_, Row, Column);
|
||||
return cell_obj;
|
||||
End;
|
||||
|
||||
// property
|
||||
Function TSDocxTable.ReadBorders(index);
|
||||
Begin
|
||||
borders_obj := new TSDocxBordersTable(application_, table_);
|
||||
borders_obj := new TSDocxBordersTable(self.Application, self.Creator, self);
|
||||
borders_obj.Init(table_);
|
||||
return ifnil(index) ? borders_obj : borders_obj[index];
|
||||
End;
|
||||
|
||||
Function TSDocxTable.ReadColumns(index);
|
||||
Begin
|
||||
columns_obj := new TSDocxColumns(application_, table_);
|
||||
columns_obj := new TSDocxColumns(self.Application, self.Creator, self);
|
||||
columns_obj.Init(table);
|
||||
return ifnil(index) ? columns_obj : columns_obj[index];
|
||||
End;
|
||||
|
||||
Function TSDocxTable.ReadRows(index);
|
||||
Begin
|
||||
rows_obj := new TSDocxRows(application_, table_);
|
||||
rows_obj := new TSDocxRows(self.Application, self.Creator, self);
|
||||
rows_obj.Init(table_);
|
||||
return ifnil(index) ? rows_obj : rows_obj[index];
|
||||
End;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,47 +1,35 @@
|
|||
Type TSDocxTables = Class
|
||||
Type TSDocxTables = Class(TSVbaBase)
|
||||
|
||||
public
|
||||
Function Create(application, docx);
|
||||
Function Init();
|
||||
Function Init(docx);
|
||||
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);
|
||||
Function TSDocxTables.Init(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;
|
||||
table_obj := new TSDocxTable(self.Application, self.Creator, self);
|
||||
table_obj.Init(docx_, table);
|
||||
return table_obj;
|
||||
End;
|
||||
|
||||
// function
|
||||
|
|
|
|||
|
|
@ -1,13 +1,14 @@
|
|||
Type TSVbaBase = class
|
||||
|
||||
public
|
||||
Function Create(app, par, cre);
|
||||
Function Create(app, cre, par);
|
||||
|
||||
private
|
||||
application_;
|
||||
parent_;
|
||||
creator_;
|
||||
parent_;
|
||||
|
||||
public
|
||||
property Application read ReadApplication;
|
||||
property Parent read ReadParent;
|
||||
property Creator read ReadCreator;
|
||||
|
|
@ -18,11 +19,11 @@ private
|
|||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function TSVbaBase.Create(app, par, cre);
|
||||
Function TSVbaBase.Create(app, cre, par);
|
||||
Begin
|
||||
application_ := app;
|
||||
parent_ := par;
|
||||
creator_ := cre;
|
||||
parent_ := par;
|
||||
End;
|
||||
|
||||
// property
|
||||
|
|
|
|||
Loading…
Reference in New Issue