//
 int wxDialog::ShowModal()
 {
-    wxASSERT_MSG( !IsModal(), _T("wxDialog::ShowModal() reentered?") );
+    wxASSERT_MSG( !IsModal(), wxT("wxDialog::ShowModal() reentered?") );
 
     m_endModalCalled = false;
 
     if ( !m_endModalCalled )
     {
         // modal dialog needs a parent window, so try to find one
-        wxWindow *parent = GetParent();
-        if ( !parent )
-        {
-            parent = FindSuitableParent();
-        }
+        wxWindow * const parent = GetParentForModalDialog();
 
         // remember where the focus was
         wxWindow *oldFocus = m_pOldFocus;
   int                               nRetCode
 )
 {
-    wxASSERT_MSG( IsModal(), _T("EndModal() called for non modal dialog") );
+    wxASSERT_MSG( IsModal(), wxT("EndModal() called for non modal dialog") );
 
     m_endModalCalled = true;
     SetReturnCode(nRetCode);