NS_IMETHODIMP
nsAutoCompleteController::HandleEndComposition()
{
  NS_ENSURE_TRUE(mIsIMEComposing, NS_OK);

  mIsIMEComposing = false;
  bool forceOpenPopup = mPopupClosedByCompositionStart;
  mPopupClosedByCompositionStart = false;

  if (!mInput)
    return NS_OK;

  nsAutoString value;
  mInput->GetTextValue(value);
  SetSearchString(EmptyString());
  if (!value.IsEmpty()) {
    // Show the popup with a filtered result set
    HandleText();
  } else if (forceOpenPopup) {
    bool cancel;
    HandleKeyNavigation(nsIDOMKeyEvent::DOM_VK_DOWN, &cancel);
  }
  // On here, |value| and |mSearchString| are same. Therefore, next HandleText should be
  // ignored. Because there are no reason to research.
  mIgnoreHandleText = true;

  return NS_OK;
}
Example #2
0
// Constructor. Set's search string and case mode.
BoyerMoore::BoyerMoore( LPCSTR pszSearchString, BOOL bCaseOn /* = FALSE  */ )
{
	_ASSERT_VALID( pszSearchString );

	// Setup data.
	m_strSearchString = pszSearchString;
	m_bCaseOn = bCaseOn;
	SetSearchString();
}
Example #3
0
const BoyerMoore& BoyerMoore::operator=( LPCSTR pszSearchString )
{
	_ASSERT_VALID( pszSearchString );

	// Setup data.
	m_strSearchString = pszSearchString;
	SetSearchString();
	return *this;
}
Example #4
0
void BoyerMoore::SetIncludeHidden( BOOL bIncludeHidden ) 
{ 
	m_bIncludeHidden = bIncludeHidden; 
	SetSearchString(); 
}
Example #5
0
void BoyerMoore::SetMatchWholeWord( BOOL bMatchWholeWord ) 
{ 
	m_bMatchWholeWord = bMatchWholeWord; 
	SetSearchString(); 
}
Example #6
0
void BoyerMoore::SetCaseMode( BOOL bCase ) 
{ 
	m_bCaseOn = bCase; 
	SetSearchString(); 
}
Example #7
0
void BoyerMoore::SetSearchString( LPCSTR pszSearchString )
{ 
	_ASSERT_VALID( pszSearchString ); 
	m_strSearchString = pszSearchString; 
	SetSearchString();
}