From 2e0a32b51681fb356699b4a722f461f55a46b890 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 7 Apr 2020 12:21:47 +0100 Subject: weld FontNameBox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit with custom row rendering Change-Id: Ia909b5b9ad56b6ea4611e9ea0a1e2cb0064a8cd4 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91841 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sd/source/ui/animations/CustomAnimationList.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sd') diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 68ecf1362ce9..3b4c3b3afaa6 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -230,6 +230,7 @@ private: OUString msEffectName; CustomAnimationEffectPtr mpEffect; +public: static const long nIconWidth = 19; static const long nItemMinHeight = 38; }; @@ -275,6 +276,8 @@ IMPL_STATIC_LINK(CustomAnimationList, CustomGetSizeHdl, weld::TreeView::get_size const OUString& rId = aPayload.second; CustomAnimationListEntryItem* pItem = reinterpret_cast(rId.toInt64()); + if (!pItem) + return Size(CustomAnimationListEntryItem::nIconWidth, CustomAnimationListEntryItem::nItemMinHeight); return pItem->GetSize(rRenderContext); } @@ -426,7 +429,6 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr xTreeVi mxEmptyLabel->set_stack_background(); mxTreeView->set_selection_mode(SelectionMode::Multiple); - mxTreeView->set_column_custom_renderer(0); mxTreeView->connect_changed(LINK(this, CustomAnimationList, SelectHdl)); mxTreeView->connect_key_press(LINK(this, CustomAnimationList, KeyInputHdl)); mxTreeView->connect_popup_menu(LINK(this, CustomAnimationList, CommandHdl)); @@ -436,6 +438,7 @@ CustomAnimationList::CustomAnimationList(std::unique_ptr xTreeVi mxTreeView->connect_drag_begin(LINK(this, CustomAnimationList, DragBeginHdl)); mxTreeView->connect_custom_get_size(LINK(this, CustomAnimationList, CustomGetSizeHdl)); mxTreeView->connect_custom_render(LINK(this, CustomAnimationList, CustomRenderHdl)); + mxTreeView->set_column_custom_renderer(0); } CustomAnimationListDropTarget::CustomAnimationListDropTarget(CustomAnimationList& rTreeView) -- cgit