From ca64f2f7e7e66b7b025104e1d3e025ce0061f98b Mon Sep 17 00:00:00 2001 From: Hans Goudey Date: Wed, 29 Jan 2025 12:49:31 -0500 Subject: [PATCH] Cleanup: Use StringRef instead of StringRefNull --- source/blender/editors/include/UI_interface_c.hh | 7 ++----- source/blender/editors/interface/interface_layout.cc | 11 ++++------- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/source/blender/editors/include/UI_interface_c.hh b/source/blender/editors/include/UI_interface_c.hh index 64f6165f81f..f2c0cfcc8e5 100644 --- a/source/blender/editors/include/UI_interface_c.hh +++ b/source/blender/editors/include/UI_interface_c.hh @@ -3152,13 +3152,10 @@ void uiItemLDrag(uiLayout *layout, PointerRNA *ptr, blender::StringRef name, int /** * Menu. */ -void uiItemM_ptr(uiLayout *layout, - MenuType *mt, - std::optional name, - int icon); +void uiItemM_ptr(uiLayout *layout, MenuType *mt, std::optional name, int icon); void uiItemM(uiLayout *layout, blender::StringRefNull menuname, - std::optional name, + std::optional name, int icon); /** * Menu contents. diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index ffd69ab89f3..cd1125ffab8 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -2968,7 +2968,7 @@ void ui_item_paneltype_func(bContext *C, uiLayout *layout, void *arg_pt) } static uiBut *ui_item_menu(uiLayout *layout, - const StringRefNull name, + const StringRef name, int icon, uiMenuCreateFunc func, void *arg, @@ -3043,10 +3043,7 @@ static uiBut *ui_item_menu(uiLayout *layout, return but; } -void uiItemM_ptr(uiLayout *layout, - MenuType *mt, - const std::optional name_opt, - int icon) +void uiItemM_ptr(uiLayout *layout, MenuType *mt, const std::optional name_opt, int icon) { uiBlock *block = layout->root->block; bContext *C = static_cast(block->evil_C); @@ -3054,7 +3051,7 @@ void uiItemM_ptr(uiLayout *layout, return; } - const StringRefNull name = name_opt.value_or(CTX_IFACE_(mt->translation_context, mt->label)); + const StringRef name = name_opt.value_or(CTX_IFACE_(mt->translation_context, mt->label)); if (layout->root->type == UI_LAYOUT_MENU && !icon) { icon = ICON_BLANK1; @@ -3072,7 +3069,7 @@ void uiItemM_ptr(uiLayout *layout, void uiItemM(uiLayout *layout, const StringRefNull menuname, - const std::optional name, + const std::optional name, int icon) { MenuType *mt = WM_menutype_find(menuname.c_str(), false); -- 2.11.4.GIT