From aa3797eadd9c0b6e0255a7803219d6a0bb8ca5ca Mon Sep 17 00:00:00 2001 From: Don Ho Date: Mon, 13 Dec 2010 01:11:35 +0000 Subject: [PATCH] [BUG_FIXED] Fix langs.xml 0 length problem while user ends session w/o closing Notepad++. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@725 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Parameters.cpp | 4 +--- PowerEditor/src/TinyXml/tinyxml.h | 8 -------- PowerEditor/src/WinControls/Preference/preferenceDlg.cpp | 3 +-- 3 files changed, 2 insertions(+), 13 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 4aee691b6..649ba3e46 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -1108,8 +1108,6 @@ void NppParameters::destroyInstance() { if (_pXmlDoc != NULL) { - if (_pXmlDoc->isDirty()) - _pXmlDoc->SaveFile(); delete _pXmlDoc; } @@ -4978,7 +4976,7 @@ bool NppParameters::insertTabInfo(const TCHAR *langName, int tabInfo) if (nm && lstrcmp(langName, nm) == 0) { childNode->ToElement()->SetAttribute(TEXT("tabSettings"), tabInfo); - _pXmlDoc->makeDirty(); + _pXmlDoc->SaveFile(); return true; } } diff --git a/PowerEditor/src/TinyXml/tinyxml.h b/PowerEditor/src/TinyXml/tinyxml.h index 4b8b532e4..6634b70f1 100644 --- a/PowerEditor/src/TinyXml/tinyxml.h +++ b/PowerEditor/src/TinyXml/tinyxml.h @@ -1095,13 +1095,6 @@ public: virtual void Print( FILE* cfile, int depth = 0 ) const; // [internal use] void SetError( int err, const TCHAR* errorLocation, TiXmlParsingData* prevData ); - void makeDirty() { - _isDirty = true; - }; - - bool isDirty() const { - return _isDirty; - }; protected : virtual void StreamOut ( TIXML_OSTREAM * out) const; @@ -1117,7 +1110,6 @@ private: TIXML_STRING errorDesc; int tabsize; TiXmlCursor errorLocation; - bool _isDirty; }; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index d48319bfb..9763509d0 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -1215,8 +1215,7 @@ BOOL CALLBACK LangMenuDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPara ValueDlg tabSizeDlg; tabSizeDlg.init(_hInst, _hParent, nppGUI._tabSize, TEXT("Tab Size : ")); POINT p; - ::GetCursorPos(&p);//::GetParent(::GetParent(_hParent)) - //::ScreenToClient(NULL, &p); + ::GetCursorPos(&p); int size = tabSizeDlg.doDialog(p); if (size == -1) return FALSE;