Minor cleanup after the previous commit

Make m_origWinFlags const; keep just a single call to
SetWindowStyleFlag() and some space harmonization.

No real changes.
This commit is contained in:
Vadim Zeitlin
2018-02-16 13:27:13 +01:00
parent 986f61f33e
commit 5b2bb1ab81

View File

@@ -228,10 +228,11 @@ public:
// see wxTextCtrl::OnChar() // see wxTextCtrl::OnChar()
void ToggleProcessEnterFlag(bool toggleOff) void ToggleProcessEnterFlag(bool toggleOff)
{ {
long flags = m_origWinFlags;
if ( toggleOff ) if ( toggleOff )
GetEditableWindow(m_entry)->SetWindowStyleFlag(m_origWinFlags & ~wxTE_PROCESS_ENTER); flags &= ~wxTE_PROCESS_ENTER;
else
GetEditableWindow(m_entry)->SetWindowStyleFlag(m_origWinFlags); GetEditableWindow(m_entry)->SetWindowStyleFlag(flags);
} }
void DisableCompletion() void DisableCompletion()
@@ -258,11 +259,9 @@ protected:
} }
explicit wxTextAutoCompleteData(wxTextEntry* entry) explicit wxTextAutoCompleteData(wxTextEntry* entry)
: m_entry(entry) : m_entry(entry),
m_origWinFlags(GetEditableWindow(m_entry)->GetWindowStyleFlag())
{ {
// Save original flags
m_origWinFlags = GetEditableWindow(m_entry)->GetWindowStyleFlag();
GtkEntryCompletion* const completion = gtk_entry_completion_new(); GtkEntryCompletion* const completion = gtk_entry_completion_new();
gtk_entry_completion_set_text_column (completion, 0); gtk_entry_completion_set_text_column (completion, 0);
@@ -304,7 +303,7 @@ protected:
wxTextEntry * const m_entry; wxTextEntry * const m_entry;
// The original flags of the associated wxTextEntry. // The original flags of the associated wxTextEntry.
long m_origWinFlags; const long m_origWinFlags;
wxDECLARE_NO_COPY_CLASS(wxTextAutoCompleteData); wxDECLARE_NO_COPY_CLASS(wxTextAutoCompleteData);
}; };