bug in handling of strings that run off the right edge of the margin

(in HTMLCheckerImpl) - thanks to Chuq von Rospach for reporting this
This commit is contained in:
Eric J. Bowersox 2001-10-02 18:00:43 +00:00
parent 334fdb5c6b
commit 2db3b44e7e

View File

@ -7,7 +7,7 @@
* WARRANTY OF ANY KIND, either express or implied. See the License for the specific
* language governing rights and limitations under the License.
*
* The Original Code is the Venice Web Community System.
* The Original Code is the Venice Web Communities System.
*
* The Initial Developer of the Original Code is Eric J. Bowersox <erbo@silcom.com>,
* for Silverwrist Design Studios. Portions created by Eric J. Bowersox are
@ -404,7 +404,7 @@ class HTMLCheckerImpl implements HTMLChecker, HTMLCheckerBackend, RewriterServic
private void emitFromStartOfTempBuffer(int nchars)
{
if (nchars<=0)
return;
return; // can't emit less than 1 character!
if ((config.getWordWrapLength()>0) && (nobreak_count<=0))
{ // we can output the line break anywhere in the subsequence...
@ -415,12 +415,16 @@ class HTMLCheckerImpl implements HTMLChecker, HTMLCheckerBackend, RewriterServic
if (curlen>remaining_space)
curlen = remaining_space;
// output those characters
// EJB 10/2/2001 - only output if we have something to output (and there is space for it)
if (curlen>0)
{ // output those characters
emitString(temp_buffer.substring(0,curlen),config.getOutputFilters(),true);
temp_buffer.delete(0,curlen);
nchars -= curlen;
if (columns==config.getWordWrapLength())
} // end if
if (columns>=config.getWordWrapLength()) // EJB 10/2/2001 - might be greater
emitLineBreak(); // and line break us to get to the next line
} // end while
@ -750,7 +754,7 @@ class HTMLCheckerImpl implements HTMLChecker, HTMLCheckerBackend, RewriterServic
i++;
break;
case '\r': // compress 1 or more \r's followe by optional \n to a single \n
case '\r': // compress 1 or more \r's followed by optional \n to a single \n
if ( (i==(str.length()-1))
|| ((str.charAt(i+1)!='\r') && (str.charAt(i+1)!='\n')))
temp_buffer.append('\n');
@ -783,7 +787,7 @@ class HTMLCheckerImpl implements HTMLChecker, HTMLCheckerBackend, RewriterServic
i++;
break;
case '\\': // backslash processing is complext - shift to ST_CHARS state to handle it
case '\\': // backslash processing is complex - shift to ST_CHARS state to handle it
doFlushWhitespace();
state = ST_CHARS;
break;