Skip to content

Commit

Permalink
Refactor form/report export to split VBA
Browse files Browse the repository at this point in the history
Export is now splitting the VBA from Form and Report objects to separate files with a .cls extension. Moving on to the code that will stitch these files back together before import.
  • Loading branch information
joyfullservice committed Nov 2, 2023
1 parent c87261a commit 89101c5
Show file tree
Hide file tree
Showing 6 changed files with 280 additions and 82 deletions.
3 changes: 2 additions & 1 deletion Version Control.accda.src/modules/clsDbForm.cls
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ End Sub
Private Sub IDbComponent_MoveSource(strFromFolder As String, strToFolder As String)
MoveFileIfExists strFromFolder & FSO.GetFileName(IDbComponent_SourceFile), strToFolder
MoveFileIfExists strFromFolder & FSO.GetBaseName(IDbComponent_SourceFile) & ".json", strToFolder
MoveFileIfExists strFromFolder & FSO.GetBaseName(IDbComponent_SourceFile) & ".cls", strToFolder
End Sub


Expand Down Expand Up @@ -180,7 +181,7 @@ End Function
'
Private Sub IDbComponent_ClearOrphanedSourceFiles()
If Not Options.SavePrintVars Then ClearFilesByExtension IDbComponent_BaseFolder, "json"
ClearOrphanedSourceFiles Me, "bas", "json"
ClearOrphanedSourceFiles Me, "bas", "json", "cls"
End Sub


Expand Down
3 changes: 2 additions & 1 deletion Version Control.accda.src/modules/clsDbReport.cls
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ End Sub
Private Sub IDbComponent_MoveSource(strFromFolder As String, strToFolder As String)
MoveFileIfExists strFromFolder & FSO.GetFileName(IDbComponent_SourceFile), strToFolder
MoveFileIfExists strFromFolder & FSO.GetBaseName(IDbComponent_SourceFile) & ".json", strToFolder
MoveFileIfExists strFromFolder & FSO.GetBaseName(IDbComponent_SourceFile) & ".cls", strToFolder
End Sub


Expand Down Expand Up @@ -150,7 +151,7 @@ End Function
Private Sub IDbComponent_ClearOrphanedSourceFiles()
ClearFilesByExtension IDbComponent_BaseFolder, "pv" ' Remove legacy files
If Not Options.SavePrintVars Then ClearFilesByExtension IDbComponent_BaseFolder, "json"
ClearOrphanedSourceFiles Me, "bas", "json"
ClearOrphanedSourceFiles Me, "bas", "json", "cls"
End Sub


Expand Down
3 changes: 2 additions & 1 deletion Version Control.accda.src/modules/clsDbTableData.cls
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ Private Sub IDbComponent_Export(Optional strAlternatePath As String)
End If
Perf.OperationEnd
With New clsSanitize
.SanitizeXML strFile, False
.LoadSourceFile strFile
WriteFile .Sanitize(ectXML), strFile
End With
End Select
End If
Expand Down
5 changes: 4 additions & 1 deletion Version Control.accda.src/modules/clsDbTableDef.cls
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,10 @@ Private Sub IDbComponent_Export(Optional strAlternatePath As String)

' Rewrite sanitized XML as formatted UTF-8 content
With New clsSanitize
strHash = .SanitizeXML(strFile, True)
.LoadSourceFile strFile
DeleteFile strFile
WriteFile .Sanitize(ectXML), strFile
strHash = .Hash
End With

Else
Expand Down
Loading

0 comments on commit 89101c5

Please sign in to comment.