fix extra indentation in wxHTML_ALIGN_JUSTIFY display (patch 1565375)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-17 16:39:58 +00:00
parent 399a4fe570
commit 9076e56d93
2 changed files with 18 additions and 6 deletions

View File

@@ -99,6 +99,7 @@ wxMSW:
All: All:
- Shut down the sockets gracefully (Sergio Aguayo) - Shut down the sockets gracefully (Sergio Aguayo)
- Fix extra indentation in wxHTML_ALIGN_JUSTIFY display (Chacal)
wxMac: wxMac:

View File

@@ -884,12 +884,12 @@ void wxHtmlContainerCell::Layout(int w)
if ( step > 0 ) if ( step > 0 )
{ {
// first count the cells which will get extra space // first count the cells which will get extra space
int total = 0; int total = -1;
const wxHtmlCell *c; const wxHtmlCell *c;
if ( line != cell ) if ( line != cell )
{ {
for ( c = line->GetNext(); c != cell; c = c->GetNext() ) for ( c = line; c != cell; c = c->GetNext() )
{ {
if ( c->IsLinebreakAllowed() ) if ( c->IsLinebreakAllowed() )
{ {
@@ -901,11 +901,22 @@ void wxHtmlContainerCell::Layout(int w)
// and now extra space to those cells which merit it // and now extra space to those cells which merit it
if ( total ) if ( total )
{ {
// first cell on line is not moved: // first visible cell on line is not moved:
line->SetPos(line->GetPosX() + s_indent, while (line !=cell && !line->IsLinebreakAllowed())
line->GetPosY() + ypos); {
line->SetPos(line->GetPosX() + s_indent,
line->GetPosY() + ypos);
line = line->GetNext();
}
if (line != cell)
{
line->SetPos(line->GetPosX() + s_indent,
line->GetPosY() + ypos);
line = line->GetNext();
}
line = line->GetNext();
for ( int n = 0; line != cell; line = line->GetNext() ) for ( int n = 0; line != cell; line = line->GetNext() )
{ {
if ( line->IsLinebreakAllowed() ) if ( line->IsLinebreakAllowed() )