diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index 37ad44bcf..20e165373 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -54,11 +54,10 @@ void printMsg(const TCHAR *msg2print, const TCHAR *title, DWORD flags) ::MessageBox(Notepad_plus::gNppHWND, msg2print, title, flags); } -void writeLog(const TCHAR *logFileName, const TCHAR *log2write) +void writeLog(const TCHAR *logFileName, const char *log2write) { FILE *f = generic_fopen(logFileName, TEXT("a+")); - const TCHAR * ptr = log2write; - fwrite(log2write, sizeof(log2write[0]), lstrlen(log2write), f); + fwrite(log2write, sizeof(log2write[0]), strlen(log2write), f); fputc('\n', f); fflush(f); fclose(f); diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 41922580d..231d7c2df 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -89,7 +89,7 @@ void systemMessage(const TCHAR *title); void printInt(int int2print); void printStr(const TCHAR *str2print); void printMsg(const TCHAR *msg2print, const TCHAR *title, DWORD flags = MB_OK); -void writeLog(const TCHAR *logFileName, const TCHAR *log2write); +void writeLog(const TCHAR *logFileName, const char *log2write); int filter(unsigned int code, struct _EXCEPTION_POINTERS *ep); int getCpFromStringValue(const char * encodingStr); std::generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false); diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 9026f66bf..875da70a8 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -416,6 +416,7 @@ winVer getWindowsVersion() NppParameters * NppParameters::_pSelf = new NppParameters; int FileDialog::_dialogFileBoxId = (NppParameters::getInstance())->getWinVersion() < WV_W2K?edt1:cmb13; + NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserStylerDoc(NULL),\ _pXmlUserLangDoc(NULL), /*_pXmlNativeLangDoc(NULL), */_pXmlNativeLangDocA(NULL),\ _nbLang(0), _nbFile(0), _nbMaxFile(10), _pXmlToolIconsDoc(NULL),\ @@ -448,7 +449,6 @@ NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserSty PathAppend(notepadStylePath, notepadStyleFile); _asNotepadStyle = (PathFileExists(notepadStylePath) == TRUE); - ::AddFontResource(LINEDRAW_FONT); //Load initial accelerator key definitions @@ -840,8 +840,6 @@ void NppParameters::destroyInstance() void NppParameters::setFontList(HWND hWnd) { - ::AddFontResource(LINEDRAW_FONT); - //---------------// // Sys font list // //---------------// @@ -854,6 +852,7 @@ void NppParameters::setFontList(HWND hWnd) lf.lfFaceName[0]='\0'; lf.lfPitchAndFamily = 0; HDC hDC = ::GetDC(hWnd); + ::EnumFontFamiliesEx(hDC, &lf, (FONTENUMPROC) EnumFontFamExProc, diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index d76111cad..5ec2e6810 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -894,7 +894,6 @@ void ScintillaEditView::makeStyle(LangType language, const TCHAR **keywordArray) void ScintillaEditView::defineDocType(LangType typeDoc) { - //setStyle(STYLE_DEFAULT, black, white, TEXT("Verdana"), 0, 9); StyleArray & stylers = _pParameter->getMiscStylerArray(); int iStyleDefault = stylers.getStylerIndexByID(STYLE_DEFAULT); if (iStyleDefault != -1) @@ -1015,6 +1014,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc) Style nfoStyle; nfoStyle._styleID = STYLE_DEFAULT; nfoStyle._fontName = TEXT("MS LineDraw"); + if (pStyler) { int i = pStyler->getStylerIndexByName(TEXT("DEFAULT")); @@ -1026,9 +1026,9 @@ void ScintillaEditView::defineDocType(LangType typeDoc) nfoStyle._colorStyle = style._colorStyle; } } - setStyle(nfoStyle); execute(SCI_STYLECLEARALL); + } break; @@ -1128,7 +1128,6 @@ void ScintillaEditView::defineDocType(LangType typeDoc) break; } - //All the global styles should put here static int indexOfIndentGuide = stylers.getStylerIndexByID(STYLE_INDENTGUIDE); if (indexOfIndentGuide != -1) @@ -1136,7 +1135,6 @@ void ScintillaEditView::defineDocType(LangType typeDoc) static Style & styleIG = stylers.getStyler(indexOfIndentGuide); setStyle(styleIG); } - static int indexOfBraceLight = stylers.getStylerIndexByID(STYLE_BRACELIGHT); if (indexOfBraceLight != -1) { @@ -1144,27 +1142,22 @@ void ScintillaEditView::defineDocType(LangType typeDoc) setStyle(styleBL); } //setStyle(STYLE_CONTROLCHAR, liteGrey); - static int indexBadBrace = stylers.getStylerIndexByID(STYLE_BRACEBAD); if (indexBadBrace != -1) { static Style & styleBB = stylers.getStyler(indexBadBrace); setStyle(styleBB); } - static int indexLineNumber = stylers.getStylerIndexByID(STYLE_LINENUMBER); if (indexLineNumber != -1) { static Style & styleLN = stylers.getStyler(indexLineNumber); setSpecialStyle(styleLN); } - execute(SCI_SETTABWIDTH, ((NppParameters::getInstance())->getNppGUI())._tabSize); execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace); - int bitsNeeded = execute(SCI_GETSTYLEBITSNEEDED); - //if (oldBits != bitsNeeded) - execute(SCI_SETSTYLEBITS, bitsNeeded); + execute(SCI_SETSTYLEBITS, bitsNeeded); } BufferID ScintillaEditView::attachDefaultDoc() diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index a128d30ac..e3e2215ec 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -51,7 +51,6 @@ class NppParameters; typedef int (* SCINTILLA_FUNC) (void*, int, int, int); typedef void * SCINTILLA_PTR; -//typedef std::vector buf_vec_t; #define WM_DOCK_USERDEFINE_DLG (SCINTILLA_USER + 1) #define WM_UNDOCK_USERDEFINE_DLG (SCINTILLA_USER + 2) @@ -63,8 +62,6 @@ typedef void * SCINTILLA_PTR; #define WM_DOOPEN (SCINTILLA_USER + 8) #define WM_FINDINFILES (SCINTILLA_USER + 9) -//const TCHAR * LINEDRAW_FONT = TEXT("LINEDRAW.TTF"); - const int NB_FOLDER_STATE = 7; // Codepage @@ -167,12 +164,6 @@ public: void activateBuffer(BufferID buffer); - /*void setCurrentDocUserType(const TCHAR *userLangName) { - lstrcpy(_buffers[_currentIndex]._userLangExt, userLangName); - _buffers[_currentIndex]._lang = L_USER; - defineDocType(L_USER); - };*/ - void getText(char *dest, int start, int end) const; void getGenericText(TCHAR *dest, int start, int end) const; void insertGenericTextFrom(int position, const TCHAR *text2insert) const; @@ -186,7 +177,6 @@ public: char * getSelectedText(char * txt, int size, bool expand = true); TCHAR * getGenericSelectedText(TCHAR * txt, int size, bool expand = true); int searchInTarget(const TCHAR * Text2Find, int fromPos, int toPos) const; - //void appandText(const char * text2Append) const; void appandGenericText(const TCHAR * text2Append) const; int replaceTarget(const TCHAR * str2replace, int fromTargetPos = -1, int toTargetPos = -1) const; int replaceTargetRegExMode(const TCHAR * re, int fromTargetPos = -1, int toTargetPos = -1) const; @@ -436,8 +426,6 @@ public: void foldCurrentPos(bool mode); int getCodepage() const {return _codepage;}; - //int getMaxNbDigit const () {return _maxNbDigit;}; - bool increaseMaxNbDigit(int newValue) { if (newValue > _maxNbDigit) { diff --git a/PowerEditor/src/stylers.model.xml b/PowerEditor/src/stylers.model.xml index 34b7ae375..fea784818 100644 --- a/PowerEditor/src/stylers.model.xml +++ b/PowerEditor/src/stylers.model.xml @@ -500,6 +500,7 @@ +