From: kiri_feather Date: Fri, 6 May 2011 09:40:21 +0000 (+0900) Subject: IDNリンクを踏むと例外が発生する問題に対処(WebBrowserコントロールで該当ページを開いてしまう問題は未対処) X-Git-Tag: Tween_v1.0.2.0~35 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=4e8f4ba82b1447caf5b7af3e485586676c15035e;p=opentween%2Fopen-tween.git IDNリンクを踏むと例外が発生する問題に対処(WebBrowserコントロールで該当ページを開いてしまう問題は未対処) --- diff --git a/Tween/StatusDictionary.vb b/Tween/StatusDictionary.vb index f880f528..e20e3b19 100644 --- a/Tween/StatusDictionary.vb +++ b/Tween/StatusDictionary.vb @@ -845,21 +845,21 @@ Public NotInheritable Class TabInformations toIdx = 0 stp = -1 End If + + Dim posts As Dictionary(Of Long, PostClass) If Not Tab.IsInnerStorageTabType Then - For i As Integer = StartIdx To toIdx Step stp - If Not _statuses(Tab.GetId(i)).IsRead Then - Tab.OldestUnreadId = Tab.GetId(i) - Exit For - End If - Next + posts = _statuses Else - For i As Integer = StartIdx To toIdx Step stp - If Not Tab.Posts(Tab.GetId(i)).IsRead Then - Tab.OldestUnreadId = Tab.GetId(i) - Exit For - End If - Next + posts = Tab.Posts End If + + For i As Integer = StartIdx To toIdx Step stp + Dim id As Long = Tab.GetId(i) + If id > -1 AndAlso Not posts(id).IsRead Then + Tab.OldestUnreadId = id + Exit For + End If + Next End Sub Public Function DistributePosts() As Integer diff --git a/Tween/Tween.vb b/Tween/Tween.vb index 82ed73d1..06f421a1 100644 --- a/Tween/Tween.vb +++ b/Tween/Tween.vb @@ -3891,13 +3891,16 @@ Public Class TweenMain End Sub Private Sub PostBrowser_StatusTextChanged(ByVal sender As Object, ByVal e As EventArgs) Handles PostBrowser.StatusTextChanged - If PostBrowser.StatusText.StartsWith("http") OrElse PostBrowser.StatusText.StartsWith("ftp") _ - OrElse PostBrowser.StatusText.StartsWith("data") Then - StatusLabelUrl.Text = PostBrowser.StatusText.Replace("&", "&&") - End If - If PostBrowser.StatusText = "" Then - SetStatusLabelUrl() - End If + Try + If PostBrowser.StatusText.StartsWith("http") OrElse PostBrowser.StatusText.StartsWith("ftp") _ + OrElse PostBrowser.StatusText.StartsWith("data") Then + StatusLabelUrl.Text = PostBrowser.StatusText.Replace("&", "&&") + End If + If PostBrowser.StatusText = "" Then + SetStatusLabelUrl() + End If + Catch ex As Exception + End Try End Sub Private Sub StatusText_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles StatusText.KeyPress @@ -4893,6 +4896,8 @@ RETRY: End If Catch ex As System.Runtime.InteropServices.COMException '原因不明 + Catch ex As UriFormatException + PostBrowser.DocumentText = dTxt Finally PostBrowser.Visible = True End Try