* Cleanup of TextElement.

git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@838 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
rakshasa
2007-01-01 06:52:56 +00:00
parent 0854e65775
commit fe7adfc999
12 changed files with 98 additions and 97 deletions
+8 -3
View File
@@ -45,6 +45,13 @@
namespace display {
WindowText::WindowText(void* object, extent_type margin) :
Window(new Canvas, 0, 0, 0, extent_static, extent_static),
m_object(object),
m_margin(margin),
m_interval(0) {
}
void
WindowText::clear() {
std::for_each(begin(), end(), rak::call_delete<TextElement>());
@@ -78,7 +85,6 @@ WindowText::redraw() {
m_canvas->erase();
unsigned int position = 0;
Canvas::attributes_list attributes;
for (iterator itr = begin(); itr != end() && position < m_canvas->height(); ++itr, ++position) {
if (*itr == NULL)
@@ -86,8 +92,7 @@ WindowText::redraw() {
char buffer[m_canvas->width() + 1];
// Add a print function that sets up attributes etc?
attributes.clear();
Canvas::attributes_list attributes;
attributes.push_back(Attributes(buffer, Attributes::a_normal, Attributes::color_default));
char* last = (*itr)->print(buffer, buffer + m_canvas->width(), &attributes, m_object);