From d3c2df5d229b819e5515904494b8d152bcf5fe3f Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Mon, 16 Sep 2013 19:27:32 +0000 Subject: -fixed line endings -unneeded translations removed git-svn-id: http://svn.miranda-ng.org/main/trunk@6096 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Non-IM Contact/src/dialog.cpp | 32 ++++++------- plugins/Non-IM Contact/src/namereplacing.cpp | 72 ++++++++++++++-------------- 2 files changed, 52 insertions(+), 52 deletions(-) (limited to 'plugins/Non-IM Contact') diff --git a/plugins/Non-IM Contact/src/dialog.cpp b/plugins/Non-IM Contact/src/dialog.cpp index cf99e00c03..9a769a4556 100644 --- a/plugins/Non-IM Contact/src/dialog.cpp +++ b/plugins/Non-IM Contact/src/dialog.cpp @@ -1,20 +1,20 @@ #include "commonheaders.h" - -#define NIM_HELP_TEXT LPGEN("String replacing variables....\r\nThe following are all the valid variables that can be used. Refer to the readme for a proper explanation.\r\n\r\n\ -file(X)\t\t<- specifies the file to read from\r\nMUST be followed by either start() or end() or wholeline()\r\n\ -filename(X)\t\t<- copyies the filename of file X.\r\n\ -start(...)\t\t<-specifies where to start copying from.\r\n\ -end(...)\t\t<-specifies where to stop copying.\r\n\ -wholeline(line(...))\t<-specifies a whole line to copy\r\n\r\n\ -start() and end() explained\r\n.........................\r\n\ -MUST start with line() followed by a number or a string inside \" marks, OR csv(seperatorX) variable\r\n\ -The number specifies which character in the line to start/end copying.\r\nThe string specifies a string in the line to start/end copying.\r\n\ -csv(seperatorX) explained...\r\nseperator is either \"tab\" or \"space\" or any SINGLE character.\r\nX is the Xth seperator to pass before copying, (or to stop before)\r\n\r\n\ -Lastly the line(...) variable...\r\n\ -Inside the brackets must be either a number (to specify the line number), or a string inside \" marks (to use the line with that string), or lastline(X).\r\nthe X in lastline is the Xth line above the last line. i.e lastline(1) will use the 2nd last line of the file.\r\n\ -If searching for a line with u may put a + or - X after the closing ) i.e line(\"some words\")+3 to go 3 lines after the line with \"some words\".\r\n\r\n\ -Some Expamples...\r\n\r\n\ -filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(line(0))) <- will display the whole first line of the 0th file\r\nfile(0)wholeline(line(\"hello\")-1))) <- the wholeline above the first occurance of \"hello\" in the file\r\nfile(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4))) <- starts at the 2nd last line of the file, from the 2nd tab variable, untill the 4th tab variable in the last line (in the 0th file)\r\nfile(0)start(line(\"hello\")+1\"zzzz\")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.\r\n") + +#define NIM_HELP_TEXT LPGEN("String replacing variables....\r\nThe following are all the valid variables that can be used. Refer to the readme for a proper explanation.\r\n\r\n\ +file(X)\t\t<- specifies the file to read from\r\nMUST be followed by either start() or end() or wholeline()\r\n\ +filename(X)\t\t<- copyies the filename of file X.\r\n\ +start(...)\t\t<-specifies where to start copying from.\r\n\ +end(...)\t\t<-specifies where to stop copying.\r\n\ +wholeline(line(...))\t<-specifies a whole line to copy\r\n\r\n\ +start() and end() explained\r\n.........................\r\n\ +MUST start with line() followed by a number or a string inside \" marks, OR csv(seperatorX) variable\r\n\ +The number specifies which character in the line to start/end copying.\r\nThe string specifies a string in the line to start/end copying.\r\n\ +csv(seperatorX) explained...\r\nseperator is either \"tab\" or \"space\" or any SINGLE character.\r\nX is the Xth seperator to pass before copying, (or to stop before)\r\n\r\n\ +Lastly the line(...) variable...\r\n\ +Inside the brackets must be either a number (to specify the line number), or a string inside \" marks (to use the line with that string), or lastline(X).\r\nthe X in lastline is the Xth line above the last line. i.e lastline(1) will use the 2nd last line of the file.\r\n\ +If searching for a line with u may put a + or - X after the closing ) i.e line(\"some words\")+3 to go 3 lines after the line with \"some words\".\r\n\r\n\ +Some Expamples...\r\n\r\n\ +filename(0) <- will display the filename of the 0th file\r\nfile(0)wholeline(line(0))) <- will display the whole first line of the 0th file\r\nfile(0)wholeline(line(\"hello\")-1))) <- the wholeline above the first occurance of \"hello\" in the file\r\nfile(0)start(line(lastline(1))csv(tab2))end(line(lastline())csv(tab4))) <- starts at the 2nd last line of the file, from the 2nd tab variable, untill the 4th tab variable in the last line (in the 0th file)\r\nfile(0)start(line(\"hello\")+1\"zzzz\")end(line(6)17)) <- starts from the first occurance of zzzz in the line after the first occurance of hello, untill the 17th character in the 6th line (starting from line 0) of the 0th file.\r\n") INT_PTR CALLBACK DlgProcNimcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) diff --git a/plugins/Non-IM Contact/src/namereplacing.cpp b/plugins/Non-IM Contact/src/namereplacing.cpp index 5643a03849..f1b32f91d9 100644 --- a/plugins/Non-IM Contact/src/namereplacing.cpp +++ b/plugins/Non-IM Contact/src/namereplacing.cpp @@ -43,8 +43,8 @@ int findWordInString(const char* line, const char* string, int* lengthOfWord, in { unsigned int i, j=0; char word[64]="", OpenDivider[8], CloseDivider[8]; - strcpy(OpenDivider, Translate("(\"")); - strcpy(CloseDivider, Translate("\")")); + strncpy(OpenDivider, "(\"", sizeof(OpenDivider)); + strncpy(CloseDivider, "\")", sizeof(CloseDivider)); /* get the word we r looking for */ if (!strncmp(string, OpenDivider, strlen(OpenDivider))) { for (i=2; strncmp(&string[i], CloseDivider, strlen(CloseDivider)); i++) { @@ -81,8 +81,8 @@ int findLine(char* FileContents[], const char* string, int linesInFile,int start } // lastline - if (!strncmp(&string[*positionInOldString], Translate("lastline("), strlen(Translate("lastline(")))) { - *positionInOldString += (int)strlen(Translate("lastline(")); + if (!strncmp(&string[*positionInOldString], "lastline(", strlen("lastline("))) { + *positionInOldString += (int)strlen("lastline("); i = getNumber(&string[*positionInOldString]); if ( i != -1) { *positionInOldString += (int)strlen(_itoa(i,tmp,10)); @@ -111,7 +111,7 @@ int findLine(char* FileContents[], const char* string, int linesInFile,int start } i = -1; } - *positionInOldString += (int)(strlen(string2Find) + strlen(Translate("\"\")"))); + *positionInOldString += (int)(strlen(string2Find) + strlen("\"\")")); if (i==-1) return i; // allow for a +- after the word to go up or down lines if (string[*positionInOldString] == '+') { @@ -170,10 +170,10 @@ int findChar(char* FileContents[], const char* string, int linesInFile,int start } // csv( - if (!strncmp(&string[*positionInOldString], Translate("csv("), strlen(Translate("csv(")))) { + if (!strncmp(&string[*positionInOldString], "csv(", strlen("csv("))) { char seperator; int j=0, k=startChar; - *positionInOldString += (int)strlen(Translate("csv(")); + *positionInOldString += (int)strlen("csv("); if (!strncmp(&string[*positionInOldString], "tab", 3)) { *positionInOldString += 3; seperator = '\t'; @@ -206,10 +206,10 @@ void checkStringForcompare(char *str) char *A,*B, *X, *Y , *newStr = (char*)malloc(strlen(str)), *copyOfStr = _strdup(str); unsigned int i, j = 0, s = (int)strlen(str); newStr[0] = '\0'; - if (!strstr(str,Translate("compare(\""))) return; + if (!strstr(str,"compare(\"")) return; for (i=0; i= 0) strcat(newString, fileContents[wholeLine]); else @@ -545,9 +545,9 @@ int stringReplacer(const char* oldString, char* newString, HANDLE hContact) } } // filename() - else if (!strncmp(&oldString[positionInOldString], Translate("filename("), strlen(Translate("filename(")))) + else if (!strncmp(&oldString[positionInOldString], "filename(", strlen("filename("))) { - positionInOldString += (int)strlen(Translate("filename(")); + positionInOldString += (int)strlen("filename("); tempInt = getNumber(&oldString[positionInOldString]); if (tempInt == -1) { @@ -563,7 +563,7 @@ int stringReplacer(const char* oldString, char* newString, HANDLE hContact) } } // lastchecked(file(X)) - else if (!strncmp(&oldString[positionInOldString], Translate("lastchecked(file("), strlen(Translate("lastchecked(file(")))) + else if (!strncmp(&oldString[positionInOldString], "lastchecked(file(", strlen("lastchecked(file("))) { positionInOldString += lastChecked(newString, &oldString[positionInOldString]); } -- cgit v1.2.3