summaryrefslogtreecommitdiffstats
path: root/toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2018-04-17 07:31:18 -0400
committerMatt A. Tobin <email@mattatobin.com>2018-04-17 07:31:18 -0400
commit0bdaa97892ead4977d69382a2bfe8f00a7dbac82 (patch)
tree91a1539a0d5602bab94ca6d2357f63e2ae2839fb /toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
parente719d7b3be222dfafad78c71761bad2bafb1243d (diff)
downloadUXP-0bdaa97892ead4977d69382a2bfe8f00a7dbac82.tar
UXP-0bdaa97892ead4977d69382a2bfe8f00a7dbac82.tar.gz
UXP-0bdaa97892ead4977d69382a2bfe8f00a7dbac82.tar.lz
UXP-0bdaa97892ead4977d69382a2bfe8f00a7dbac82.tar.xz
UXP-0bdaa97892ead4977d69382a2bfe8f00a7dbac82.zip
Restore typeAheadResult support in autocomplete
Diffstat (limited to 'toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp')
-rw-r--r--toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp b/toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
index 9fd2c0022..683ac462a 100644
--- a/toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
+++ b/toolkit/components/autocomplete/nsAutoCompleteSimpleResult.cpp
@@ -43,7 +43,8 @@ struct AutoCompleteSimpleResultMatch
nsAutoCompleteSimpleResult::nsAutoCompleteSimpleResult() :
mDefaultIndex(-1),
- mSearchResult(RESULT_NOMATCH)
+ mSearchResult(RESULT_NOMATCH),
+ mTypeAheadResult(false)
{
}
@@ -66,6 +67,12 @@ nsAutoCompleteSimpleResult::AppendResult(nsIAutoCompleteResult* aResult)
mErrorDescription = errorDescription;
}
+ bool typeAheadResult = false;
+ if (NS_SUCCEEDED(aResult->GetTypeAheadResult(&typeAheadResult)) &&
+ typeAheadResult) {
+ mTypeAheadResult = typeAheadResult;
+ }
+
int32_t defaultIndex = -1;
if (NS_SUCCEEDED(aResult->GetDefaultIndex(&defaultIndex)) &&
defaultIndex >= 0) {
@@ -166,6 +173,20 @@ nsAutoCompleteSimpleResult::SetErrorDescription(
return NS_OK;
}
+// typeAheadResult
+NS_IMETHODIMP
+nsAutoCompleteSimpleResult::GetTypeAheadResult(bool *aTypeAheadResult)
+{
+ *aTypeAheadResult = mTypeAheadResult;
+ return NS_OK;
+}
+NS_IMETHODIMP
+nsAutoCompleteSimpleResult::SetTypeAheadResult(bool aTypeAheadResult)
+{
+ mTypeAheadResult = aTypeAheadResult;
+ return NS_OK;
+}
+
NS_IMETHODIMP
nsAutoCompleteSimpleResult::InsertMatchAt(int32_t aIndex,
const nsAString& aValue,