Path: blob/main/editors/fxite/files/patch-src_help.cpp
16461 views
--- src/help.cpp.orig 2013-10-03 09:22:51 UTC1+++ src/help.cpp2@@ -36,7 +36,13 @@3#define sendString(iMessage, wParam, lParam) sendMessage(iMessage, wParam, reinterpret_cast<long>(lParam))456+#ifdef FOX_1_7_50_OR_NEWER7+# define RxFind(rx,subj,start,beg,end,npar) (rx.search(subj,strlen(subj),start,strlen(subj),FXRex::Normal,beg,end,npar)>=0)8+#else9+# define RxFind(rx,subj,start,beg,end,npar) (rx.match(subj,beg,end,REX_FORWARD,npar,start))10+#endif1112+13enum {14SCHLP_FIXED,15SCHLP_ITALIC,16@@ -224,7 +230,7 @@ void SciHelp::replace(const char*oldstr, const char*ne17FXRex generic_rx(oldstr, REX_NORMAL|REX_NEWLINE);18content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));19FXint n=strlen(newstr);20- while (generic_rx.match(content,beg,end,REX_FORWARD,1)) {21+ while (RxFind(generic_rx,content,0,beg,end,1)) {22sendMessage(SCI_SETTARGETSTART,beg[0],0);23sendMessage(SCI_SETTARGETEND,end[0],0);24sendString(SCI_REPLACETARGET,n,newstr);25@@ -261,7 +267,7 @@ void SciHelp::parse(const char*txt, unsigned int size)26for (FXint i=SCHLP_FIRST; i<SCHLP_LAST; i++) {27content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));28FXRex rx(phrases[i], REX_CAPTURE|REX_NEWLINE);29- while (rx.match(content,beg,end,REX_FORWARD,2)) {30+ while (RxFind(rx,content,0,beg,end,2)) {31sendMessage(SCI_SETTARGETSTART,beg[0],0);32sendMessage(SCI_SETTARGETEND,end[0],0);33char*tmp=my_strndup(content+beg[1], end[1]-beg[1]);34@@ -289,10 +295,10 @@ void SciHelp::parse(const char*txt, unsigned int size)35}3637// Make the editor's name stand out a little...38- FXRex appname_rx("\\<"APP_NAME"\\>", REX_NORMAL|REX_NEWLINE);39+ FXRex appname_rx("\\<" APP_NAME "\\>", REX_NORMAL|REX_NEWLINE);40content=(const char*)(sendMessage(SCI_GETCHARACTERPOINTER,0,0));41FXint p=0;42- while (appname_rx.match(content,beg,end,REX_FORWARD,1, p)) {43+ while (RxFind(appname_rx,content,p,beg,end,1)) {44sendMessage(SCI_STARTSTYLING,beg[0],0xff);45sendMessage(SCI_SETSTYLING,(end[0]-beg[0]),SCHLP_LOGO);46p=end[0];474849