Deprecate unused wxTextDataObject::GetTextLength()

This function was supposed to be overridden in the subclasses to allow
efficiently implementing GetDataSize(), but it wasn't actually called
any longer since 229f00eb69 (Translate wxTextDataObject to/from native
EOL format., 2012-07-29).

And while it was probably a mistake to stop calling it in that commit,
the fact that nobody has complained about it since then seems to prove
that nobody was overriding it anyhow and it's not worth resurrecting it,
so just deprecate it instead.
This commit is contained in:
Vadim Zeitlin 2022-12-04 20:34:47 +00:00
parent 0f54ec8b36
commit 9440b473c0
2 changed files with 9 additions and 8 deletions

View file

@ -373,7 +373,6 @@ public:
// virtual functions which you may override if you want to provide text on
// demand only - otherwise, the trivial default versions will be used
virtual size_t GetTextLength() const { return m_text.Len() + 1; }
virtual wxString GetText() const { return m_text; }
virtual void SetText(const wxString& text) { m_text = text; }
@ -412,6 +411,9 @@ public:
}
#endif // different wxTextDataObject implementations
wxDEPRECATED_MSG("Don't call nor override this function")
size_t GetTextLength() const { return m_text.Len() + 1; }
private:
#if defined(__WXQT__)
// Overridden to set text directly instead of extracting byte array