[BUG_FIXED] Fix a regression bug about Configurator GUI: font setting controls are disabled.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@978 f5eea248-9336-0410-98b8-ebc06183d4e3
This commit is contained in:
Don Ho 2012-11-04 14:13:44 +00:00
parent 71b72dbdf0
commit 29ff3561ca
4 changed files with 22 additions and 11 deletions

View File

@ -5304,7 +5304,11 @@ void NppParameters::writeStyle2Element(Style & style2Write, Style & style2Sync,
element->SetAttribute(TEXT("fontSize"), style2Write._fontSize);
}
element->SetAttribute(TEXT("fontStyle"), style2Write._fontStyle);
if (style2Write._fontStyle != -1)
{
element->SetAttribute(TEXT("fontStyle"), style2Write._fontStyle);
}
if (style2Write._keywords)
{
@ -5388,7 +5392,14 @@ void NppParameters::insertUserLang2Tree(TiXmlNode *node, UserLangContainer *user
styleElement->SetAttribute(TEXT("fontName"), style2Write._fontName);
}
styleElement->SetAttribute(TEXT("fontStyle"), style2Write._fontStyle);
if (style2Write._fontStyle == -1)
{
styleElement->SetAttribute(TEXT("fontStyle"), TEXT("0"));
}
else
{
styleElement->SetAttribute(TEXT("fontStyle"), style2Write._fontStyle);
}
if (style2Write._fontSize != -1)
{

View File

@ -277,7 +277,7 @@ struct Style
int _keywordClass;
generic_string *_keywords;
Style():_styleID(-1), _styleDesc(NULL), _fgColor(COLORREF(-1)), _bgColor(COLORREF(-1)), _colorStyle(COLORSTYLE_ALL), _fontName(NULL), _fontStyle(FONTSTYLE_NONE), _fontSize(-1), _keywordClass(-1), _keywords(NULL), _nesting(0){};
Style():_styleID(-1), _styleDesc(NULL), _fgColor(COLORREF(-1)), _bgColor(COLORREF(-1)), _colorStyle(COLORSTYLE_ALL), _fontName(NULL), _fontStyle(-1), _fontSize(-1), _keywordClass(-1), _keywords(NULL){};
~Style(){
if (_keywords)

View File

@ -489,8 +489,8 @@ void ScintillaEditView::setStyle(Style styleToSet)
if (go.enableFontSize && (style._fontSize > 0))
styleToSet._fontSize = style._fontSize;
//if (style._fontStyle != -1)
//{
if (style._fontStyle != -1)
{
if (go.enableBold)
{
if (style._fontStyle & FONTSTYLE_BOLD)
@ -512,7 +512,7 @@ void ScintillaEditView::setStyle(Style styleToSet)
else
styleToSet._fontStyle &= ~FONTSTYLE_UNDERLINE;
}
//}
}
}
}
setSpecialStyle(styleToSet);

View File

@ -592,8 +592,8 @@ void WordStyleDlg::updateFontName()
void WordStyleDlg::updateFontStyleStatus(fontStyleType whitchStyle)
{
Style & style = getCurrentStyler();
//if (style._fontStyle == -1)
// style._fontStyle = 0;
if (style._fontStyle == -1)
style._fontStyle = 0;
int fontStyle = FONTSTYLE_UNDERLINE;
HWND hWnd = _hCheckUnderline;
@ -783,10 +783,10 @@ void WordStyleDlg::setVisualFromStyleList()
::SendMessage(_hFontSizeCombo, CB_SETCURSEL, iFontSize, 0);
enableFontSize(isEnable);
//-- font style : bold et italic
//-- font style : bold & italic
isEnable = false;
int isBold, isItalic, isUnderline;
if (style._fontStyle != FONTSTYLE_NONE)
if (style._fontStyle != -1)
{
isBold = (style._fontStyle & FONTSTYLE_BOLD)?BST_CHECKED:BST_UNCHECKED;
isItalic = (style._fontStyle & FONTSTYLE_ITALIC)?BST_CHECKED:BST_UNCHECKED;
@ -796,7 +796,7 @@ void WordStyleDlg::setVisualFromStyleList()
::SendMessage(_hCheckUnderline, BM_SETCHECK, isUnderline, 0);
isEnable = true;
}
else // -1 est comme 0
else // -1 : reset them all
{
::SendMessage(_hCheckBold, BM_SETCHECK, BST_UNCHECKED, 0);
::SendMessage(_hCheckItalic, BM_SETCHECK, BST_UNCHECKED, 0);