aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2004-08-11 12:41:28 (GMT)
committerfluxgen <fluxgen>2004-08-11 12:41:28 (GMT)
commit0e8c41821002489811317874d941e519b683cfea (patch)
tree49de9f690974161261a81c2debd4d6d3fc783901
parent3c8e7ae95a85f8e84bb6b4690c11956177a0710f (diff)
downloadfluxbox-0e8c41821002489811317874d941e519b683cfea.zip
fluxbox-0e8c41821002489811317874d941e519b683cfea.tar.bz2
fixed fbrun crash when history item is bigger than entry box, sf: [ 1005182 ] fix for Bug with RequestID #877004, patch from mangala
-rw-r--r--src/FbTk/TextBox.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/FbTk/TextBox.cc b/src/FbTk/TextBox.cc
index 460db7e..a23f9a6 100644
--- a/src/FbTk/TextBox.cc
+++ b/src/FbTk/TextBox.cc
@@ -19,7 +19,7 @@
19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 19// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20// DEALINGS IN THE SOFTWARE. 20// DEALINGS IN THE SOFTWARE.
21 21
22// $Id: TextBox.cc,v 1.10 2004/07/15 13:48:54 fluxgen Exp $ 22// $Id: TextBox.cc,v 1.11 2004/08/11 12:41:28 fluxgen Exp $
23 23
24#include "TextBox.hh" 24#include "TextBox.hh"
25#include "Font.hh" 25#include "Font.hh"
@@ -278,7 +278,10 @@ void TextBox::adjustEndPos() {
278} 278}
279 279
280void TextBox::adjustStartPos() { 280void TextBox::adjustStartPos() {
281 int text_width = font().textWidth(text().c_str() + m_start_pos, m_end_pos - m_start_pos); 281 // reset global start po
282 m_start_pos = 0;
283
284 int text_width = font().textWidth(text().c_str(), m_end_pos);
282 if (text_width < static_cast<signed>(width())) 285 if (text_width < static_cast<signed>(width()))
283 return; 286 return;
284 287