diff options
author | fluxgen <fluxgen> | 2004-08-11 12:41:28 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2004-08-11 12:41:28 (GMT) |
commit | 0e8c41821002489811317874d941e519b683cfea (patch) | |
tree | 49de9f690974161261a81c2debd4d6d3fc783901 /src | |
parent | 3c8e7ae95a85f8e84bb6b4690c11956177a0710f (diff) | |
download | fluxbox_lack-0e8c41821002489811317874d941e519b683cfea.zip fluxbox_lack-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
Diffstat (limited to 'src')
-rw-r--r-- | src/FbTk/TextBox.cc | 7 |
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 | ||
280 | void TextBox::adjustStartPos() { | 280 | void 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 | ||