From cc5fd88be313142d3996c81f8bdfc1290485858c Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 2 Oct 2014 18:38:22 -0500 Subject: Don't use insane (negative) layout values if layout engine does not allocate sufficient space for a text string This resolves Bug 1950 Make most debugging statements work again Add new debugging statements Fix several annoying build warnings --- tdehtml/rendering/render_text.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'tdehtml/rendering/render_text.h') diff --git a/tdehtml/rendering/render_text.h b/tdehtml/rendering/render_text.h index acce98350..a05d65daa 100644 --- a/tdehtml/rendering/render_text.h +++ b/tdehtml/rendering/render_text.h @@ -74,7 +74,15 @@ private: void* operator new(size_t sz) throw(); public: - void setSpaceAdd(int add) { m_width -= m_toAdd; m_toAdd = add; m_width += m_toAdd; } + void setSpaceAdd(int add) { + if (add < 0) { + m_toAdd = 0; + kdDebug( 6040 ) << " InlineTextBox::setSpaceAdd() invalid negative value " << add << " specified!" << endl; + } + else { + m_width -= m_toAdd; m_toAdd = add; m_width += m_toAdd; + } + } int spaceAdd() { return m_toAdd; } virtual bool isInlineTextBox() const { return true; } -- cgit v1.2.1