From bc0b68b2ba58c490fe0fea1d40630606e48d64c7 Mon Sep 17 00:00:00 2001 From: Joshua Noel Date: Sat, 30 May 2015 13:40:41 -0400 Subject: [PATCH 01/16] Fixed extra space between UNTITLED_STR and document number when creating a new document through the function FileManager::newEmptyDocument() --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 875bf973..afd2ae9e 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -1090,7 +1090,7 @@ BufferID FileManager::newEmptyDocument() { generic_string newTitle = UNTITLED_STR; TCHAR nb[10]; - wsprintf(nb, TEXT(" %d"), nextUntitledNewNumber()); + wsprintf(nb, TEXT("%d"), nextUntitledNewNumber()); newTitle += nb; Document doc = (Document)_pscratchTilla->execute(SCI_CREATEDOCUMENT); //this already sets a reference for filemanager From 3319bcc581ee9bb7dca9c7ddf72e2ca1b2ff8b36 Mon Sep 17 00:00:00 2001 From: NN Date: Sat, 30 May 2015 21:06:32 +0300 Subject: [PATCH 02/16] Fix incorrect thread procedure prototype. It has to be __stdcall. Remove unnecessary casts. --- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 3 +-- PowerEditor/src/ScitillaComponent/FindReplaceDlg.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 3c8fb972..6ee03aae 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2999,8 +2999,7 @@ HWND Progress::open(HWND hCallerWnd, const TCHAR* header) else _tcscpy_s(_header, _countof(_header), cDefaultHeader); - _hThread = ::CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)threadFunc, - (LPVOID)this, 0, NULL); + _hThread = ::CreateThread(NULL, 0, threadFunc, this, 0, NULL); if (!_hThread) { ::CloseHandle(_hActiveState); diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index 92a35fb4..137c4c4c 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -440,7 +440,7 @@ private: static volatile LONG refCount; - static DWORD threadFunc(LPVOID data); + static DWORD WINAPI threadFunc(LPVOID data); static LRESULT APIENTRY wndProc(HWND hwnd, UINT umsg, WPARAM wparam, LPARAM lparam); // Disable copy construction and operator= From 6adc3b35fca36b73a02520ae303ef305d996debc Mon Sep 17 00:00:00 2001 From: milipili Date: Sat, 30 May 2015 20:32:33 +0200 Subject: [PATCH 03/16] scintilla: buffer: fixed invalid read in the stack when loading a file The method `FileManager::loadFileData` uses a stack-based buffer for reading a file. However, due to the optimization used by `Utf8_16_Read` (`UnicodeConvertor`), this buffer is not copied, but a pointer to this object is kept. After `loadFileData`, this object is destroyed, but is used afterward (via `UnicodeConvertor.getNewBuf`). --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 24 ++++++++++++-------- PowerEditor/src/ScitillaComponent/Buffer.h | 2 +- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 875bf973..a5001fe8 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -38,13 +38,18 @@ FileManager * FileManager::_pSelf = new FileManager(); -const int blockSize = 128 * 1024 + 4; +static const int blockSize = 128 * 1024 + 4; // Ordre important!! Ne le changes pas! //SC_EOL_CRLF (0), SC_EOL_CR (1), or SC_EOL_LF (2). -const int CR = 0x0D; -const int LF = 0x0A; +static const int CR = 0x0D; +static const int LF = 0x0A; + + + + + Buffer::Buffer(FileManager * pManager, BufferID id, Document doc, DocFileStatus type, const TCHAR *fileName) //type must be either DOC_REGULAR or DOC_UNNAMED : _pManager(pManager), _id(id), _isDirty(false), _doc(doc), _isFileReadOnly(false), _isUserReadOnly(false), _recentTag(-1), _references(0), @@ -480,8 +485,9 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin Utf8_16_Read UnicodeConvertor; //declare here so we can get information after loading is done + char data[blockSize + 8]; // +8 for incomplete multibyte char formatType format; - bool res = loadFileData(doc, backupFileName?backupFileName:fullpath, &UnicodeConvertor, L_TEXT, encoding, &format); + bool res = loadFileData(doc, backupFileName?backupFileName:fullpath, data, &UnicodeConvertor, L_TEXT, encoding, &format); if (res) { Buffer * newBuf = new Buffer(this, _nextBufferID, doc, DOC_REGULAR, fullpath); @@ -560,14 +566,15 @@ bool FileManager::reloadBuffer(BufferID id) Utf8_16_Read UnicodeConvertor; buf->_canNotify = false; //disable notify during file load, we dont want dirty to be triggered int encoding = buf->getEncoding(); + char data[blockSize + 8]; // +8 for incomplete multibyte char formatType format; - bool res = loadFileData(doc, buf->getFullPathName(), &UnicodeConvertor, buf->getLangType(), encoding, &format); + bool res = loadFileData(doc, buf->getFullPathName(), data, &UnicodeConvertor, buf->getLangType(), encoding, &format); buf->_canNotify = true; if (res) { if (encoding == -1) { - if (UnicodeConvertor.getNewBuf()) + if (nullptr != UnicodeConvertor.getNewBuf()) { int format = getEOLFormatForm(UnicodeConvertor.getNewBuf()); buf->setFormat(format == -1?WIN_FORMAT:(formatType)format); @@ -1134,10 +1141,9 @@ int FileManager::detectCodepage(char* buf, size_t len) return codepage; } -bool FileManager::loadFileData(Document doc, const TCHAR * filename, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat) +inline bool FileManager::loadFileData(Document doc, const TCHAR * filename, char* data, Utf8_16_Read * UnicodeConvertor, + LangType language, int & encoding, formatType *pFormat) { - const int blockSize = 128 * 1024; //128 kB - char data[blockSize+8]; FILE *fp = generic_fopen(filename, TEXT("rb")); if (!fp) return false; diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 51c30cba..d460f27d 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -120,7 +120,7 @@ private: size_t _nrBufs; int detectCodepage(char* buf, size_t len); - bool loadFileData(Document doc, const TCHAR * filename, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat = NULL); + bool loadFileData(Document doc, const TCHAR * filename, char* buffer, Utf8_16_Read * UnicodeConvertor, LangType language, int & encoding, formatType *pFormat = NULL); }; #define MainFileManager FileManager::getInstance() From d09947d22dbb9e4acbda9e6ce6ba0c20cc87023f Mon Sep 17 00:00:00 2001 From: milipili Date: Sat, 30 May 2015 19:47:44 +0200 Subject: [PATCH 04/16] Scintilla: Buffer: fixed invalid read via strlen when loading a file When loading a file via `FileManager::loadFileData`, a fixed-length buffer is filled via `fread`. Then, in some cases, a conversion is done with the help of `Utf8_16_Read`. However, the method `Utf8_16_Read::convert` performs a call to `strlen` on this buffer. This is obviously wrong: `\0` char should be accepted (even if a bit strange) and the buffer is not zero-terminated. The changes merely consist in adding an additional parameter `length` to not have to guess the size of the buffer. --- PowerEditor/src/ScitillaComponent/Buffer.cpp | 18 ++++++++-------- PowerEditor/src/ScitillaComponent/Buffer.h | 5 ++++- PowerEditor/src/Utf8_16.cpp | 22 ++++++++++---------- PowerEditor/src/Utf8_16.h | 8 +++++-- 4 files changed, 30 insertions(+), 23 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 875bf973..3c1dc9d8 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -508,11 +508,10 @@ BufferID FileManager::loadFile(const TCHAR * filename, Document doc, int encodin if (encoding == -1) { // 3 formats : WIN_FORMAT, UNIX_FORMAT and MAC_FORMAT - if (UnicodeConvertor.getNewBuf()) + if (nullptr != UnicodeConvertor.getNewBuf()) { - int format = getEOLFormatForm(UnicodeConvertor.getNewBuf()); + int format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize()); buf->setFormat(format == -1?WIN_FORMAT:(formatType)format); - } else { @@ -569,7 +568,7 @@ bool FileManager::reloadBuffer(BufferID id) { if (UnicodeConvertor.getNewBuf()) { - int format = getEOLFormatForm(UnicodeConvertor.getNewBuf()); + int format = getEOLFormatForm(UnicodeConvertor.getNewBuf(), UnicodeConvertor.getNewSize()); buf->setFormat(format == -1?WIN_FORMAT:(formatType)format); } else @@ -1241,7 +1240,7 @@ bool FileManager::loadFileData(Document doc, const TCHAR * filename, Utf8_16_Rea } if (format == -1) - format = getEOLFormatForm(data); + format = getEOLFormatForm(data, lenFile); } else { @@ -1323,14 +1322,15 @@ int FileManager::docLength(Buffer * buffer) const return docLen; } -int FileManager::getEOLFormatForm(const char *data) const +int FileManager::getEOLFormatForm(const char* const data, size_t length) const { - size_t len = strlen(data); - for (size_t i = 0 ; i < len ; i++) + assert(data != nullptr && "invalid buffer for getEOLFormatForm()"); + + for (size_t i = 0; i != length; ++i) { if (data[i] == CR) { - if (i+1 < len && data[i+1] == LF) + if (i+1 < length && data[i+1] == LF) { return int(WIN_FORMAT); } diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 51c30cba..a96c8b7e 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -104,7 +104,7 @@ public: void destroyInstance() { delete _pSelf; }; int getFileNameFromBuffer(BufferID id, TCHAR * fn2copy); int docLength(Buffer * buffer) const; - int getEOLFormatForm(const char *data) const; + int getEOLFormatForm(const char* const data, size_t length) const; size_t nextUntitledNewNumber() const; private: @@ -384,6 +384,9 @@ private : if (_canNotify) _pManager->beNotifiedOfBufferChange(this, mask); }; + + Buffer(const Buffer&) { assert(false); } + Buffer& operator = (const Buffer&) { assert(false); return *this; } }; #endif //BUFFER_H diff --git a/PowerEditor/src/Utf8_16.cpp b/PowerEditor/src/Utf8_16.cpp index b120c35c..729427ab 100644 --- a/PowerEditor/src/Utf8_16.cpp +++ b/PowerEditor/src/Utf8_16.cpp @@ -31,7 +31,8 @@ const Utf8_16::utf8 Utf8_16::k_Boms[][3] = { Utf8_16_Read::Utf8_16_Read() { m_eEncoding = uni8Bit; - m_nBufSize = 0; + m_nAllocatedBufSize = 0; + m_nNewBufSize = 0; m_pNewBuf = NULL; m_bFirstRead = true; } @@ -113,10 +114,9 @@ size_t Utf8_16_Read::convert(char* buf, size_t len) // bugfix by Jens Lorenz static size_t nSkip = 0; - size_t ret = 0; - m_pBuf = (ubyte*)buf; m_nLen = len; + m_nNewBufSize = 0; if (m_bFirstRead == true) { @@ -131,16 +131,16 @@ size_t Utf8_16_Read::convert(char* buf, size_t len) case uni8Bit: case uniCookie: { // Do nothing, pass through - m_nBufSize = 0; + m_nAllocatedBufSize = 0; m_pNewBuf = m_pBuf; - ret = len; + m_nNewBufSize = len; break; } case uniUTF8: { // Pass through after BOM - m_nBufSize = 0; + m_nAllocatedBufSize = 0; m_pNewBuf = m_pBuf + nSkip; - ret = len - nSkip; + m_nNewBufSize = len - nSkip; break; } case uni16BE_NoBOM: @@ -149,13 +149,13 @@ size_t Utf8_16_Read::convert(char* buf, size_t len) case uni16LE: { size_t newSize = len + len / 2 + 1; - if (m_nBufSize != newSize) + if (m_nAllocatedBufSize != newSize) { if (m_pNewBuf) delete [] m_pNewBuf; m_pNewBuf = NULL; m_pNewBuf = new ubyte[newSize]; - m_nBufSize = newSize; + m_nAllocatedBufSize = newSize; } ubyte* pCur = m_pNewBuf; @@ -166,7 +166,7 @@ size_t Utf8_16_Read::convert(char* buf, size_t len) { *pCur++ = m_Iter16.get(); } - ret = pCur - m_pNewBuf; + m_nNewBufSize = pCur - m_pNewBuf; break; } default: @@ -176,7 +176,7 @@ size_t Utf8_16_Read::convert(char* buf, size_t len) // necessary for second calls and more nSkip = 0; - return ret; + return m_nNewBufSize; } diff --git a/PowerEditor/src/Utf8_16.h b/PowerEditor/src/Utf8_16.h index c47d964b..e9aa102a 100644 --- a/PowerEditor/src/Utf8_16.h +++ b/PowerEditor/src/Utf8_16.h @@ -112,7 +112,8 @@ public: ~Utf8_16_Read(); size_t convert(char* buf, size_t len); - char* getNewBuf() { return reinterpret_cast(m_pNewBuf); } + const char* getNewBuf() const { return (const char*) m_pNewBuf; } + size_t getNewSize() const { return m_nNewBufSize; } UniMode getEncoding() const { return m_eEncoding; } size_t calcCurPos(size_t pos); @@ -126,7 +127,10 @@ private: UniMode m_eEncoding; ubyte* m_pBuf; ubyte* m_pNewBuf; - size_t m_nBufSize; + // size of the new buffer + size_t m_nNewBufSize; + // size of the previously allocated buffer (if != 0) + size_t m_nAllocatedBufSize; size_t m_nSkip; bool m_bFirstRead; size_t m_nLen; From 9f5f8d13c56a2db60ce578817cbc385f984f61e7 Mon Sep 17 00:00:00 2001 From: milipili Date: Sat, 30 May 2015 23:34:58 +0200 Subject: [PATCH 05/16] documentmap: ViewZoneDlg: fixed uninitialized variables The real problem is `_viewZoneCanvas`, which can be used unitialized by `drawZone`. --- .../src/WinControls/DocumentMap/documentMap.cpp | 14 +++++++++----- .../src/WinControls/DocumentMap/documentMap.h | 5 +++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index e584a4ab..11f50af0 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -440,9 +440,13 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara case WM_INITDIALOG : { _viewZoneCanvas = ::GetDlgItem(_hSelf, IDC_VIEWZONECANVAS); - ::SetWindowLongPtrW(_viewZoneCanvas, GWL_USERDATA, reinterpret_cast(this)); - _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWL_WNDPROC, reinterpret_cast(canvasStaticProc))); - return TRUE; + if (NULL != _viewZoneCanvas) + { + ::SetWindowLongPtrW(_viewZoneCanvas, GWL_USERDATA, reinterpret_cast(this)); + _canvasDefaultProc = reinterpret_cast(::SetWindowLongPtr(_viewZoneCanvas, GWL_WNDPROC, reinterpret_cast(canvasStaticProc))); + return TRUE; + } + break; } case WM_LBUTTONDOWN: @@ -466,7 +470,7 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara case WM_SIZE: { - if (_viewZoneCanvas) + if (NULL != _viewZoneCanvas) { int width = LOWORD(lParam); int height = HIWORD(lParam); @@ -479,8 +483,8 @@ BOOL CALLBACK ViewZoneDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lPara { //Have to perform the scroll first, because the first/last line do not get updated untill after the scroll has been parsed ::SendMessage(_hParent, DOCUMENTMAP_MOUSEWHEEL, wParam, lParam); + return TRUE; } - return TRUE; case WM_DESTROY : { diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.h b/PowerEditor/src/WinControls/DocumentMap/documentMap.h index de688eca..27b86e29 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.h +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.h @@ -53,7 +53,7 @@ enum moveMode { class ViewZoneDlg : public StaticDialog { public : - ViewZoneDlg() : StaticDialog() {}; + ViewZoneDlg() : StaticDialog(), _viewZoneCanvas(NULL), _canvasDefaultProc(nullptr), _higherY(0), _lowerY(0) {} void doDialog(); @@ -63,7 +63,8 @@ public : void drawZone(long hY, long lY) { _higherY = hY; _lowerY = lY; - ::InvalidateRect(_viewZoneCanvas, NULL, TRUE); + if (NULL != _viewZoneCanvas) + ::InvalidateRect(_viewZoneCanvas, NULL, TRUE); }; int getViewerHeight() const { From b35e759d11d5eb9bf954300b02fea1bce781a635 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 31 May 2015 15:57:17 +0200 Subject: [PATCH 06/16] [UPDATE] Unprecompile headers --- PowerEditor/src/MISC/Common/Common.h | 5 ++ .../src/MISC/Common/precompiledHeaders.h | 6 +- .../src/MISC/PluginsManager/PluginInterface.h | 4 +- PowerEditor/src/Notepad_plus.cpp | 10 +-- PowerEditor/src/Parameters.cpp | 84 ++++++++++++++----- PowerEditor/src/Parameters.h | 63 +------------- .../src/ScitillaComponent/AutoCompletion.cpp | 1 - .../ScitillaComponent/SmartHighlighter.cpp | 1 - PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h | 5 ++ PowerEditor/src/TinyXml/tinyxml.h | 8 +- .../src/WinControls/AboutDlg/AboutDlg.cpp | 11 +-- .../src/WinControls/AboutDlg/AboutDlg.h | 2 + .../src/WinControls/AboutDlg/URLCtrl.h | 3 + .../DockingWnd/DockingDlgInterface.h | 5 +- .../WinControls/ImageListSet/ImageListSet.h | 2 + .../OpenSaveFileDialog/FileDialog.cpp | 3 +- .../OpenSaveFileDialog/FileDialog.h | 5 +- .../SplitterContainer/Splitter.cpp | 3 +- .../WinControls/SplitterContainer/Splitter.h | 2 + .../SplitterContainer/SplitterContainer.cpp | 3 +- .../WinControls/StaticDialog/StaticDialog.cpp | 5 +- .../WinControls/StaticDialog/StaticDialog.h | 2 + .../src/WinControls/StatusBar/StatusBar.cpp | 17 +++- .../src/WinControls/StatusBar/StatusBar.h | 17 ++-- PowerEditor/src/WinControls/ToolBar/ToolBar.h | 5 +- PowerEditor/src/WinControls/Window.h | 2 + .../src/WinControls/WindowsDlg/WindowsDlg.cpp | 10 --- .../src/WinControls/shortcut/shortcut.cpp | 15 ---- .../src/WinControls/shortcut/shortcut.h | 2 + 29 files changed, 148 insertions(+), 153 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 44b1c1ce..519de712 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -29,6 +29,11 @@ #ifndef M30_IDE_COMMUN_H #define M30_IDE_COMMUN_H +#include +#include + +#include + const bool dirUp = true; const bool dirDown = false; diff --git a/PowerEditor/src/MISC/Common/precompiledHeaders.h b/PowerEditor/src/MISC/Common/precompiledHeaders.h index 96bbf5c3..3ad68618 100644 --- a/PowerEditor/src/MISC/Common/precompiledHeaders.h +++ b/PowerEditor/src/MISC/Common/precompiledHeaders.h @@ -70,14 +70,12 @@ #include #pragma warning(pop) #include - -#ifdef UNICODE #include -#endif + // Notepad++ #include "Common.h" #include "Window.h" #include "StaticDialog.h" -#endif PRECOMPILEHEADER_H +#endif //PRECOMPILEHEADER_H diff --git a/PowerEditor/src/MISC/PluginsManager/PluginInterface.h b/PowerEditor/src/MISC/PluginsManager/PluginInterface.h index 8328f8d1..63f01c88 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginInterface.h +++ b/PowerEditor/src/MISC/PluginsManager/PluginInterface.h @@ -77,8 +77,8 @@ extern "C" __declspec(dllexport) FuncItem * getFuncsArray(int *); extern "C" __declspec(dllexport) void beNotified(SCNotification *); extern "C" __declspec(dllexport) LRESULT messageProc(UINT Message, WPARAM wParam, LPARAM lParam); -#ifdef UNICODE +// This API return always true now, since Notepad++ isn't compiled in ANSI mode anymore extern "C" __declspec(dllexport) BOOL isUnicode(); -#endif //UNICODE + #endif //PLUGININTERFACE_H diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index a618c82b..74d75cdd 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1970,11 +1970,8 @@ void Notepad_plus::deleteMarkedLines(bool isMarked) void Notepad_plus::pasteToMarkedLines() { int clipFormat; -#ifdef UNICODE clipFormat = CF_UNICODETEXT; -#else - clipFormat = CF_TEXT; -#endif + BOOL canPaste = ::IsClipboardFormatAvailable(clipFormat); if (!canPaste) return; @@ -4565,9 +4562,7 @@ bool Notepad_plus::str2Cliboard(const TCHAR *str2cpy) len2Allocate *= sizeof(TCHAR); unsigned int cilpboardFormat = CF_TEXT; -#ifdef UNICODE cilpboardFormat = CF_UNICODETEXT; -#endif HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate); if (hglbCopy == NULL) @@ -5546,7 +5541,6 @@ Quote quotes[nbQuote] = { {"Bob Gray", "Writing in C or C++ is like running a chain saw with all the safety guards removed."}, {"Roberto Waltman", "In the one and only true way. The object-oriented version of \"Spaghetti code\" is, of course, \"Lasagna code\". (Too many layers)"}, {"Gavin Russell Baker", "C++ : Where friends have access to your private members."}, -{"Alanna", "Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders."}, {"Linus Torvalds", "Software is like sex: It's better when it's free."}, {"Cult of vi", "Emacs is a great operating system, lacking only a decent editor."}, {"Church of Emacs", "vi has two modes - \"beep repeatedly\" and \"break everything\"."}, @@ -5642,7 +5636,7 @@ Quote quotes[nbQuote] = { {"Anonymous #81", "A male engineering student was crossing a road one day when a frog called out to him and said, \"If you kiss me, I'll turn into a beautiful princess.\" He bent over, picked up the frog, and put it in his pocket.\n\nThe frog spoke up again and said, \"If you kiss me and turn me back into a beautiful princess, I will stay with you for one week.\" The engineering student took the frog out of his pocket, smiled at it; and returned it to his pocket.\n\nThe frog then cried out, \"If you kiss me and turn me back into a princess, I'll stay with you and do ANYTHING you want.\" Again the boy took the frog out, smiled at it, and put it back into his pocket.\n\nFinally, the frog asked, \"What is the matter? I've told you I'm a beautiful princess, that I'll stay with you for a week and do anything you want. Why won't you kiss me?\" The boy said, \"Look I'm an engineer. I don't have time for a girlfriend, but a talking frog is cool.\"\n"}, {"Anonymous #82", "Programmers never die.\nThey just go offline."}, {"Anonymous #83", "Copy from one, it's plagiarism.\nCopy from two, it's research."}, -//{"Anonymous #84", ""}, +{"Anonymous #84", "Saying that Java is nice because it works on all OSes is like saying that anal sex is nice because it works on all genders."}, {"Anonymous #85", "Race, religion, ethnic pride and nationalism etc... does nothing but teach you how to hate people that you've never met."}, {"Anonymous #86", "Farts are just the ghosts of the things we eat."}, {"Anonymous #87", "I promised I would never kill someone who had my blood.\nBut that mosquito made me break my word."}, diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index dc543550..c0cff90a 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -32,6 +32,7 @@ #include "ScintillaEditView.h" #include "keys.h" #include "localization.h" +#include "localizationString.h" #include "UserDefineDialog.h" #include "../src/sqlite/sqlite3.h" @@ -496,8 +497,6 @@ static int getKwClassFromName(const TCHAR *str) { return -1; }; -#ifdef UNICODE -#include "localizationString.h" wstring LocalizationSwitcher::getLangFromXmlFileName(const wchar_t *fn) const { @@ -541,8 +540,6 @@ bool LocalizationSwitcher::switchToLang(wchar_t *lang2switch) const return ::CopyFileW(langPath.c_str(), _nativeLangPath.c_str(), FALSE) != FALSE; } -#endif - generic_string ThemeSwitcher::getThemeFromXmlFileName(const TCHAR *xmlFullPath) const { @@ -1843,9 +1840,7 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins if (!root) return false; -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); -#endif TiXmlNodeA *contextMenuRoot = root->FirstChildElement("ScintillaContextMenu"); if (contextMenuRoot) @@ -1859,13 +1854,9 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins generic_string folderName; generic_string displayAs; -#ifdef UNICODE folderName = folderNameA?wmc->char2wchar(folderNameA, SC_CP_UTF8):TEXT(""); displayAs = displayAsA?wmc->char2wchar(displayAsA, SC_CP_UTF8):TEXT(""); -#else - folderName = folderNameA?folderNameA:""; - displayAs = displayAsA?displayAsA:""; -#endif + int id; const char *idStr = (childNode->ToElement())->Attribute("id", &id); if (idStr) @@ -1879,13 +1870,9 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins generic_string menuEntryName; generic_string menuItemName; -#ifdef UNICODE menuEntryName = menuEntryNameA?wmc->char2wchar(menuEntryNameA, SC_CP_UTF8):TEXT(""); menuItemName = menuItemNameA?wmc->char2wchar(menuItemNameA, SC_CP_UTF8):TEXT(""); -#else - menuEntryName = menuEntryNameA?menuEntryNameA:""; - menuItemName = menuItemNameA?menuItemNameA:""; -#endif + if (menuEntryName != TEXT("") && menuItemName != TEXT("")) { int nbMenuEntry = ::GetMenuItemCount(mainMenuHadle); @@ -1949,13 +1936,9 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins generic_string pluginName; generic_string pluginCmdName; -#ifdef UNICODE pluginName = pluginNameA?wmc->char2wchar(pluginNameA, SC_CP_UTF8):TEXT(""); pluginCmdName = pluginCmdNameA?wmc->char2wchar(pluginCmdNameA, SC_CP_UTF8):TEXT(""); -#else - pluginName = pluginNameA?pluginNameA:""; - pluginCmdName = pluginCmdNameA?pluginCmdNameA:""; -#endif + // if plugin menu existing plls the value of PluginEntryName and PluginCommandItemName are valid if (pluginsMenu && pluginName != TEXT("") && pluginCmdName != TEXT("")) { @@ -6417,3 +6400,62 @@ void NppParameters::safeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirect } } + +Date::Date(const TCHAR *dateStr) +{ + // timeStr should be Notepad++ date format : YYYYMMDD + assert(dateStr); + if (lstrlen(dateStr) == 8) + { + generic_string ds(dateStr); + generic_string yyyy(ds, 0, 4); + generic_string mm(ds, 4, 2); + generic_string dd(ds, 6, 2); + + int y = generic_atoi(yyyy.c_str()); + int m = generic_atoi(mm.c_str()); + int d = generic_atoi(dd.c_str()); + + if ((y > 0 && y <= 9999) && (m > 0 && m <= 12) && (d > 0 && d <= 31)) + { + _year = y; + _month = m; + _day = d; + return; + } + } + now(); +} + +// The constructor which makes the date of number of days from now +// nbDaysFromNow could be negative if user want to make a date in the past +// if the value of nbDaysFromNow is 0 then the date will be now +Date::Date(int nbDaysFromNow) +{ + const time_t oneDay = (60 * 60 * 24); + + time_t rawtime; + tm* timeinfo; + + time(&rawtime); + rawtime += (nbDaysFromNow * oneDay); + + timeinfo = localtime(&rawtime); + + _year = timeinfo->tm_year + 1900; + _month = timeinfo->tm_mon + 1; + _day = timeinfo->tm_mday; +} + +void Date::now() +{ + time_t rawtime; + tm* timeinfo; + + time(&rawtime); + timeinfo = localtime(&rawtime); + + _year = timeinfo->tm_year + 1900; + _month = timeinfo->tm_mon + 1; + _day = timeinfo->tm_mday; +} diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index 283d8ebf..eae35abb 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -69,7 +69,7 @@ #include "dpiManager.h" #endif //DPIMANAGER_H - +#include #include class NativeLangSpeaker; @@ -402,13 +402,6 @@ public: Style & getStyler(int index) { assert(index >= 0 && index < SCE_STYLE_ARRAY_SIZE); - /* - if (index < 0 || index >= SCE_STYLE_ARRAY_SIZE) - { - Style s; - return s; - } - */ return _styleArray[index]; }; @@ -416,7 +409,6 @@ public: void addStyler(int styleID, TiXmlNode *styleNode); void addStyler(int styleID, const TCHAR *styleName) { - //ZeroMemory(&_styleArray[_nbStyler], sizeof(Style));; _styleArray[styleID]._styleID = styleID; _styleArray[styleID]._styleDesc = styleName; _styleArray[styleID]._fgColor = black; @@ -605,61 +597,14 @@ public: _day = day; }; - Date(const TCHAR *dateStr) { // timeStr should be Notepad++ date format : YYYYMMDD - assert(dateStr); - if (lstrlen(dateStr) == 8) - { - generic_string ds(dateStr); - generic_string yyyy(ds, 0, 4); - generic_string mm(ds, 4, 2); - generic_string dd(ds, 6, 2); - - int y = generic_atoi(yyyy.c_str()); - int m = generic_atoi(mm.c_str()); - int d = generic_atoi(dd.c_str()); - - if ((y > 0 && y <= 9999) && (m > 0 && m <= 12) && (d > 0 && d <= 31)) - { - _year = y; - _month = m; - _day = d; - return; - } - } - now(); - }; + Date(const TCHAR *dateStr); // The constructor which makes the date of number of days from now // nbDaysFromNow could be negative if user want to make a date in the past // if the value of nbDaysFromNow is 0 then the date will be now - Date(int nbDaysFromNow) - { - const time_t oneDay = (60 * 60 * 24); + Date(int nbDaysFromNow); - time_t rawtime; - tm* timeinfo; - - time(&rawtime); - rawtime += (nbDaysFromNow * oneDay); - - timeinfo = localtime(&rawtime); - - _year = timeinfo->tm_year+1900; - _month = timeinfo->tm_mon+1; - _day = timeinfo->tm_mday; - } - - void now() { - time_t rawtime; - tm* timeinfo; - - time(&rawtime); - timeinfo = localtime(&rawtime); - - _year = timeinfo->tm_year+1900; - _month = timeinfo->tm_mon+1; - _day = timeinfo->tm_mday; - }; + void now(); generic_string toString() { // Return Notepad++ date format : YYYYMMDD TCHAR dateStr[8+1]; diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index ca01118b..2d071afe 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -345,7 +345,6 @@ bool AutoCompletion::showWordComplete(bool autoInsert) words += TEXT(" "); } - // UNICODE TO DO _pEditView->execute(SCI_AUTOCSETSEPARATOR, WPARAM(' ')); _pEditView->execute(SCI_AUTOCSETIGNORECASE, _ignoreCase); _pEditView->showAutoComletion(curPos - startPos, words.c_str()); diff --git a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp index 1bc5b0df..3fa21f67 100644 --- a/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/SmartHighlighter.cpp @@ -25,7 +25,6 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "SmartHighlighter.h" #include "ScintillaEditView.h" #include "FindReplaceDlg.h" diff --git a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h index 63dd48eb..ea8cf17c 100644 --- a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h +++ b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.h @@ -56,6 +56,11 @@ distribution. #define TIXMLA_OSTREAM TiXmlOutStreamA #endif +#include +#include +#include +#include + class TiXmlDocumentA; class TiXmlElementA; class TiXmlCommentA; diff --git a/PowerEditor/src/TinyXml/tinyxml.h b/PowerEditor/src/TinyXml/tinyxml.h index d3730a51..7e2313ce 100644 --- a/PowerEditor/src/TinyXml/tinyxml.h +++ b/PowerEditor/src/TinyXml/tinyxml.h @@ -50,14 +50,18 @@ distribution. #define TIXML_STRING generic_string #define TIXML_ISTREAM std::basic_istream #define TIXML_OSTREAM std::basic_ostream - - #else #include "tinystr.h" #define TIXML_STRING TiXmlString #define TIXML_OSTREAM TiXmlOutStream #endif +#include + +#include + +#include "Common.h" + class TiXmlDocument; class TiXmlElement; class TiXmlComment; diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp index a2e63a7a..3218ac2c 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp @@ -26,7 +26,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + +#include +#include + #include "AboutDlg.h" #include "Parameters.h" @@ -39,17 +42,11 @@ BOOL CALLBACK AboutDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) HWND compileDateHandle = ::GetDlgItem(_hSelf, IDC_BUILD_DATETIME); generic_string buildTime = TEXT("Build time : "); -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); buildTime += wmc->char2wchar(__DATE__, CP_ACP); buildTime += TEXT(" - "); buildTime += wmc->char2wchar(__TIME__, CP_ACP); -#else - buildTime += __DATE__; - buildTime += TEXT(" - "); - buildTime += __TIME__; -#endif ::SendMessage(compileDateHandle, WM_SETTEXT, 0, (LPARAM)buildTime.c_str()); ::EnableWindow(compileDateHandle, FALSE); diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h index 1dd602dc..8f7760c5 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h @@ -37,6 +37,8 @@ #include "resource.h" #endif// RESOURCE_H +#include "StaticDialog.h" + #define LICENCE_TXT \ TEXT("This program is free software; you can redistribute it and/or \ modify it under the terms of the GNU General Public License \ diff --git a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h index 776bc466..6a818b50 100644 --- a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h +++ b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h @@ -29,6 +29,9 @@ #ifndef URLCTRL_INCLUDED #define URLCTRL_INCLUDED +#include "Window.h" +#include "Common.h" + class URLCtrl : public Window { public: URLCtrl():_hfUnderlined(0),_hCursor(0), _msgDest(NULL), _cmdID(0), _oldproc(NULL), \ diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h index c0c7de4e..99de6462 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h @@ -36,6 +36,9 @@ #include "Docking.h" #endif //DOCKING_H +#include +#include + class DockingDlgInterface : public StaticDialog { public: @@ -49,7 +52,7 @@ public: StaticDialog::init(hInst, parent); TCHAR temp[MAX_PATH]; ::GetModuleFileName((HMODULE)hInst, temp, MAX_PATH); - _moduleName = PathFindFileName(temp); + _moduleName = ::PathFindFileName(temp); }; void create(tTbData * data, bool isRTL = false){ diff --git a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h index 04298a5f..84343b75 100644 --- a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h +++ b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h @@ -29,6 +29,8 @@ #ifndef IMAGE_LIST_H #define IMAGE_LIST_H +#include + const int nbMax = 45; #define IDI_SEPARATOR_ICON -1 diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp index 9d9fcf30..ff5f093f 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include + #include "FileDialog.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index df2507d7..11711be7 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -29,6 +29,9 @@ #ifndef FILE_DIALOG_H #define FILE_DIALOG_H +#include "Common.h" +#include "Notepad_plus_msgs.h" + const int nbExtMax = 256; const int extLenMax = 64; @@ -72,8 +75,6 @@ private: OPENFILENAME _ofn; winVer _winVersion; - - //TCHAR _extArray[nbExtMax][extLenMax]; int _nbExt; int _extTypeIndex; static FileDialog *staticThis; diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp index f1d9f912..9573cea9 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "Splitter.h" bool Splitter::_isHorizontalRegistered = false; diff --git a/PowerEditor/src/WinControls/SplitterContainer/Splitter.h b/PowerEditor/src/WinControls/SplitterContainer/Splitter.h index 17d822d6..a2827181 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/Splitter.h +++ b/PowerEditor/src/WinControls/SplitterContainer/Splitter.h @@ -33,6 +33,8 @@ #include "resource.h" #endif //RESOURCE_H +#include "Window.h" + #define SV_HORIZONTAL 0x00000001 #define SV_VERTICAL 0x00000002 #define SV_FIXED 0x00000004 diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index d85b8f11..c9fe2471 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "SplitterContainer.h" bool SplitterContainer::_isRegistered = false; diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp index b665e2d0..b6035d2e 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.cpp @@ -25,8 +25,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include +#include "StaticDialog.h" void StaticDialog::goToCenter() { diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h index d6f04c4e..f4e37456 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h @@ -33,6 +33,8 @@ #include "Notepad_plus_msgs.h" #endif //NOTEPAD_PLUS_MSGS_H +#include "Window.h" + typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); enum PosAlign{ALIGNPOS_LEFT, ALIGNPOS_RIGHT, ALIGNPOS_TOP, ALIGNPOS_BOTTOM}; diff --git a/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp b/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp index 131555e9..49245b59 100644 --- a/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp +++ b/PowerEditor/src/WinControls/StatusBar/StatusBar.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "StatusBar.h" //#define IDC_STATUSBAR 789 @@ -85,3 +86,17 @@ void StatusBar::adjustParts(int clientWidth) // Tell the status bar to create the window parts. ::SendMessage(_hSelf, SB_SETPARTS, (WPARAM)_nbParts, (LPARAM)_lpParts); } + +bool StatusBar::setText(const TCHAR *str, int whichPart) +{ + if (whichPart > _nbParts) + return false; + _lastSetText = str; + return (::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str()) == TRUE); +} + +bool StatusBar::setOwnerDrawText(const TCHAR *str) +{ + _lastSetText = str; + return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)_lastSetText.c_str()) == TRUE); +} \ No newline at end of file diff --git a/PowerEditor/src/WinControls/StatusBar/StatusBar.h b/PowerEditor/src/WinControls/StatusBar/StatusBar.h index 704d6fba..9f2c2cad 100644 --- a/PowerEditor/src/WinControls/StatusBar/StatusBar.h +++ b/PowerEditor/src/WinControls/StatusBar/StatusBar.h @@ -33,6 +33,9 @@ #define _WIN32_IE 0x0600 #endif //_WIN32_IE +#include "Window.h" +#include "Common.h" + class StatusBar : public Window { public : @@ -73,18 +76,8 @@ public : return Window::getHeight(); }; - bool setText(const TCHAR *str, int whichPart) { - if (whichPart > _nbParts) - return false; - _lastSetText = str; - return (::SendMessage(_hSelf, SB_SETTEXT, whichPart, (LPARAM)_lastSetText.c_str()) == TRUE); - }; - - bool setOwnerDrawText(const TCHAR *str) { - _lastSetText = str; - return (::SendMessage(_hSelf, SB_SETTEXT, SBT_OWNERDRAW, (LPARAM)_lastSetText.c_str()) == TRUE); - }; - + bool setText(const TCHAR *str, int whichPart); + bool setOwnerDrawText(const TCHAR *str); void adjustParts(int clientWidth); private : diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index 63046ead..c9e87ea4 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -33,6 +33,9 @@ #include "Notepad_plus_msgs.h" #endif //NOTEPAD_PLUS_MSGS_H +#include "Window.h" +#include "ImageListSet.h" + #define REBAR_BAR_TOOLBAR 0 #define REBAR_BAR_SEARCH 1 @@ -45,8 +48,6 @@ using namespace std; enum toolBarStatusType {/*TB_HIDE, */TB_SMALL, TB_LARGE, TB_STANDARD}; -#include "ImageListSet.h" - typedef struct { UINT message; // identification of icon in tool bar (menu ID) diff --git a/PowerEditor/src/WinControls/Window.h b/PowerEditor/src/WinControls/Window.h index 937266b3..3e760aa5 100644 --- a/PowerEditor/src/WinControls/Window.h +++ b/PowerEditor/src/WinControls/Window.h @@ -29,6 +29,8 @@ #ifndef WINDOW_CONTROL_H #define WINDOW_CONTROL_H +#include + class Window { public: diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index 411b035e..3ffb964f 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -422,7 +422,6 @@ bool WindowsDlg::changeDlgLang() { if (!_dlgNode) return false; -#ifdef UNICODE WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); int nativeLangEncoding = CP_ACP; TiXmlDeclarationA *declaration = _dlgNode->GetDocument()->FirstChild()->ToDeclaration(); @@ -432,18 +431,13 @@ bool WindowsDlg::changeDlgLang() EncodingMapper *em = EncodingMapper::getInstance(); nativeLangEncoding = em->getEncodingFromString(encodingStr); } -#endif // Set Title const char *titre = (_dlgNode->ToElement())->Attribute("title"); if (titre && titre[0]) { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(titre, nativeLangEncoding); ::SetWindowText(_hSelf, nameW); -#else - ::SetWindowText(_hSelf, titre); -#endif } // Set the text of child control @@ -460,12 +454,8 @@ bool WindowsDlg::changeDlgLang() HWND hItem = ::GetDlgItem(_hSelf, id); if (hItem) { -#ifdef UNICODE const wchar_t *nameW = wmc->char2wchar(name, nativeLangEncoding); ::SetWindowText(hItem, nameW); -#else - ::SetWindowText(hItem, name); -#endif } } } diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index 4c0a52c3..335deabf 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -611,19 +611,10 @@ recordedMacroStep::recordedMacroStep(int iMessage, long wParam, long lParam, int case IDD_FINDINFILES_DIR_COMBO: case IDD_FINDINFILES_FILTERS_COMBO: { -#ifdef UNICODE char *ch = reinterpret_cast(lParameter); TCHAR tch[2]; ::MultiByteToWideChar(codepage, 0, ch, -1, tch, 2); sParameter = *tch; -#else - char ch = *reinterpret_cast(lParameter); - TCHAR tch = ch; - sParameter = tch; - - // dummy call - codepage = 0; -#endif MacroType = mtUseSParameter; lParameter = 0; } @@ -644,17 +635,11 @@ void recordedMacroStep::PlayBack(Window* pNotepad, ScintillaEditView *pEditView) else { long lParam = lParameter; -#ifdef UNICODE char ansiBuffer[3]; -#endif if (MacroType == mtUseSParameter) { -#ifdef UNICODE ::WideCharToMultiByte(pEditView->execute(SCI_GETCODEPAGE), 0, sParameter.c_str(), -1, ansiBuffer, 3, NULL, NULL); lParam = reinterpret_cast(ansiBuffer); -#else - lParam = reinterpret_cast(sParameter.c_str()); -#endif } pEditView->execute(message, wParameter, lParam); diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.h b/PowerEditor/src/WinControls/shortcut/shortcut.h index a67940bf..41748865 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.h +++ b/PowerEditor/src/WinControls/shortcut/shortcut.h @@ -37,6 +37,8 @@ #include "Scintilla.h" #endif //SCINTILLA_H +#include "StaticDialog.h" + using namespace std; const size_t nameLenMax = 64; From 41c2d99327ea078add14a6da2358e820c0ab6601 Mon Sep 17 00:00:00 2001 From: milipili Date: Sun, 31 May 2015 20:55:51 +0200 Subject: [PATCH 07/16] ignore scintilla generated files --- .gitignore | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.gitignore b/.gitignore index cc714841..03bfc2cb 100644 --- a/.gitignore +++ b/.gitignore @@ -74,6 +74,14 @@ PowerEditor/visual.net/Unicode Release/ PowerEditor/visual.net/notepadPlus.sln +# scintilla - generated files +scintilla/bin/SciLexer.* +scintilla/bin/Scintilla.* +scintilla/win32/*.lib +scintilla/win32/ScintRes.res +scintilla/boostregex/bin +scintilla/boostregex/boostpath.mak + #------------------------------------------------------------------------------- # Windows From 25b3a712fbbaebd99480ee2e188f316a54c99059 Mon Sep 17 00:00:00 2001 From: milipili Date: Sun, 31 May 2015 21:27:27 +0200 Subject: [PATCH 08/16] fixed minor memory leak when exporting the parameters to XML When writing the parameters as a XML file (when the application quits), a new node was created but not destroyed (`InsertEndChild` makes a clone of the given node). --- PowerEditor/src/Parameters.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index dc543550..141cf9e5 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -3401,28 +3401,28 @@ bool NppParameters::writeProjectPanelsSettings() const TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); if (!nppRoot) return false; - TiXmlNode *projPanelRootNode = nppRoot->FirstChildElement(TEXT("ProjectPanels")); - if (projPanelRootNode) + TiXmlNode *oldProjPanelRootNode = nppRoot->FirstChildElement(TEXT("ProjectPanels")); + if (nullptr != oldProjPanelRootNode) { // Erase the Project Panel root - nppRoot->RemoveChild(projPanelRootNode); + nppRoot->RemoveChild(oldProjPanelRootNode); } // Create the Project Panel root - projPanelRootNode = new TiXmlElement(TEXT("ProjectPanels")); + TiXmlElement projPanelRootNode{TEXT("ProjectPanels")}; // Add 3 Project Panel parameters for (int i = 0 ; i < 3 ; ++i) { - TiXmlElement projPanelNode(TEXT("ProjectPanel")); + TiXmlElement projPanelNode{TEXT("ProjectPanel")}; (projPanelNode.ToElement())->SetAttribute(TEXT("id"), i); (projPanelNode.ToElement())->SetAttribute(TEXT("workSpaceFile"), _workSpaceFilePathes[i]); - (projPanelRootNode->ToElement())->InsertEndChild(projPanelNode); + (projPanelRootNode.ToElement())->InsertEndChild(projPanelNode); } // (Re)Insert the Project Panel root - (nppRoot->ToElement())->InsertEndChild(*projPanelRootNode); + (nppRoot->ToElement())->InsertEndChild(projPanelRootNode); return true; } From e9e710a3d4124763dc0a2e0353cdf7d55c812d60 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 31 May 2015 22:40:07 +0200 Subject: [PATCH 09/16] [UPDATE] Unprecompile headers (part 2) --- PowerEditor/src/MISC/Common/Sorters.h | 8 +- .../MISC/PluginsManager/Notepad_plus_msgs.h | 78 ++++++------ .../MISC/PluginsManager/PluginsManager.cpp | 2 + .../src/MISC/PluginsManager/PluginsManager.h | 8 +- PowerEditor/src/MISC/Process/Process.h | 2 - PowerEditor/src/Notepad_plus.cpp | 2 + PowerEditor/src/Notepad_plus.h | 12 +- PowerEditor/src/Notepad_plus_Window.cpp | 6 +- PowerEditor/src/Notepad_plus_Window.h | 2 +- PowerEditor/src/NppBigSwitch.cpp | 2 + PowerEditor/src/NppCommands.cpp | 1 + PowerEditor/src/NppIO.cpp | 1 + PowerEditor/src/NppNotification.cpp | 2 + PowerEditor/src/Parameters.cpp | 2 + PowerEditor/src/Parameters.h | 114 +++++++++--------- .../src/ScitillaComponent/AutoCompletion.cpp | 9 +- .../src/ScitillaComponent/AutoCompletion.h | 4 +- PowerEditor/src/ScitillaComponent/Buffer.cpp | 5 +- PowerEditor/src/ScitillaComponent/Buffer.h | 6 +- .../src/ScitillaComponent/FindReplaceDlg.cpp | 2 + .../src/ScitillaComponent/FindReplaceDlg.h | 4 +- .../src/ScitillaComponent/FunctionCallTip.h | 2 +- .../src/ScitillaComponent/ScintillaCtrls.cpp | 3 +- .../src/ScitillaComponent/ScintillaCtrls.h | 3 + .../ScitillaComponent/ScintillaEditView.cpp | 3 +- .../src/ScitillaComponent/ScintillaEditView.h | 6 +- .../ScitillaComponent/UserDefineDialog.cpp | 2 + .../src/ScitillaComponent/UserDefineDialog.h | 20 +-- .../src/ScitillaComponent/columnEditor.cpp | 14 ++- .../src/ScitillaComponent/columnEditor.h | 9 +- .../xmlMatchedTagsHighlighter.cpp | 3 +- .../xmlMatchedTagsHighlighter.h | 5 +- .../AnsiCharPanel/ansiCharPanel.cpp | 1 - .../WinControls/AnsiCharPanel/ansiCharPanel.h | 4 +- .../clipboardHistoryPanel.cpp | 1 - .../WinControls/ColourPicker/ColourPicker.cpp | 2 +- .../WinControls/ColourPicker/ColourPicker.h | 2 + .../WinControls/ColourPicker/ColourPopup.cpp | 2 +- .../WinControls/ColourPicker/ColourPopup.h | 2 + .../WinControls/ColourPicker/WordStyleDlg.cpp | 6 +- .../WinControls/ColourPicker/WordStyleDlg.h | 2 +- .../WinControls/ContextMenu/ContextMenu.cpp | 3 +- .../src/WinControls/ContextMenu/ContextMenu.h | 6 +- .../src/WinControls/DockingWnd/Docking.h | 2 + .../WinControls/DockingWnd/DockingCont.cpp | 3 +- .../src/WinControls/DockingWnd/DockingCont.h | 13 +- .../DockingWnd/DockingDlgInterface.h | 2 + .../WinControls/DockingWnd/DockingManager.cpp | 1 + .../WinControls/DockingWnd/DockingManager.h | 12 +- .../src/WinControls/DockingWnd/Gripper.cpp | 2 + .../FunctionList/functionListPanel.cpp | 2 + .../FunctionList/functionParser.cpp | 2 + PowerEditor/src/WinControls/Grid/BabyGrid.cpp | 1 - PowerEditor/src/WinControls/Grid/BabyGrid.h | 2 + .../src/WinControls/Grid/BabyGridWrapper.cpp | 1 - .../src/WinControls/Grid/BabyGridWrapper.h | 2 + .../src/WinControls/Grid/ShortcutMapper.cpp | 2 +- .../OpenSaveFileDialog/FileDialog.h | 4 +- .../WinControls/Preference/preferenceDlg.cpp | 2 + .../WinControls/Preference/preferenceDlg.h | 4 +- .../WinControls/StaticDialog/RunDlg/RunDlg.h | 2 - .../src/WinControls/TabBar/ControlsTab.cpp | 1 - .../src/WinControls/TabBar/ControlsTab.h | 4 + PowerEditor/src/WinControls/TabBar/TabBar.h | 4 + PowerEditor/src/WinControls/ToolBar/ToolBar.h | 8 +- PowerEditor/src/WinControls/ToolTip/ToolTip.h | 2 +- .../src/WinControls/WindowsDlg/SizeableDlg.h | 2 + .../src/WinControls/WindowsDlg/WinMgr.h | 3 + .../src/WinControls/WindowsDlg/WindowsDlg.cpp | 5 +- .../src/WinControls/WindowsDlg/WindowsDlg.h | 2 + .../src/WinControls/shortcut/RunMacroDlg.cpp | 4 +- .../src/WinControls/shortcut/RunMacroDlg.h | 2 +- .../src/WinControls/shortcut/shortcut.cpp | 5 +- .../src/WinControls/shortcut/shortcut.h | 11 +- PowerEditor/src/lastRecentFileList.h | 2 + PowerEditor/src/localization.cpp | 2 +- PowerEditor/src/uchardet/CharDistribution.cpp | 1 - 77 files changed, 273 insertions(+), 217 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Sorters.h b/PowerEditor/src/MISC/Common/Sorters.h index 82290438..388976e5 100644 --- a/PowerEditor/src/MISC/Common/Sorters.h +++ b/PowerEditor/src/MISC/Common/Sorters.h @@ -26,8 +26,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#ifndef M30_IDE_SORTERS_H -#define M30_IDE_SORTERS_H +#ifndef NPP_SORTERS_H +#define NPP_SORTERS_H + +#include // Base interface for line sorting. class ISorter @@ -259,4 +261,4 @@ protected: } }; -#endif //M30_IDE_SORTERS_H +#endif //NPP_SORTERS_H diff --git a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h index 3acce661..dc2912a3 100644 --- a/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h +++ b/PowerEditor/src/MISC/PluginsManager/Notepad_plus_msgs.h @@ -29,6 +29,8 @@ #ifndef NOTEPAD_PLUS_MSGS_H #define NOTEPAD_PLUS_MSGS_H +#include +#include enum LangType {L_TEXT, L_PHP , L_C, L_CPP, L_CS, L_OBJC, L_JAVA, L_RC,\ L_HTML, L_XML, L_MAKEFILE, L_PASCAL, L_BATCH, L_INI, L_ASCII, L_USER,\ @@ -541,44 +543,44 @@ enum winVer{WV_UNKNOWN, WV_WIN32S, WV_95, WV_98, WV_ME, WV_NT, WV_W2K, WV_XP, WV //scnNotification->nmhdr.hwndFrom = NULL; //scnNotification->nmhdr.idFrom = BufferID; - #define NPPN_BEFORESHUTDOWN (NPPN_FIRST + 19) // To notify plugins that Npp shutdown has been triggered, files have not been closed yet - //scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = 0; - - #define NPPN_CANCELSHUTDOWN (NPPN_FIRST + 20) // To notify plugins that Npp shutdown has been cancelled - //scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = 0; - - #define NPPN_FILEBEFORERENAME (NPPN_FIRST + 21) // To notify plugins that file is to be renamed - //scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = BufferID; - - #define NPPN_FILERENAMECANCEL (NPPN_FIRST + 22) // To notify plugins that file rename has been cancelled - //scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = BufferID; - - #define NPPN_FILERENAMED (NPPN_FIRST + 23) // To notify plugins that file has been renamed - //scnNotification->nmhdr.code = NPPN_FILERENAMED; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = BufferID; - - #define NPPN_FILEBEFOREDELETE (NPPN_FIRST + 24) // To notify plugins that file is to be deleted - //scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = BufferID; - - #define NPPN_FILEDELETEFAILED (NPPN_FIRST + 25) // To notify plugins that file deletion has failed - //scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED; - //scnNotification->nmhdr.hwndFrom = hwndNpp; - //scnNotification->nmhdr.idFrom = BufferID; - - #define NPPN_FILEDELETED (NPPN_FIRST + 26) // To notify plugins that file has been deleted - //scnNotification->nmhdr.code = NPPN_FILEDELETED; - //scnNotification->nmhdr.hwndFrom = hwndNpp; + #define NPPN_BEFORESHUTDOWN (NPPN_FIRST + 19) // To notify plugins that Npp shutdown has been triggered, files have not been closed yet + //scnNotification->nmhdr.code = NPPN_BEFORESHUTDOWN; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; + + #define NPPN_CANCELSHUTDOWN (NPPN_FIRST + 20) // To notify plugins that Npp shutdown has been cancelled + //scnNotification->nmhdr.code = NPPN_CANCELSHUTDOWN; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = 0; + + #define NPPN_FILEBEFORERENAME (NPPN_FIRST + 21) // To notify plugins that file is to be renamed + //scnNotification->nmhdr.code = NPPN_FILEBEFORERENAME; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILERENAMECANCEL (NPPN_FIRST + 22) // To notify plugins that file rename has been cancelled + //scnNotification->nmhdr.code = NPPN_FILERENAMECANCEL; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILERENAMED (NPPN_FIRST + 23) // To notify plugins that file has been renamed + //scnNotification->nmhdr.code = NPPN_FILERENAMED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILEBEFOREDELETE (NPPN_FIRST + 24) // To notify plugins that file is to be deleted + //scnNotification->nmhdr.code = NPPN_FILEBEFOREDELETE; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILEDELETEFAILED (NPPN_FIRST + 25) // To notify plugins that file deletion has failed + //scnNotification->nmhdr.code = NPPN_FILEDELETEFAILED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; + //scnNotification->nmhdr.idFrom = BufferID; + + #define NPPN_FILEDELETED (NPPN_FIRST + 26) // To notify plugins that file has been deleted + //scnNotification->nmhdr.code = NPPN_FILEDELETED; + //scnNotification->nmhdr.hwndFrom = hwndNpp; //scnNotification->nmhdr.idFrom = BufferID; #endif //NOTEPAD_PLUS_MSGS_H diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index a2966d83..f37a993e 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -30,6 +30,8 @@ #include "PluginsManager.h" #include "resource.h" +using namespace std; + const TCHAR * USERMSG = TEXT("This plugin is not compatible with current version of Notepad++.\n\n\ Do you want to remove this plugin from plugins directory to prevent this message from the next launch time?"); diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.h b/PowerEditor/src/MISC/PluginsManager/PluginsManager.h index ecc9e019..cb05f2a3 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.h +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.h @@ -97,7 +97,7 @@ public: _nppData = nppData; }; - int loadPlugin(const TCHAR *pluginFilePath, vector & dll2Remove); + int loadPlugin(const TCHAR *pluginFilePath, std::vector & dll2Remove); bool loadPlugins(const TCHAR *dir = NULL); bool unloadPlugin(int index, HWND nppHandle); @@ -129,9 +129,9 @@ private: NppData _nppData; HMENU _hPluginsMenu; - vector _pluginInfos; - vector _pluginsCommands; - vector _loadedDlls; + std::vector _pluginInfos; + std::vector _pluginsCommands; + std::vector _loadedDlls; bool _isDisabled; IDAllocator _dynamicIDAlloc; IDAllocator _markerAlloc; diff --git a/PowerEditor/src/MISC/Process/Process.h b/PowerEditor/src/MISC/Process/Process.h index 81d3ca54..2bf7ec23 100644 --- a/PowerEditor/src/MISC/Process/Process.h +++ b/PowerEditor/src/MISC/Process/Process.h @@ -29,8 +29,6 @@ #ifndef PROCESSUS_H #define PROCESSUS_H -using namespace std; - enum progType {WIN32_PROG, CONSOLE_PROG}; class Process diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 74d75cdd..1d455312 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -48,6 +48,8 @@ #include "documentMap.h" #include "functionListPanel.h" +using namespace std; + enum tb_stat {tb_saved, tb_unsaved, tb_ro}; #define DIR_LEFT true #define DIR_RIGHT false diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index 43fad220..f0d4d607 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -296,7 +296,7 @@ public: bool findInFiles(); bool replaceInFiles(); void setFindReplaceFolderFilter(const TCHAR *dir, const TCHAR *filters); - vector addNppComponents(const TCHAR *destDir, const TCHAR *extFilterName, const TCHAR *extFilter); + std::vector addNppComponents(const TCHAR *destDir, const TCHAR *extFilterName, const TCHAR *extFilter); int getHtmlXmlEncoding(const TCHAR *fileName) const; HACCEL getAccTable() const{ return _accelerator.getAccTable(); @@ -314,7 +314,7 @@ private: Notepad_plus_Window *_pPublicInterface; Window *_pMainWindow; DockingManager _dockingManager; - vector _internalFuncIDs; + std::vector _internalFuncIDs; AutoCompletion _autoCompleteMain; AutoCompletion _autoCompleteSub; //each Scintilla has its own autoComplete @@ -358,7 +358,7 @@ private: FindCharsInRangeDlg _findCharsInRangeDlg; // a handle list of all the Notepad++ dialogs - vector _hModelessDlgs; + std::vector _hModelessDlgs; LastRecentFileList _lastRecentFileList; @@ -422,7 +422,7 @@ private: ScintillaCtrls _scintillaCtrls4Plugins; - vector > _hideLinesMarks; + std::vector > _hideLinesMarks; StyleArray _hotspotStyles; AnsiCharPanel *_pAnsiCharPanel; @@ -594,8 +594,8 @@ private: bool findInOpenedFiles(); bool findInCurrentFile(); - bool matchInList(const TCHAR *fileName, const vector & patterns); - void getMatchedFileNames(const TCHAR *dir, const vector & patterns, vector & fileNames, bool isRecursive, bool isInHiddenDir); + bool matchInList(const TCHAR *fileName, const std::vector & patterns); + void getMatchedFileNames(const TCHAR *dir, const std::vector & patterns, std::vector & fileNames, bool isRecursive, bool isInHiddenDir); void doSynScorll(HWND hW); void setWorkingDir(const TCHAR *dir); diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 29670d4d..0e9d8169 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -159,14 +159,14 @@ void Notepad_plus_Window::init(HINSTANCE hInst, HWND parent, const TCHAR *cmdLin _notepad_plus_plus_core.loadCommandlineParams(cmdLine, cmdLineParams); } - vector fileNames; - vector patterns; + std::vector fileNames; + std::vector patterns; patterns.push_back(TEXT("*.xml")); generic_string nppDir = pNppParams->getNppPath(); LocalizationSwitcher & localizationSwitcher = pNppParams->getLocalizationSwitcher(); - wstring localizationDir = nppDir; + std::wstring localizationDir = nppDir; PathAppend(localizationDir, TEXT("localization\\")); _notepad_plus_plus_core.getMatchedFileNames(localizationDir.c_str(), patterns, fileNames, false, false); diff --git a/PowerEditor/src/Notepad_plus_Window.h b/PowerEditor/src/Notepad_plus_Window.h index 4fd1db82..b1766470 100644 --- a/PowerEditor/src/Notepad_plus_Window.h +++ b/PowerEditor/src/Notepad_plus_Window.h @@ -99,7 +99,7 @@ private: static const TCHAR _className[32]; bool _isPrelaunch; bool _disablePluginsManager; - string _userQuote; // keep the availability of this string for thread using + std::string _userQuote; // keep the availability of this string for thread using }; #endif //NOTEPAD_PLUS_WINDOW_H diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 8f25abd2..494238e3 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -38,6 +38,8 @@ #include "documentMap.h" #include "functionListPanel.h" +using namespace std; + #define WM_DPICHANGED 0x02E0 struct SortTaskListPred diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 98542483..a75a8186 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -38,6 +38,7 @@ #include "Sorters.h" #include "LongRunningOperation.h" +using namespace std; void Notepad_plus::macroPlayback(Macro macro) { diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index b430b97f..ee732d1a 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -34,6 +34,7 @@ #include "functionListPanel.h" #include +using namespace std; BufferID Notepad_plus::doOpen(const TCHAR *fileName, bool isRecursive, bool isReadOnly, int encoding, const TCHAR *backupFileName, time_t fileNameTimestamp) { diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index 99a00790..fcbc5eee 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -34,6 +34,8 @@ #include "documentMap.h" #include +using namespace std; + BOOL Notepad_plus::notify(SCNotification *notification) { //Important, keep track of which element generated the message diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index c0cff90a..93086e7a 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -36,6 +36,8 @@ #include "UserDefineDialog.h" #include "../src/sqlite/sqlite3.h" +using namespace std; + struct WinMenuKeyDefinition { //more or less matches accelerator table definition, easy copy/paste //const TCHAR * name; //name retrieved from menu? int vKey; diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index eae35abb..86243821 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -74,8 +74,6 @@ class NativeLangSpeaker; -using namespace std; - const bool POS_VERTICAL = true; const bool POS_HORIZOTAL = false; @@ -136,7 +134,7 @@ const TCHAR localConfFile[] = TEXT("doLocalConf.xml"); const TCHAR allowAppDataPluginsFile[] = TEXT("allowAppDataPlugins.xml"); const TCHAR notepadStyleFile[] = TEXT("asNotepad.xml"); -void cutString(const TCHAR *str2cut, vector & patternVect); +void cutString(const TCHAR *str2cut, std::vector & patternVect); struct Position @@ -162,8 +160,8 @@ struct sessionFileInfo : public Position { generic_string _fileName; generic_string _langName; - vector _marks; - vector _foldStates; + std::vector _marks; + std::vector _foldStates; int _encoding; generic_string _backupFilePath; @@ -176,8 +174,8 @@ struct Session { size_t _activeView; size_t _activeMainIndex; size_t _activeSubIndex; - vector _mainViewFiles; - vector _subViewFiles; + std::vector _mainViewFiles; + std::vector _subViewFiles; }; struct CmdLineParams { @@ -258,9 +256,9 @@ struct DockingManagerData { DockingManagerData() : _leftWidth(200), _rightWidth(200), _topHeight(200), _bottomHight(200) {}; - vector _flaotingWindowInfo; - vector _pluginDockInfo; - vector _containerTabInfo; + std::vector _flaotingWindowInfo; + std::vector _pluginDockInfo; + std::vector _containerTabInfo; bool getFloatingRCFrom(int floatCont, RECT & rc) { for (size_t i = 0, fwiLen = _flaotingWindowInfo.size(); i < fwiLen; ++i) @@ -648,8 +646,8 @@ private: }; struct MatchedPairConf { - vector< pair > _matchedPairs; - vector< pair > _matchedPairsInit; // used only on init + std::vector< std::pair > _matchedPairs; + std::vector< std::pair > _matchedPairsInit; // used only on init bool _doHtmlXmlTag; bool _doParentheses; bool _doBrackets; @@ -739,7 +737,7 @@ struct NppGUI NewDocDefaultSettings _newDocDefaultSettings; void setTabReplacedBySpace(bool b) {_tabReplacedBySpace = b;}; const NewDocDefaultSettings & getNewDocDefaultSettings() const {return _newDocDefaultSettings;}; - vector _excludedLangList; + std::vector _excludedLangList; bool _isLangMenuCompact; PrintSettings _printSettings; @@ -1024,10 +1022,10 @@ struct FindHistory { int _nbMaxFindHistoryFind; int _nbMaxFindHistoryReplace; - vector _findHistoryPaths; - vector _findHistoryFilters; - vector _findHistoryFinds; - vector _findHistoryReplaces; + std::vector _findHistoryPaths; + std::vector _findHistoryFilters; + std::vector _findHistoryFinds; + std::vector _findHistoryReplaces; bool _isMatchWord; bool _isMatchCase; @@ -1057,19 +1055,19 @@ public : wchar_t *_xmlFileName; }; - bool addLanguageFromXml(wstring xmlFullPath); - wstring getLangFromXmlFileName(const wchar_t *fn) const; + bool addLanguageFromXml(std::wstring xmlFullPath); + std::wstring getLangFromXmlFileName(const wchar_t *fn) const; - wstring getXmlFilePathFromLangName(const wchar_t *langName) const; + std::wstring getXmlFilePathFromLangName(const wchar_t *langName) const; bool switchToLang(wchar_t *lang2switch) const; size_t size() const { return _localizationList.size(); }; - pair getElementFromIndex(size_t index) { + std::pair getElementFromIndex(size_t index) { if (index >= _localizationList.size()) - return pair(TEXT(""), TEXT("")); + return std::pair(TEXT(""), TEXT("")); return _localizationList[index]; }; @@ -1078,14 +1076,14 @@ public : _fileName = fn; }; - string getFileName() const { + std::string getFileName() const { return _fileName; }; private : - vector< pair< wstring, wstring > > _localizationList; - wstring _nativeLangPath; - string _fileName; + std::vector< std::pair< std::wstring, std::wstring > > _localizationList; + std::wstring _nativeLangPath; + std::string _fileName; }; class ThemeSwitcher { @@ -1095,11 +1093,11 @@ public : ThemeSwitcher(){}; void addThemeFromXml(generic_string xmlFullPath) { - _themeList.push_back(pair(getThemeFromXmlFileName(xmlFullPath.c_str()), xmlFullPath)); + _themeList.push_back(std::pair(getThemeFromXmlFileName(xmlFullPath.c_str()), xmlFullPath)); }; void addDefaultThemeFromXml(generic_string xmlFullPath) { - _themeList.push_back(pair(TEXT("Default (stylers.xml)"), xmlFullPath)); + _themeList.push_back(std::pair(TEXT("Default (stylers.xml)"), xmlFullPath)); }; generic_string getThemeFromXmlFileName(const TCHAR *fn) const; @@ -1124,24 +1122,24 @@ public : }; - pair & getElementFromIndex(size_t index) { + std::pair & getElementFromIndex(size_t index) { //if (index >= _themeList.size()) //return pair(TEXT(""), TEXT("")); return _themeList[index]; }; private : - vector< pair< generic_string, generic_string > > _themeList; + std::vector< std::pair< generic_string, generic_string > > _themeList; generic_string _stylesXmlPath; }; class PluginList { public : void add(generic_string fn, bool isInBL){ - _list.push_back(pair(fn, isInBL)); + _list.push_back(std::pair(fn, isInBL)); }; private : - vector>_list; + std::vector>_list; }; const int NB_LANG = 80; @@ -1278,7 +1276,7 @@ public: }; void setFontList(HWND hWnd); - const vector & getFontList() const {return _fontlist;}; + const std::vector & getFontList() const { return _fontlist; }; int getNbUserLang() const {return _nbUserLang;}; UserLangContainer & getULCFromIndex(int i) {return *_userLangArray[i];}; @@ -1304,7 +1302,7 @@ public: bool ExternalLangHasRoom() const {return _nbExternalLang < NB_MAX_EXTERNAL_LANG;}; void getExternalLexerFromXmlTree(TiXmlDocument *doc); - vector * getExternalLexerDoc() { return &_pXmlExternalLexerDoc;}; + std::vector * getExternalLexerDoc() { return &_pXmlExternalLexerDoc; }; void writeUserDefinedLang(); void writeShortcuts(); @@ -1329,7 +1327,7 @@ public: for (int i = 0 ; i < _nbUserLang ; ++i) { - vector extVect; + std::vector extVect; cutString(_userLangArray[i]->_ext.c_str(), extVect); for (size_t j = 0, len = extVect.size(); j < len; ++j) if (!generic_stricmp(extVect[j].c_str(), ext) || (_tcschr(fullName, '.') && !generic_stricmp(extVect[j].c_str(), fullName))) @@ -1389,21 +1387,21 @@ public: bool isRemappingShortcut() const {return _shortcuts.size() != 0;}; - vector & getUserShortcuts() {return _shortcuts;}; - vector & getUserModifiedShortcuts() {return _customizedShortcuts;}; + std::vector & getUserShortcuts() { return _shortcuts; }; + std::vector & getUserModifiedShortcuts() { return _customizedShortcuts; }; void addUserModifiedIndex(int index); - vector & getMacroList() {return _macros;}; - vector & getUserCommandList() {return _userCommands;}; - vector & getPluginCommandList() {return _pluginCommands;}; - vector & getPluginModifiedKeyIndices() {return _pluginCustomizedCmds;}; + std::vector & getMacroList() { return _macros; }; + std::vector & getUserCommandList() { return _userCommands; }; + std::vector & getPluginCommandList() { return _pluginCommands; }; + std::vector & getPluginModifiedKeyIndices() { return _pluginCustomizedCmds; }; void addPluginModifiedIndex(int index); - vector & getScintillaKeyList() {return _scintillaKeyCommands;}; - vector & getScintillaModifiedKeyIndices() {return _scintillaModifiedKeyIndices;}; + std::vector & getScintillaKeyList() { return _scintillaKeyCommands; }; + std::vector & getScintillaModifiedKeyIndices() { return _scintillaModifiedKeyIndices; }; void addScintillaModifiedIndex(int index); - vector & getContextMenuItems() {return _contextMenuItems;}; + std::vector & getContextMenuItems() { return _contextMenuItems; }; const Session & getSession() const {return _session;}; bool hasCustomContextMenu() const {return !_contextMenuItems.empty();}; @@ -1468,7 +1466,7 @@ public: return _themeSwitcher; }; - vector & getBlackList() {return _blacklist;}; + std::vector & getBlackList() { return _blacklist; }; bool isInBlackList(TCHAR *fn) { for (size_t i = 0, len = _blacklist.size(); i < len ; ++i) if (_blacklist[i] == fn) @@ -1534,7 +1532,7 @@ private: TiXmlDocumentA *_pXmlNativeLangDocA, *_pXmlContextMenuDocA; - vector _pXmlExternalLexerDoc; + std::vector _pXmlExternalLexerDoc; NppGUI _nppGUI; ScintillaViewParams _svp; @@ -1566,8 +1564,8 @@ private: LexerStylerArray _lexerStylerArray; StyleArray _widgetStyleArray; - vector _fontlist; - vector _blacklist; + std::vector _fontlist; + std::vector _blacklist; PluginList _pluginList; HMODULE _hUXTheme; @@ -1577,15 +1575,15 @@ private: bool _isLocal; - vector _shortcuts; //main menu shortuts. Static size - vector _customizedShortcuts; //altered main menu shortcuts. Indices static. Needed when saving alterations - vector _macros; //macro shortcuts, dynamic size, defined on loading macros and adding/deleting them - vector _userCommands; //run shortcuts, dynamic size, defined on loading run commands and adding/deleting them - vector _pluginCommands; //plugin commands, dynamic size, defined on loading plugins - vector _pluginCustomizedCmds; //plugincommands that have been altered. Indices determined after loading ALL plugins. Needed when saving alterations + std::vector _shortcuts; //main menu shortuts. Static size + std::vector _customizedShortcuts; //altered main menu shortcuts. Indices static. Needed when saving alterations + std::vector _macros; //macro shortcuts, dynamic size, defined on loading macros and adding/deleting them + std::vector _userCommands; //run shortcuts, dynamic size, defined on loading run commands and adding/deleting them + std::vector _pluginCommands; //plugin commands, dynamic size, defined on loading plugins + std::vector _pluginCustomizedCmds; //plugincommands that have been altered. Indices determined after loading ALL plugins. Needed when saving alterations - vector _scintillaKeyCommands; //scintilla keycommands. Static size - vector _scintillaModifiedKeyIndices; //modified scintilla keys. Indices static, determined by searching for commandId. Needed when saving alterations + std::vector _scintillaKeyCommands; //scintilla keycommands. Static size + std::vector _scintillaModifiedKeyIndices; //modified scintilla keys. Indices static, determined by searching for commandId. Needed when saving alterations LocalizationSwitcher _localizationSwitcher; generic_string _startWithLocFileName; @@ -1593,7 +1591,7 @@ private: ThemeSwitcher _themeSwitcher; //vector _noMenuCmdNames; - vector _contextMenuItems; + std::vector _contextMenuItems; Session _session; generic_string _shortcutsPath; @@ -1621,7 +1619,7 @@ private: COLORREF _currentDefaultFgColor; static int CALLBACK EnumFontFamExProc(ENUMLOGFONTEX *lpelfe, NEWTEXTMETRICEX *, int, LPARAM lParam) { - vector *pStrVect = (vector *)lParam; + std::vector *pStrVect = (std::vector *)lParam; size_t vectSize = pStrVect->size(); //Search through all the fonts, EnumFontFamiliesEx never states anything about order diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index 2d071afe..cd79faf7 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -25,12 +25,13 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" - +#include +#include +#include #include "AutoCompletion.h" #include "Notepad_plus_msgs.h" -#include + +using namespace std; static bool isInList(generic_string word, const vector & wordArray) { diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.h b/PowerEditor/src/ScitillaComponent/AutoCompletion.h index a3d66e02..58dfe39f 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.h +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.h @@ -103,14 +103,14 @@ private: bool _ignoreCase; - vector _keyWordArray; + std::vector _keyWordArray; generic_string _keyWords; size_t _keyWordMaxLen; FunctionCallTip _funcCalltip; const TCHAR * getApiFileName(); - void getWordArray(vector & wordArray, TCHAR *beginChars); + void getWordArray(std::vector & wordArray, TCHAR *beginChars); }; #endif //AUTOCOMPLETION_H diff --git a/PowerEditor/src/ScitillaComponent/Buffer.cpp b/PowerEditor/src/ScitillaComponent/Buffer.cpp index 875bf973..2826ec5b 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.cpp +++ b/PowerEditor/src/ScitillaComponent/Buffer.cpp @@ -25,8 +25,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include +#include #include "Buffer.h" #include "Scintilla.h" #include "Parameters.h" diff --git a/PowerEditor/src/ScitillaComponent/Buffer.h b/PowerEditor/src/ScitillaComponent/Buffer.h index 51c30cba..0a8a5e4a 100644 --- a/PowerEditor/src/ScitillaComponent/Buffer.h +++ b/PowerEditor/src/ScitillaComponent/Buffer.h @@ -348,9 +348,9 @@ private : bool _needLexer; //initially true //these properties have to be duplicated because of multiple references //All the vectors must have the same size at all times - vector< ScintillaEditView * > _referees; - vector< Position > _positions; - vector< vector > _foldStates; + std::vector< ScintillaEditView * > _referees; + std::vector< Position > _positions; + std::vector< std::vector > _foldStates; //vector< pair > > _linesUndoState; diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 3c8fb972..153760e5 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -33,6 +33,8 @@ #include "UniConversion.h" #include "LongRunningOperation.h" +using namespace std; + FindOption * FindReplaceDlg::_env; FindOption FindReplaceDlg::_options; diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index 92a35fb4..e69b725c 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -239,7 +239,7 @@ public : }; const TCHAR * getDir2Search() const {return _env->_directory.c_str();}; - void getPatterns(vector & patternVect); + void getPatterns(std::vector & patternVect); void launchFindInFilesDlg() { doDialog(FINDINFILES_DLG); @@ -361,7 +361,7 @@ private : }; void fillFindHistory(); void fillComboHistory(int id, const std::vector & strings); - int saveComboHistory(int id, int maxcount, vector & strings); + int saveComboHistory(int id, int maxcount, std::vector & strings); static const int FR_OP_FIND = 1; static const int FR_OP_REPLACE = 2; static const int FR_OP_FIF = 4; diff --git a/PowerEditor/src/ScitillaComponent/FunctionCallTip.h b/PowerEditor/src/ScitillaComponent/FunctionCallTip.h index a7ce55cc..01575ce6 100644 --- a/PowerEditor/src/ScitillaComponent/FunctionCallTip.h +++ b/PowerEditor/src/ScitillaComponent/FunctionCallTip.h @@ -62,7 +62,7 @@ private: //cache some XML values n stuff TCHAR * _funcName; //name of function stringVec _retVals; //vector of overload return values/types - vector _overloads; //vector of overload params (=vector) + std::vector _overloads; //vector of overload params (=vector) stringVec _descriptions; //vecotr of function descriptions int _currentNrOverloads; //current amount of overloads int _currentOverload; //current chosen overload diff --git a/PowerEditor/src/ScitillaComponent/ScintillaCtrls.cpp b/PowerEditor/src/ScitillaComponent/ScintillaCtrls.cpp index dc91087a..d7df7692 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaCtrls.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaCtrls.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ScintillaCtrls.h" #include "ScintillaEditView.h" @@ -68,7 +67,7 @@ bool ScintillaCtrls::destroyScintilla(HWND handle2Destroy) _scintVector[i]->destroy(); delete _scintVector[i]; - vector::iterator it2delete = _scintVector.begin()+ i; + std::vector::iterator it2delete = _scintVector.begin()+ i; _scintVector.erase(it2delete); return true; } diff --git a/PowerEditor/src/ScitillaComponent/ScintillaCtrls.h b/PowerEditor/src/ScitillaComponent/ScintillaCtrls.h index fc9e8fcf..81b4a61e 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaCtrls.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaCtrls.h @@ -29,6 +29,9 @@ #ifndef SCINTILLACTRLS_H #define SCINTILLACTRLS_H +#include +#include + class ScintillaEditView; class ScintillaCtrls { diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index bc22ac59..97922c18 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -26,12 +26,13 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "ScintillaEditView.h" #include "Parameters.h" #include "Sorters.h" #include "TCHAR.h" +using namespace std; // initialize the static variable diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 122149a7..eb2f34c1 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -187,7 +187,7 @@ struct SortInPositionOrder { } }; -typedef vector ColumnModeInfos; +typedef std::vector ColumnModeInfos; struct LanguageName { const TCHAR * lexerName; @@ -539,7 +539,7 @@ public: void currentLineUp() const; void currentLineDown() const; - pair getSelectionLinesRange() const; + std::pair getSelectionLinesRange() const; void currentLinesUp() const; void currentLinesDown() const; @@ -912,7 +912,7 @@ protected: } }; - pair getWordRange(); + std::pair getWordRange(); bool expandWordSelection(); }; diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp index 09f04b34..1485d8b1 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp @@ -37,6 +37,8 @@ #include "FileDialog.h" #include "Common.h" +using namespace std; + UserLangContainer * SharedParametersDialog::_pUserLang = NULL; ScintillaEditView * SharedParametersDialog::_pScintilla = NULL; diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.h b/PowerEditor/src/ScitillaComponent/UserDefineDialog.h index cc97a4b7..c8146f59 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.h +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.h @@ -52,7 +52,7 @@ static int max(int a, int b) { #include "tchar.h" #include "scilexer.h" #include -using namespace std; + class ScintillaEditView; class UserLangContainer; struct Style; @@ -66,18 +66,18 @@ class GlobalMappers { public: - map keywordIdMapper; - map keywordNameMapper; + std::map keywordIdMapper; + std::map keywordNameMapper; - map styleIdMapper; - map styleNameMapper; + std::map styleIdMapper; + std::map styleNameMapper; - map temp; - map::iterator iter; + std::map temp; + std::map::iterator iter; - map nestingMapper; - map dialogMapper; - map setLexerMapper; + std::map nestingMapper; + std::map dialogMapper; + std::map setLexerMapper; // only default constructor is needed GlobalMappers() diff --git a/PowerEditor/src/ScitillaComponent/columnEditor.cpp b/PowerEditor/src/ScitillaComponent/columnEditor.cpp index 19520940..a4809bce 100644 --- a/PowerEditor/src/ScitillaComponent/columnEditor.cpp +++ b/PowerEditor/src/ScitillaComponent/columnEditor.cpp @@ -26,12 +26,22 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include +#include +#include #include "columnEditor.h" #include "ScintillaEditView.h" -#include +void ColumnEditorDlg::init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView) +{ + Window::init(hInst, hPere); + if (!ppEditView) + throw std::runtime_error("StaticDialog::init : ppEditView is null."); + _ppEditView = ppEditView; +} + void ColumnEditorDlg::display(bool toShow) const { Window::display(toShow); diff --git a/PowerEditor/src/ScitillaComponent/columnEditor.h b/PowerEditor/src/ScitillaComponent/columnEditor.h index ced55197..c7632713 100644 --- a/PowerEditor/src/ScitillaComponent/columnEditor.h +++ b/PowerEditor/src/ScitillaComponent/columnEditor.h @@ -33,6 +33,8 @@ #include "columnEditor_rc.h" #endif //COLUMNEDITOR_RC_H +#include "StaticDialog.h" + class ScintillaEditView; const bool activeText = true; @@ -43,12 +45,7 @@ class ColumnEditorDlg : public StaticDialog public : ColumnEditorDlg() : StaticDialog() {}; - void init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView) { - Window::init(hInst, hPere); - if (!ppEditView) - throw std::runtime_error("StaticDialog::init : ppEditView is null."); - _ppEditView = ppEditView; - }; + void init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView); virtual void create(int dialogID, bool isRTL = false) { StaticDialog::create(dialogID, isRTL); diff --git a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp index 8ab62256..110df952 100644 --- a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp +++ b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.cpp @@ -31,11 +31,10 @@ // Reverse regex are slow using the new regex engine, and hence cost too much time. -#include "precompiledHeaders.h" #include "xmlMatchedTagsHighlighter.h" #include "ScintillaEditView.h" - +using namespace std; vector< pair > XmlMatchedTagsHighlighter::getAttributesPos(int start, int end) { diff --git a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h index 4c36619f..3d209a38 100644 --- a/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h +++ b/PowerEditor/src/ScitillaComponent/xmlMatchedTagsHighlighter.h @@ -29,7 +29,8 @@ #ifndef XMLMATCHEDTAGSHIGHLIGHTER_H #define XMLMATCHEDTAGSHIGHLIGHTER_H -using namespace std; +#include +#include class ScintillaEditView; @@ -68,7 +69,7 @@ private: FindResult findCloseTag(const std::string& tagName, int start, int end); int findCloseAngle(int startPosition, int endPosition); - vector< pair > getAttributesPos(int start, int end); + std::vector< std::pair > getAttributesPos(int start, int end); }; diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp index 9d9e786b..7a1e8673 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ansiCharPanel.h" #include "ScintillaEditView.h" diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.h b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.h index f9659d39..c1eef333 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.h +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ansiCharPanel.h @@ -29,7 +29,9 @@ #ifndef ANSICHARPANEL_H #define ANSICHARPANEL_H -//#include +#include +#include + #ifndef DOCKINGDLGINTERFACE_H #include "DockingDlgInterface.h" #endif //DOCKINGDLGINTERFACE_H diff --git a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp index 9a70c20d..15848ebc 100644 --- a/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp +++ b/PowerEditor/src/WinControls/ClipboardHistory/clipboardHistoryPanel.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "clipboardHistoryPanel.h" #include "ScintillaEditView.h" #include "clipboardFormats.h" diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp index 0469c1c8..4810b7ca 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "ColourPicker.h" #include "ColourPopup.h" diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h index 16f1f63d..c1d32cb8 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPicker.h @@ -29,6 +29,8 @@ #ifndef COLOUR_PICKER_H #define COLOUR_PICKER_H +#include "Window.h" + class ColourPopup; #define CPN_COLOURPICKED (BN_CLICKED) diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp index e8f7606e..12bc83a5 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "ColourPopup.h" DWORD colourItems[] = { diff --git a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h index cf2ed7d3..08ea6921 100644 --- a/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h +++ b/PowerEditor/src/WinControls/ColourPicker/ColourPopup.h @@ -37,6 +37,8 @@ #include "resource.h" #endif //RESOURCE_H +#include "Window.h" + #define WM_PICKUP_COLOR (COLOURPOPUP_USER + 1) #define WM_PICKUP_CANCEL (COLOURPOPUP_USER + 2) diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index 5a50dc72..f9fdbf2a 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -26,10 +26,14 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include +#include #include "WordStyleDlg.h" #include "ScintillaEditView.h" +using namespace std; + BOOL CALLBACK ColourStaticTextHooker::colourStaticProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam) { switch(Message) diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 3b18875c..8df97f7b 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -121,7 +121,7 @@ public : void addLastThemeEntry() { NppParameters *nppParamInst = NppParameters::getInstance(); ThemeSwitcher & themeSwitcher = nppParamInst->getThemeSwitcher(); - pair & themeInfo = themeSwitcher.getElementFromIndex(themeSwitcher.size() - 1); + std::pair & themeInfo = themeSwitcher.getElementFromIndex(themeSwitcher.size() - 1); ::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, (LPARAM)themeInfo.first.c_str()); }; diff --git a/PowerEditor/src/WinControls/ContextMenu/ContextMenu.cpp b/PowerEditor/src/WinControls/ContextMenu/ContextMenu.cpp index 4a6940f9..e518f705 100644 --- a/PowerEditor/src/WinControls/ContextMenu/ContextMenu.cpp +++ b/PowerEditor/src/WinControls/ContextMenu/ContextMenu.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ContextMenu.h" MenuItemUnit::MenuItemUnit(unsigned long cmdID, const TCHAR *itemName, const TCHAR *parentFolderName) : _cmdID(cmdID) @@ -52,7 +51,7 @@ ContextMenu::~ContextMenu() } } -void ContextMenu::create(HWND hParent, const vector & menuItemArray, const HMENU mainMenuHandle) +void ContextMenu::create(HWND hParent, const std::vector & menuItemArray, const HMENU mainMenuHandle) { _hParent = hParent; _hMenu = ::CreatePopupMenu(); diff --git a/PowerEditor/src/WinControls/ContextMenu/ContextMenu.h b/PowerEditor/src/WinControls/ContextMenu/ContextMenu.h index 6f7fb113..5e58ca5f 100644 --- a/PowerEditor/src/WinControls/ContextMenu/ContextMenu.h +++ b/PowerEditor/src/WinControls/ContextMenu/ContextMenu.h @@ -29,7 +29,7 @@ #ifndef CONTEXTMENU_H #define CONTEXTMENU_H -using namespace std; +#include "Common.h" struct MenuItemUnit { unsigned long _cmdID; @@ -46,7 +46,7 @@ public: ContextMenu() : _hParent(NULL), _hMenu(NULL) {}; ~ContextMenu(); - void create(HWND hParent, const vector & menuItemArray, const HMENU mainMenuHandle = NULL); + void create(HWND hParent, const std::vector & menuItemArray, const HMENU mainMenuHandle = NULL); bool isCreated() const {return _hMenu != NULL;}; void display(const POINT & p) const { @@ -69,7 +69,7 @@ public: private: HWND _hParent; HMENU _hMenu; - vector _subMenus; + std::vector _subMenus; }; diff --git a/PowerEditor/src/WinControls/DockingWnd/Docking.h b/PowerEditor/src/WinControls/DockingWnd/Docking.h index abd43eec..4ee00fe2 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Docking.h +++ b/PowerEditor/src/WinControls/DockingWnd/Docking.h @@ -29,6 +29,8 @@ #ifndef DOCKING_H #define DOCKING_H +#include + // ATTENTION : It's a part of interface header, so don't include the others header here // styles for containers diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 8b54a07a..619176b4 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -25,7 +25,6 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "dockingResource.h" #include "DockingCont.h" @@ -33,6 +32,8 @@ #include "ToolTip.h" #include "Parameters.h" +using namespace std; + #ifndef WH_MOUSE_LL #define WH_MOUSE_LL 14 #endif diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index b5117d8c..e3a05c99 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -37,8 +37,9 @@ #include "Docking.h" #endif //DOCKING_H - -using namespace std; +#include +#include "StaticDialog.h" +#include "Common.h" // window styles @@ -61,8 +62,6 @@ enum eMousePos { #define CLOSEBTN_POS_TOP 3 - - class DockingCont : public StaticDialog { public: @@ -102,10 +101,10 @@ public: void setActiveTb(INT iItem); INT getActiveTb(); tTbData * getDataOfActiveTb(); - vector getDataOfAllTb() { + std::vector getDataOfAllTb() { return _vTbData; }; - vector getDataOfVisTb(); + std::vector getDataOfVisTb(); bool isTbVis(tTbData* data); void doDialog(bool willBeShown = true, bool isFloating = false); @@ -234,7 +233,7 @@ private: eMousePos _hoverMPos; // data of added windows - vector _vTbData; + std::vector _vTbData; }; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h index 99de6462..cefacb48 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h @@ -38,6 +38,8 @@ #include #include +#include "Common.h" +#include "StaticDialog.h" class DockingDlgInterface : public StaticDialog { diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp index 63a70ae1..8c78baf6 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp @@ -33,6 +33,7 @@ #include "Gripper.h" #include "parameters.h" +using namespace std; BOOL DockingManager::_isRegistered = FALSE; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h index f4acdbc3..da401842 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h @@ -40,10 +40,6 @@ class DockingSplitter; #endif //SPLITTER_CONTAINER_H #define DSPC_CLASS_NAME TEXT("dockingManager") - -using namespace std; - - #define CONT_MAP_MAX 50 @@ -83,7 +79,7 @@ public : int GetContainer(DockingCont* pCont); // get all container in vector - vector & getContainerInfo() { + std::vector & getContainerInfo() { return _vContainer; }; // get dock data (sized areas) @@ -124,14 +120,14 @@ private: RECT _rcWork; RECT _rect; Window **_ppMainWindow; - vector _vImageList; + std::vector _vImageList; HIMAGELIST _hImageList; - vector _vContainer; + std::vector _vContainer; tDockMgr _dockData; static BOOL _isRegistered; BOOL _isInitialized; int _iContMap[CONT_MAP_MAX]; - vector _vSplitter; + std::vector _vSplitter; }; #endif //DOCKINGMANAGER_H diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp index f7065889..344d6d4f 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -34,6 +34,8 @@ #include "DockingManager.h" #include "Parameters.h" +using namespace std; + #ifndef WH_KEYBOARD_LL #define WH_KEYBOARD_LL 13 #endif diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index db230d9a..2e2fd339 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -31,6 +31,8 @@ #include "ScintillaEditView.h" #include "localization.h" +using namespace std; + #define CX_BITMAP 16 #define CY_BITMAP 16 diff --git a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp index 6c112fdb..16d3904b 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp @@ -30,6 +30,8 @@ #include "functionParser.h" #include "boostregexsearch.h" +using namespace std; + FunctionParsersManager::~FunctionParsersManager() { for (size_t i = 0, len = _parsers.size(); i < len; ++i) diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 76c636b2..ef833d5f 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -10,7 +10,6 @@ Add WM_MOUSEWHEEL, WM_LBUTTONDBLCLK and WM_RBUTTONUP events Modified by Don HO */ -#include "precompiledHeaders.h" #include "babygrid.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.h b/PowerEditor/src/WinControls/Grid/BabyGrid.h index b39f3bd8..be1e3dba 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.h +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.h @@ -7,6 +7,8 @@ #ifndef BABYGRID_H +#include + #ifndef RESOURCE_H #include "resource.h" #endif// RESOURCE_H diff --git a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.cpp b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.cpp index 21714837..8ecb5e42 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "BabyGridWrapper.h" const TCHAR *babyGridClassName = TEXT("BABYGRID"); diff --git a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h index 85f2fb9d..9b87a8d2 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h +++ b/PowerEditor/src/WinControls/Grid/BabyGridWrapper.h @@ -33,6 +33,8 @@ #include "babygrid.h" #endif// BABYGRID_H +#include "Window.h" + class BabyGridWrapper : public Window { public : diff --git a/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp b/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp index 002d48bc..b384613b 100644 --- a/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp +++ b/PowerEditor/src/WinControls/Grid/ShortcutMapper.cpp @@ -26,10 +26,10 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ShortcutMapper.h" #include "Notepad_plus.h" +using namespace std; void ShortcutMapper::initTabs() { HWND hTab = _hTabCtrl = ::GetDlgItem(_hSelf, IDC_BABYGRID_TABBAR); diff --git a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h index 11711be7..307827aa 100644 --- a/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h +++ b/PowerEditor/src/WinControls/OpenSaveFileDialog/FileDialog.h @@ -35,9 +35,7 @@ const int nbExtMax = 256; const int extLenMax = 64; -using namespace std; - -typedef vector stringVector; +typedef std::vector stringVector; generic_string changeExt(generic_string fn, generic_string ext, bool forceReplaced = true); void goToCenter(HWND hwnd); diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index a2849c29..d8f4d2ba 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -31,6 +31,8 @@ #include "lesDlgs.h" #include "EncodingMapper.h" +using namespace std; + const int BLINKRATE_FASTEST = 50; const int BLINKRATE_SLOWEST = 2500; const int BLINKRATE_INTERVAL = 50; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.h b/PowerEditor/src/WinControls/Preference/preferenceDlg.h index ab79ef9d..045e8c22 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.h +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.h @@ -139,7 +139,7 @@ public : private : LexerStylerArray _lsArray; BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); - vector _langList; + std::vector _langList; }; class TabSettings : public StaticDialog @@ -168,7 +168,7 @@ public : PrintSettingsDlg():_focusedEditCtrl(0), _selStart(0), _selEnd(0){}; private : BOOL CALLBACK run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam); - vector varList; + std::vector varList; int _focusedEditCtrl; DWORD _selStart; DWORD _selEnd; diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h index 5d52f709..18e6898a 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h @@ -22,8 +22,6 @@ #include "RunDlg_rc.h" #endif //RUN_DLG_RC_H -using namespace std; - #define CURRENTWORD_MAXLENGTH 2048 const TCHAR fullCurrentPath[] = TEXT("FULL_CURRENT_PATH"); diff --git a/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp b/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp index 73b4ae05..8e05dee5 100644 --- a/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp +++ b/PowerEditor/src/WinControls/TabBar/ControlsTab.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ControlsTab.h" void ControlsTab::createTabs(WindowVector & winVector) diff --git a/PowerEditor/src/WinControls/TabBar/ControlsTab.h b/PowerEditor/src/WinControls/TabBar/ControlsTab.h index 925f84a7..32aaa95b 100644 --- a/PowerEditor/src/WinControls/TabBar/ControlsTab.h +++ b/PowerEditor/src/WinControls/TabBar/ControlsTab.h @@ -29,10 +29,14 @@ #ifndef CONTROLS_TAB_H #define CONTROLS_TAB_H + #ifndef TAB_BAR_H #include "TabBar.h" #endif //TAB_BAR_H +#include "window.h" +#include "Common.h" + struct DlgInfo { Window *_dlg; generic_string _name; diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.h b/PowerEditor/src/WinControls/TabBar/TabBar.h index ab2567c8..e3a5d529 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.h +++ b/PowerEditor/src/WinControls/TabBar/TabBar.h @@ -41,6 +41,10 @@ #include "resource.h" #endif //RESOURCE_H +#include +#include +#include "Window.h" + //Notification message #define TCN_TABDROPPED (TCN_FIRST - 10) #define TCN_TABDROPPEDOUTSIDE (TCN_FIRST - 11) diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index c9e87ea4..ec695189 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -44,8 +44,6 @@ #define _WIN32_IE 0x0600 #endif //_WIN32_IE -using namespace std; - enum toolBarStatusType {/*TB_HIDE, */TB_SMALL, TB_LARGE, TB_STANDARD}; @@ -124,14 +122,14 @@ private : TBBUTTON *_pTBB; ToolBarIcons _toolBarIcons; toolBarStatusType _state; - vector _vDynBtnReg; + std::vector _vDynBtnReg; size_t _nrButtons; size_t _nrDynButtons; size_t _nrTotalButtons; size_t _nrCurrentButtons; ReBar * _pRebar; REBARBANDINFO _rbBand; - vector _customIconVect; + std::vector _customIconVect; TiXmlNode *_toolIcons; @@ -173,7 +171,7 @@ public : void setGrayBackground(int id); private: - vector usedIDs; + std::vector usedIDs; int getNewID(); void releaseID(int id); diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.h b/PowerEditor/src/WinControls/ToolTip/ToolTip.h index fb4fd5f7..a8bf735e 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.h +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.h @@ -29,7 +29,7 @@ #ifndef __TOOLTIP_H__ #define __TOOLTIP_H__ -using namespace std; +#include class ToolTip : public Window { diff --git a/PowerEditor/src/WinControls/WindowsDlg/SizeableDlg.h b/PowerEditor/src/WinControls/WindowsDlg/SizeableDlg.h index c1b4120d..58e67031 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/SizeableDlg.h +++ b/PowerEditor/src/WinControls/WindowsDlg/SizeableDlg.h @@ -37,6 +37,8 @@ #include "WinMgr.h" #endif //WINMGR_H +#include "StaticDialog.h" + class SizeableDlg : public StaticDialog { typedef StaticDialog MyBaseClass; public: diff --git a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.h b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.h index 1971d0ba..dbfe934b 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.h +++ b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.h @@ -14,6 +14,9 @@ #pragma once +#include +#include + const SIZE SIZEZERO = {0, 0}; const SIZE SIZEMAX = {SHRT_MAX, SHRT_MAX}; diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index 3ffb964f..647f95c9 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -26,12 +26,15 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "WindowsDlg.h" #include "WindowsDlgRc.h" #include "DocTabView.h" #include "EncodingMapper.h" +using namespace std; + #ifndef _countof #define _countof(x) (sizeof(x)/sizeof((x)[0])) #endif diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h index f7679d19..48eac8b0 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h @@ -33,6 +33,8 @@ #include "SizeableDlg.h" #endif //SIZABLE_DLG_H +#include "Common.h" + class DocTabView; class TiXmlNodeA; diff --git a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp index 2e67424f..46b5957f 100644 --- a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp +++ b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.cpp @@ -27,7 +27,7 @@ // created by Daniel Volk mordorpost@volkarts.com -#include "precompiledHeaders.h" + #include "RunMacroDlg.h" #include "ScintillaEditView.h" #include "Notepad_plus_msgs.h" @@ -37,7 +37,7 @@ void RunMacroDlg::initMacroList() if (!isCreated()) return; NppParameters *pNppParam = NppParameters::getInstance(); - vector & macroList = pNppParam->getMacroList(); + std::vector & macroList = pNppParam->getMacroList(); ::SendDlgItemMessage(_hSelf, IDC_MACRO_COMBO, CB_RESETCONTENT, 0, 0); diff --git a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.h b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.h index 04e09382..7c218012 100644 --- a/PowerEditor/src/WinControls/shortcut/RunMacroDlg.h +++ b/PowerEditor/src/WinControls/shortcut/RunMacroDlg.h @@ -34,7 +34,7 @@ #include "RunMacroDlg_rc.h" #endif //RUN_MACRO_DLG_RC_H -using namespace std; +#include "StaticDialog.h" #define RM_CANCEL -1 #define RM_RUN_MULTI 1 diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index 335deabf..bd7b31d4 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -26,16 +26,15 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" - #include "shortcut.h" #include "Parameters.h" #include "ScintillaEditView.h" #include "resource.h" #include "Notepad_plus_Window.h" - #include "keys.h" +using namespace std; + const int KEY_STR_LEN = 16; struct KeyIDNAME { diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.h b/PowerEditor/src/WinControls/shortcut/shortcut.h index 41748865..cb39f2cd 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.h +++ b/PowerEditor/src/WinControls/shortcut/shortcut.h @@ -38,8 +38,7 @@ #endif //SCINTILLA_H #include "StaticDialog.h" - -using namespace std; +#include "Common.h" const size_t nameLenMax = 64; @@ -259,7 +258,7 @@ public: private: unsigned long _scintillaKeyID; int _menuCmdID; - vector _keyCombos; + std::vector _keyCombos; size_t size; void applyToCurrentIndex(); void validateDialog(); @@ -298,7 +297,7 @@ struct recordedMacroStep { void PlayBack(Window* pNotepad, ScintillaEditView *pEditView); }; -typedef vector Macro; +typedef std::vector Macro; class MacroShortcut : public CommandShortcut { friend class NppParameters; @@ -378,13 +377,13 @@ private: class ScintillaAccelerator { //Handles accelerator keys for scintilla public: ScintillaAccelerator() : _nrScintillas(0) {}; - void init(vector * vScintillas, HMENU hMenu, HWND menuParent); + void init(std::vector * vScintillas, HMENU hMenu, HWND menuParent); void updateKeys(); void updateKey(ScintillaKeyMap skmOld, ScintillaKeyMap skm); private: HMENU _hAccelMenu; HWND _hMenuParent; - vector _vScintillas; + std::vector _vScintillas; int _nrScintillas; void updateMenuItemByID(ScintillaKeyMap skm, int id); diff --git a/PowerEditor/src/lastRecentFileList.h b/PowerEditor/src/lastRecentFileList.h index f2271d37..ddfe14ac 100644 --- a/PowerEditor/src/lastRecentFileList.h +++ b/PowerEditor/src/lastRecentFileList.h @@ -33,6 +33,8 @@ #include "Parameters.h" #endif //PARAMETERS_H +#include + struct RecentItem { int _id; generic_string _name; diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index 85ae80e6..fd41fa30 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -30,9 +30,9 @@ #include "Notepad_plus.h" #include "ShortcutMapper.h" #include "EncodingMapper.h" - #include "localization.h" +using namespace std; void NativeLangSpeaker::init(TiXmlDocumentA *nativeLangDocRootA, bool loadIfEnglish) { diff --git a/PowerEditor/src/uchardet/CharDistribution.cpp b/PowerEditor/src/uchardet/CharDistribution.cpp index e78cf891..488d9bc3 100644 --- a/PowerEditor/src/uchardet/CharDistribution.cpp +++ b/PowerEditor/src/uchardet/CharDistribution.cpp @@ -35,7 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" #include "CharDistribution.h" #include "JISFreq.tab" From 54c8fd7ac8028a4ffb194a7cfc03a99915b4a0b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Mon, 1 Jun 2015 18:10:43 +0200 Subject: [PATCH 10/16] Make case of "all" consistent. --- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 39ba9980..289624bf 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2658,10 +2658,10 @@ BOOL CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERUNCOLLAPSE, TEXT("Uncollapse all"))); tmp.push_back(MenuItemUnit(0, TEXT("Separator"))); tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCOPY, TEXT("Copy"))); - tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERSELECTALL, TEXT("Select All"))); - tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCLEARALL, TEXT("Clear All"))); + tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERSELECTALL, TEXT("Select all"))); + tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFERCLEARALL, TEXT("Clear all"))); tmp.push_back(MenuItemUnit(0, TEXT("Separator"))); - tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFEROPENALL, TEXT("Open All"))); + tmp.push_back(MenuItemUnit(NPPM_INTERNAL_SCINTILLAFINFEROPENALL, TEXT("Open all"))); scintillaContextmenu.create(_hSelf, tmp); From d6081a5f3785fe0565900fc4c7f6ce1a78e5c6ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Mon, 1 Jun 2015 18:39:22 +0200 Subject: [PATCH 11/16] Improve copy functionality in find results window Just copy the actual results, without the additional formatting with line and file name. It respects the hierarchy in the results, i.e. you can copy all results from a search operation, or from a specific file, or just the lines you selected. --- PowerEditor/src/MISC/Common/Common.cpp | 33 +++++++++ PowerEditor/src/MISC/Common/Common.h | 2 + PowerEditor/src/Notepad_plus.cpp | 30 +------- .../src/ScitillaComponent/FindReplaceDlg.cpp | 71 ++++++++++++++++++- .../src/ScitillaComponent/FindReplaceDlg.h | 4 ++ .../ScitillaComponent/ScintillaEditView.cpp | 10 +++ .../src/ScitillaComponent/ScintillaEditView.h | 1 + 7 files changed, 121 insertions(+), 30 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index e5236475..eb6e8ece 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -777,4 +777,37 @@ double stodLocale(const generic_string& str, _locale_t loc, size_t* idx) if (idx != NULL) *idx = (size_t)(eptr - ptr); return ans; +} + +bool str2Clipboard(const TCHAR *str2cpy, HWND hwnd) +{ + if (!str2cpy) + return false; + + int len2Allocate = lstrlen(str2cpy) + 1; + len2Allocate *= sizeof(TCHAR); + unsigned int cilpboardFormat = CF_TEXT; + + cilpboardFormat = CF_UNICODETEXT; + + HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate); + if (hglbCopy == NULL) + { + return false; + } + + if (!::OpenClipboard(hwnd)) //_pPublicInterface->getHSelf())) + return false; + + ::EmptyClipboard(); + + // Lock the handle and copy the text to the buffer. + TCHAR *pStr = (TCHAR *)::GlobalLock(hglbCopy); + lstrcpy(pStr, str2cpy); + ::GlobalUnlock(hglbCopy); + + // Place the handle on the clipboard. + ::SetClipboardData(cilpboardFormat, hglbCopy); + ::CloseClipboard(); + return true; } \ No newline at end of file diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 519de712..22572d9c 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -198,4 +198,6 @@ generic_string stringJoin(const std::vector& strings, const gene generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); +bool str2Clipboard(const TCHAR *str2cpy, HWND hwnd); + #endif //M30_IDE_COMMUN_H diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 1d455312..7b63f764 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4557,35 +4557,7 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session, bool includUntitledD bool Notepad_plus::str2Cliboard(const TCHAR *str2cpy) { - if (!str2cpy) - return false; - - int len2Allocate = lstrlen(str2cpy) + 1; - len2Allocate *= sizeof(TCHAR); - unsigned int cilpboardFormat = CF_TEXT; - - cilpboardFormat = CF_UNICODETEXT; - - HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate); - if (hglbCopy == NULL) - { - return false; - } - - if (!::OpenClipboard(_pPublicInterface->getHSelf())) - return false; - - ::EmptyClipboard(); - - // Lock the handle and copy the text to the buffer. - TCHAR *pStr = (TCHAR *)::GlobalLock(hglbCopy); - lstrcpy(pStr, str2cpy); - ::GlobalUnlock(hglbCopy); - - // Place the handle on the clipboard. - ::SetClipboardData(cilpboardFormat, hglbCopy); - ::CloseClipboard(); - return true; + return str2Clipboard(str2cpy, _pPublicInterface->getHSelf()); } //ONLY CALL IN CASE OF EMERGENCY: EXCEPTION diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 289624bf..1279b3fa 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2505,6 +2505,75 @@ void Finder::openAll() } } +bool Finder::isLineActualSearchResult(int line) +{ + const int foldLevel = _scintView.execute(SCI_GETFOLDLEVEL, line) & SC_FOLDLEVELNUMBERMASK; + return foldLevel == SC_FOLDLEVELBASE + 3; +} + +generic_string Finder::prepareStringForClipboard(generic_string s) +{ + // Input: a string like "\tLine 3: search result". + // Output: "search result" + s = stringReplace(s, TEXT("\r"), TEXT("")); + s = stringReplace(s, TEXT("\n"), TEXT("")); + const unsigned int firstColon = s.find(TEXT(':')); + if (firstColon == std::string::npos) + { + // Should never happen. + assert(false); + return s; + } + else + { + // Plus 2 in order to deal with ": ". + return s.substr(2 + firstColon); + } +} + +void Finder::copy() +{ + size_t fromLine, toLine; + { + const int selStart = _scintView.execute(SCI_GETSELECTIONSTART); + const int selEnd = _scintView.execute(SCI_GETSELECTIONEND); + const bool hasSelection = selStart != selEnd; + const pair lineRange = _scintView.getSelectionLinesRange(); + if (hasSelection && lineRange.first != lineRange.second) + { + fromLine = lineRange.first; + toLine = lineRange.second; + } + else + { + // Abuse fold levels to find out which lines to copy to clipboard. + // We get the current line and then the next line which has a smaller fold level (SCI_GETLASTCHILD). + // Then we loop all lines between them and determine which actually contain search results. + fromLine = _scintView.getCurrentLineNumber(); + const int selectedLineFoldLevel = _scintView.execute(SCI_GETFOLDLEVEL, fromLine) & SC_FOLDLEVELNUMBERMASK; + toLine = _scintView.execute(SCI_GETLASTCHILD, fromLine, selectedLineFoldLevel); + } + } + + std::vector lines; + for (size_t line = fromLine; line <= toLine; ++line) + { + if (isLineActualSearchResult(line)) + { + lines.push_back(prepareStringForClipboard(_scintView.getLine(line))); + } + } + const generic_string toClipboard = stringJoin(lines, TEXT("\r\n")); + if (!toClipboard.empty()) + { + if (!str2Clipboard(toClipboard.c_str(), _hSelf)) + { + assert(false); + ::MessageBox(NULL, TEXT("Error placing text in clipboard."), TEXT("Notepad++"), MB_ICONINFORMATION); + } + } +} + void Finder::beginNewFilesSearch() { //_scintView.execute(SCI_SETLEXER, SCLEX_NULL); @@ -2617,7 +2686,7 @@ BOOL CALLBACK Finder::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) case NPPM_INTERNAL_SCINTILLAFINFERCOPY : { - _scintView.execute(SCI_COPY); + copy(); return TRUE; } diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index 3d21ee18..280afc29 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -144,6 +144,7 @@ public: void setFinderStyle(); void removeAll(); void openAll(); + void copy(); void beginNewFilesSearch(); void finishFilesSearch(int count); void gotoNextFoundResult(int direction); @@ -177,6 +178,9 @@ private: _scintView.execute(SCI_SETREADONLY, isReadOnly); }; + bool isLineActualSearchResult(int line); + generic_string prepareStringForClipboard(generic_string s); + static FoundInfo EmptyFoundInfo; static SearchResultMarking EmptySearchResultMarking; }; diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 97922c18..1e206a9b 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -31,6 +31,7 @@ #include "Parameters.h" #include "Sorters.h" #include "TCHAR.h" +#include using namespace std; @@ -1913,6 +1914,15 @@ void ScintillaEditView::showCallTip(int startPos, const TCHAR * def) execute(SCI_CALLTIPSHOW, startPos, LPARAM(defA)); } +generic_string ScintillaEditView::getLine(int lineNumber) +{ + int lineLen = execute(SCI_LINELENGTH, lineNumber); + const int bufSize = lineLen; + std::unique_ptr buf = std::make_unique(bufSize); + getLine(lineNumber, buf.get(), bufSize); + return buf.get(); +} + void ScintillaEditView::getLine(int lineNumber, TCHAR * line, int lineBufferLen) { WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index eb2f34c1..f218b83e 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -272,6 +272,7 @@ public: int replaceTargetRegExMode(const TCHAR * re, int fromTargetPos = -1, int toTargetPos = -1) const; void showAutoComletion(int lenEntered, const TCHAR * list); void showCallTip(int startPos, const TCHAR * def); + generic_string getLine(int lineNumber); void getLine(int lineNumber, TCHAR * line, int lineBufferLen); void addText(int length, const char *buf); From 933aae4fc25f007ce4ca5375be2ddf2b2bd0a191 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Mon, 1 Jun 2015 18:47:24 +0200 Subject: [PATCH 12/16] Improve str2Clipboard. Make it take generic_string instead of TCHAR*, since at most callsites we already have a generic_string. Improve error handling. Depending on where we are in the function when we get an error, we need to free the memory, unlock the memory, or close the clipboard. Note that if SetClipboardData succeeds then we should not do anything more to the memory. --- PowerEditor/src/MISC/Common/Common.cpp | 52 ++++++++++++++++---------- PowerEditor/src/MISC/Common/Common.h | 2 +- PowerEditor/src/Notepad_plus.cpp | 6 +-- PowerEditor/src/Notepad_plus.h | 2 +- PowerEditor/src/NppCommands.cpp | 2 +- 5 files changed, 39 insertions(+), 25 deletions(-) diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index eb6e8ece..3b97a041 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -779,35 +779,49 @@ double stodLocale(const generic_string& str, _locale_t loc, size_t* idx) return ans; } -bool str2Clipboard(const TCHAR *str2cpy, HWND hwnd) +bool str2Clipboard(const generic_string &str2cpy, HWND hwnd) { - if (!str2cpy) - return false; - - int len2Allocate = lstrlen(str2cpy) + 1; - len2Allocate *= sizeof(TCHAR); - unsigned int cilpboardFormat = CF_TEXT; - - cilpboardFormat = CF_UNICODETEXT; - + int len2Allocate = (str2cpy.size() + 1) * sizeof(TCHAR); HGLOBAL hglbCopy = ::GlobalAlloc(GMEM_MOVEABLE, len2Allocate); if (hglbCopy == NULL) { return false; } - - if (!::OpenClipboard(hwnd)) //_pPublicInterface->getHSelf())) + if (!::OpenClipboard(hwnd)) + { + ::GlobalFree(hglbCopy); + ::CloseClipboard(); return false; - - ::EmptyClipboard(); - + } + if (!::EmptyClipboard()) + { + ::GlobalFree(hglbCopy); + ::CloseClipboard(); + return false; + } // Lock the handle and copy the text to the buffer. TCHAR *pStr = (TCHAR *)::GlobalLock(hglbCopy); - lstrcpy(pStr, str2cpy); + if (pStr == NULL) + { + ::GlobalUnlock(hglbCopy); + ::GlobalFree(hglbCopy); + ::CloseClipboard(); + return false; + } + _tcscpy_s(pStr, len2Allocate / sizeof(TCHAR), str2cpy.c_str()); ::GlobalUnlock(hglbCopy); - // Place the handle on the clipboard. - ::SetClipboardData(cilpboardFormat, hglbCopy); - ::CloseClipboard(); + unsigned int clipBoardFormat = CF_UNICODETEXT; + if (::SetClipboardData(clipBoardFormat, hglbCopy) == NULL) + { + ::GlobalUnlock(hglbCopy); + ::GlobalFree(hglbCopy); + ::CloseClipboard(); + return false; + } + if (!::CloseClipboard()) + { + return false; + } return true; } \ No newline at end of file diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 22572d9c..80171755 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -198,6 +198,6 @@ generic_string stringJoin(const std::vector& strings, const gene generic_string stringTakeWhileAdmissable(const generic_string& input, const generic_string& admissable); double stodLocale(const generic_string& str, _locale_t loc, size_t* idx = NULL); -bool str2Clipboard(const TCHAR *str2cpy, HWND hwnd); +bool str2Clipboard(const generic_string &str2cpy, HWND hwnd); #endif //M30_IDE_COMMUN_H diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 7b63f764..c81d48a5 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -1933,7 +1933,7 @@ void Notepad_plus::copyMarkedLines() globalStr = currentStr; } } - str2Cliboard(globalStr.c_str()); + str2Cliboard(globalStr); } void Notepad_plus::cutMarkedLines() @@ -1953,7 +1953,7 @@ void Notepad_plus::cutMarkedLines() } } _pEditView->execute(SCI_ENDUNDOACTION); - str2Cliboard(globalStr.c_str()); + str2Cliboard(globalStr); } void Notepad_plus::deleteMarkedLines(bool isMarked) @@ -4555,7 +4555,7 @@ void Notepad_plus::getCurrentOpenedFiles(Session & session, bool includUntitledD _invisibleEditView.execute(SCI_SETDOCPOINTER, 0, oldDoc); } -bool Notepad_plus::str2Cliboard(const TCHAR *str2cpy) +bool Notepad_plus::str2Cliboard(const generic_string & str2cpy) { return str2Clipboard(str2cpy, _pPublicInterface->getHSelf()); } diff --git a/PowerEditor/src/Notepad_plus.h b/PowerEditor/src/Notepad_plus.h index f0d4d607..d209080f 100644 --- a/PowerEditor/src/Notepad_plus.h +++ b/PowerEditor/src/Notepad_plus.h @@ -599,7 +599,7 @@ private: void doSynScorll(HWND hW); void setWorkingDir(const TCHAR *dir); - bool str2Cliboard(const TCHAR *str2cpy); + bool str2Cliboard(const generic_string & str2cpy); bool bin2Cliboard(const UCHAR *uchar2cpy, size_t length); bool getIntegralDockingData(tTbData & dockData, int & iCont, bool & isVisible); diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index a75a8186..2df44ee7 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -676,7 +676,7 @@ void Notepad_plus::command(int id) { generic_string dir(buf->getFullPathName()); PathRemoveFileSpec(dir); - str2Cliboard(dir.c_str()); + str2Cliboard(dir); } else if (id == IDM_EDIT_FILENAMETOCLIP) { From 23ac5e3da840d82b1e8561aa7f5fa70c2f6655d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Mon, 1 Jun 2015 18:48:49 +0200 Subject: [PATCH 13/16] Mark some methods as const. --- PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp | 4 ++-- PowerEditor/src/ScitillaComponent/FindReplaceDlg.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index 1279b3fa..cf9fdb4b 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -2505,13 +2505,13 @@ void Finder::openAll() } } -bool Finder::isLineActualSearchResult(int line) +bool Finder::isLineActualSearchResult(int line) const { const int foldLevel = _scintView.execute(SCI_GETFOLDLEVEL, line) & SC_FOLDLEVELNUMBERMASK; return foldLevel == SC_FOLDLEVELBASE + 3; } -generic_string Finder::prepareStringForClipboard(generic_string s) +generic_string Finder::prepareStringForClipboard(generic_string s) const { // Input: a string like "\tLine 3: search result". // Output: "search result" diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h index 280afc29..52a436c0 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.h @@ -178,8 +178,8 @@ private: _scintView.execute(SCI_SETREADONLY, isReadOnly); }; - bool isLineActualSearchResult(int line); - generic_string prepareStringForClipboard(generic_string s); + bool isLineActualSearchResult(int line) const; + generic_string prepareStringForClipboard(generic_string s) const; static FoundInfo EmptyFoundInfo; static SearchResultMarking EmptySearchResultMarking; From f3934fadb726ae4471e1a8008da066bf3ebcfa1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20J=C3=B6nsson?= Date: Mon, 1 Jun 2015 18:55:25 +0200 Subject: [PATCH 14/16] Fix array termination error. --- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index 1e206a9b..c21646fc 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1917,7 +1917,7 @@ void ScintillaEditView::showCallTip(int startPos, const TCHAR * def) generic_string ScintillaEditView::getLine(int lineNumber) { int lineLen = execute(SCI_LINELENGTH, lineNumber); - const int bufSize = lineLen; + const int bufSize = lineLen + 1; std::unique_ptr buf = std::make_unique(bufSize); getLine(lineNumber, buf.get(), bufSize); return buf.get(); @@ -1928,6 +1928,8 @@ void ScintillaEditView::getLine(int lineNumber, TCHAR * line, int lineBufferLen) WcharMbcsConvertor *wmc = WcharMbcsConvertor::getInstance(); unsigned int cp = execute(SCI_GETCODEPAGE); char *lineA = new char[lineBufferLen]; + // From Scintilla documentation for SCI_GETLINE: "The buffer is not terminated by a 0 character." + memset(lineA, '\0', sizeof(char) * lineBufferLen); execute(SCI_GETLINE, lineNumber, (LPARAM)lineA); const TCHAR *lineW = wmc->char2wchar(lineA, cp); lstrcpyn(line, lineW, lineBufferLen); From c18101823a0631e0e265b0908286d4c24dfd28dc Mon Sep 17 00:00:00 2001 From: NN Date: Mon, 1 Jun 2015 21:40:20 +0300 Subject: [PATCH 15/16] Add missing files. Add warning 4091 to be ignored. Define _CRT_NON_CONFORMING_WCSTOK globally. --- PowerEditor/src/MISC/Common/precompiledHeaders.h | 5 ----- PowerEditor/visual.net/notepadPlus.vs2015.vcxproj | 10 ++++++---- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/PowerEditor/src/MISC/Common/precompiledHeaders.h b/PowerEditor/src/MISC/Common/precompiledHeaders.h index 3ad68618..73bff62f 100644 --- a/PowerEditor/src/MISC/Common/precompiledHeaders.h +++ b/PowerEditor/src/MISC/Common/precompiledHeaders.h @@ -32,7 +32,6 @@ // w/o precompiled headers file : 1 minute 55 sec #define _WIN32_WINNT 0x0501 -#define _CRT_NON_CONFORMING_WCSTOK // C RunTime Header Files #include @@ -64,11 +63,7 @@ #include #include #include - -#pragma warning(push) -#pragma warning(disable: 4091) // 'keyword' : ignored on left of 'type' when no variable is declared #include -#pragma warning(pop) #include #include diff --git a/PowerEditor/visual.net/notepadPlus.vs2015.vcxproj b/PowerEditor/visual.net/notepadPlus.vs2015.vcxproj index 17c3bf72..bfcbc74e 100644 --- a/PowerEditor/visual.net/notepadPlus.vs2015.vcxproj +++ b/PowerEditor/visual.net/notepadPlus.vs2015.vcxproj @@ -58,7 +58,7 @@ Disabled Neither ..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;%(AdditionalIncludeDirectories) - WIN32;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions) + WIN32;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;_CRT_NON_CONFORMING_WCSTOK;%(PreprocessorDefinitions) Async Default MultiThreadedDebug @@ -66,7 +66,7 @@ true ProgramDatabase true - 4456;4457;4459 + 4091;4456;4457;4459 /fixed:no %(AdditionalOptions) @@ -96,7 +96,7 @@ false false ..\src\WinControls\AboutDlg;..\..\scintilla\include;..\include;..\src\WinControls;..\src\WinControls\ImageListSet;..\src\WinControls\OpenSaveFileDialog;..\src\WinControls\SplitterContainer;..\src\WinControls\StaticDialog;..\src\WinControls\TabBar;..\src\WinControls\ToolBar;..\src\MISC\Process;..\src\ScitillaComponent;..\src\MISC;..\src\MISC\SysMsg;..\src\WinControls\StatusBar;..\src;..\src\WinControls\StaticDialog\RunDlg;..\src\tinyxml;..\src\WinControls\ColourPicker;..\src\Win32Explr;..\src\MISC\RegExt;..\src\WinControls\TrayIcon;..\src\WinControls\shortcut;..\src\WinControls\Grid;..\src\WinControls\ContextMenu;..\src\MISC\PluginsManager;..\src\WinControls\Preference;..\src\WinControls\WindowsDlg;..\src\WinControls\TaskList;..\src\WinControls\DockingWnd;..\src\WinControls\ToolTip;..\src\MISC\Exception;..\src\MISC\Common;..\src\tinyxml\tinyXmlA;..\src\WinControls\AnsiCharPanel;..\src\WinControls\ClipboardHistory;..\src\WinControls\FindCharsInRange;..\src\WinControls\VerticalFileSwitcher;..\src\WinControls\ProjectPanel;..\src\WinControls\DocumentMap;..\src\WinControls\FunctionList;..\src\uchardet;%(AdditionalIncludeDirectories) - WIN32;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;%(PreprocessorDefinitions) + WIN32;NDEBUG;_WINDOWS;_USE_64BIT_TIME_T;TIXML_USE_STL;TIXMLA_USE_STL;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_WARNINGS;_CRT_NON_CONFORMING_SWPRINTFS=1;_CRT_NON_CONFORMING_WCSTOK;%(PreprocessorDefinitions) false false true @@ -108,7 +108,7 @@ ProgramDatabase NoExtensions true - 4456;4457;4459 + 4091;4456;4457;4459 comctl32.lib;shlwapi.lib;shell32.lib;Oleacc.lib;%(AdditionalDependencies) @@ -140,6 +140,7 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml + @@ -409,6 +410,7 @@ copy ..\src\contextMenu.xml ..\bin\contextMenu.xml + From 246c8bd1684f89d1e3c87a77148bc51e6555f83c Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 2 Jun 2015 18:01:47 +0200 Subject: [PATCH 16/16] [UPDATE] Unprecompile headers (part 3) --- PowerEditor/src/EncodingMapper.cpp | 2 +- PowerEditor/src/MISC/Common/Common.cpp | 10 +++++++++- .../src/MISC/Common/precompiledHeaders.h | 2 +- PowerEditor/src/MISC/Exception/MiniDumper.cpp | 2 +- PowerEditor/src/MISC/Exception/MiniDumper.h | 3 +++ .../src/MISC/Exception/Win32Exception.cpp | 1 - .../src/MISC/Exception/Win32Exception.h | 7 +++++++ .../src/MISC/PluginsManager/IDAllocator.cpp | 2 -- .../src/MISC/PluginsManager/PluginsManager.cpp | 2 +- PowerEditor/src/MISC/Process/Process.cpp | 1 - PowerEditor/src/MISC/RegExt/regExtDlg.cpp | 3 +-- PowerEditor/src/MISC/RegExt/regExtDlg.h | 2 ++ PowerEditor/src/Notepad_plus.cpp | 4 ++-- PowerEditor/src/Notepad_plus_Window.cpp | 3 ++- PowerEditor/src/NppBigSwitch.cpp | 3 ++- PowerEditor/src/NppCommands.cpp | 4 ++-- PowerEditor/src/NppIO.cpp | 3 ++- PowerEditor/src/NppNotification.cpp | 2 +- .../src/ScitillaComponent/DocTabView.cpp | 2 +- .../src/ScitillaComponent/FindReplaceDlg.cpp | 4 ++-- .../src/ScitillaComponent/FunctionCallTip.cpp | 1 - .../src/ScitillaComponent/GoToLineDlg.cpp | 1 - PowerEditor/src/ScitillaComponent/Printer.cpp | 1 - .../src/ScitillaComponent/UserDefineDialog.cpp | 2 -- .../UserDefineLangReference.h | 2 -- PowerEditor/src/TinyXml/tinyXmlA/tinystrA.cpp | 1 - PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.cpp | 2 +- .../src/TinyXml/tinyXmlA/tinyxmlerrorA.cpp | 2 +- .../src/TinyXml/tinyXmlA/tinyxmlparserA.cpp | 2 +- PowerEditor/src/TinyXml/tinystr.cpp | 1 - PowerEditor/src/TinyXml/tinyxml.cpp | 2 +- PowerEditor/src/TinyXml/tinyxmlerror.cpp | 2 +- PowerEditor/src/TinyXml/tinyxmlparser.cpp | 2 +- PowerEditor/src/UniConversion.cpp | 2 +- PowerEditor/src/UniConversion.h | 5 +++++ PowerEditor/src/Utf8_16.cpp | 1 - .../src/WinControls/AnsiCharPanel/ListView.cpp | 2 +- .../src/WinControls/AnsiCharPanel/ListView.h | 1 + .../WinControls/ColourPicker/WordStyleDlg.h | 9 +-------- .../WinControls/DockingWnd/DockingManager.cpp | 18 ++++++++++++------ .../WinControls/DockingWnd/DockingManager.h | 6 ++++++ .../WinControls/DockingWnd/DockingSplitter.cpp | 2 +- .../WinControls/DockingWnd/DockingSplitter.h | 2 ++ .../src/WinControls/DockingWnd/Gripper.cpp | 1 - .../src/WinControls/DockingWnd/Gripper.h | 4 ++++ .../WinControls/DocumentMap/documentMap.cpp | 1 - .../FindCharsInRange/FindCharsInRange.cpp | 1 - .../FunctionList/functionListPanel.cpp | 1 - .../FunctionList/functionParser.cpp | 2 +- .../WinControls/ImageListSet/ImageListSet.cpp | 1 - .../WinControls/ImageListSet/ImageListSet.h | 2 ++ .../WinControls/Preference/preferenceDlg.cpp | 5 +++-- .../WinControls/ProjectPanel/ProjectPanel.cpp | 1 - .../src/WinControls/ProjectPanel/TreeView.cpp | 2 +- .../src/WinControls/ProjectPanel/TreeView.h | 3 +++ .../WinControls/StaticDialog/RunDlg/RunDlg.cpp | 2 +- .../WinControls/StaticDialog/RunDlg/RunDlg.h | 3 +++ .../WinControls/StaticDialog/StaticDialog.h | 3 --- PowerEditor/src/WinControls/TabBar/TabBar.cpp | 2 +- .../src/WinControls/TaskList/TaskList.cpp | 2 +- .../src/WinControls/TaskList/TaskList.h | 4 ++++ .../src/WinControls/TaskList/TaskListDlg.cpp | 2 +- .../src/WinControls/TaskList/TaskListDlg.h | 3 +++ .../src/WinControls/ToolBar/ToolBar.cpp | 2 +- PowerEditor/src/WinControls/ToolBar/ToolBar.h | 6 ++---- .../src/WinControls/ToolTip/ToolTip.cpp | 5 +---- PowerEditor/src/WinControls/ToolTip/ToolTip.h | 2 ++ .../WinControls/TrayIcon/trayIconControler.cpp | 1 - .../WinControls/TrayIcon/trayIconControler.h | 2 ++ .../VerticalFileSwitcher.cpp | 2 +- .../VerticalFileSwitcher.h | 4 ---- .../src/WinControls/WindowsDlg/WinMgr.cpp | 2 +- .../src/WinControls/WindowsDlg/WinRect.cpp | 1 - .../src/WinControls/WindowsDlg/WindowsDlg.h | 3 --- PowerEditor/src/lastRecentFileList.cpp | 2 +- PowerEditor/src/lesDlgs.cpp | 2 +- PowerEditor/src/lesDlgs.h | 3 +++ PowerEditor/src/localization.cpp | 1 - PowerEditor/src/localization.h | 4 ++-- PowerEditor/src/uchardet/JpCntx.cpp | 2 +- .../src/uchardet/LangBulgarianModel.cpp | 2 +- PowerEditor/src/uchardet/LangCyrillicModel.cpp | 2 +- PowerEditor/src/uchardet/LangGreekModel.cpp | 2 +- PowerEditor/src/uchardet/LangHebrewModel.cpp | 2 +- .../src/uchardet/LangHungarianModel.cpp | 2 +- PowerEditor/src/uchardet/LangThaiModel.cpp | 2 +- PowerEditor/src/uchardet/nsBig5Prober.cpp | 2 +- PowerEditor/src/uchardet/nsCharSetProber.cpp | 2 +- PowerEditor/src/uchardet/nsEUCJPProber.cpp | 2 +- PowerEditor/src/uchardet/nsEUCKRProber.cpp | 2 +- PowerEditor/src/uchardet/nsEUCTWProber.cpp | 2 +- .../src/uchardet/nsEscCharsetProber.cpp | 2 +- PowerEditor/src/uchardet/nsEscSM.cpp | 2 +- PowerEditor/src/uchardet/nsGB2312Prober.cpp | 2 +- PowerEditor/src/uchardet/nsHebrewProber.cpp | 1 - PowerEditor/src/uchardet/nsLatin1Prober.cpp | 1 - PowerEditor/src/uchardet/nsMBCSGroupProber.cpp | 2 +- PowerEditor/src/uchardet/nsMBCSSM.cpp | 2 +- PowerEditor/src/uchardet/nsSBCSGroupProber.cpp | 1 - PowerEditor/src/uchardet/nsSBCharSetProber.cpp | 2 +- PowerEditor/src/uchardet/nsSJISProber.cpp | 2 +- PowerEditor/src/uchardet/nsUTF8Prober.cpp | 1 - .../src/uchardet/nsUniversalDetector.cpp | 2 -- PowerEditor/src/uchardet/uchardet.cpp | 2 +- PowerEditor/src/winmain.cpp | 2 +- 105 files changed, 142 insertions(+), 124 deletions(-) diff --git a/PowerEditor/src/EncodingMapper.cpp b/PowerEditor/src/EncodingMapper.cpp index 48245966..27c02c49 100644 --- a/PowerEditor/src/EncodingMapper.cpp +++ b/PowerEditor/src/EncodingMapper.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "EncodingMapper.h" #include "Scintilla.h" diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index 3b97a041..d9a5a04c 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -26,7 +26,15 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include +#include +#include +#include "StaticDialog.h" + + + +#include "Common.h" #include "../Utf8.h" WcharMbcsConvertor * WcharMbcsConvertor::_pSelf = new WcharMbcsConvertor; diff --git a/PowerEditor/src/MISC/Common/precompiledHeaders.h b/PowerEditor/src/MISC/Common/precompiledHeaders.h index 73bff62f..c3a6a897 100644 --- a/PowerEditor/src/MISC/Common/precompiledHeaders.h +++ b/PowerEditor/src/MISC/Common/precompiledHeaders.h @@ -59,8 +59,8 @@ // Windows Header Files #include #include -#include #include +#include #include #include #include diff --git a/PowerEditor/src/MISC/Exception/MiniDumper.cpp b/PowerEditor/src/MISC/Exception/MiniDumper.cpp index f713a160..939cbda0 100644 --- a/PowerEditor/src/MISC/Exception/MiniDumper.cpp +++ b/PowerEditor/src/MISC/Exception/MiniDumper.cpp @@ -29,7 +29,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "MiniDumper.h" LPCTSTR msgTitle = TEXT("Notepad++ crash analysis"); diff --git a/PowerEditor/src/MISC/Exception/MiniDumper.h b/PowerEditor/src/MISC/Exception/MiniDumper.h index 130953d2..d3b5c112 100644 --- a/PowerEditor/src/MISC/Exception/MiniDumper.h +++ b/PowerEditor/src/MISC/Exception/MiniDumper.h @@ -32,6 +32,9 @@ #ifndef MDUMP_H #define MDUMP_H +#include +#include + // based on dbghelp.h typedef BOOL (WINAPI *MINIDUMPWRITEDUMP)(HANDLE hProcess, DWORD dwPid, HANDLE hFile, MINIDUMP_TYPE DumpType, diff --git a/PowerEditor/src/MISC/Exception/Win32Exception.cpp b/PowerEditor/src/MISC/Exception/Win32Exception.cpp index d37d4d41..74fca430 100644 --- a/PowerEditor/src/MISC/Exception/Win32Exception.cpp +++ b/PowerEditor/src/MISC/Exception/Win32Exception.cpp @@ -32,7 +32,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "Win32Exception.h" diff --git a/PowerEditor/src/MISC/Exception/Win32Exception.h b/PowerEditor/src/MISC/Exception/Win32Exception.h index 3117a1bc..5be89c2f 100644 --- a/PowerEditor/src/MISC/Exception/Win32Exception.h +++ b/PowerEditor/src/MISC/Exception/Win32Exception.h @@ -31,6 +31,11 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#ifndef WIN32_EXCEPTION_H +#define WIN32_EXCEPTION_H + +#include +#include typedef const void* ExceptionAddress; // OK on Win32 platform @@ -69,3 +74,5 @@ private: friend void Win32Exception::translate(unsigned code, EXCEPTION_POINTERS* info); }; + +#endif // WIN32_EXCEPTION_H \ No newline at end of file diff --git a/PowerEditor/src/MISC/PluginsManager/IDAllocator.cpp b/PowerEditor/src/MISC/PluginsManager/IDAllocator.cpp index 568d6fb8..5cd78d51 100644 --- a/PowerEditor/src/MISC/PluginsManager/IDAllocator.cpp +++ b/PowerEditor/src/MISC/PluginsManager/IDAllocator.cpp @@ -28,8 +28,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" - #include "IDAllocator.h" IDAllocator::IDAllocator(int start, int maximumID) diff --git a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp index f37a993e..9048cfae 100644 --- a/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp +++ b/PowerEditor/src/MISC/PluginsManager/PluginsManager.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "PluginsManager.h" #include "resource.h" diff --git a/PowerEditor/src/MISC/Process/Process.cpp b/PowerEditor/src/MISC/Process/Process.cpp index 33c7818a..56904083 100644 --- a/PowerEditor/src/MISC/Process/Process.cpp +++ b/PowerEditor/src/MISC/Process/Process.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "Parameters.h" #include "process.h" diff --git a/PowerEditor/src/MISC/RegExt/regExtDlg.cpp b/PowerEditor/src/MISC/RegExt/regExtDlg.cpp index 41015a2a..6a21061e 100644 --- a/PowerEditor/src/MISC/RegExt/regExtDlg.cpp +++ b/PowerEditor/src/MISC/RegExt/regExtDlg.cpp @@ -25,8 +25,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include "Common.h" #include "regExtDlg.h" #include "resource.h" diff --git a/PowerEditor/src/MISC/RegExt/regExtDlg.h b/PowerEditor/src/MISC/RegExt/regExtDlg.h index 2ef81778..14a48634 100644 --- a/PowerEditor/src/MISC/RegExt/regExtDlg.h +++ b/PowerEditor/src/MISC/RegExt/regExtDlg.h @@ -33,6 +33,8 @@ #include "regExtDlgRc.h" #endif //REGEXTDLGRC_H +#include "StaticDialog.h" + const int extNameLen = 32; class RegExtDlg : public StaticDialog diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index c81d48a5..3a0d078c 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -25,8 +25,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include #include "Notepad_plus.h" #include "Notepad_plus_Window.h" #include "FileDialog.h" diff --git a/PowerEditor/src/Notepad_plus_Window.cpp b/PowerEditor/src/Notepad_plus_Window.cpp index 0e9d8169..49f8be61 100644 --- a/PowerEditor/src/Notepad_plus_Window.cpp +++ b/PowerEditor/src/Notepad_plus_Window.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "Notepad_plus_Window.h" const TCHAR Notepad_plus_Window::_className[32] = TEXT("Notepad++"); diff --git a/PowerEditor/src/NppBigSwitch.cpp b/PowerEditor/src/NppBigSwitch.cpp index 494238e3..89857a46 100644 --- a/PowerEditor/src/NppBigSwitch.cpp +++ b/PowerEditor/src/NppBigSwitch.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "Notepad_plus_Window.h" #include "TaskListDlg.h" #include "ImageListSet.h" diff --git a/PowerEditor/src/NppCommands.cpp b/PowerEditor/src/NppCommands.cpp index 2df44ee7..d15c671b 100644 --- a/PowerEditor/src/NppCommands.cpp +++ b/PowerEditor/src/NppCommands.cpp @@ -25,8 +25,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include #include "Notepad_plus_Window.h" #include "EncodingMapper.h" #include "ShortcutMapper.h" diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index ee732d1a..9fcc33a7 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -26,7 +26,8 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include +#include #include "Notepad_plus_Window.h" #include "FileDialog.h" #include "EncodingMapper.h" diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index fcbc5eee..44599880 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "Notepad_plus_Window.h" #include "xmlMatchedTagsHighlighter.h" #include "VerticalFileSwitcher.h" diff --git a/PowerEditor/src/ScitillaComponent/DocTabView.cpp b/PowerEditor/src/ScitillaComponent/DocTabView.cpp index 95506df7..03d26069 100644 --- a/PowerEditor/src/ScitillaComponent/DocTabView.cpp +++ b/PowerEditor/src/ScitillaComponent/DocTabView.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "DocTabView.h" #include "ScintillaEditView.h" diff --git a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp index cf9fdb4b..89059ef9 100644 --- a/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/FindReplaceDlg.cpp @@ -25,8 +25,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include #include "FindReplaceDlg.h" #include "ScintillaEditView.h" #include "Notepad_plus_msgs.h" diff --git a/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp b/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp index 475a49e2..c7d40daf 100644 --- a/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp +++ b/PowerEditor/src/ScitillaComponent/FunctionCallTip.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "FunctionCallTip.h" diff --git a/PowerEditor/src/ScitillaComponent/GoToLineDlg.cpp b/PowerEditor/src/ScitillaComponent/GoToLineDlg.cpp index 55375f06..3f2543d0 100644 --- a/PowerEditor/src/ScitillaComponent/GoToLineDlg.cpp +++ b/PowerEditor/src/ScitillaComponent/GoToLineDlg.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "GoToLineDlg.h" diff --git a/PowerEditor/src/ScitillaComponent/Printer.cpp b/PowerEditor/src/ScitillaComponent/Printer.cpp index b82de0a3..4b976b31 100644 --- a/PowerEditor/src/ScitillaComponent/Printer.cpp +++ b/PowerEditor/src/ScitillaComponent/Printer.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "Printer.h" #include "RunDlg.h" //#include "Parameters.h" diff --git a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp index 1485d8b1..83d2de23 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp +++ b/PowerEditor/src/ScitillaComponent/UserDefineDialog.cpp @@ -26,8 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" - #include "localization.h" #include "UserDefineDialog.h" #include "ScintillaEditView.h" diff --git a/PowerEditor/src/ScitillaComponent/UserDefineLangReference.h b/PowerEditor/src/ScitillaComponent/UserDefineLangReference.h index cc924065..3f8c7a92 100644 --- a/PowerEditor/src/ScitillaComponent/UserDefineLangReference.h +++ b/PowerEditor/src/ScitillaComponent/UserDefineLangReference.h @@ -29,9 +29,7 @@ #ifndef USER_DEFINE_LANG_REFERENCE_H #define USER_DEFINE_LANG_REFERENCE_H -#ifndef SCILEXER_H #include "scilexer.h" -#endif //SCILEXER_H const int langNameLenMax = 33; const int extsLenMax = 256; diff --git a/PowerEditor/src/TinyXml/tinyXmlA/tinystrA.cpp b/PowerEditor/src/TinyXml/tinyXmlA/tinystrA.cpp index 39240495..3640ea72 100644 --- a/PowerEditor/src/TinyXml/tinyXmlA/tinystrA.cpp +++ b/PowerEditor/src/TinyXml/tinyXmlA/tinystrA.cpp @@ -22,7 +22,6 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" #include "tinyxmlA.h" #ifndef TIXMLA_USE_STL diff --git a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.cpp b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.cpp index afaa1c3d..c3affd57 100644 --- a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.cpp +++ b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlA.cpp @@ -22,7 +22,7 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" +#include "Common.h" #include "tinyxmlA.h" #ifdef TIXMLA_USE_STL diff --git a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlerrorA.cpp b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlerrorA.cpp index 5ad92200..51302660 100644 --- a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlerrorA.cpp +++ b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlerrorA.cpp @@ -22,7 +22,7 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" + #include "tinyxmlA.h" // The goal of the seperate error file is to make the first diff --git a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlparserA.cpp b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlparserA.cpp index 935f8fc4..d7d4f375 100644 --- a/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlparserA.cpp +++ b/PowerEditor/src/TinyXml/tinyXmlA/tinyxmlparserA.cpp @@ -22,7 +22,7 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" + #include "tinyxmlA.h" //#define DEBUG_PARSER diff --git a/PowerEditor/src/TinyXml/tinystr.cpp b/PowerEditor/src/TinyXml/tinystr.cpp index 78bf513b..45343fda 100644 --- a/PowerEditor/src/TinyXml/tinystr.cpp +++ b/PowerEditor/src/TinyXml/tinystr.cpp @@ -22,7 +22,6 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" #ifndef TIXML_USE_STL diff --git a/PowerEditor/src/TinyXml/tinyxml.cpp b/PowerEditor/src/TinyXml/tinyxml.cpp index e8419cc1..d50938c5 100644 --- a/PowerEditor/src/TinyXml/tinyxml.cpp +++ b/PowerEditor/src/TinyXml/tinyxml.cpp @@ -22,7 +22,7 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" +#include #include "tinyxml.h" bool TiXmlBase::condenseWhiteSpace = true; diff --git a/PowerEditor/src/TinyXml/tinyxmlerror.cpp b/PowerEditor/src/TinyXml/tinyxmlerror.cpp index a5259b99..717cfb9d 100644 --- a/PowerEditor/src/TinyXml/tinyxmlerror.cpp +++ b/PowerEditor/src/TinyXml/tinyxmlerror.cpp @@ -22,7 +22,7 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" + #include "tinyxml.h" // The goal of the seperate error file is to make the first diff --git a/PowerEditor/src/TinyXml/tinyxmlparser.cpp b/PowerEditor/src/TinyXml/tinyxmlparser.cpp index f4a8d941..45ff2621 100644 --- a/PowerEditor/src/TinyXml/tinyxmlparser.cpp +++ b/PowerEditor/src/TinyXml/tinyxmlparser.cpp @@ -22,7 +22,7 @@ must not be misrepresented as being the original software. distribution. */ -#include "precompiledHeaders.h" + #include "tinyxml.h" //#define DEBUG_PARSER diff --git a/PowerEditor/src/UniConversion.cpp b/PowerEditor/src/UniConversion.cpp index 90f90225..bff612c6 100644 --- a/PowerEditor/src/UniConversion.cpp +++ b/PowerEditor/src/UniConversion.cpp @@ -5,7 +5,7 @@ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. -#include "precompiledHeaders.h" +#include #include "UniConversion.h" unsigned int UTF8Length(const wchar_t *uptr, unsigned int tlen) { diff --git a/PowerEditor/src/UniConversion.h b/PowerEditor/src/UniConversion.h index c959087c..3a0b3393 100644 --- a/PowerEditor/src/UniConversion.h +++ b/PowerEditor/src/UniConversion.h @@ -5,9 +5,14 @@ // Copyright 1998-2001 by Neil Hodgson // The License.txt file describes the conditions under which this software may be distributed. +#ifndef UNICONVERSION_H +#define UNICONVERSION_H + unsigned int UTF8Length(const wchar_t * uptr, unsigned int tlen); void UTF8FromUCS2(const wchar_t * uptr, unsigned int tlen, char * putf, unsigned int len); unsigned int UCS2Length(const char * s, unsigned int len); unsigned int UCS2FromUTF8(const char * s, unsigned int len, wchar_t * tbuf, unsigned int tlen); unsigned int ascii_to_utf8(const char * pszASCII, unsigned int lenASCII, char * pszUTF8); int utf8_to_ascii(const char * pszUTF8, unsigned int lenUTF8, char * pszASCII); + +#endif //UNICONVERSION_H diff --git a/PowerEditor/src/Utf8_16.cpp b/PowerEditor/src/Utf8_16.cpp index 729427ab..1532c758 100644 --- a/PowerEditor/src/Utf8_16.cpp +++ b/PowerEditor/src/Utf8_16.cpp @@ -16,7 +16,6 @@ // - Add convert function in Utf8_16_Write //////////////////////////////////////////////////////////////////////////////// -#include "precompiledHeaders.h" #include "Utf8_16.h" const Utf8_16::utf8 Utf8_16::k_Boms[][3] = { diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp index e5f15c1f..ea37f218 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "ListView.h" #include "Parameters.h" #include "localization.h" diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h index 0b7faf34..6a510161 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h @@ -30,6 +30,7 @@ #define LISTVIEW_H #include "window.h" +#include "Common.h" class ListView : public Window { diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 8df97f7b..5a290a4b 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -29,17 +29,10 @@ #ifndef WORD_STYLE_H #define WORD_STYLE_H -#ifndef COLOUR_PICKER_H #include "ColourPicker.h" -#endif //COLOUR_PICKER_H - -#ifndef WORD_STYLE_DLG_RES_H #include "WordStyleDlgRes.h" -#endif //WORD_STYLE_DLG_RES_H - -#ifndef PARAMETERS_H #include "Parameters.h" -#endif //PARAMETERS_H + #define WM_UPDATESCINTILLAS (WORDSTYLE_USER + 1) //GlobalStyleDlg's msg 2 send 2 its parent diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp index 8c78baf6..88d0361e 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "DockingManager.h" #include "DockingSplitter.h" #include "DockingCont.h" @@ -44,18 +44,24 @@ static HHOOK gWinCallHook = NULL; LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam); // Callback function that handles messages (to test focus) -LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) { - if (nCode == HC_ACTION && hWndServer) { +LRESULT CALLBACK FocusWndProc(int nCode, WPARAM wParam, LPARAM lParam) +{ + if (nCode == HC_ACTION && hWndServer) + { DockingManager *pDockingManager = (DockingManager *)::GetWindowLongPtr(hWndServer, GWL_USERDATA); - if (pDockingManager) { + if (pDockingManager) + { vector & vcontainer = pDockingManager->getContainerInfo(); CWPSTRUCT * pCwp = (CWPSTRUCT*)lParam; - if (pCwp->message == WM_KILLFOCUS) { + if (pCwp->message == WM_KILLFOCUS) + { for (int i = 0; i < DOCKCONT_MAX; ++i) { vcontainer[i]->SetActive(FALSE); //deactivate all containers } - } else if (pCwp->message == WM_SETFOCUS) { + } + else if (pCwp->message == WM_SETFOCUS) + { for (int i = 0; i < DOCKCONT_MAX; ++i) { vcontainer[i]->SetActive(IsChild(vcontainer[i]->getHSelf(), pCwp->hwnd)); //activate the container that contains the window with focus, this can be none diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h index da401842..91ab144f 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingManager.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingManager.h @@ -29,6 +29,11 @@ #ifndef DOCKINGMANAGER_H #define DOCKINGMANAGER_H +#include +#include +#include +#include "Window.h" + #ifndef DOCKINGCONT #include "DockingCont.h" #endif //DOCKINGCONT @@ -39,6 +44,7 @@ class DockingSplitter; #include "SplitterContainer.h" #endif //SPLITTER_CONTAINER_H + #define DSPC_CLASS_NAME TEXT("dockingManager") #define CONT_MAP_MAX 50 diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp index 1778042e..3d07437e 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "DockingSplitter.h" #include "Notepad_plus_msgs.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.h b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.h index ffc33cbe..521c117c 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingSplitter.h @@ -29,6 +29,8 @@ #ifndef DOCKINGSPLITTER_H #define DOCKINGSPLITTER_H +#include "Window.h" + #ifndef DOCKING_H #include "Docking.h" #endif //DOCKING_H diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp index 344d6d4f..10284fc5 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.cpp @@ -29,7 +29,6 @@ // speed and consistency of the drag-rectangle - August 2010, Joern Gruel (jg) -#include "precompiledHeaders.h" #include "Gripper.h" #include "DockingManager.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/DockingWnd/Gripper.h b/PowerEditor/src/WinControls/DockingWnd/Gripper.h index 98aa4662..c154821b 100644 --- a/PowerEditor/src/WinControls/DockingWnd/Gripper.h +++ b/PowerEditor/src/WinControls/DockingWnd/Gripper.h @@ -29,6 +29,10 @@ #ifndef GRIPPER_H #define GRIPPER_H +#include +#include +#include "Common.h" + #ifndef DOCKING_H #include "Docking.h" #endif //DOCKING_H diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp index 11f50af0..ac8245c1 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "documentMap.h" #include "ScintillaEditView.h" diff --git a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp index 79716580..8ad4227e 100644 --- a/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp +++ b/PowerEditor/src/WinControls/FindCharsInRange/FindCharsInRange.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "FindCharsInRange.h" #include "FindCharsInRange_rc.h" diff --git a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp index 2e2fd339..13f780ba 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionListPanel.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "functionListPanel.h" #include "ScintillaEditView.h" #include "localization.h" diff --git a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp index 16d3904b..a0b80242 100644 --- a/PowerEditor/src/WinControls/FunctionList/functionParser.cpp +++ b/PowerEditor/src/WinControls/FunctionList/functionParser.cpp @@ -25,7 +25,7 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "ScintillaEditView.h" #include "functionParser.h" #include "boostregexsearch.h" diff --git a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp index e6f42f02..8f8a7cba 100644 --- a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp +++ b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ImageListSet.h" void IconList::create(HINSTANCE hInst, int iconSize) diff --git a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h index 84343b75..6ebbea91 100644 --- a/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h +++ b/PowerEditor/src/WinControls/ImageListSet/ImageListSet.h @@ -29,6 +29,8 @@ #ifndef IMAGE_LIST_H #define IMAGE_LIST_H +#include +#include #include const int nbMax = 45; diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index d8f4d2ba..477a43a5 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -25,8 +25,9 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -#include "precompiledHeaders.h" +#include +#include +#include #include "preferenceDlg.h" #include "lesDlgs.h" #include "EncodingMapper.h" diff --git a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp index f0372919..2c56c05a 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/ProjectPanel.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "ProjectPanel.h" #include "resource.h" #include "tinyxml.h" diff --git a/PowerEditor/src/WinControls/ProjectPanel/TreeView.cpp b/PowerEditor/src/WinControls/ProjectPanel/TreeView.cpp index d46f347b..7aa100e8 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/TreeView.cpp +++ b/PowerEditor/src/WinControls/ProjectPanel/TreeView.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "TreeView.h" #define CY_ITEMHEIGHT 18 diff --git a/PowerEditor/src/WinControls/ProjectPanel/TreeView.h b/PowerEditor/src/WinControls/ProjectPanel/TreeView.h index 0138fe8c..d14b4b5c 100644 --- a/PowerEditor/src/WinControls/ProjectPanel/TreeView.h +++ b/PowerEditor/src/WinControls/ProjectPanel/TreeView.h @@ -28,7 +28,10 @@ #ifndef TREE_VIEW_H #define TREE_VIEW_H +#include +#include #include "window.h" +#include "Common.h" struct TreeStateNode { generic_string _label; diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index f4b6526a..63255732 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -15,7 +15,7 @@ //along with this program; if not, write to the Free Software //Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include "StaticDialog.h" #include "RunDlg.h" #include "FileDialog.h" #include "Notepad_plus_msgs.h" diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h index 18e6898a..a4ef21ba 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h @@ -18,6 +18,9 @@ #ifndef RUN_DLG_H #define RUN_DLG_H +#include +#include "Common.h" + #ifndef RUN_DLG_RC_H #include "RunDlg_rc.h" #endif //RUN_DLG_RC_H diff --git a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h index f4e37456..e3431a89 100644 --- a/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h +++ b/PowerEditor/src/WinControls/StaticDialog/StaticDialog.h @@ -29,10 +29,7 @@ #ifndef STATIC_DIALOG_H #define STATIC_DIALOG_H -#ifndef NOTEPAD_PLUS_MSGS_H #include "Notepad_plus_msgs.h" -#endif //NOTEPAD_PLUS_MSGS_H - #include "Window.h" typedef HRESULT (WINAPI * ETDTProc) (HWND, DWORD); diff --git a/PowerEditor/src/WinControls/TabBar/TabBar.cpp b/PowerEditor/src/WinControls/TabBar/TabBar.cpp index 6e9e24a4..bcb9aa20 100644 --- a/PowerEditor/src/WinControls/TabBar/TabBar.cpp +++ b/PowerEditor/src/WinControls/TabBar/TabBar.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "TabBar.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/TaskList/TaskList.cpp b/PowerEditor/src/WinControls/TaskList/TaskList.cpp index 0006583b..42205a46 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskList.cpp +++ b/PowerEditor/src/WinControls/TaskList/TaskList.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "TaskList.h" #include "TaskListDlg_rc.h" #include "colors.h" diff --git a/PowerEditor/src/WinControls/TaskList/TaskList.h b/PowerEditor/src/WinControls/TaskList/TaskList.h index 9645823e..b2a64142 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskList.h +++ b/PowerEditor/src/WinControls/TaskList/TaskList.h @@ -29,6 +29,10 @@ #ifndef TASKLIST_H #define TASKLIST_H +#include +#include +#include "Window.h" + #ifndef WM_MOUSEWHEEL #define WM_MOUSEWHEEL 0x020A #endif //WM_MOUSEWHEEL diff --git a/PowerEditor/src/WinControls/TaskList/TaskListDlg.cpp b/PowerEditor/src/WinControls/TaskList/TaskListDlg.cpp index 67dda3cc..ef5657ad 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskListDlg.cpp +++ b/PowerEditor/src/WinControls/TaskList/TaskListDlg.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "TaskListDlg.h" #include "Parameters.h" #include "resource.h" diff --git a/PowerEditor/src/WinControls/TaskList/TaskListDlg.h b/PowerEditor/src/WinControls/TaskList/TaskListDlg.h index 9362e736..42cd16b4 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskListDlg.h +++ b/PowerEditor/src/WinControls/TaskList/TaskListDlg.h @@ -29,6 +29,9 @@ #ifndef TASKLISTDLG_H #define TASKLISTDLG_H +#include "Common.h" +#include "StaticDialog.h" + #ifndef TASKLISTDLGRC_H #include "TaskListDlg_rc.h" #endif //TASKLISTDLGRC_H diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index c2807f61..2439d852 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "ToolBar.h" #include "Shortcut.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index ec695189..6db67f13 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -29,11 +29,9 @@ #ifndef TOOL_BAR_H #define TOOL_BAR_H -#ifndef NOTEPAD_PLUS_MSGS_H -#include "Notepad_plus_msgs.h" -#endif //NOTEPAD_PLUS_MSGS_H - +#include "Common.h" #include "Window.h" +#include "Notepad_plus_msgs.h" #include "ImageListSet.h" #define REBAR_BAR_TOOLBAR 0 diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp b/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp index 1d7024cb..9b984c05 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.cpp @@ -26,14 +26,11 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" +#include #include "ToolTip.h" - - LRESULT CALLBACK dlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); - void ToolTip::init(HINSTANCE hInst, HWND hParent) { if (_hSelf == NULL) diff --git a/PowerEditor/src/WinControls/ToolTip/ToolTip.h b/PowerEditor/src/WinControls/ToolTip/ToolTip.h index a8bf735e..8310c57d 100644 --- a/PowerEditor/src/WinControls/ToolTip/ToolTip.h +++ b/PowerEditor/src/WinControls/ToolTip/ToolTip.h @@ -29,7 +29,9 @@ #ifndef __TOOLTIP_H__ #define __TOOLTIP_H__ +#include #include +#include "Window.h" class ToolTip : public Window { diff --git a/PowerEditor/src/WinControls/TrayIcon/trayIconControler.cpp b/PowerEditor/src/WinControls/TrayIcon/trayIconControler.cpp index 84d77284..b34af62f 100644 --- a/PowerEditor/src/WinControls/TrayIcon/trayIconControler.cpp +++ b/PowerEditor/src/WinControls/TrayIcon/trayIconControler.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "trayIconControler.h" trayIconControler::trayIconControler(HWND hwnd, UINT uID, UINT uCBMsg, HICON hicon, TCHAR *tip) diff --git a/PowerEditor/src/WinControls/TrayIcon/trayIconControler.h b/PowerEditor/src/WinControls/TrayIcon/trayIconControler.h index d3bd689a..bfaf436b 100644 --- a/PowerEditor/src/WinControls/TrayIcon/trayIconControler.h +++ b/PowerEditor/src/WinControls/TrayIcon/trayIconControler.h @@ -29,6 +29,8 @@ #ifndef TRAY_ICON_CONTROLER_H #define TRAY_ICON_CONTROLER_H +#include + #define ADD NIM_ADD #define REMOVE NIM_DELETE diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index a5532f58..658648ad 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "VerticalFileSwitcher.h" #include "menuCmdID.h" #include "Parameters.h" diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h index 5fb08eb4..0276cd00 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h @@ -29,11 +29,7 @@ #ifndef VERTICALFILESWITCHER_H #define VERTICALFILESWITCHER_H -//#include -#ifndef DOCKINGDLGINTERFACE_H #include "DockingDlgInterface.h" -#endif //DOCKINGDLGINTERFACE_H - #include "VerticalFileSwitcher_rc.h" #include "VerticalFileSwitcherListView.h" diff --git a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp index 47127d92..d4f37813 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WinMgr.cpp @@ -8,7 +8,7 @@ // Theo - Heavily modified to remove MFC dependencies. // Replaced CWnd*/HWND, CRect/RECT, CSize/SIZE, CPoint/POINT -#include "precompiledHeaders.h" + #include "WinMgr.h" // Theo - Style Helpers diff --git a/PowerEditor/src/WinControls/WindowsDlg/WinRect.cpp b/PowerEditor/src/WinControls/WindowsDlg/WinRect.cpp index 5caeb955..3dcb68f0 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WinRect.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WinRect.cpp @@ -7,7 +7,6 @@ // -#include "precompiledHeaders.h" #include "WinMgr.h" ////////////////// diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h index 48eac8b0..d194dc4e 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.h @@ -29,10 +29,7 @@ #ifndef WINDOWS_DLG_H #define WINDOWS_DLG_H -#ifndef SIZABLE_DLG_H #include "SizeableDlg.h" -#endif //SIZABLE_DLG_H - #include "Common.h" class DocTabView; diff --git a/PowerEditor/src/lastRecentFileList.cpp b/PowerEditor/src/lastRecentFileList.cpp index 2e7dc670..b2b9d80b 100644 --- a/PowerEditor/src/lastRecentFileList.cpp +++ b/PowerEditor/src/lastRecentFileList.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "lastRecentFileList.h" #include "menuCmdID.h" #include "localization.h" diff --git a/PowerEditor/src/lesDlgs.cpp b/PowerEditor/src/lesDlgs.cpp index 57947d89..0b2e29c6 100644 --- a/PowerEditor/src/lesDlgs.cpp +++ b/PowerEditor/src/lesDlgs.cpp @@ -26,7 +26,7 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" + #include "lesDlgs.h" #include "resource.h" #include "menuCmdID.h" diff --git a/PowerEditor/src/lesDlgs.h b/PowerEditor/src/lesDlgs.h index a3e52e7e..0fdd66be 100644 --- a/PowerEditor/src/lesDlgs.h +++ b/PowerEditor/src/lesDlgs.h @@ -29,6 +29,9 @@ #ifndef SIZE_DLG_H #define SIZE_DLG_H +#include "StaticDialog.h" +#include "Common.h" + const int DEFAULT_NB_NUMBER = 2; class ValueDlg : public StaticDialog { diff --git a/PowerEditor/src/localization.cpp b/PowerEditor/src/localization.cpp index fd41fa30..920eba3e 100644 --- a/PowerEditor/src/localization.cpp +++ b/PowerEditor/src/localization.cpp @@ -26,7 +26,6 @@ // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#include "precompiledHeaders.h" #include "Notepad_plus.h" #include "ShortcutMapper.h" #include "EncodingMapper.h" diff --git a/PowerEditor/src/localization.h b/PowerEditor/src/localization.h index e436909e..4d77d6db 100644 --- a/PowerEditor/src/localization.h +++ b/PowerEditor/src/localization.h @@ -29,9 +29,9 @@ #ifndef LOCALIZATION_H #define LOCALIZATION_H -#ifndef TINYXMLA_INCLUDED +#include "Common.h" #include "tinyxmlA.h" -#endif //TINYXMLA_INCLUDED + class FindReplaceDlg; class PreferenceDlg; diff --git a/PowerEditor/src/uchardet/JpCntx.cpp b/PowerEditor/src/uchardet/JpCntx.cpp index 033bb2a7..7da04139 100644 --- a/PowerEditor/src/uchardet/JpCntx.cpp +++ b/PowerEditor/src/uchardet/JpCntx.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nscore.h" #include "JpCntx.h" diff --git a/PowerEditor/src/uchardet/LangBulgarianModel.cpp b/PowerEditor/src/uchardet/LangBulgarianModel.cpp index 9af123d9..77686607 100644 --- a/PowerEditor/src/uchardet/LangBulgarianModel.cpp +++ b/PowerEditor/src/uchardet/LangBulgarianModel.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsSBCharSetProber.h" /**************************************************************** 255: Control characters that usually does not exist in any text diff --git a/PowerEditor/src/uchardet/LangCyrillicModel.cpp b/PowerEditor/src/uchardet/LangCyrillicModel.cpp index 6407e8f5..42f28876 100644 --- a/PowerEditor/src/uchardet/LangCyrillicModel.cpp +++ b/PowerEditor/src/uchardet/LangCyrillicModel.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsSBCharSetProber.h" diff --git a/PowerEditor/src/uchardet/LangGreekModel.cpp b/PowerEditor/src/uchardet/LangGreekModel.cpp index e09b1864..d90ced9d 100644 --- a/PowerEditor/src/uchardet/LangGreekModel.cpp +++ b/PowerEditor/src/uchardet/LangGreekModel.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsSBCharSetProber.h" /**************************************************************** 255: Control characters that usually does not exist in any text diff --git a/PowerEditor/src/uchardet/LangHebrewModel.cpp b/PowerEditor/src/uchardet/LangHebrewModel.cpp index f3c11852..99a36e72 100644 --- a/PowerEditor/src/uchardet/LangHebrewModel.cpp +++ b/PowerEditor/src/uchardet/LangHebrewModel.cpp @@ -36,7 +36,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsSBCharSetProber.h" diff --git a/PowerEditor/src/uchardet/LangHungarianModel.cpp b/PowerEditor/src/uchardet/LangHungarianModel.cpp index cf3e449d..856644af 100644 --- a/PowerEditor/src/uchardet/LangHungarianModel.cpp +++ b/PowerEditor/src/uchardet/LangHungarianModel.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsSBCharSetProber.h" /**************************************************************** 255: Control characters that usually does not exist in any text diff --git a/PowerEditor/src/uchardet/LangThaiModel.cpp b/PowerEditor/src/uchardet/LangThaiModel.cpp index f849e01d..11b8e75e 100644 --- a/PowerEditor/src/uchardet/LangThaiModel.cpp +++ b/PowerEditor/src/uchardet/LangThaiModel.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsSBCharSetProber.h" diff --git a/PowerEditor/src/uchardet/nsBig5Prober.cpp b/PowerEditor/src/uchardet/nsBig5Prober.cpp index b2ae4f6a..7a85abb5 100644 --- a/PowerEditor/src/uchardet/nsBig5Prober.cpp +++ b/PowerEditor/src/uchardet/nsBig5Prober.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsBig5Prober.h" void nsBig5Prober::Reset(void) diff --git a/PowerEditor/src/uchardet/nsCharSetProber.cpp b/PowerEditor/src/uchardet/nsCharSetProber.cpp index 6a823470..fdfe7d7a 100644 --- a/PowerEditor/src/uchardet/nsCharSetProber.cpp +++ b/PowerEditor/src/uchardet/nsCharSetProber.cpp @@ -35,7 +35,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsCharSetProber.h" #include "prmem.h" diff --git a/PowerEditor/src/uchardet/nsEUCJPProber.cpp b/PowerEditor/src/uchardet/nsEUCJPProber.cpp index 9255394d..54861b3d 100644 --- a/PowerEditor/src/uchardet/nsEUCJPProber.cpp +++ b/PowerEditor/src/uchardet/nsEUCJPProber.cpp @@ -39,7 +39,7 @@ // 1, kana character (or hankaku?) often have hight frequency of appereance // 2, kana character often exist in group // 3, certain combination of kana is never used in japanese language -#include "precompiledHeaders.h" + #include "nsEUCJPProber.h" void nsEUCJPProber::Reset(void) diff --git a/PowerEditor/src/uchardet/nsEUCKRProber.cpp b/PowerEditor/src/uchardet/nsEUCKRProber.cpp index ff9fea0f..3632f1f9 100644 --- a/PowerEditor/src/uchardet/nsEUCKRProber.cpp +++ b/PowerEditor/src/uchardet/nsEUCKRProber.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsEUCKRProber.h" void nsEUCKRProber::Reset(void) diff --git a/PowerEditor/src/uchardet/nsEUCTWProber.cpp b/PowerEditor/src/uchardet/nsEUCTWProber.cpp index 33f4b0ee..a06e074b 100644 --- a/PowerEditor/src/uchardet/nsEUCTWProber.cpp +++ b/PowerEditor/src/uchardet/nsEUCTWProber.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsEUCTWProber.h" void nsEUCTWProber::Reset(void) diff --git a/PowerEditor/src/uchardet/nsEscCharsetProber.cpp b/PowerEditor/src/uchardet/nsEscCharsetProber.cpp index 9390b5a5..464c7534 100644 --- a/PowerEditor/src/uchardet/nsEscCharsetProber.cpp +++ b/PowerEditor/src/uchardet/nsEscCharsetProber.cpp @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsEscCharsetProber.h" #include "nsUniversalDetector.h" diff --git a/PowerEditor/src/uchardet/nsEscSM.cpp b/PowerEditor/src/uchardet/nsEscSM.cpp index c746609d..7b1de390 100644 --- a/PowerEditor/src/uchardet/nsEscSM.cpp +++ b/PowerEditor/src/uchardet/nsEscSM.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsCodingStateMachine.h" static const PRUint32 HZ_cls[ 256 / 8 ] = { diff --git a/PowerEditor/src/uchardet/nsGB2312Prober.cpp b/PowerEditor/src/uchardet/nsGB2312Prober.cpp index fb0ae6fc..b6d469ce 100644 --- a/PowerEditor/src/uchardet/nsGB2312Prober.cpp +++ b/PowerEditor/src/uchardet/nsGB2312Prober.cpp @@ -39,7 +39,7 @@ // 1, kana character (or hankaku?) often have hight frequency of appereance // 2, kana character often exist in group // 3, certain combination of kana is never used in japanese language -#include "precompiledHeaders.h" + #include "nsGB2312Prober.h" void nsGB18030Prober::Reset(void) diff --git a/PowerEditor/src/uchardet/nsHebrewProber.cpp b/PowerEditor/src/uchardet/nsHebrewProber.cpp index 2dd4b7cd..b148ce3f 100644 --- a/PowerEditor/src/uchardet/nsHebrewProber.cpp +++ b/PowerEditor/src/uchardet/nsHebrewProber.cpp @@ -35,7 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" #include "nsHebrewProber.h" #include diff --git a/PowerEditor/src/uchardet/nsLatin1Prober.cpp b/PowerEditor/src/uchardet/nsLatin1Prober.cpp index 77a8c6a2..7694ef76 100644 --- a/PowerEditor/src/uchardet/nsLatin1Prober.cpp +++ b/PowerEditor/src/uchardet/nsLatin1Prober.cpp @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" #include "nsLatin1Prober.h" #include "prmem.h" #include diff --git a/PowerEditor/src/uchardet/nsMBCSGroupProber.cpp b/PowerEditor/src/uchardet/nsMBCSGroupProber.cpp index 360635ab..4fafb134 100644 --- a/PowerEditor/src/uchardet/nsMBCSGroupProber.cpp +++ b/PowerEditor/src/uchardet/nsMBCSGroupProber.cpp @@ -36,7 +36,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include #include "nsMBCSGroupProber.h" diff --git a/PowerEditor/src/uchardet/nsMBCSSM.cpp b/PowerEditor/src/uchardet/nsMBCSSM.cpp index e4fe43ce..bedf2b76 100644 --- a/PowerEditor/src/uchardet/nsMBCSSM.cpp +++ b/PowerEditor/src/uchardet/nsMBCSSM.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "nsCodingStateMachine.h" /* diff --git a/PowerEditor/src/uchardet/nsSBCSGroupProber.cpp b/PowerEditor/src/uchardet/nsSBCSGroupProber.cpp index 1adcfef6..d8fef879 100644 --- a/PowerEditor/src/uchardet/nsSBCSGroupProber.cpp +++ b/PowerEditor/src/uchardet/nsSBCSGroupProber.cpp @@ -36,7 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" #include #include "prmem.h" diff --git a/PowerEditor/src/uchardet/nsSBCharSetProber.cpp b/PowerEditor/src/uchardet/nsSBCharSetProber.cpp index 8ebfacda..3a88fdf3 100644 --- a/PowerEditor/src/uchardet/nsSBCharSetProber.cpp +++ b/PowerEditor/src/uchardet/nsSBCharSetProber.cpp @@ -35,7 +35,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include #include "nsSBCharSetProber.h" diff --git a/PowerEditor/src/uchardet/nsSJISProber.cpp b/PowerEditor/src/uchardet/nsSJISProber.cpp index 7386a9cd..0b59e399 100644 --- a/PowerEditor/src/uchardet/nsSJISProber.cpp +++ b/PowerEditor/src/uchardet/nsSJISProber.cpp @@ -40,7 +40,7 @@ // 2, kana character often exist in group // 3, certain combination of kana is never used in japanese language -#include "precompiledHeaders.h" + #include "nsSJISProber.h" void nsSJISProber::Reset(void) diff --git a/PowerEditor/src/uchardet/nsUTF8Prober.cpp b/PowerEditor/src/uchardet/nsUTF8Prober.cpp index 81ab5f18..ab8d9f7b 100644 --- a/PowerEditor/src/uchardet/nsUTF8Prober.cpp +++ b/PowerEditor/src/uchardet/nsUTF8Prober.cpp @@ -35,7 +35,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" #include "nsUTF8Prober.h" void nsUTF8Prober::Reset(void) diff --git a/PowerEditor/src/uchardet/nsUniversalDetector.cpp b/PowerEditor/src/uchardet/nsUniversalDetector.cpp index 16a26cd7..dd74243c 100644 --- a/PowerEditor/src/uchardet/nsUniversalDetector.cpp +++ b/PowerEditor/src/uchardet/nsUniversalDetector.cpp @@ -36,8 +36,6 @@ * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" - #include "nscore.h" #include "nsUniversalDetector.h" diff --git a/PowerEditor/src/uchardet/uchardet.cpp b/PowerEditor/src/uchardet/uchardet.cpp index eeba3106..35b84092 100644 --- a/PowerEditor/src/uchardet/uchardet.cpp +++ b/PowerEditor/src/uchardet/uchardet.cpp @@ -34,7 +34,7 @@ * the terms of any one of the MPL, the GPL or the LGPL. * * ***** END LICENSE BLOCK ***** */ -#include "precompiledHeaders.h" + #include "uchardet.h" #include "nscore.h" #include "nsUniversalDetector.h" diff --git a/PowerEditor/src/winmain.cpp b/PowerEditor/src/winmain.cpp index 7ad85802..4b6a8752 100644 --- a/PowerEditor/src/winmain.cpp +++ b/PowerEditor/src/winmain.cpp @@ -25,8 +25,8 @@ // along with this program; if not, write to the Free Software // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#define _WIN32_WINNT 0x0501 -#include "precompiledHeaders.h" #include "Notepad_plus_Window.h" #include "Process.h"