Code cleanup

This commit is contained in:
spx 2013-01-24 05:24:25 +09:00
parent 84b1e3a7cd
commit 39459ad64b

View File

@ -361,10 +361,14 @@ void CMeterString::ReadOptions(CConfigParser& parser, const WCHAR* section)
else if (_wcsicmp(clipping, L"AUTO") == 0) else if (_wcsicmp(clipping, L"AUTO") == 0)
{ {
m_ClipType = CLIP_AUTO; m_ClipType = CLIP_AUTO;
}
m_ClipStringW = parser.ReadInt(section, L"ClipStringW", -1); m_ClipStringW = parser.ReadInt(section, L"ClipStringW", -1);
m_ClipStringH = parser.ReadInt(section, L"ClipStringH", -1); m_ClipStringH = parser.ReadInt(section, L"ClipStringH", -1);
}
else
{
LogWithArgs(LOG_ERROR, L"ClipString=%s is not valid in [%s]", clipping, m_Name.c_str());
}
m_FontFace = parser.ReadString(section, L"FontFace", L"Arial"); m_FontFace = parser.ReadString(section, L"FontFace", L"Arial");
if (m_FontFace.empty()) if (m_FontFace.empty())
@ -674,7 +678,7 @@ bool CMeterString::DrawString(Graphics& graphics, RectF* rect)
else else
{ {
// Special case // Special case
if (m_WDefined && m_HDefined && m_ClipType == CLIP_AUTO) if (m_ClipType == CLIP_AUTO && m_WDefined && m_HDefined)
{ {
stringFormat.SetTrimming(StringTrimmingEllipsisCharacter); stringFormat.SetTrimming(StringTrimmingEllipsisCharacter);
stringFormat.SetFormatFlags(StringFormatFlagsNoClip); stringFormat.SetFormatFlags(StringFormatFlagsNoClip);
@ -786,7 +790,6 @@ bool CMeterString::DrawString(Graphics& graphics, RectF* rect)
} }
} }
} }
} }
} }
else else