新增父类TSVbaBase调整前
This commit is contained in:
+2
-2
@@ -398,12 +398,12 @@ End;
|
||||
Function Workbook.ReadWorkSheets(index);
|
||||
Begin
|
||||
if ifnil(index) then return worksheets_;
|
||||
return worksheets_.worksheet(index);
|
||||
return worksheets_[index];
|
||||
End;
|
||||
|
||||
Function Workbook.ReadActiveSheet();
|
||||
Begin
|
||||
return worksheets_.GetCollection().GetActivate();
|
||||
return worksheets_.GetCollection().GetActivation();
|
||||
End;
|
||||
|
||||
Function Workbook.ReadFullName();
|
||||
|
||||
+10
-9
@@ -4,6 +4,9 @@ public
|
||||
Function Create();
|
||||
Function Operator[](index);
|
||||
|
||||
private
|
||||
Function AddWorkbook(xlsx, name); // Completed
|
||||
|
||||
private
|
||||
collection_;
|
||||
|
||||
@@ -30,9 +33,6 @@ public
|
||||
Function ReadCreator();
|
||||
Function ReadParent();
|
||||
|
||||
private
|
||||
Function AddWorkbook(xlsx, name); // Completed
|
||||
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
@@ -41,6 +41,12 @@ Begin
|
||||
collection_ := class(Collection).GetInstance('workbook');
|
||||
End;
|
||||
|
||||
Function Workbooks.AddWorkbook(xlsx, fullname);
|
||||
Begin
|
||||
name := ExtractFileName(fullname);
|
||||
collection_.AddCollection(new Workbook(xlsx, name, fullname), name);
|
||||
End;
|
||||
|
||||
Function Operator Workbooks.[](index);
|
||||
Begin
|
||||
return collection_[index];
|
||||
@@ -70,11 +76,6 @@ End;
|
||||
|
||||
Function Workbooks.ReadItem(index);
|
||||
Begin
|
||||
return collection_[index];
|
||||
return self[index];
|
||||
End;
|
||||
|
||||
Function Workbooks.AddWorkbook(xlsx, fullname);
|
||||
Begin
|
||||
name := ExtractFileName(fullname);
|
||||
collection_.AddCollection(new Workbook(xlsx, name, fullname), name);
|
||||
End;
|
||||
|
||||
+1
-1
@@ -71,7 +71,7 @@ End;
|
||||
|
||||
Function Worksheet.Activate();
|
||||
Begin
|
||||
collection_.SetActivate(sheet_name_);
|
||||
collection_.SetActivation(sheet_name_);
|
||||
return xlsx_.SetDefaultSheet(sheet_name_);
|
||||
End;
|
||||
|
||||
|
||||
+1
-1
@@ -42,7 +42,7 @@ Begin
|
||||
sheets := xlsx_.GetSheets();
|
||||
for k, v in sheets do
|
||||
collection_.AddCollection(new Worksheet(xlsx_, v, collection_), v);
|
||||
collection_.SetActivate(xlsx_.GetDefaultSheet());
|
||||
collection_.SetActivation(xlsx_.GetDefaultSheet());
|
||||
End;
|
||||
|
||||
Function Operator Worksheets.[](index);
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
Type Application = class
|
||||
Type XlsxApplication = class
|
||||
|
||||
public
|
||||
Function Create();
|
||||
Function Init();
|
||||
|
||||
public
|
||||
Property Workbooks read ReadWorkbooks; // Completed
|
||||
property Workbooks read ReadWorkbooks; // Completed
|
||||
Function ReadWorkbooks(index);
|
||||
|
||||
private
|
||||
@@ -14,17 +14,17 @@ private
|
||||
End;
|
||||
|
||||
// ============== 实现 ================= //
|
||||
Function Application.Create();
|
||||
Function XlsxApplication.Create();
|
||||
Begin
|
||||
Init();
|
||||
End;
|
||||
|
||||
Function Application.Init();
|
||||
Function XlsxApplication.Init();
|
||||
Begin
|
||||
workbooks_ := new Workbooks();
|
||||
End;
|
||||
|
||||
Function Application.ReadWorkbooks(index)
|
||||
Function XlsxApplication.ReadWorkbooks(index)
|
||||
Begin
|
||||
if ifnil(index) then return workbooks_;
|
||||
return workbooks_[index];
|
||||
Reference in New Issue
Block a user