git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@23084
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
wxCHECK_RET( index >= 0 && (size_t)index < GetItemCount(),
_T("invalid index in GetItemRect") );
wxCHECK_RET( index >= 0 && (size_t)index < GetItemCount(),
_T("invalid index in GetItemRect") );
+ // ensure that we're laid out, otherwise we could return nonsense
+ if ( m_dirty )
+ {
+ wxConstCast(this, wxListMainWindow)->
+ RecalculatePositions(TRUE /* no refresh */);
+ }
+
rect = GetLineRect((size_t)index);
CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y);
rect = GetLineRect((size_t)index);
CalcScrolledPosition(rect.x, rect.y, &rect.x, &rect.y);