]> git.saurik.com Git - wxWidgets.git/commitdiff
fix extra indentation in wxHTML_ALIGN_JUSTIFY display (patch 1565375)
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Mar 2007 16:39:58 +0000 (16:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 17 Mar 2007 16:39:58 +0000 (16:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44874 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

docs/changes.txt
src/html/htmlcell.cpp

index fc412e7954c6c8ef740c0518ae057d7783eb3c86..97fa8ebd9c432d40a15b3b7d219e3c5b291f2d9e 100644 (file)
@@ -99,6 +99,7 @@ wxMSW:
 All:
 
 - Shut down the sockets gracefully (Sergio Aguayo)
+- Fix extra indentation in wxHTML_ALIGN_JUSTIFY display (Chacal)
 
 wxMac:
 
index 95d81d6abc5351d15420382d59c916efb8085a7d..3244eb577fe7e168456b56a4aa026c0e63b3bd50 100644 (file)
@@ -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() )