From be2f47223c17c399e05436a34ba4140f2fc44fc9 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Thu, 4 Jul 2002 21:33:27 +0000 Subject: [PATCH] make the styles' doJustify methods stop returning the string length as this is no longer needed with the BFont class --- src/Basemenu.cc | 4 ++-- src/Screen.hh | 8 ++++---- src/Toolbar.cc | 8 +++----- src/Window.cc | 8 +++----- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/src/Basemenu.cc b/src/Basemenu.cc index 2dd6af70..5b4acdf0 100644 --- a/src/Basemenu.cc +++ b/src/Basemenu.cc @@ -442,7 +442,7 @@ void Basemenu::move(int x, int y) { void Basemenu::redrawTitle(void) { const char *text = (! menu.label.empty()) ? getLabel() : i18n(BasemenuSet, BasemenuBlackboxMenu, "Blackbox Menu"); - int dx = menu.bevel_w, len = strlen(text); + int dx = menu.bevel_w; unsigned int l; MenuStyle *style = screen->getMenuStyle(); @@ -544,7 +544,7 @@ void Basemenu::drawItem(int index, bool highlight, bool clear, int sbl = index / menu.persub, i = index - (sbl * menu.persub); int item_x = (sbl * menu.item_w), item_y = (i * menu.item_h); int hilite_x = item_x, hilite_y = item_y, hoff_x = 0, hoff_y = 0; - int text_x = 0, text_y = 0, len = strlen(text), sel_x = 0, sel_y = 0; + int text_x = 0, text_y = 0, sel_x = 0, sel_y = 0; unsigned int hilite_w = menu.item_w, hilite_h = menu.item_h, text_w = 0, text_h = 0; unsigned int half_w = menu.item_h / 2, quarter_w = menu.item_h / 4; diff --git a/src/Screen.hh b/src/Screen.hh index 0fabe9a4..60418cd7 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -71,8 +71,8 @@ struct WindowStyle { TextJustify justify; - int doJustify(const std::string &text, int &start_pos, - unsigned int max_length, unsigned int modifier) const; + void doJustify(const std::string &text, int &start_pos, + unsigned int max_length, unsigned int modifier) const; }; struct ToolbarStyle { @@ -83,8 +83,8 @@ struct ToolbarStyle { TextJustify justify; - int doJustify(const std::string &text, int &start_pos, - unsigned int max_length, unsigned int modifier) const; + void doJustify(const std::string &text, int &start_pos, + unsigned int max_length, unsigned int modifier) const; }; struct MenuStyle { diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 0018e43f..f6ff130a 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -1172,9 +1172,9 @@ void Toolbarmenu::Placementmenu::itemSelected(int button, unsigned int index) { } -int ToolbarStyle::doJustify(const std::string &text, int &start_pos, - unsigned int max_length, - unsigned int modifier) const { +void ToolbarStyle::doJustify(const std::string &text, int &start_pos, + unsigned int max_length, + unsigned int modifier) const { size_t text_len = text.size(); unsigned int length; @@ -1195,6 +1195,4 @@ int ToolbarStyle::doJustify(const std::string &text, int &start_pos, default: break; } - - return text_len; } diff --git a/src/Window.cc b/src/Window.cc index e1798243..803cd9af 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -3542,9 +3542,9 @@ void BlackboxWindow::constrain(Corner anchor, int *pw, int *ph) { } -int WindowStyle::doJustify(const std::string &text, int &start_pos, - unsigned int max_length, - unsigned int modifier) const { +void WindowStyle::doJustify(const std::string &text, int &start_pos, + unsigned int max_length, + unsigned int modifier) const { size_t text_len = text.size(); unsigned int length; @@ -3565,8 +3565,6 @@ int WindowStyle::doJustify(const std::string &text, int &start_pos, default: break; } - - return text_len; } -- 2.45.2