mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 14:54:39 +02:00
[CLEAN] Remove redundant AddFontResource call.
git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@382 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
parent
261d357e66
commit
f7a1301d04
@ -54,11 +54,10 @@ void printMsg(const TCHAR *msg2print, const TCHAR *title, DWORD flags)
|
|||||||
::MessageBox(Notepad_plus::gNppHWND, msg2print, title, 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+"));
|
FILE *f = generic_fopen(logFileName, TEXT("a+"));
|
||||||
const TCHAR * ptr = log2write;
|
fwrite(log2write, sizeof(log2write[0]), strlen(log2write), f);
|
||||||
fwrite(log2write, sizeof(log2write[0]), lstrlen(log2write), f);
|
|
||||||
fputc('\n', f);
|
fputc('\n', f);
|
||||||
fflush(f);
|
fflush(f);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
|
@ -89,7 +89,7 @@ void systemMessage(const TCHAR *title);
|
|||||||
void printInt(int int2print);
|
void printInt(int int2print);
|
||||||
void printStr(const TCHAR *str2print);
|
void printStr(const TCHAR *str2print);
|
||||||
void printMsg(const TCHAR *msg2print, const TCHAR *title, DWORD flags = MB_OK);
|
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 filter(unsigned int code, struct _EXCEPTION_POINTERS *ep);
|
||||||
int getCpFromStringValue(const char * encodingStr);
|
int getCpFromStringValue(const char * encodingStr);
|
||||||
std::generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false);
|
std::generic_string purgeMenuItemString(const TCHAR * menuItemStr, bool keepAmpersand = false);
|
||||||
|
@ -416,6 +416,7 @@ winVer getWindowsVersion()
|
|||||||
|
|
||||||
NppParameters * NppParameters::_pSelf = new NppParameters;
|
NppParameters * NppParameters::_pSelf = new NppParameters;
|
||||||
int FileDialog::_dialogFileBoxId = (NppParameters::getInstance())->getWinVersion() < WV_W2K?edt1:cmb13;
|
int FileDialog::_dialogFileBoxId = (NppParameters::getInstance())->getWinVersion() < WV_W2K?edt1:cmb13;
|
||||||
|
|
||||||
NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserStylerDoc(NULL),\
|
NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserStylerDoc(NULL),\
|
||||||
_pXmlUserLangDoc(NULL), /*_pXmlNativeLangDoc(NULL), */_pXmlNativeLangDocA(NULL),\
|
_pXmlUserLangDoc(NULL), /*_pXmlNativeLangDoc(NULL), */_pXmlNativeLangDocA(NULL),\
|
||||||
_nbLang(0), _nbFile(0), _nbMaxFile(10), _pXmlToolIconsDoc(NULL),\
|
_nbLang(0), _nbFile(0), _nbMaxFile(10), _pXmlToolIconsDoc(NULL),\
|
||||||
@ -448,7 +449,6 @@ NppParameters::NppParameters() : _pXmlDoc(NULL),_pXmlUserDoc(NULL), _pXmlUserSty
|
|||||||
PathAppend(notepadStylePath, notepadStyleFile);
|
PathAppend(notepadStylePath, notepadStyleFile);
|
||||||
|
|
||||||
_asNotepadStyle = (PathFileExists(notepadStylePath) == TRUE);
|
_asNotepadStyle = (PathFileExists(notepadStylePath) == TRUE);
|
||||||
|
|
||||||
::AddFontResource(LINEDRAW_FONT);
|
::AddFontResource(LINEDRAW_FONT);
|
||||||
|
|
||||||
//Load initial accelerator key definitions
|
//Load initial accelerator key definitions
|
||||||
@ -840,8 +840,6 @@ void NppParameters::destroyInstance()
|
|||||||
|
|
||||||
void NppParameters::setFontList(HWND hWnd)
|
void NppParameters::setFontList(HWND hWnd)
|
||||||
{
|
{
|
||||||
::AddFontResource(LINEDRAW_FONT);
|
|
||||||
|
|
||||||
//---------------//
|
//---------------//
|
||||||
// Sys font list //
|
// Sys font list //
|
||||||
//---------------//
|
//---------------//
|
||||||
@ -854,6 +852,7 @@ void NppParameters::setFontList(HWND hWnd)
|
|||||||
lf.lfFaceName[0]='\0';
|
lf.lfFaceName[0]='\0';
|
||||||
lf.lfPitchAndFamily = 0;
|
lf.lfPitchAndFamily = 0;
|
||||||
HDC hDC = ::GetDC(hWnd);
|
HDC hDC = ::GetDC(hWnd);
|
||||||
|
|
||||||
::EnumFontFamiliesEx(hDC,
|
::EnumFontFamiliesEx(hDC,
|
||||||
&lf,
|
&lf,
|
||||||
(FONTENUMPROC) EnumFontFamExProc,
|
(FONTENUMPROC) EnumFontFamExProc,
|
||||||
|
@ -894,7 +894,6 @@ void ScintillaEditView::makeStyle(LangType language, const TCHAR **keywordArray)
|
|||||||
|
|
||||||
void ScintillaEditView::defineDocType(LangType typeDoc)
|
void ScintillaEditView::defineDocType(LangType typeDoc)
|
||||||
{
|
{
|
||||||
//setStyle(STYLE_DEFAULT, black, white, TEXT("Verdana"), 0, 9);
|
|
||||||
StyleArray & stylers = _pParameter->getMiscStylerArray();
|
StyleArray & stylers = _pParameter->getMiscStylerArray();
|
||||||
int iStyleDefault = stylers.getStylerIndexByID(STYLE_DEFAULT);
|
int iStyleDefault = stylers.getStylerIndexByID(STYLE_DEFAULT);
|
||||||
if (iStyleDefault != -1)
|
if (iStyleDefault != -1)
|
||||||
@ -1015,6 +1014,7 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
Style nfoStyle;
|
Style nfoStyle;
|
||||||
nfoStyle._styleID = STYLE_DEFAULT;
|
nfoStyle._styleID = STYLE_DEFAULT;
|
||||||
nfoStyle._fontName = TEXT("MS LineDraw");
|
nfoStyle._fontName = TEXT("MS LineDraw");
|
||||||
|
|
||||||
if (pStyler)
|
if (pStyler)
|
||||||
{
|
{
|
||||||
int i = pStyler->getStylerIndexByName(TEXT("DEFAULT"));
|
int i = pStyler->getStylerIndexByName(TEXT("DEFAULT"));
|
||||||
@ -1026,9 +1026,9 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
nfoStyle._colorStyle = style._colorStyle;
|
nfoStyle._colorStyle = style._colorStyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setStyle(nfoStyle);
|
setStyle(nfoStyle);
|
||||||
execute(SCI_STYLECLEARALL);
|
execute(SCI_STYLECLEARALL);
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -1128,7 +1128,6 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//All the global styles should put here
|
//All the global styles should put here
|
||||||
static int indexOfIndentGuide = stylers.getStylerIndexByID(STYLE_INDENTGUIDE);
|
static int indexOfIndentGuide = stylers.getStylerIndexByID(STYLE_INDENTGUIDE);
|
||||||
if (indexOfIndentGuide != -1)
|
if (indexOfIndentGuide != -1)
|
||||||
@ -1136,7 +1135,6 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
static Style & styleIG = stylers.getStyler(indexOfIndentGuide);
|
static Style & styleIG = stylers.getStyler(indexOfIndentGuide);
|
||||||
setStyle(styleIG);
|
setStyle(styleIG);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int indexOfBraceLight = stylers.getStylerIndexByID(STYLE_BRACELIGHT);
|
static int indexOfBraceLight = stylers.getStylerIndexByID(STYLE_BRACELIGHT);
|
||||||
if (indexOfBraceLight != -1)
|
if (indexOfBraceLight != -1)
|
||||||
{
|
{
|
||||||
@ -1144,27 +1142,22 @@ void ScintillaEditView::defineDocType(LangType typeDoc)
|
|||||||
setStyle(styleBL);
|
setStyle(styleBL);
|
||||||
}
|
}
|
||||||
//setStyle(STYLE_CONTROLCHAR, liteGrey);
|
//setStyle(STYLE_CONTROLCHAR, liteGrey);
|
||||||
|
|
||||||
static int indexBadBrace = stylers.getStylerIndexByID(STYLE_BRACEBAD);
|
static int indexBadBrace = stylers.getStylerIndexByID(STYLE_BRACEBAD);
|
||||||
if (indexBadBrace != -1)
|
if (indexBadBrace != -1)
|
||||||
{
|
{
|
||||||
static Style & styleBB = stylers.getStyler(indexBadBrace);
|
static Style & styleBB = stylers.getStyler(indexBadBrace);
|
||||||
setStyle(styleBB);
|
setStyle(styleBB);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int indexLineNumber = stylers.getStylerIndexByID(STYLE_LINENUMBER);
|
static int indexLineNumber = stylers.getStylerIndexByID(STYLE_LINENUMBER);
|
||||||
if (indexLineNumber != -1)
|
if (indexLineNumber != -1)
|
||||||
{
|
{
|
||||||
static Style & styleLN = stylers.getStyler(indexLineNumber);
|
static Style & styleLN = stylers.getStyler(indexLineNumber);
|
||||||
setSpecialStyle(styleLN);
|
setSpecialStyle(styleLN);
|
||||||
}
|
}
|
||||||
|
|
||||||
execute(SCI_SETTABWIDTH, ((NppParameters::getInstance())->getNppGUI())._tabSize);
|
execute(SCI_SETTABWIDTH, ((NppParameters::getInstance())->getNppGUI())._tabSize);
|
||||||
execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace);
|
execute(SCI_SETUSETABS, !((NppParameters::getInstance())->getNppGUI())._tabReplacedBySpace);
|
||||||
|
|
||||||
int bitsNeeded = execute(SCI_GETSTYLEBITSNEEDED);
|
int bitsNeeded = execute(SCI_GETSTYLEBITSNEEDED);
|
||||||
//if (oldBits != bitsNeeded)
|
execute(SCI_SETSTYLEBITS, bitsNeeded);
|
||||||
execute(SCI_SETSTYLEBITS, bitsNeeded);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
BufferID ScintillaEditView::attachDefaultDoc()
|
BufferID ScintillaEditView::attachDefaultDoc()
|
||||||
|
@ -51,7 +51,6 @@ class NppParameters;
|
|||||||
|
|
||||||
typedef int (* SCINTILLA_FUNC) (void*, int, int, int);
|
typedef int (* SCINTILLA_FUNC) (void*, int, int, int);
|
||||||
typedef void * SCINTILLA_PTR;
|
typedef void * SCINTILLA_PTR;
|
||||||
//typedef std::vector<Buffer> buf_vec_t;
|
|
||||||
|
|
||||||
#define WM_DOCK_USERDEFINE_DLG (SCINTILLA_USER + 1)
|
#define WM_DOCK_USERDEFINE_DLG (SCINTILLA_USER + 1)
|
||||||
#define WM_UNDOCK_USERDEFINE_DLG (SCINTILLA_USER + 2)
|
#define WM_UNDOCK_USERDEFINE_DLG (SCINTILLA_USER + 2)
|
||||||
@ -63,8 +62,6 @@ typedef void * SCINTILLA_PTR;
|
|||||||
#define WM_DOOPEN (SCINTILLA_USER + 8)
|
#define WM_DOOPEN (SCINTILLA_USER + 8)
|
||||||
#define WM_FINDINFILES (SCINTILLA_USER + 9)
|
#define WM_FINDINFILES (SCINTILLA_USER + 9)
|
||||||
|
|
||||||
//const TCHAR * LINEDRAW_FONT = TEXT("LINEDRAW.TTF");
|
|
||||||
|
|
||||||
const int NB_FOLDER_STATE = 7;
|
const int NB_FOLDER_STATE = 7;
|
||||||
|
|
||||||
// Codepage
|
// Codepage
|
||||||
@ -167,12 +164,6 @@ public:
|
|||||||
|
|
||||||
void activateBuffer(BufferID buffer);
|
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 getText(char *dest, int start, int end) const;
|
||||||
void getGenericText(TCHAR *dest, int start, int end) const;
|
void getGenericText(TCHAR *dest, int start, int end) const;
|
||||||
void insertGenericTextFrom(int position, const TCHAR *text2insert) const;
|
void insertGenericTextFrom(int position, const TCHAR *text2insert) const;
|
||||||
@ -186,7 +177,6 @@ public:
|
|||||||
char * getSelectedText(char * txt, int size, bool expand = true);
|
char * getSelectedText(char * txt, int size, bool expand = true);
|
||||||
TCHAR * getGenericSelectedText(TCHAR * 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;
|
int searchInTarget(const TCHAR * Text2Find, int fromPos, int toPos) const;
|
||||||
//void appandText(const char * text2Append) const;
|
|
||||||
void appandGenericText(const TCHAR * text2Append) const;
|
void appandGenericText(const TCHAR * text2Append) const;
|
||||||
int replaceTarget(const TCHAR * str2replace, int fromTargetPos = -1, int toTargetPos = -1) 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;
|
int replaceTargetRegExMode(const TCHAR * re, int fromTargetPos = -1, int toTargetPos = -1) const;
|
||||||
@ -436,8 +426,6 @@ public:
|
|||||||
void foldCurrentPos(bool mode);
|
void foldCurrentPos(bool mode);
|
||||||
int getCodepage() const {return _codepage;};
|
int getCodepage() const {return _codepage;};
|
||||||
|
|
||||||
//int getMaxNbDigit const () {return _maxNbDigit;};
|
|
||||||
|
|
||||||
bool increaseMaxNbDigit(int newValue) {
|
bool increaseMaxNbDigit(int newValue) {
|
||||||
if (newValue > _maxNbDigit)
|
if (newValue > _maxNbDigit)
|
||||||
{
|
{
|
||||||
|
@ -500,6 +500,7 @@
|
|||||||
<LexerType name="props" desc="Properties file" ext="">
|
<LexerType name="props" desc="Properties file" ext="">
|
||||||
<WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
<WordsStyle name="DEFAULT" styleID="0" fgColor="000000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||||
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
<WordsStyle name="COMMENT" styleID="1" fgColor="008000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||||
|
<WordsStyle name="SECTION" styleID="2" fgColor="8000FF" bgColor="F2F4FF" fontName="" fontStyle="1" fontSize="" />
|
||||||
<WordsStyle name="ASSIGNMENT" styleID="3" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
|
<WordsStyle name="ASSIGNMENT" styleID="3" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="1" fontSize="" />
|
||||||
<WordsStyle name="DEFVAL" styleID="4" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
<WordsStyle name="DEFVAL" styleID="4" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
|
||||||
</LexerType>
|
</LexerType>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user