[BUG_FIXED] Fix the bold/italic/underline refresh problem in Stylers Configurator for Scintilla component.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@18 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
donho 2007-08-29 17:48:03 +00:00
parent f72f29ac58
commit 9128785e17

View File

@ -165,14 +165,11 @@ void ScintillaEditView::setSpecialStyle(int styleID, COLORREF fgColour, COLORREF
if ((!fontName)||(strcmp(fontName, ""))) if ((!fontName)||(strcmp(fontName, "")))
execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)fontName); execute(SCI_STYLESETFONT, (WPARAM)styleID, (LPARAM)fontName);
if ((fontStyle != -1) && (fontStyle != 0)) if (fontStyle != -1)
{ {
if (fontStyle & FONTSTYLE_BOLD) execute(SCI_STYLESETBOLD, (WPARAM)styleID, fontStyle & FONTSTYLE_BOLD);
execute(SCI_STYLESETBOLD, (WPARAM)styleID, (LPARAM)true); execute(SCI_STYLESETITALIC, (WPARAM)styleID, fontStyle & FONTSTYLE_ITALIC);
if (fontStyle & FONTSTYLE_ITALIC) execute(SCI_STYLESETUNDERLINE, (WPARAM)styleID, fontStyle & FONTSTYLE_UNDERLINE);
execute(SCI_STYLESETITALIC, (WPARAM)styleID, (LPARAM)true);
if (fontStyle & FONTSTYLE_UNDERLINE)
execute(SCI_STYLESETUNDERLINE, (WPARAM)styleID, (LPARAM)true);
} }
if (fontSize > 0) if (fontSize > 0)
@ -205,30 +202,25 @@ void ScintillaEditView::setStyle(int styleID, COLORREF fgColour, COLORREF bgColo
if (style._fontStyle != -1) if (style._fontStyle != -1)
{ {
if (go.enableBold && (style._fontStyle & FONTSTYLE_BOLD)) if (go.enableBold)
{ {
if (style._fontStyle & FONTSTYLE_BOLD)
fontStyle |= FONTSTYLE_BOLD; fontStyle |= FONTSTYLE_BOLD;
}
else else
{
fontStyle &= ~FONTSTYLE_BOLD; fontStyle &= ~FONTSTYLE_BOLD;
} }
if (go.enableItalic)
if (go.enableItalic && (style._fontStyle & FONTSTYLE_ITALIC))
{ {
if (style._fontStyle & FONTSTYLE_ITALIC)
fontStyle |= FONTSTYLE_ITALIC; fontStyle |= FONTSTYLE_ITALIC;
}
else else
{
fontStyle &= ~FONTSTYLE_ITALIC; fontStyle &= ~FONTSTYLE_ITALIC;
} }
if (go.enableUnderLine)
if (go.enableUnderLine && (style._fontStyle & FONTSTYLE_UNDERLINE))
{ {
if (style._fontStyle & FONTSTYLE_UNDERLINE)
fontStyle |= FONTSTYLE_UNDERLINE; fontStyle |= FONTSTYLE_UNDERLINE;
}
else else
{
fontStyle &= ~FONTSTYLE_UNDERLINE; fontStyle &= ~FONTSTYLE_UNDERLINE;
} }
} }
@ -265,7 +257,6 @@ void ScintillaEditView::setXmlLexer(LangType type)
setPhpEmbeddedLexer(); setPhpEmbeddedLexer();
setEmbeddedAspLexer(); setEmbeddedAspLexer();
} }
} }
void ScintillaEditView::setEmbeddedJSLexer() void ScintillaEditView::setEmbeddedJSLexer()