]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/regex.cpp
fixing osx_cocoa
[wxWidgets.git] / src / common / regex.cpp
index f97d0727bc7f286a02d3114ea938c7c7b4abad48..4683b81de3965847a03adf4a2f71b830ca840ae7 100644 (file)
@@ -520,7 +520,7 @@ int wxRegExImpl::Replace(wxString *text,
                     textstr + matchStart,
 #else
                     textstr.data() + matchStart,
                     textstr + matchStart,
 #else
                     textstr.data() + matchStart,
-#endif 
+#endif
                     countRepl ? wxRE_NOTBOL : 0
                     WXREGEX_IF_NEED_LEN(textlen - matchStart)) )
     {
                     countRepl ? wxRE_NOTBOL : 0
                     WXREGEX_IF_NEED_LEN(textlen - matchStart)) )
     {
@@ -566,13 +566,14 @@ int wxRegExImpl::Replace(wxString *text,
                     }
                     else
                     {
                     }
                     else
                     {
+                        textNew += wxString(
 #ifndef WXREGEX_CONVERT_TO_MB
 #ifndef WXREGEX_CONVERT_TO_MB
-                        textNew += wxString(textstr + matchStart + start,
+                                textstr
 #else
 #else
-                        textNew += wxString(textstr.data() + matchStart +
-                                           start,
+                                textstr.data()
 #endif
 #endif
-                                            *wxConvCurrent, len);
+                                + matchStart + start,
+                                *wxConvCurrent, len);
 
                         mayHaveBackrefs = true;
                     }
 
                         mayHaveBackrefs = true;
                     }
@@ -601,8 +602,7 @@ int wxRegExImpl::Replace(wxString *text,
 #ifndef WXREGEX_CONVERT_TO_MB
         result.append(*text, matchStart, start);
 #else
 #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);
 #endif
         matchStart += start;
         result.append(textNew);
@@ -646,8 +646,7 @@ bool wxRegEx::Compile(const wxString& expr, int flags)
     if ( !m_impl->Compile(expr, flags) )
     {
         // error message already given in wxRegExImpl::Compile
     if ( !m_impl->Compile(expr, flags) )
     {
         // error message already given in wxRegExImpl::Compile
-        delete m_impl;
-        m_impl = NULL;
+        wxDELETE(m_impl);
 
         return false;
     }
 
         return false;
     }