Skip to content

Commit

Permalink
Code cleanup and minor tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
joyfullservice committed Nov 8, 2023
1 parent 9069232 commit 8f1649a
Show file tree
Hide file tree
Showing 11 changed files with 11 additions and 25 deletions.
2 changes: 1 addition & 1 deletion Version Control.accda.src/modules/clsDbForm.cls
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ Private Sub IDbComponent_Import(strFile As String)
End If

' Load the form from the source file
LoadComponentFromText acForm, strName, strFile, Me
LoadComponentFromText acForm, strName, strFile
Set m_Form = CurrentProject.AllForms(strName)
VCSIndex.Update Me, eatImport, GetCodeModuleHash(IDbComponent_ComponentType, strName)

Expand Down
2 changes: 1 addition & 1 deletion Version Control.accda.src/modules/clsDbModule.cls
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ Private Function ParseSourceFile(strFile As String, strName As String) As udtVba
blnIsClass = True
Exit For
End If
' Exit after 10 lines
' Exit after 9 lines
If lngLine > 8 Then Exit For
Next lngLine

Expand Down
2 changes: 1 addition & 1 deletion Version Control.accda.src/modules/clsDbReport.cls
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Private Sub IDbComponent_Import(strFile As String)
If Not strFile Like "*.bas" Then Exit Sub

strName = GetObjectNameFromFileName(strFile)
LoadComponentFromText acReport, strName, strFile, Me
LoadComponentFromText acReport, strName, strFile
Set m_Report = CurrentProject.AllReports(strName)
VCSIndex.Update Me, eatImport, GetFileHash(strFile), GetCodeModuleHash(IDbComponent_ComponentType, strName)

Expand Down
2 changes: 0 additions & 2 deletions Version Control.accda.src/modules/clsDevMode.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1012,10 +1012,8 @@ End Sub
'
Public Function AddToExportFile(strFileContent As String) As String

Dim strTempFile As String
Dim strLine As String
Dim varLines As Variant
Dim strData As String
Dim lngLine As Long
Dim blnFound As Boolean
Dim blnInBlock As Boolean
Expand Down
1 change: 0 additions & 1 deletion Version Control.accda.src/modules/clsGitIntegration.cls
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ End Function
'---------------------------------------------------------------------------------------
'
Public Function IsInsideRepository() As Boolean
Dim strResult As String
If Me.GitInstalled Then
IsInsideRepository = (RunGitCommand(egcIsInsideTree) = "true")
End If
Expand Down
4 changes: 0 additions & 4 deletions Version Control.accda.src/modules/clsOptions.cls
Original file line number Diff line number Diff line change
Expand Up @@ -275,9 +275,6 @@ End Sub
'
Private Sub Upgrade(ByRef dOptions As Dictionary)

Dim dFiles As Dictionary
Dim strPath As String

' 6/16/2021
' Aggressive sanitize to sanitize levels
If dOptions.Exists("AggressiveSanitize") Then
Expand Down Expand Up @@ -327,7 +324,6 @@ End Sub
Private Function HasUnifiedLayoutFilesInGit(strExportPath As String) As Boolean

Dim blnHasFiles As Boolean
Dim strFolder As String

' See if we have any ".bas" files, but no corresponding ".cls" files in the
' forms and reports export folders.
Expand Down
6 changes: 2 additions & 4 deletions Version Control.accda.src/modules/clsSourceParser.cls
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,8 @@ End Function
' Purpose : Return a hash of the sanitized content
'---------------------------------------------------------------------------------------
'
Public Function Hash(Optional blnWithBOM As Boolean = True) As String
Hash = GetStringHash(this.strOutput, blnWithBOM)
Public Function Hash(Optional blnWithBom As Boolean = True) As String
Hash = GetStringHash(this.strOutput, blnWithBom)
End Function


