fix some compiler errors(clang)

This commit is contained in:
Jinhao 2015-10-13 23:16:25 +08:00
parent a9983101ab
commit 84f071dc95
2 changed files with 9 additions and 29 deletions

View File

@ -1541,7 +1541,6 @@ namespace nana
} }
private: private:
nana::cursor splitter_cursor_; nana::cursor splitter_cursor_;
bool created_{ false };
place_parts::splitter<true> splitter_; place_parts::splitter<true> splitter_;
nana::point begin_point_; nana::point begin_point_;
int left_pos_, right_pos_; int left_pos_, right_pos_;
@ -1588,18 +1587,6 @@ namespace nana
} }
auto & dockarea = dockable_field->dockarea; 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()) if (dockarea && !dockarea->floating())
dockarea->move(this->field_area); dockarea->move(this->field_area);
} }
@ -1763,9 +1750,10 @@ namespace nana
} }
public: public:
field_dock * dockable_field{ nullptr }; field_dock * dockable_field{ nullptr };
std::unique_ptr<widget> splitter;
private: private:
implement * impl_ptr_; implement * impl_ptr_;
bool created_{ false };
// //
struct indicator_rep struct indicator_rep
@ -1938,8 +1926,6 @@ namespace nana
double top = area.y; double top = area.y;
double bottom = area.bottom(); double bottom = area.bottom();
std::map<division*, std::unique_ptr<splitter>> swp_splitters;
for (auto & child : children) for (auto & child : children)
{ {
if (!child->display) if (!child->display)
@ -1964,16 +1950,13 @@ namespace nana
if (_m_right(child_dv)) if (_m_right(child_dv))
{ {
//Creates a splitbar if the 'right' leaf is not empty //Creates a splitbar if the 'right' leaf is not empty
if (!child_dv->splitter)
auto & splitter_ptr = swp_splitters[child_dv]; {
split = new splitter(impl_->window_handle, child->dir, this, child_dv);
auto si = splitters_.find(child_dv); child_dv->splitter.reset(split);
if (si == splitters_.end()) }
splitter_ptr.reset(new splitter(impl_->window_handle, child->dir, this, child_dv));
else else
splitter_ptr.swap(si->second); split = dynamic_cast<splitter*>(child_dv->splitter.get());
split = splitter_ptr.get();
} }
::nana::rectangle child_r; ::nana::rectangle child_r;
@ -2056,8 +2039,6 @@ namespace nana
child->field_area = child_r; child->field_area = child_r;
child->collocate(wd); child->collocate(wd);
} }
splitters_.swap(swp_splitters);
} }
private: private:
static bool _m_is_vert(::nana::direction dir) static bool _m_is_vert(::nana::direction dir)
@ -2079,7 +2060,6 @@ namespace nana
} }
private: private:
implement * const impl_; implement * const impl_;
std::map<division*, std::unique_ptr<splitter>> splitters_;
}; };
place::implement::~implement() place::implement::~implement()

View File

@ -474,7 +474,7 @@ namespace paint
::nana::size graphics::bidi_extent_size(const std::string& str) const ::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<std::wstring>(::nana::charset(str, ::nana::unicode::utf8)));
} }
bool graphics::text_metrics(unsigned & ascent, unsigned& descent, unsigned& internal_leading) const bool graphics::text_metrics(unsigned & ascent, unsigned& descent, unsigned& internal_leading) const