Refactor wxTextEntry to use MSWEnsureHasAutoCompleteData()

The new function has more clear semantics than GetOrCreateCompleter()
which both returned the completer value and set m_autoCompleteData to it
as a side effect. MSWEnsureHasAutoCompleteData() still does the latter,
but returns just a boolean indicating whether it succeeded or failed,
making using it more straightforward.

No real changes.
This commit is contained in:
Vadim Zeitlin
2021-04-07 22:20:05 +01:00
parent 5f33a52f49
commit a6e4cc7eb0
2 changed files with 15 additions and 14 deletions

View File

@@ -100,9 +100,9 @@ private:
// be called and the default implementation asserts if this is not the case.
virtual void MSWProcessSpecialKey(wxKeyEvent& event);
// Get the auto-complete object creating it if necessary. Returns NULL if
// creating it failed.
wxTextAutoCompleteData *GetOrCreateCompleter();
// Check that we have auto-complete data, creating it if necessary. Returns
// false if creating it failed.
bool MSWEnsureHasAutoCompleteData();
// Various auto-completion-related stuff, only used if any of AutoComplete()
// methods are called. Use the function above to access it.