From 69d52387a1d8f96144f3c9a5527f86bb384786a72077858687cb1c927a2558f0 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Fri, 25 Jun 2021 15:13:23 +0000 Subject: [PATCH] Accepting request 902378 from home:1Antoine1:branches:X11:wxWidgets - Add wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch (boo#1187712). OBS-URL: https://build.opensuse.org/request/show/902378 OBS-URL: https://build.opensuse.org/package/show/X11:wxWidgets/wxWidgets-3_2?expand=0&rev=86 --- ...dgets-3.1.5-fix-wxIcon-wxDVC-columns.patch | 38 +++++++++++++++++++ wxWidgets-3_2.changes | 5 +++ wxWidgets-3_2.spec | 1 + 3 files changed, 44 insertions(+) create mode 100644 wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch diff --git a/wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch b/wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch new file mode 100644 index 0000000..2a6502e --- /dev/null +++ b/wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch @@ -0,0 +1,38 @@ +From c817a434d8d0d13a10f936af1eef0d8ffecb8069 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= +Date: Mon, 7 Jun 2021 16:15:53 +0200 +Subject: [PATCH] Fix wxIcon wxDVC columns under wxGTK + +b376d1402bdc48614888704cf191f82a630d93c0 accidentally broke columns +with wxIcon type. Contrary to that commit's assumption, operator<< +cannot convert wxIcon to wxBitmap and asserts: + +src/common/bmpbase.cpp(33): assert "variant.GetType() == "wxBitmap"" failed in operator<<(). + +Fixed by restoring explicit conversion. +--- + src/gtk/dataview.cpp | 10 +++++++++- + 1 file changed, 9 insertions(+), 1 deletion(-) + +diff --git a/src/gtk/dataview.cpp b/src/gtk/dataview.cpp +index 8ffa7b7b3b5..767334e0043 100644 +--- a/src/gtk/dataview.cpp ++++ b/src/gtk/dataview.cpp +@@ -2562,8 +2562,16 @@ wxDataViewBitmapRenderer::wxDataViewBitmapRenderer( const wxString &varianttype, + bool wxDataViewBitmapRenderer::SetValue( const wxVariant &value ) + { + wxBitmap bitmap; +- if (value.GetType() == wxS("wxBitmap") || value.GetType() == wxS("wxIcon")) ++ if (value.GetType() == wxS("wxBitmap")) ++ { + bitmap << value; ++ } ++ else if (value.GetType() == wxS("wxIcon")) ++ { ++ wxIcon icon; ++ icon << value; ++ bitmap.CopyFromIcon(icon); ++ } + + #ifdef __WXGTK3__ + WX_CELL_RENDERER_PIXBUF(m_renderer)->Set(bitmap); diff --git a/wxWidgets-3_2.changes b/wxWidgets-3_2.changes index b87f732..7861665 100644 --- a/wxWidgets-3_2.changes +++ b/wxWidgets-3_2.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Fri Jun 25 10:41:40 UTC 2021 - Antoine Belvire + +- Add wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch (boo#1187712). + ------------------------------------------------------------------- Sun Jun 6 11:09:48 UTC 2021 - Antoine Belvire diff --git a/wxWidgets-3_2.spec b/wxWidgets-3_2.spec index 4c35776..9aebfe6 100644 --- a/wxWidgets-3_2.spec +++ b/wxWidgets-3_2.spec @@ -82,6 +82,7 @@ Source5: wxWidgets-3_2-rpmlintrc # identify and backport wxPython fixes to wxWidgets. Source6: wxpython-mkdiff.sh Patch1: soversion.diff +Patch2: wxWidgets-3.1.5-fix-wxIcon-wxDVC-columns.patch BuildRequires: autoconf BuildRequires: cppunit-devel BuildRequires: gcc-c++