From 798ffa148ebf8e3e259a45fd2d64d1ad53eb92cb Mon Sep 17 00:00:00 2001 From: donho Date: Fri, 19 Oct 2007 18:57:18 +0000 Subject: [PATCH] [ENHANCEMENT] New auto-add extension behaviour : 1. The filter *.* don't change the extension at all, whatever users type. 2. The file save dialog will be launched with the filter *.* set as default. So user can add any customized extension. 3. Choose other filters will change extension of file automatically. For example, a file name "toto.php" will be changed to "toto.txt" if the filter Normal Text "*.txt" is choosen. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@55 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h | 6 +++++- PowerEditor/src/langs.xml | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index aa8f7d1f..5dc99b27 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -38,9 +38,13 @@ typedef vector stringVector; static string changeExt(string fn, string ext) { + if (ext == "") + return fn; + string fnExt = fn; + int index = fnExt.find_last_of("."); - string extension = ext == ""?"":"."; + string extension = "."; extension += ext; if (index == string::npos) { diff --git a/PowerEditor/src/langs.xml b/PowerEditor/src/langs.xml index 278260d9..73681458 100644 --- a/PowerEditor/src/langs.xml +++ b/PowerEditor/src/langs.xml @@ -11,7 +11,7 @@ if else switch case default break goto return for while do continue typedef sizeof NULL new delete throw try catch namespace operator this const_cast static_cast dynamic_cast reinterpret_cast true false using typeid and and_eq bitand bitor compl not not_eq or or_eq xor xor_eq - void struct union enum char short int long double float signed unsigned const static extern auto register volatile bool class private protected public friend inline template virtual asm explicit typename + void struct union enum char short int long double float signed unsigned const static extern auto register volatile bool class private protected public friend inline template virtual asm explicit typename mutable a addindex addtogroup anchor arg attention author b brief bug c class code date def defgroup deprecated dontinclude e em endcode endhtmlonly endif endlatexonly endlink endverbatim enum example exception f$ f[ f] file fn hideinitializer htmlinclude htmlonly if image include ingroup internal invariant interface latexonly li line link mainpage name namespace nosubgrouping note overload p page par param post preref relates remarks return retval sa section see showinitializer since skip skipline struct subsection test throw throws todo typedef union until var verbatim verbinclude version warning weakgroup $ @ \ & < > # { }