diff --git a/source/gui/place.cpp b/source/gui/place.cpp index 5c7b6231..aa4692b5 100644 --- a/source/gui/place.cpp +++ b/source/gui/place.cpp @@ -1541,7 +1541,6 @@ namespace nana } private: nana::cursor splitter_cursor_; - bool created_{ false }; place_parts::splitter splitter_; nana::point begin_point_; int left_pos_, right_pos_; @@ -1588,18 +1587,6 @@ namespace nana } auto & dockarea = dockable_field->dockarea; - - /* - if (!created_) - { - created_ = true; - dockarea.create(wd, this); - } - - if (!dockarea.empty() && !dockarea.floating()) - dockarea.move(this->field_area); - */ - if (dockarea && !dockarea->floating()) dockarea->move(this->field_area); } @@ -1763,9 +1750,10 @@ namespace nana } public: field_dock * dockable_field{ nullptr }; + + std::unique_ptr splitter; private: implement * impl_ptr_; - bool created_{ false }; // struct indicator_rep @@ -1938,8 +1926,6 @@ namespace nana double top = area.y; double bottom = area.bottom(); - std::map> swp_splitters; - for (auto & child : children) { if (!child->display) @@ -1964,16 +1950,13 @@ namespace nana if (_m_right(child_dv)) { //Creates a splitbar if the 'right' leaf is not empty - - auto & splitter_ptr = swp_splitters[child_dv]; - - auto si = splitters_.find(child_dv); - if (si == splitters_.end()) - splitter_ptr.reset(new splitter(impl_->window_handle, child->dir, this, child_dv)); + if (!child_dv->splitter) + { + split = new splitter(impl_->window_handle, child->dir, this, child_dv); + child_dv->splitter.reset(split); + } else - splitter_ptr.swap(si->second); - - split = splitter_ptr.get(); + split = dynamic_cast(child_dv->splitter.get()); } ::nana::rectangle child_r; @@ -2056,8 +2039,6 @@ namespace nana child->field_area = child_r; child->collocate(wd); } - - splitters_.swap(swp_splitters); } private: static bool _m_is_vert(::nana::direction dir) @@ -2079,7 +2060,6 @@ namespace nana } private: implement * const impl_; - std::map> splitters_; }; place::implement::~implement() diff --git a/source/paint/graphics.cpp b/source/paint/graphics.cpp index c6b71f21..5b489cdf 100644 --- a/source/paint/graphics.cpp +++ b/source/paint/graphics.cpp @@ -474,7 +474,7 @@ namespace paint ::nana::size graphics::bidi_extent_size(const std::string& str) const { - return bidi_extent_size(std::wstring{ ::nana::charset(str, ::nana::unicode::utf8) }); + return bidi_extent_size(static_cast(::nana::charset(str, ::nana::unicode::utf8))); } bool graphics::text_metrics(unsigned & ascent, unsigned& descent, unsigned& internal_leading) const