Skip to content

wxDataObject::IsSupportedFormat optimization#24981

Open
hwiesmann wants to merge 1 commit intowxWidgets:masterfrom
hwiesmann:wxDataObjectIsSupportedFormat-simplification
Open

wxDataObject::IsSupportedFormat optimization#24981
hwiesmann wants to merge 1 commit intowxWidgets:masterfrom
hwiesmann:wxDataObjectIsSupportedFormat-simplification

Conversation

@hwiesmann
Copy link
Contributor

In general, wxDataObject::IsSupportedFormat is not documented, though wxDataObjectBase::IsSupported is.

On macOS, qt and X11 wxDataObject::IsSupportedFormat's implementation is identical to wxDataObjectBase::IsSupported. Therefore, on these platforms wxDataObject::IsSupportedFormat is now calling wxDataObjectBase::IsSupported.
On MSW wxDataObject::IsSupportedFormat is not defined as on all the other platforms (missing direction parameter). But the current implementation already calls wxDataObjectBase::IsSupported.
On GTK wxDataObject::IsSupportedFormat is slightly differently implemented and its implementation is therefore kept.

@vadz
Copy link
Contributor

vadz commented Nov 28, 2024

I think wxGTK implementation is actually the same too because wxDataFormat::operator==() calls the same wxGTKIsSameFormat() as is called there, so I'd really just define IsSupportedFormat() as a trivial inline wrapper in wxDataObjectBase itself and remove all the other definitions completely. What do you think?

@hwiesmann
Copy link
Contributor Author

hwiesmann commented Nov 28, 2024 via email

@vadz
Copy link
Contributor

vadz commented Dec 5, 2024

Hi, Actually, I did not have a look at wxDataFormat::operator==(). If it calls wxGTKIsSameFormat(), then wxDataObjectBase::IsSupported can be used for GTK, too.

Just to check: do you plan to update this PR to do it?

@vadz vadz added the work needed Too useful to close, but can't be applied in current state label Dec 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

work needed Too useful to close, but can't be applied in current state

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants