OSDN Git Service

IDNリンクを踏むと例外が発生する問題に対処(WebBrowserコントロールで該当ページを開いてしまう問題は未対処)
authorkiri_feather <kiri_feather@users.sourceforge.jp>
Fri, 6 May 2011 09:40:21 +0000 (18:40 +0900)
committerKimura Youichi <kim.upsilon@bucyou.net>
Sat, 18 Feb 2012 14:19:28 +0000 (23:19 +0900)
Tween/StatusDictionary.vb
Tween/Tween.vb

index f880f52..e20e3b1 100644 (file)
@@ -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
index 82ed73d..06f421a 100644 (file)
@@ -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