]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix splitting message into title in body in MSW wxProgressDialog.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Oct 2011 16:41:34 +0000 (16:41 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sun, 30 Oct 2011 16:41:34 +0000 (16:41 +0000)
If the message doesn't contain any new lines, it should be used as the body,
not the title as having title without body doesn't make sense and looks
strange.

Closes #13441.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@69592 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/msw/progdlg.cpp

index 09cba141b7bb22f23516435bc48c0c91019e3878..0cb869aa2ef91d557c41f246e3cd424e463e3c98 100644 (file)
@@ -236,6 +236,11 @@ void PerformNotificationUpdates(HWND hwnd,
             body.assign(title, posNL + numNLs, wxString::npos);
             title.erase(posNL);
         }
             body.assign(title, posNL + numNLs, wxString::npos);
             title.erase(posNL);
         }
+        else // A single line
+        {
+            // Don't use title without the body, this doesn't make sense.
+            title.swap(body);
+        }
 
         ::SendMessage( hwnd,
                        TDM_SET_ELEMENT_TEXT,
 
         ::SendMessage( hwnd,
                        TDM_SET_ELEMENT_TEXT,