X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/b5e656ae0259211cf0beb02d19d87a651435625f..4d01e350fe2d8cb15c068d579c4022345f3ff0c0:/src/html/htmlcell.cpp?ds=sidebyside diff --git a/src/html/htmlcell.cpp b/src/html/htmlcell.cpp index 0e1b2a00fe..90dfc46e46 100644 --- a/src/html/htmlcell.cpp +++ b/src/html/htmlcell.cpp @@ -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 @@ -783,7 +783,7 @@ void wxHtmlContainerCell::Layout(int w) const wxHtmlCell *c, *prev = NULL, - *next = NULL; + *next wxDUMMY_INITIALIZE(NULL); for ( c = line; c != cell; prev = c, c = next ) { next = c->GetNext(); @@ -800,7 +800,7 @@ void wxHtmlContainerCell::Layout(int w) { prev = next = NULL; - for ( int n = 0; line != cell; prev = line, line = next ) + 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)