[wx-dev] Re: #10263: wxHtmlContainerCell::GetMaxTotalWidth returns zero sometimes

0 views
Skip to first unread message

wxTrac

unread,
Mar 1, 2009, 11:07:48 AM3/1/09
to wx-...@lists.wxwidgets.org
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:1>

#10263: wxHtmlContainerCell::GetMaxTotalWidth returns zero sometimes
---------------------+------------------------------------------------------
Reporter: basos | Owner:
Type: defect | Status: closed
Priority: normal | Milestone: 2.8.9
Component: wxHtml | Version: 2.8.8
Resolution: fixed | Keywords: GetMaxTotalWidth is zero, wxHtml width zero
Blockedby: | Patch: 1
Blocking: |
---------------------+------------------------------------------------------
Changes (by basos):

* status: new => closed
* patch: 0 => 1
* resolution: => fixed
* milestone: => 2.8.9


Comment:

Indeed there was a problem. I found it and solved it. Now GetMaxTotalWidth
return a correct value.

Patch included


--
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:1>

wxTrac

unread,
Mar 1, 2009, 11:30:23 AM3/1/09
to wx-...@lists.wxwidgets.org
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:2>

#10263: wxHtmlContainerCell::GetMaxTotalWidth returns zero sometimes
---------------------+------------------------------------------------------
Reporter: basos | Owner:

Type: defect | Status: reopened

Priority: normal | Milestone: 2.8.9
Component: wxHtml | Version: 2.8.8

Resolution: | Keywords: GetMaxTotalWidth is zero, wxHtml width zero


Blockedby: | Patch: 1
Blocking: |
---------------------+------------------------------------------------------

Changes (by frm):

* status: closed => reopened
* resolution: fixed =>


Comment:

Don't set status as closed until the patch has been applied otherwise this
bug report would just get lost...


--
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:2>

wxTrac

unread,
Nov 3, 2009, 8:52:42 AM11/3/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:4>

#10263: wxHtmlContainerCell::GetMaxTotalWidth returns zero sometimes
---------------------+------------------------------------------------------
Reporter: basos | Owner:

Type: defect | Status: confirmed
Priority: normal | Milestone: 2.8.11

Component: wxHtml | Version: 2.8.8
Resolution: | Keywords: GetMaxTotalWidth is zero, wxHtml width zero
Blockedby: | Patch: 1
Blocking: |
---------------------+------------------------------------------------------

Changes (by vadz):

* cc: vaclavslavik (added)
* status: reopened => confirmed


Comment:

AFAICS the only thing this patch really changes is that it sets the total
width differently. The new version makes sense to me but I don't really
know this code, maybe there was some reason for the original logic.

Vaclav, would you remember anything about it?


--
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:4>

wxTrac

unread,
Nov 4, 2009, 9:15:56 AM11/4/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:5>

#10263: wxHtmlContainerCell::GetMaxTotalWidth returns zero sometimes
---------------------+------------------------------------------------------
Reporter: basos | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone: 2.8.11
Component: wxHtml | Version: 2.8.8
Resolution: | Keywords: GetMaxTotalWidth is zero, wxHtml width zero
Blockedby: | Patch: 1
Blocking: |
---------------------+------------------------------------------------------

Comment(by vaclavslavik):

Not much, I'm afraid.

If this change makes any difference, it must mean that `cell->GetWidth()`
is larger than `cell->GetMaxTotalWidth()` somewhere. That sounds like a
larger problem to me, one that this patch is merely hiding.

This still doesn't resolve the underlying weirdness, but if it helped, I'd
feel much safer applying it instead:

{{{
#!diff
--- src/html/htmlcell.cpp (revision 62555)
+++ src/html/htmlcell.cpp (working copy)
@@ -904,8 +904,10 @@
if (curLineWidth > m_MaxTotalWidth)
m_MaxTotalWidth = curLineWidth;

- if (wxMax(cell->GetWidth(), cell->GetMaxTotalWidth()) >
m_MaxTotalWidth)
+ if (cell->GetMaxTotalWidth() > m_MaxTotalWidth)
m_MaxTotalWidth = cell->GetMaxTotalWidth();
+ if (cell->GetWidth() > m_MaxTotalWidth)
+ m_MaxTotalWidth = cell->GetWidth();
curLineWidth = 0;
}
else
}}}


--
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:5>

wxTrac

unread,
Nov 8, 2009, 3:16:57 PM11/8/09
to wx-...@googlegroups.com
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:6>

#10263: wxHtmlContainerCell::GetMaxTotalWidth returns zero sometimes
---------------------+------------------------------------------------------
Reporter: basos | Owner:
Type: defect | Status: confirmed
Priority: normal | Milestone: 2.8.11
Component: wxHtml | Version: 2.8.8
Resolution: | Keywords: GetMaxTotalWidth is zero, wxHtml width zero

Blockedby: | Patch: 0

Blocking: |
---------------------+------------------------------------------------------
Changes (by basos):

* patch: 1 => 0


Comment:

Maybe m_width is not valid in the layout() context.
E.g. it is set later. With a quick look maybe at last line of layout() :
{{{
if (m_Width < MaxLineWidth) m_Width = MaxLineWidth;
}}}

\It worked like a charm here,
besides the previous code was a little obscure in a sense that it didn't
control which value was larger before making the assignment .


--
Ticket URL: <http://trac.wxwidgets.org/ticket/10263#comment:6>

Reply all
Reply to author
Forward
0 new messages