X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4dd9ae575f7639c770facd3236b6caf20035b34c..37de49a3225b9e87ec950f73d361335c73ad3f7f:/src/html/htmlcell.cpp diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 9e8f795042..4747a35f43 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -4,7 +4,7 @@ // Author: Vaclav Slavik // RCS-ID: $Id$ // Copyright: (c) 1999 Vaclav Slavik -// Licence: wxWindows Licence +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) @@ -775,7 +775,7 @@ void wxHtmlContainerCell::Layout(int w) // between two cells separated by, e.g. font change, cell which // is wrong - const int step = s_width - xpos; + int step = s_width - xpos; if ( step > 0 ) { // first count the cells which will get extra space @@ -800,7 +800,7 @@ void wxHtmlContainerCell::Layout(int w) { prev = next = NULL; - for ( int n = 0; line != cell; line = line->GetNext() ) + for ( int n = 0; line != cell; prev = line, line = line->GetNext() ) { line->SetPos(line->GetPosX() + s_indent + ((n * step) / total), @@ -818,8 +818,14 @@ void wxHtmlContainerCell::Layout(int w) } } } + else + { + // this will cause the code to enter "else branch" below: + step = 0; + } } - else // no extra space to distribute + // else branch: + if ( step <= 0 ) // no extra space to distribute { // just set the indent properly while (line != cell)