mirror of
https://github.com/rakshasa/rtorrent.git
synced 2026-08-10 12:12:31 +00:00
* Fix TextElement* to use rpc::target_type.
* Moved most of src/ui/download.cc to use commands for TextElements. git-svn-id: svn://rakshasa.no/libtorrent/trunk/rtorrent@967 e378c898-3ddf-0310-93e7-cc216c733640
This commit is contained in:
@@ -43,7 +43,7 @@
|
||||
namespace display {
|
||||
|
||||
char*
|
||||
TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* attributes, void* object) {
|
||||
TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* attributes, rpc::target_type target) {
|
||||
Attributes baseAttribute = attributes->back();
|
||||
push_attribute(attributes, Attributes(first, m_attributes, Attributes::color_invalid));
|
||||
|
||||
@@ -52,18 +52,18 @@ TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* a
|
||||
|
||||
if (m_flags & flag_escape_hex) {
|
||||
char buffer[last - first];
|
||||
char* bufferLast = copy_string(buffer, buffer + (last - first), object);
|
||||
char* bufferLast = copy_string(buffer, buffer + (last - first), target);
|
||||
|
||||
first = rak::transform_hex(buffer, bufferLast, first, last);
|
||||
|
||||
} else if (m_flags & flag_escape_html) {
|
||||
char buffer[last - first];
|
||||
char* bufferLast = copy_string(buffer, buffer + (last - first), object);
|
||||
char* bufferLast = copy_string(buffer, buffer + (last - first), target);
|
||||
|
||||
first = rak::copy_escape_html(buffer, bufferLast, first, last);
|
||||
|
||||
} else {
|
||||
first = copy_string(first, last, object);
|
||||
first = copy_string(first, last, target);
|
||||
}
|
||||
|
||||
push_attribute(attributes, Attributes(first, baseAttribute));
|
||||
@@ -72,7 +72,7 @@ TextElementStringBase::print(char* first, char* last, Canvas::attributes_list* a
|
||||
}
|
||||
|
||||
char*
|
||||
TextElementString::copy_string(char* first, char* last, void* object) {
|
||||
TextElementString::copy_string(char* first, char* last, rpc::target_type target) {
|
||||
extent_type length = std::min<extent_type>(last - first, m_string.size());
|
||||
|
||||
std::memcpy(first, m_string.c_str(), length);
|
||||
@@ -81,7 +81,7 @@ TextElementString::copy_string(char* first, char* last, void* object) {
|
||||
}
|
||||
|
||||
char*
|
||||
TextElementCString::copy_string(char* first, char* last, void* object) {
|
||||
TextElementCString::copy_string(char* first, char* last, rpc::target_type target) {
|
||||
extent_type length = std::min<extent_type>(last - first, m_length);
|
||||
|
||||
std::memcpy(first, m_string, length);
|
||||
|
||||
Reference in New Issue
Block a user