From b3abee88242732f65cbc9d1721cff438db2132bb Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 21 Jul 2014 19:36:34 +0000 Subject: [PATCH] [BUG_FIXED] (Author: Andreas Jonsson) Fix the bug that "backslash is escape char for SQL" setting is not saved correctly. [BUG_FIXED] (Author: Andreas Jonsson) Fix the bug that user cannot disable "backslash is SQL escape char" without restarting. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1263 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Parameters.cpp | 10 +++++----- PowerEditor/src/ScitillaComponent/ScintillaEditView.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index dc927df07..c24c599fb 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -4552,10 +4552,10 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._fileSwitcherWithoutExtColumn = true; } - optName = element->Attribute(TEXT("backSlashIsEscapeCharacterForSql")); - if (optName && !lstrcmp(optName, TEXT("yes"))) + const TCHAR * optNameBackSlashEscape = element->Attribute(TEXT("backSlashIsEscapeCharacterForSql")); + if (optNameBackSlashEscape && !lstrcmp(optNameBackSlashEscape, TEXT("no"))) { - _nppGUI._backSlashIsEscapeCharacterForSql = true; + _nppGUI._backSlashIsEscapeCharacterForSql = false; } } } @@ -5297,8 +5297,8 @@ bool NppParameters::writeGUIParams() const TCHAR * pStr = _nppGUI._fileSwitcherWithoutExtColumn?TEXT("yes"):TEXT("no"); element->SetAttribute(TEXT("fileSwitcherWithoutExtColumn"), pStr); - pStr = _nppGUI._backSlashIsEscapeCharacterForSql?TEXT("yes"):TEXT("no"); - element->SetAttribute(TEXT("backSlashIsEscapeCharacterForSql"), pStr); + const TCHAR * pStrBackSlashEscape = _nppGUI._backSlashIsEscapeCharacterForSql ? TEXT("yes") : TEXT("no"); + element->SetAttribute(TEXT("backSlashIsEscapeCharacterForSql"), pStrBackSlashEscape); } else if (!lstrcmp(nm, TEXT("sessionExt"))) { diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 265b822cc..55486111a 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -715,8 +715,8 @@ protected: void setSqlLexer() { - if(NppParameters::getInstance()->getNppGUI()._backSlashIsEscapeCharacterForSql) - execute(SCI_SETPROPERTY, (WPARAM)"sql.backslash.escapes", (LPARAM)"1"); + const bool kbBackSlash = NppParameters::getInstance()->getNppGUI()._backSlashIsEscapeCharacterForSql; + execute(SCI_SETPROPERTY, (WPARAM)"sql.backslash.escapes", kbBackSlash ? (LPARAM)"1" : (LPARAM)"0"); setLexer(SCLEX_SQL, L_SQL, LIST_0); };