[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:
donho 2009-01-01 20:22:03 +00:00
parent 261d357e66
commit f7a1301d04
6 changed files with 9 additions and 29 deletions

View File

@ -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);

View File

@ -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);

View File

@ -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,

View File

@ -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,26 +1142,21 @@ 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);
}

View File

@ -51,7 +51,6 @@ class NppParameters;
typedef int (* SCINTILLA_FUNC) (void*, int, int, int);
typedef void * SCINTILLA_PTR;
//typedef std::vector<Buffer> 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)
{

View File

@ -500,6 +500,7 @@
<LexerType name="props" desc="Properties file" ext="">
<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="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="DEFVAL" styleID="4" fgColor="FF0000" bgColor="FFFFFF" fontName="" fontStyle="0" fontSize="" />
</LexerType>