mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-29 16:54:43 +02:00
Fixed bugs:
Open in new instance not allowing spaces in paths. open in new instance uses filename of current running executable instead of 'notepad++.exe'. Filters for open/save dialog not showing or incorrectly showing 'L'. "Global Styles" string incorrectly displayed in Unicode version. Removed redundant array for extensions in file dialogs. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@349 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
a7df3063dd
commit
67499d839a
@ -4929,7 +4929,13 @@ void Notepad_plus::docOpenInNewInstance(FileTransferMode mode)
|
||||
if (buf->isUntitled() || buf->isDirty())
|
||||
return;
|
||||
|
||||
Command cmd(TEXT("$(NPP_DIRECTORY)\\notepad++.exe $(FULL_CURRENT_PATH) -multiInst -nosession"));
|
||||
TCHAR nppName[MAX_PATH];
|
||||
::GetModuleFileName(NULL, nppName, MAX_PATH);
|
||||
std::generic_string command;
|
||||
command += nppName;
|
||||
command += TEXT(" \"$(FULL_CURRENT_PATH)\" -multiInst -nosession");
|
||||
//Command cmd(TEXT("$(NPP_DIRECTORY)\\notepad++.exe $(FULL_CURRENT_PATH) -multiInst -nosession"));
|
||||
Command cmd(command);
|
||||
cmd.run(_hSelf);
|
||||
if (mode == TransferMove)
|
||||
doClose(bufferID, currentView());
|
||||
|
@ -74,7 +74,7 @@ BOOL CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPar
|
||||
_lsArray = (NppParameters::getInstance())->getLStylerArray();
|
||||
_globalStyles = (NppParameters::getInstance())->getGlobalStylers();
|
||||
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)"Global Styles");
|
||||
::SendDlgItemMessage(_hSelf, IDC_LANGUAGES_LIST, LB_ADDSTRING, 0, (LPARAM)TEXT("Global Styles"));
|
||||
// All the lexers
|
||||
for (int i = 0 ; i < _lsArray.getNbLexer() ; i++)
|
||||
{
|
||||
|
@ -25,8 +25,8 @@ FileDialog::FileDialog(HWND hwnd, HINSTANCE hInst)
|
||||
: _nbCharFileExt(0), _nbExt(0)
|
||||
{
|
||||
staticThis = this;
|
||||
for (int i = 0 ; i < nbExtMax ; i++)
|
||||
_extArray[i][0] = '\0';
|
||||
//for (int i = 0 ; i < nbExtMax ; i++)
|
||||
// _extArray[i][0] = '\0';
|
||||
|
||||
memset(_fileExt, 0x00, sizeof(_fileExt));
|
||||
_fileName[0] = '\0';
|
||||
@ -65,69 +65,69 @@ FileDialog::FileDialog(HWND hwnd, HINSTANCE hInst)
|
||||
// a file name to filter. Since the nb of arguments is variable, you have to add NULL at the end.
|
||||
// example :
|
||||
// FileDialog.setExtFilter(TEXT("c/c++ src file"), TEXT(".c"), TEXT(".cpp"), TEXT(".cxx"), TEXT(".h"), NULL);
|
||||
// FileDialog.setExtFilter(TEXT("Makeile"), TEXT("makefile"), TEXT("GNUmakefile"), NULL);
|
||||
// FileDialog.setExtFilter(TEXT("Makefile"), TEXT("makefile"), TEXT("GNUmakefile"), NULL);
|
||||
void FileDialog::setExtFilter(const TCHAR *extText, const TCHAR *ext, ...)
|
||||
{
|
||||
// fill out the ext array for save as file dialog
|
||||
if (_nbExt < nbExtMax)
|
||||
lstrcpy(_extArray[_nbExt++], ext);
|
||||
//if (_nbExt < nbExtMax)
|
||||
// lstrcpy(_extArray[_nbExt++], ext);
|
||||
//
|
||||
std::generic_string extFilter = extText;
|
||||
std::generic_string exts;
|
||||
|
||||
va_list pArg;
|
||||
va_start(pArg, ext);
|
||||
|
||||
std::generic_string exts;
|
||||
|
||||
if (ext[0] == '.')
|
||||
exts += TEXT("*");
|
||||
exts += ext;
|
||||
exts += TEXT(";");
|
||||
|
||||
const TCHAR *ext2Concat;
|
||||
|
||||
while ((ext2Concat = va_arg(pArg, const TCHAR *)))
|
||||
ext2Concat = ext;
|
||||
do
|
||||
{
|
||||
if (ext2Concat[0] == '.')
|
||||
if (ext2Concat[0] == TEXT('.'))
|
||||
exts += TEXT("*");
|
||||
exts += ext2Concat;
|
||||
exts += TEXT(";");
|
||||
}
|
||||
while ( (ext2Concat = va_arg(pArg, const TCHAR *)) != NULL );
|
||||
|
||||
va_end(pArg);
|
||||
|
||||
// remove the last ';'
|
||||
exts = exts.substr(0, exts.length()-1);
|
||||
|
||||
extFilter += TEXT(" (L");
|
||||
extFilter += TEXT(" (");
|
||||
extFilter += exts + TEXT(")");
|
||||
|
||||
TCHAR *pFileExt = _fileExt + _nbCharFileExt;
|
||||
memcpy(pFileExt, extFilter.c_str(), extFilter.length() + 1);
|
||||
//memcpy(pFileExt, extFilter.c_str(), extFilter.length() + 1);
|
||||
lstrcpy(pFileExt, extFilter.c_str());
|
||||
_nbCharFileExt += extFilter.length() + 1;
|
||||
|
||||
pFileExt = _fileExt + _nbCharFileExt;
|
||||
memcpy(pFileExt, exts.c_str(), exts.length() + 1);
|
||||
//memcpy(pFileExt, exts.c_str(), exts.length() + 1);
|
||||
lstrcpy(pFileExt, exts.c_str());
|
||||
_nbCharFileExt += exts.length() + 1;
|
||||
}
|
||||
|
||||
int FileDialog::setExtsFilter(const TCHAR *extText, const TCHAR *exts)
|
||||
{
|
||||
// fill out the ext array for save as file dialog
|
||||
if (_nbExt < nbExtMax)
|
||||
lstrcpy(_extArray[_nbExt++], exts);
|
||||
//if (_nbExt < nbExtMax)
|
||||
// lstrcpy(_extArray[_nbExt++], exts);
|
||||
//
|
||||
std::generic_string extFilter = extText;
|
||||
|
||||
extFilter += TEXT(" (L");
|
||||
extFilter += TEXT(" (");
|
||||
extFilter += exts;
|
||||
extFilter += TEXT(")");
|
||||
|
||||
TCHAR *pFileExt = _fileExt + _nbCharFileExt;
|
||||
memcpy(pFileExt, extFilter.c_str(), extFilter.length() + 1);
|
||||
lstrcpy(pFileExt, extFilter.c_str());
|
||||
//memcpy(pFileExt, extFilter.c_str(), extFilter.length() + 1);
|
||||
_nbCharFileExt += extFilter.length() + 1;
|
||||
|
||||
pFileExt = _fileExt + _nbCharFileExt;
|
||||
memcpy(pFileExt, exts, lstrlen(exts) + 1);
|
||||
lstrcpy(pFileExt, exts);
|
||||
//memcpy(pFileExt, exts, lstrlen(exts) + 1);
|
||||
_nbCharFileExt += lstrlen(exts) + 1;
|
||||
|
||||
return _nbExt;
|
||||
|
@ -142,7 +142,7 @@ private:
|
||||
winVer _winVersion;
|
||||
|
||||
|
||||
TCHAR _extArray[nbExtMax][extLenMax];
|
||||
//TCHAR _extArray[nbExtMax][extLenMax];
|
||||
int _nbExt;
|
||||
|
||||
static FileDialog *staticThis;
|
||||
|
Loading…
x
Reference in New Issue
Block a user