From 857a8a1ba1aa685f263ba30ff71d6e3e243ab66c Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 16 Jun 2016 17:26:38 +0200 Subject: [PATCH] Don't assert in wxRenderer::GetHeaderButtonMargin() Even if we don't have any way to determine the real margin, don't assert in this method implementation in wxGTK and wxOSX, but just return 0 instead. This fixes asserts when trying to fit a column of wxDataViewCtrl, by double clicking a separator after it, to its contents. See #13685. --- src/gtk/renderer.cpp | 3 +-- src/osx/carbon/renderer.cpp | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/src/gtk/renderer.cpp b/src/gtk/renderer.cpp index a80ebb065b..30f2e28e4d 100644 --- a/src/gtk/renderer.cpp +++ b/src/gtk/renderer.cpp @@ -269,8 +269,7 @@ int wxRendererGTK::GetHeaderButtonHeight(wxWindow *WXUNUSED(win)) int wxRendererGTK::GetHeaderButtonMargin(wxWindow *WXUNUSED(win)) { - wxFAIL_MSG( "GetHeaderButtonMargin() not implemented" ); - return -1; + return 0; // TODO: How to determine the real margin? } diff --git a/src/osx/carbon/renderer.cpp b/src/osx/carbon/renderer.cpp index 6d7d52a360..8cc34dbcef 100644 --- a/src/osx/carbon/renderer.cpp +++ b/src/osx/carbon/renderer.cpp @@ -251,8 +251,7 @@ int wxRendererMac::GetHeaderButtonHeight(wxWindow* WXUNUSED(win)) int wxRendererMac::GetHeaderButtonMargin(wxWindow *WXUNUSED(win)) { - wxFAIL_MSG( "GetHeaderButtonMargin() not implemented" ); - return -1; + return 0; // TODO: How to determine the real margin? } void wxRendererMac::DrawTreeItemButton( wxWindow *win,