From 4e425d1d8d036cf4354b918e43bfd188e82da0cc Mon Sep 17 00:00:00 2001 From: Jinhao Date: Tue, 22 Aug 2017 07:48:37 +0800 Subject: [PATCH] fix crash where menubar hotkey isn't an ASCII character --- source/gui/widgets/menubar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/gui/widgets/menubar.cpp b/source/gui/widgets/menubar.cpp index 8ad5e35b..0fc114b9 100644 --- a/source/gui/widgets/menubar.cpp +++ b/source/gui/widgets/menubar.cpp @@ -215,7 +215,7 @@ namespace nana if (hotkey) { unsigned off_w = (hotkey_pos ? graph.text_extent_size(text.c_str(), hotkey_pos).width : 0); - auto hotkey_size = graph.text_extent_size(text.c_str() + hotkey_pos, 1); + auto hotkey_size = graph.text_extent_size(nana::to_wstring(text.c_str() + hotkey_pos), 1); unsigned ascent, descent, inleading; graph.text_metrics(ascent, descent, inleading);