1

Closed

A few minor issues

description

Thanks for an excellent gui library. I have been studying it and have the following observations:
In handle_manager.hpp (line 95 for Cpp03, line 101 for Cpp11) there is the following line
                (addr_+pos)->~pair_type;
Should this actually be?
                (addr_+pos)->~pair_type();
In window_layout.hpp (line 119 for Cpp03, line 115 for Cpp11) there are the following lines:
        visual = wd->pos_root;
        visual = wd->dimension;
I think only the second statement is required as the first will have no effect?

In listbox.cpp (line 124 for Cpp03, line 127 for Cpp11)
            const item_t& get_item(size_type index) const
the function is redundant because the only difference is with the previous function that returns a item_t reference rather than a const item_t reference?

In programming_interface.hpp (line 620 for Cpp03, line 606 for Cpp11)
    r = iwd->pos_owner;
    r = iwd->dimension;
I think only the second statement is required as the first will have no effect?
Closed Apr 24, 2014 at 5:13 PM by cnjinhao

comments

cnjinhao wrote Jan 30, 2014 at 7:25 AM

Hi,
Thank you for reviewing the code, the erase() function at line 95/101 in handle_manager.hpp is removed, becuase this function is never called. and same to the const item_t& get_item() const.
r = iwd->pos_owner;
r = iwd->dimension;
this piece of code is correct in logic,
r = iwd->pos_owner; //pos_owner is type of point
is equivalent to
r.x = pos.x;
r.y = pos.y;

r = iwd->dimension; //dimension is type of size
is equivalent to
r.width = size.width;
r.height = size.height;

Through it is easy for use, it is not a good style.
r = rectangle(iwd->pos_owner, iwd->dimension);
It's a readable code now.