diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 9d9d6b33..bf9066c9 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -2565,24 +2565,20 @@ bool NppParameters::importUDLFromFile(generic_string sourceFile) bool NppParameters::exportUDLToFile(int langIndex2export, generic_string fileName2save) { - if (langIndex2export != -1 && langIndex2export >= _nbUserLang) + if (langIndex2export >= NB_MAX_USER_LANG) + return false; + + if (langIndex2export < 0 && langIndex2export >= _nbUserLang) return false; TiXmlDocument *pNewXmlUserLangDoc = new TiXmlDocument(fileName2save); TiXmlNode *newRoot2export = pNewXmlUserLangDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); - bool b = false; - - if ( langIndex2export >= NB_MAX_USER_LANG ) - { - return false; - } - insertUserLang2Tree(newRoot2export, _userLangArray[langIndex2export]); - b = pNewXmlUserLangDoc->SaveFile(); + bool result = pNewXmlUserLangDoc->SaveFile(); delete pNewXmlUserLangDoc; - return b; + return result; } LangType NppParameters::getLangFromExt(const TCHAR *ext) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 8d89cf92..a03decf4 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -3076,7 +3076,6 @@ void ScintillaEditView::changeTextDirection(bool isRTL) generic_string ScintillaEditView::getEOLString() { const int eol_mode = int(execute(SCI_GETEOLMODE)); - string newline; if (eol_mode == SC_EOL_CRLF) { return TEXT("\r\n"); diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 69e488e5..c671e230 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -163,12 +163,12 @@ int GetNextColWithWidth(int SI, int startcol, int direction) if(direction == 1){j++;} if(direction != 1){j--;} - while((BGHS[SI].columnwidths[j] == 0)&&(j<=BGHS[SI].cols)&&(j>0)) + while((j>0)&&(j<=BGHS[SI].cols)&&(BGHS[SI].columnwidths[j] == 0)) { if(direction == 1){j++;} if(direction != 1){j--;} } - if((BGHS[SI].columnwidths[j] > 0)&&(j<=BGHS[SI].cols)) + if((j<=BGHS[SI].cols)&&(BGHS[SI].columnwidths[j] > 0)) { ReturnValue = j; } diff --git a/scintilla/lexers/LexUser.cxx b/scintilla/lexers/LexUser.cxx index 491e6310..609cb0a2 100644 --- a/scintilla/lexers/LexUser.cxx +++ b/scintilla/lexers/LexUser.cxx @@ -1123,7 +1123,7 @@ static void setBackwards(WordList * kwLists[], StyleContext & sc, bool prefixes[ int folding = FOLD_NONE; int moveForward = 0; - for (int i=0; i<=MAPPER_TOTAL; ++i) + for (int i=0; i