all repos — fluxbox @ 8feb0b8c83559e44bc6b2fc418c9cf7b6b46a03c

custom fork of the fluxbox windowmanager

avoid constructing new strings implicit
Mathias Gumz akira at fluxbox dot org
commit

8feb0b8c83559e44bc6b2fc418c9cf7b6b46a03c

parent

83656fc0e817c2a00a315176e651881cdfc804eb

4 files changed, 7 insertions(+), 7 deletions(-)

jump to
M src/ClockTool.ccsrc/ClockTool.cc

@@ -255,7 +255,7 @@

unsigned int new_width = m_button.width(); unsigned int new_height = m_button.height(); translateSize(orientation(), new_width, new_height); - new_width = m_theme->font().textWidth(text.c_str(), text.size()); + new_width = m_theme->font().textWidth(text, text.size()); translateSize(orientation(), new_width, new_height); if (new_width != m_button.width() || new_height != m_button.height()) { resize(new_width, new_height);
M src/FbTk/MenuItem.ccsrc/FbTk/MenuItem.cc

@@ -54,12 +54,12 @@ int underline_height = font_top + theme->frameFont().ascent() + 2;

int bottom = height - bevelW - 1; text_y += bottom > underline_height ? underline_height : bottom; - int text_w = theme->frameFont().textWidth(m_label.c_str(), m_label.size()); + int text_w = theme->frameFont().textWidth(m_label, m_label.size()); // width of the searchstring size = size > m_label.length() ? m_label.length() : size; std::string search_string = m_label.substr(0,size); - int search_string_w = theme->frameFont().textWidth(search_string.c_str(), size); + int search_string_w = theme->frameFont().textWidth(search_string, size); // pay attention to the text justification switch(theme->frameFontJustify()) {

@@ -157,7 +157,7 @@ // Text

// int text_y = y, text_x = x; - int text_w = theme->frameFont().textWidth(label().c_str(), label().size()); + int text_w = theme->frameFont().textWidth(label(), label().size()); int height_offset = theme->itemHeight() - (theme->frameFont().height() + 2*theme->bevelWidth()); text_y = y + theme->bevelWidth() + theme->frameFont().ascent() + height_offset/2;
M src/FbTk/TextBox.ccsrc/FbTk/TextBox.cc

@@ -369,7 +369,7 @@ }

void TextBox::adjustStartPos() { - int text_width = font().textWidth(text().c_str(), m_end_pos); + int text_width = font().textWidth(text(), m_end_pos); if (text_width < static_cast<signed>(width())) return;
M src/FbTk/TextButton.ccsrc/FbTk/TextButton.cc

@@ -126,7 +126,7 @@ }

unsigned int TextButton::textWidth() const { - return font().textWidth(text().data(), text().size()); + return font().textWidth(text(), text().size()); } void TextButton::renderForeground(FbWindow &win, FbDrawable &drawable) {

@@ -161,7 +161,7 @@

font().drawText(*drawable, screenNumber(), gc(), // graphic context - text().data(), textlen, // string and string size + text(), textlen, // string and string size textx, texty, m_orientation); // position }