]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/docview.cpp
ignore mouse wheel events which are coming too fast to be processed (#9057)
[wxWidgets.git] / src / common / docview.cpp
index 7f37a56f550004c905a9ad3929b9ae3cc328b22a..fd55bcb89f0574787222595091976045377146db 100644 (file)
@@ -1509,7 +1509,7 @@ void wxDocManager::FileHistoryRemoveMenu(wxMenu *menu)
 }
 
 #if wxUSE_CONFIG
-void wxDocManager::FileHistoryLoad(wxConfigBase& config)
+void wxDocManager::FileHistoryLoad(const wxConfigBase& config)
 {
     if (m_fileHistory)
         m_fileHistory->Load(config);
@@ -2275,7 +2275,7 @@ void wxFileHistory::RemoveMenu(wxMenu *menu)
 }
 
 #if wxUSE_CONFIG
-void wxFileHistory::Load(wxConfigBase& config)
+void wxFileHistory::Load(const wxConfigBase& config)
 {
     m_fileHistory.Clear();
 
@@ -2439,15 +2439,22 @@ bool wxTransferStreamToFile(wxInputStream& stream, const wxString& filename)
         return false;
 
     char buf[4096];
-    do
+    for ( ;; )
     {
         stream.Read(buf, WXSIZEOF(buf));
 
         const size_t nRead = stream.LastRead();
-        if ( !nRead || !file.Write(buf, nRead) )
+        if ( !nRead )
+        {
+            if ( stream.Eof() )
+                break;
+
+            return false;
+        }
+
+        if ( !file.Write(buf, nRead) )
             return false;
     }
-    while ( !stream.Eof() );
 
     return true;
 }