From 9076e56d931c244f41283a33a9808b2e56176011 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 17 Mar 2007 16:39:58 +0000 Subject: [PATCH] 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 --- docs/changes.txt | 1 + src/html/htmlcell.cpp | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/docs/changes.txt b/docs/changes.txt index fc412e7954..97fa8ebd9c 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -99,6 +99,7 @@ wxMSW: All: - Shut down the sockets gracefully (Sergio Aguayo) +- Fix extra indentation in wxHTML_ALIGN_JUSTIFY display (Chacal) wxMac: diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 95d81d6abc..3244eb577f 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -884,12 +884,12 @@ void wxHtmlContainerCell::Layout(int w) if ( step > 0 ) { // first count the cells which will get extra space - int total = 0; + int total = -1; const wxHtmlCell *c; if ( line != cell ) { - for ( c = line->GetNext(); c != cell; c = c->GetNext() ) + for ( c = line; c != cell; c = c->GetNext() ) { if ( c->IsLinebreakAllowed() ) { @@ -901,11 +901,22 @@ void wxHtmlContainerCell::Layout(int w) // and now extra space to those cells which merit it if ( total ) { - // first cell on line is not moved: - line->SetPos(line->GetPosX() + s_indent, - line->GetPosY() + ypos); + // first visible cell on line is not moved: + while (line !=cell && !line->IsLinebreakAllowed()) + { + 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() ) { if ( line->IsLinebreakAllowed() ) -- 2.45.2