diff --git a/source/gui/widgets/categorize.cpp b/source/gui/widgets/categorize.cpp index 7307d7ab..3c10b41f 100644 --- a/source/gui/widgets/categorize.cpp +++ b/source/gui/widgets/categorize.cpp @@ -579,17 +579,17 @@ namespace nana if ((style_.module.index != npos) && style_.module.have_selected) { + node_handle node = nullptr; if (ui_element::item_arrow == style_.list_trigger) { treebase_.tail(style_.active); - node_handle node = treebase_.find_child(style_.module.items[style_.module.index]->text()); + node = treebase_.find_child(style_.module.items[style_.module.index]->text()); if (!node) { style_.listbox = nullptr; return; } treebase_.cur(node); - _m_selected(node); } else if (ui_element::item_root != style_.list_trigger) { @@ -597,7 +597,9 @@ namespace nana return; } else - _m_selected(treebase_.tail(style_.module.index)); + node = treebase_.tail(style_.module.index); + + _m_selected(node); } API::refresh_window(window_); diff --git a/source/paint/detail/image_jpeg.hpp b/source/paint/detail/image_jpeg.hpp index 32e25935..9d8e0b2e 100644 --- a/source/paint/detail/image_jpeg.hpp +++ b/source/paint/detail/image_jpeg.hpp @@ -26,13 +26,9 @@ namespace nana std::jmp_buf setjmp_buf; }; public: - bool open(const nana::char_t* jpeg_file) override + bool open(const experimental::filesystem::path& jpeg_file) override { -#ifdef NANA_UNICODE - FILE * fp = ::fopen(static_cast(nana::charset(jpeg_file)).c_str(), "rb"); -#else - FILE* fp = ::fopen(jpeg_file, "rb"); -#endif + auto fp = ::fopen(to_osmbstr(to_utf8(jpeg_file.native())).c_str(), "rb"); if(nullptr == fp) return false; bool is_opened = false; diff --git a/source/paint/detail/image_png.hpp b/source/paint/detail/image_png.hpp index ac42fafa..8cc641d3 100644 --- a/source/paint/detail/image_png.hpp +++ b/source/paint/detail/image_png.hpp @@ -20,13 +20,9 @@ namespace nana : public basic_image_pixbuf { public: - bool open(const nana::char_t* png_file) override + bool open(const experimental::filesystem::path& png_file) override { -#ifdef NANA_UNICODE - FILE * fp = ::fopen(static_cast(nana::charset(png_file)).c_str(), "rb"); -#else - FILE* fp = ::fopen(png_file, "rb"); -#endif + auto fp = ::fopen(to_osmbstr(to_utf8(png_file.native())).c_str(), "rb"); if(nullptr == fp) return false; bool is_opened = false;