Menu

How do you want bug fixes?

2008-01-09
2013-01-03
  • Brian Hawkins

    Brian Hawkins - 2008-01-09

    I found and fixed a bug.

    In OutputDocument.java in writeTo(final Writer writer, int begin, int end)

    When the outputSegments are empty you call Util.appendTo but you do not pass begin and end to the method.  So it ends up outputting the entire document.

     
    • Martin Jericho

      Martin Jericho - 2008-01-10

      Please send me the source code of the method you have changed.  I cannot find a method with the signature you have provided.

       
    • Brian Hawkins

      Brian Hawkins - 2008-01-11

      I tried sending you a private message.  I guess it didn't work.

      The file is OutputDocument.java
      The code is starting on line 361:
      public void writeTo(final Writer writer, int begin, int end) throws IOException {
      try {
          if (outputSegments.isEmpty()) {
              Util.appendTo(writer,sourceText,begin,end); //I changed this line
              return;
          }
          int pos=begin;
          Collections.sort(outputSegments,OutputSegment.COMPARATOR);
          OutputSegment lastOutputSegment=null;

       
      • Martin Jericho

        Martin Jericho - 2008-01-12

        Hi Brian,
        I got your private message but didn't have a chance to respond.
        The method you have fixed seems to be one of your own creation, as there is no OutputDocument.writeTo method with those parameters.
        Cheers
        Martin

         
        • Brian Hawkins

          Brian Hawkins - 2008-01-12

          Oh ok that would explain why it was busted then ;)

          So I've got this really good idea for a new method in the OutputDocument class.

          As you now know I added a writeTo that takes start and end parameters.  Very handy when you want to export part of the document with replacements.

          So send me an email and I'll send you my entire OutputDocument.java file.

          Brian

           
    • Martin Jericho

      Martin Jericho - 2008-01-30

      OutputDocument.writeTo(Writer writer , int begin, int end) has been added in version 2.6.

      The output now also excludes any output segments that are enclosed by other output segments.

      Until version 2.6 is officially released, a development version is available here:
      http://jerichohtml.sourceforge.net/temp/jericho-html-2.6-dev.zip

       

Log in to post a comment.