Browse Source

[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
pull/343/head^2
donho 17 years ago
parent
commit
9128785e17
  1. 29
      PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp

29
PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp

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

Loading…
Cancel
Save