[BUG_FIXED] Fix a bug that file detection options set are not saved.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@297 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2008-07-20 00:00:03 +00:00
parent 68673f8049
commit f3ebd08bd3
4 changed files with 8 additions and 3 deletions

View File

@ -7166,6 +7166,8 @@ LRESULT Notepad_plus::runProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lPa
case NPPM_SETCHECKDOCOPT : case NPPM_SETCHECKDOCOPT :
{ {
// If nothing is changed by user, then we allow to set this value
if (((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection == ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetectionOriginalValue)
((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = (ChangeDetect)wParam; ((NppGUI &)(pNppParam->getNppGUI()))._fileAutoDetection = (ChangeDetect)wParam;
return TRUE; return TRUE;
} }

View File

@ -2344,6 +2344,8 @@ void NppParameters::feedGUIParameters(TiXmlNode *node)
_nppGUI._fileAutoDetection = cdAutoUpdateGo2end; _nppGUI._fileAutoDetection = cdAutoUpdateGo2end;
else //(!strcmp(val, "no")) else //(!strcmp(val, "no"))
_nppGUI._fileAutoDetection = cdDisabled; _nppGUI._fileAutoDetection = cdDisabled;
_nppGUI._fileAutoDetectionOriginalValue = _nppGUI._fileAutoDetection;
} }
} }
} }

View File

@ -531,7 +531,7 @@ struct NppGUI
{ {
NppGUI() : _toolBarStatus(TB_LARGE), _toolbarShow(true), _statusBarShow(true), _menuBarShow(true),\ NppGUI() : _toolBarStatus(TB_LARGE), _toolbarShow(true), _statusBarShow(true), _menuBarShow(true),\
_tabStatus(TAB_DRAWTOPBAR | TAB_DRAWINACTIVETAB | TAB_DRAGNDROP), _splitterPos(POS_HORIZOTAL),\ _tabStatus(TAB_DRAWTOPBAR | TAB_DRAWINACTIVETAB | TAB_DRAGNDROP), _splitterPos(POS_HORIZOTAL),\
_userDefineDlgStatus(UDD_DOCKED), _tabSize(8), _tabReplacedBySpace(false), _fileAutoDetection(cdEnabled),\ _userDefineDlgStatus(UDD_DOCKED), _tabSize(8), _tabReplacedBySpace(false), _fileAutoDetection(cdEnabled), _fileAutoDetectionOriginalValue(_fileAutoDetection),\
_checkHistoryFiles(true) ,_enableSmartHilite(true), _enableTagsMatchHilite(true), _enableTagAttrsHilite(true),\ _checkHistoryFiles(true) ,_enableSmartHilite(true), _enableTagsMatchHilite(true), _enableTagAttrsHilite(true),\
_isMaximized(false), _isMinimizedToTray(false), _rememberLastSession(true), _backup(bak_none), _useDir(false),\ _isMaximized(false), _isMinimizedToTray(false), _rememberLastSession(true), _backup(bak_none), _useDir(false),\
_doTaskList(true), _maitainIndent(true), _saveOpenKeepInSameDir(false), _styleMRU(true), _styleURL(0),\ _doTaskList(true), _maitainIndent(true), _saveOpenKeepInSameDir(false), _styleMRU(true), _styleURL(0),\
@ -566,6 +566,7 @@ struct NppGUI
bool _tabReplacedBySpace; bool _tabReplacedBySpace;
ChangeDetect _fileAutoDetection; ChangeDetect _fileAutoDetection;
ChangeDetect _fileAutoDetectionOriginalValue;
bool _checkHistoryFiles; bool _checkHistoryFiles;
RECT _appPos; RECT _appPos;

View File

@ -1,5 +1,5 @@
//this file is part of notepad++ //this file is part of notepad++
//Copyright (C)2003 Don HO ( donho@altern.org ) //Copyright (C)2003 Don HO < donho@altern.org >
// //
//This program is free software; you can redistribute it and/or //This program is free software; you can redistribute it and/or
//modify it under the terms of the GNU General Public License //modify it under the terms of the GNU General Public License