# define WXREGEX_USING_BUILTIN
# define WXREGEX_IF_NEED_LEN(x) ,x
# if wxUSE_UNICODE
-# define WXREGEX_CHAR(x) x.wc_str()
+# define WXREGEX_CHAR(x) (x).wc_str()
# else
-# define WXREGEX_CHAR(x) x.mb_str()
+# define WXREGEX_CHAR(x) (x).mb_str()
# endif
#else
# ifdef HAVE_RE_SEARCH
# if wxUSE_UNICODE
# define WXREGEX_CONVERT_TO_MB
# endif
-# define WXREGEX_CHAR(x) x.mb_str()
+# define WXREGEX_CHAR(x) (x).mb_str()
# define wx_regfree regfree
# define wx_regerror regerror
#endif
// note that "^" shouldn't match after the first call to Matches() so we
// use wxRE_NOTBOL to prevent it from happening
while ( (!maxMatches || countRepl < maxMatches) &&
+#ifndef WXREGEX_CONVERT_TO_MB
Matches(textstr + matchStart,
+#else
+ Matches(textstr.data() + matchStart,
+#endif
countRepl ? wxRE_NOTBOL : 0
WXREGEX_IF_NEED_LEN(textlen - matchStart)) )
{
}
else
{
+#ifndef WXREGEX_CONVERT_TO_MB
textNew += wxString(textstr + matchStart + start,
+#else
+ textNew += wxString(textstr.data() + matchStart +
+ start,
+#endif
*wxConvCurrent, len);
mayHaveBackrefs = true;
#ifndef WXREGEX_CONVERT_TO_MB
result.append(*text, matchStart, start);
#else
- result.append(wxString(textstr + matchStart, *wxConvCurrent, start));
+ result.append(wxString(textstr.data() + matchStart, *wxConvCurrent,
+ start));
#endif
matchStart += start;
result.append(textNew);
#ifndef WXREGEX_CONVERT_TO_MB
result.append(*text, matchStart, wxString::npos);
#else
- result.append(wxString(textstr + matchStart, *wxConvCurrent));
+ result.append(wxString(textstr.data() + matchStart, *wxConvCurrent));
#endif
*text = result;