X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f6bcfd974ef26faf6f91a62cac09827e09463fd1..005f5d1878c1d344e79e3c43b2790332dcea68f3:/src/common/valtext.cpp?ds=sidebyside

diff --git a/src/common/valtext.cpp b/src/common/valtext.cpp
index 9e7599571b..3ecc428116 100644
--- a/src/common/valtext.cpp
+++ b/src/common/valtext.cpp
@@ -119,11 +119,7 @@ static bool wxIsAlphaNumeric(const wxString& val)
 // This function can pop up an error message.
 bool wxTextValidator::Validate(wxWindow *parent)
 {
-    if ( !m_validatorWindow )
-        return FALSE;
-    if ( !m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
-        return FALSE;
-    if ( !m_stringValue )
+    if( !CheckValidator() )
         return FALSE;
 
     wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
@@ -195,11 +191,7 @@ bool wxTextValidator::Validate(wxWindow *parent)
 // Called to transfer data to the window
 bool wxTextValidator::TransferToWindow(void)
 {
-    if ( !m_validatorWindow )
-        return FALSE;
-    if ( !m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
-        return FALSE;
-    if ( !m_stringValue )
+    if( !CheckValidator() )
         return FALSE;
 
     wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;
@@ -211,11 +203,7 @@ bool wxTextValidator::TransferToWindow(void)
 // Called to transfer data to the window
 bool wxTextValidator::TransferFromWindow(void)
 {
-    if ( !m_validatorWindow )
-        return FALSE;
-    if ( !m_validatorWindow->IsKindOf(CLASSINFO(wxTextCtrl)) )
-        return FALSE;
-    if ( !m_stringValue )
+    if( !CheckValidator() )
         return FALSE;
 
     wxTextCtrl *control = (wxTextCtrl *) m_validatorWindow ;