Skip to content

Commit

Permalink
性能优化
Browse files Browse the repository at this point in the history
  • Loading branch information
GXKe committed Dec 29, 2016
1 parent 211eb3c commit 9097377
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions DuiLib/Core/UIDlgBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,16 +214,20 @@ CControlUI* CDialogBuilder::_Parse(CMarkupNode* pRoot, CControlUI* pParent, CPai
count = _tcstol(szValue, &pstr, 10);
cchLen = lengthof(szValue) - 1;
if ( !node.GetAttributeValue(_T("source"), szValue, cchLen) ) continue;
for ( int i = 0; i < count; i++ ) {
CDialogBuilder builder;
if( m_pstrtype != NULL ) { // 使用资源dll,从资源中读取
WORD id = (WORD)_tcstol(szValue, &pstr, 10);
pControl = builder.Create((UINT)id, m_pstrtype, m_pCallback, pManager, pParent);
}
else {
pControl = builder.Create((LPCTSTR)szValue, (UINT)0, m_pCallback, pManager, pParent);
}
}
CDialogBuilder builder;
for ( int i = 0; i < count; i++ ) {
if (!builder.GetMarkup()->IsValid())
{
if( m_pstrtype != NULL ) { // 使用资源dll,从资源中读取
WORD id = (WORD)_tcstol(szValue, &pstr, 10);
pControl = builder.Create((UINT)id, m_pstrtype, m_pCallback, pManager, pParent);
}
else
pControl = builder.Create((LPCTSTR)szValue, (UINT)0, m_pCallback, pManager, pParent);
}
else
pControl = builder.Create(m_pCallback, pManager, pParent);
}
continue;
}
//树控件XML解析
Expand Down

0 comments on commit 9097377

Please sign in to comment.