Expand All @@ -246,8 +246,6 @@ Private Function SanitizeObject() As String 'strPath As String, blnReturnHash As
Dim blnIsReport As Boolean
Dim blnIsPassThroughQuery As Boolean
Dim curStart As Currency
Dim strTempFile As String
Dim strContent As String
Dim cVBA As clsConcat

If DebugMode(True) Then On Error GoTo 0 Else On Error Resume Next
Expand Down
1 change: 1 addition & 0 deletions Version Control.accda.src/modules/clsSqlFormatter.cls
Original file line number Diff line number Diff line change
Expand Up @@ -1628,6 +1628,7 @@ End Function
' Author : Adam Waller
' Date : 8/18/2023
' Purpose : Print out AscW indexes of each character in the string.
' : (Use this when building case statements)
'---------------------------------------------------------------------------------------
'
Private Function GetAscWFromString(strText As String) As String
Expand Down
4 changes: 2 additions & 2 deletions Version Control.accda.src/modules/modFunctions.bas
Original file line number Diff line number Diff line change
Expand Up @@ -910,10 +910,10 @@ End Function
' : I.e. c:\test.bas > c:\test.cls
'---------------------------------------------------------------------------------------
'
Public Function SwapExtension(strFilePath As String, strNewExtension As String) As String
Public Function SwapExtension(strFilePath As String, strNewExtensionWithoutDelimiter As String) As String
Dim strCurrentExt As String
strCurrentExt = FSO.GetExtensionName(strFilePath)
SwapExtension = Left(strFilePath, Len(strFilePath) - Len(strCurrentExt)) & strNewExtension
SwapExtension = Left(strFilePath, Len(strFilePath) - Len(strCurrentExt)) & strNewExtensionWithoutDelimiter
End Function


Expand Down
4 changes: 2 additions & 2 deletions Version Control.accda.src/modules/modInstall.bas
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ Public Sub InstallVCSAddin(blnTrustFolder As Boolean, blnUseRibbon As Boolean, b
.blnTrustAddInFolder = blnTrustFolder
If .strInstallFolder <> strInstallFolder Then
' Attempt to migrate any saved user settings files
MigrateUserFiles .strInstallFolder, strInstallFolder, GetFilePathsInFolder(.strInstallFolder)
MigrateUserFiles strInstallFolder, GetFilePathsInFolder(.strInstallFolder)
' Update install folder to new path
.strInstallFolder = strInstallFolder
End If
Expand Down Expand Up @@ -305,7 +305,7 @@ End Function
' : the source file.
'---------------------------------------------------------------------------------------
'
Private Sub MigrateUserFiles(strFromFolder As String, strToFolder As String, colNames As Dictionary)
Private Sub MigrateUserFiles(strToFolder As String, colNames As Dictionary)

Dim varKey As Variant
Dim strFile As String
Expand Down
8 changes: 1 addition & 7 deletions Version Control.accda.src/modules/modVCSUtility.bas
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,6 @@ Public Function SaveComponentAsText(intType As AcObjectType, _
Dim strTempFile As String
Dim strAltFile As String
Dim strContent As String
Dim strPrefix As String
Dim strPrintSettingsFile As String
Dim strHash As String
Dim cParser As clsSourceParser
Expand Down Expand Up @@ -533,19 +532,14 @@ End Function
' Purpose : Load the object into the database from the saved source file.
'---------------------------------------------------------------------------------------
'
Public Sub LoadComponentFromText(intType As AcObjectType, _
strName As String, _
strFile As String, _
Optional cDbObjectClass As IDbComponent = Nothing)
Public Sub LoadComponentFromText(intType As AcObjectType, strName As String, strFile As String)

Dim strTempFile As String
Dim strSourceFile As String
Dim strAltFile As String
Dim strContent As String
Dim blnVbaOverlay As Boolean
Dim blnConvert As Boolean
Dim dFile As Dictionary
Dim cParser As clsSourceParser

' In most cases we are importing/converting the actual source file.
strSourceFile = strFile
Expand Down

0 comments on commit 8f1649a

Please sign in to comment.