Skip to content

Commit

Permalink
・ToitoiseSVNで「needs-lock」対応のため、「ロック」「アンロック」「コミット」後、
Browse files Browse the repository at this point in the history
 ブックを開きなおすように修正。
  • Loading branch information
RelaxTools committed Sep 14, 2017
1 parent 3d5674e commit 27ada86
Show file tree
Hide file tree
Showing 4 changed files with 91 additions and 3 deletions.
Binary file modified RelaxTools.xlam
Binary file not shown.
Binary file modified Source/RelaxTools.xlsm
Binary file not shown.
87 changes: 85 additions & 2 deletions Source/src/Class/TortoiseSVN.cls
Original file line number Diff line number Diff line change
Expand Up @@ -170,19 +170,32 @@ Private Sub IVersion_Commit()

Dim strCommand As String
Dim WB As Workbook
Dim strBook As String

On Error GoTo e

Set WB = ActiveWorkbook
strBook = WB.FullName
If IsError(WB) Then
Exit Sub
End If

Application.DisplayAlerts = False
Application.ScreenUpdating = False

strCommand = CMD_COMMIT & GetPath(WB.FullName) & OPT_END0
WB.Close False

Run strCommand

Workbooks.Open strBook
Application.DisplayAlerts = True
Application.ScreenUpdating = True

Exit Sub
e:
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "TortoiseSVNの起動に失敗しました。インストールされていないか、PATHの設定を確認してください。", vbOKOnly + vbCritical, C_TITLE
End Sub

Expand Down Expand Up @@ -226,14 +239,27 @@ Private Sub IVersion_Locked()

Dim strCommand As String
Dim WB As Workbook
Dim strBook As String

On Error GoTo e

Set WB = ActiveWorkbook
If IsError(WB) Then
strBook = WB.FullName

If Not rlxIsFileExists(strBook) Then
MsgBox "バージョン管理外のブックです。", vbOKOnly + vbExclamation, C_TITLE
Exit Sub
End If

With CreateObject("SubWCRev.object")
.GetWCInfo strBook, 0, 0
If .IsSvnItem Then
Else
MsgBox "バージョン管理外のブックです。", vbOKOnly + vbExclamation, C_TITLE
Exit Sub
End If
End With

With CreateObject("SubWCRev.object")
.GetWCInfo WB.FullName, 0, 0
If .IsLocked Then
Expand All @@ -242,11 +268,29 @@ Private Sub IVersion_Locked()
End If
End With

If Not WB.Saved Then
If MsgBox("ブックが変更されています。破棄しますか?", vbOKCancel + vbQuestion, C_TITLE) <> vbOK Then
Exit Sub
End If
End If

On Error Resume Next

Application.DisplayAlerts = False
Application.ScreenUpdating = False

strCommand = CMD_LOCK & GetPath(WB.FullName) & OPT_END0
WB.Close False
Run strCommand

Workbooks.Open strBook
Application.DisplayAlerts = True
Application.ScreenUpdating = True

Exit Sub
e:
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "TortoiseSVNの起動に失敗しました。インストールされていないか、PATHの設定を確認してください。", vbOKOnly + vbCritical, C_TITLE
End Sub

Expand All @@ -270,19 +314,58 @@ Private Sub IVersion_Unlocked()

Dim strCommand As String
Dim WB As Workbook
Dim strBook As String

On Error GoTo e

Set WB = ActiveWorkbook
If IsError(WB) Then
strBook = WB.FullName

If Not rlxIsFileExists(strBook) Then
MsgBox "バージョン管理外のブックです。", vbOKOnly + vbExclamation, C_TITLE
Exit Sub
End If

With CreateObject("SubWCRev.object")
.GetWCInfo strBook, 0, 0
If .IsSvnItem Then
Else
MsgBox "バージョン管理外のブックです。", vbOKOnly + vbExclamation, C_TITLE
Exit Sub
End If
End With

With CreateObject("SubWCRev.object")
.GetWCInfo WB.FullName, 0, 0
If Not .IsLocked Then
MsgBox "ブックはロックされていません。", vbOKCancel + vbQuestion, C_TITLE
Exit Sub
End If
End With

If Not WB.Saved Then
If MsgBox("ブックが変更されています。破棄しますか?", vbOKCancel + vbQuestion, C_TITLE) <> vbOK Then
Exit Sub
End If
End If

On Error Resume Next

Application.DisplayAlerts = False
Application.ScreenUpdating = False

strCommand = CMD_UNLOCK & GetPath(WB.FullName) & OPT_END0
WB.Close False
Run strCommand

Workbooks.Open strBook
Application.DisplayAlerts = True
Application.ScreenUpdating = True

Exit Sub
e:
Application.DisplayAlerts = True
Application.ScreenUpdating = True
MsgBox "TortoiseSVNの起動に失敗しました。インストールされていないか、PATHの設定を確認してください。", vbOKOnly + vbCritical, C_TITLE
End Sub
Private Sub IVersion_Log()
Expand Down
7 changes: 6 additions & 1 deletion Version.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
2017/09/11(mon) RelaxTools-Addin Version 4.14.2(RustRemover)
2017/09/14(thu) RelaxTools-Addin Version 4.14.3(RustRemover)
◇機能改善
・ToitoiseSVNで「needs-lock」対応のため、「ロック」「アンロック」「コミット」後、
 ブックを開きなおすように修正。

2017/09/11(mon) RelaxTools-Addin Version 4.14.2(RustRemover)
◇バグ修正
・付箋「メモ」青のアイコンが表示されない不具合を修正。
・「ブックの静的チェック」のボタンを「検索」→「チェック」に修正。
Expand Down

0 comments on commit 27ada86

Please sign in to comment.