]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/regex.cpp
Allow absent checkbox when transferring dimension data
[wxWidgets.git] / src / common / regex.cpp
index f97d0727bc7f286a02d3114ea938c7c7b4abad48..a93ca08bf5e394beb0bcc3269735eb5720fe7b57 100644 (file)
@@ -4,7 +4,6 @@
 // Author:      Karsten Ballueder and Vadim Zeitlin
 // Modified by:
 // Created:     13.07.01
-// RCS-ID:      $Id$
 // Copyright:   (c) 2000 Karsten Ballueder <ballueder@gmx.net>
 //                  2001 Vadim Zeitlin <vadim@wxwindows.org>
 // Licence:     wxWindows licence
@@ -520,7 +519,7 @@ int wxRegExImpl::Replace(wxString *text,
                     textstr + matchStart,
 #else
                     textstr.data() + matchStart,
-#endif 
+#endif
                     countRepl ? wxRE_NOTBOL : 0
                     WXREGEX_IF_NEED_LEN(textlen - matchStart)) )
     {
@@ -566,13 +565,14 @@ int wxRegExImpl::Replace(wxString *text,
                     }
                     else
                     {
+                        textNew += wxString(
 #ifndef WXREGEX_CONVERT_TO_MB
-                        textNew += wxString(textstr + matchStart + start,
+                                textstr
 #else
-                        textNew += wxString(textstr.data() + matchStart +
-                                           start,
+                                textstr.data()
 #endif
-                                            *wxConvCurrent, len);
+                                + matchStart + start,
+                                *wxConvCurrent, len);
 
                         mayHaveBackrefs = true;
                     }
@@ -601,8 +601,7 @@ int wxRegExImpl::Replace(wxString *text,
 #ifndef WXREGEX_CONVERT_TO_MB
         result.append(*text, matchStart, start);
 #else
-        result.append(wxString(textstr.data() + matchStart, *wxConvCurrent, 
-                              start));
+        result.append(wxString(textstr.data() + matchStart, *wxConvCurrent, start));
 #endif
         matchStart += start;
         result.append(textNew);
@@ -646,8 +645,7 @@ bool wxRegEx::Compile(const wxString& expr, int flags)
     if ( !m_impl->Compile(expr, flags) )
     {
         // error message already given in wxRegExImpl::Compile
-        delete m_impl;
-        m_impl = NULL;
+        wxDELETE(m_impl);
 
         return false;
     }