Forum
Please
Log In
to post a new message or reply to an existing one. If you are not registered, please
register.
NOTE: Some forums may be read-only if you are not currently subscribed to
our technical support services.
Subject |
Author |
Date |
|
Krustys Donuts
|
Nov 16, 2008 - 6:09 PM
|
Despite its title, CExtGridCellComboBox::FindStringExact is case insensitive. Can you change this so that it’s case sensitive, or at least add an optional argument to enable case sensitivity? Thanks.
|
|
Technical Support
|
Nov 17, 2008 - 7:09 AM
|
Thank you for reporting this issue. We changed the CExtGridCellComboBox::FindStringExact() method. Here is the method declaration: LONG FindStringExact(
__EXT_MFC_SAFE_LPCTSTR lpszString,
LONG nIndexStart = -1,
bool bCaseSensitive = false
) const;
Here is the method implementation: LONG CExtGridCellComboBox::FindStringExact(
__EXT_MFC_SAFE_LPCTSTR lpszString,
LONG nIndexStart, // = -1
bool bCaseSensitive // = false
) const
{
ASSERT_VALID( this );
if( !_IsItemIndexValid( nIndexStart )
&& nIndexStart != -1
)
{
ASSERT( FALSE );
return CB_ERR;
}
LONG nItemsProcessed = 0;
LONG nItem = nIndexStart;
LONG nSize = LONG(m_arrItems.GetSize());
while( nItemsProcessed < nSize )
{
if( nItem == -1 )
nItem = 0;
else if( nItem < nSize - 1 )
nItem++;
else
nItem = 0;
ITEM_INFO * pItemInfo = m_arrItems[ nItem ];
ASSERT( pItemInfo != NULL );
if( bCaseSensitive )
{
if( pItemInfo->m_sString == LPCTSTR( lpszString ) )
return nItem;
}
else
{
if( pItemInfo->m_sString.CompareNoCase( lpszString ) == 0 )
return nItem;
}
nItemsProcessed++;
}
return CB_ERR;
}
|
|