Program: 67832
Project: 67832
Buggy source:
protected void writeText(int type,String txt,IContent content,InlineFlag inlineFlag,IStyle computedStyle,IStyle inlineStyle){
  HyperlinkInfo hyper=getHyperlink(content);
  int paragraphWidth=(int)WordUtil.twipToPt(context.getCurrentWidth());
  if (content instanceof TextContent) {
    TextFlag textFlag=TextFlag.START;
    String fontFamily=null;
    if ("String_Node_Str".equals(txt) || txt == null || WordUtil.isField(content)) {
      wordWriter.writeContent(type,txt,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag,paragraphWidth);
    }
 else {
      FontSplitter fontSplitter=getFontSplitter(content);
      while (fontSplitter.hasMore()) {
        Chunk ch=fontSplitter.getNext();
        int offset=ch.getOffset();
        int length=ch.getLength();
        fontFamily=getFontFamily(computedStyle,ch);
        String string=null;
        if (ch == Chunk.HARD_LINE_BREAK) {
          string=ch.getText();
        }
 else {
          string=txt.substring(offset,offset + length);
        }
        wordWriter.writeContent(type,string,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag,paragraphWidth);
        textFlag=fontSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
      }
    }
    if (inlineFlag == InlineFlag.BLOCK) {
      wordWriter.writeContent(type,null,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,TextFlag.END,paragraphWidth);
    }
  }
 else {
    wordWriter.writeContent(type,txt,computedStyle,inlineStyle,computedStyle.getFontFamily(),hyper,inlineFlag,TextFlag.WHOLE,paragraphWidth);
  }
}

Fixed version (ground truth):
protected void writeText(int type,String txt,IContent content,InlineFlag inlineFlag,IStyle computedStyle,IStyle inlineStyle){
  HyperlinkInfo hyper=getHyperlink(content);
  int paragraphWidth=(int)WordUtil.twipToPt(context.getCurrentWidth());
  boolean rtl=content.isDirectionRTL();
  if (content instanceof TextContent) {
    TextFlag textFlag=TextFlag.START;
    String fontFamily=null;
    if ("String_Node_Str".equals(txt) || txt == null || WordUtil.isField(content)) {
      wordWriter.writeContent(type,txt,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag,paragraphWidth,rtl);
    }
 else {
      int level=rtl ? 1 : 0;
      BidiSplitter bidiSplitter=new BidiSplitter(new Chunk(txt,0,level,level));
      if (bidiSplitter.hasMore()) {
        do {
          Chunk ch=bidiSplitter.getNext();
          level=ch.getRunLevel();
          FontSplitter fontSplitter=getFontSplitter(content,ch.getText());
          while (fontSplitter.hasMore()) {
            ch=fontSplitter.getNext();
            wordWriter.writeContent(type,ch.getText(),computedStyle,inlineStyle,getFontFamily(computedStyle,ch),hyper,inlineFlag,textFlag,paragraphWidth,(level & 1) != 0 || !rtl && level > 0);
            textFlag=fontSplitter.hasMore() || bidiSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
          }
        }
 while (bidiSplitter.hasMore());
      }
 else {
        FontSplitter fontSplitter=getFontSplitter(content,((TextContent)content).getText());
        while (fontSplitter.hasMore()) {
          Chunk ch=fontSplitter.getNext();
          int offset=ch.getOffset();
          int length=ch.getLength();
          fontFamily=getFontFamily(computedStyle,ch);
          String string=null;
          if (ch == Chunk.HARD_LINE_BREAK) {
            string=ch.getText();
          }
 else {
            string=txt.substring(offset,offset + length);
          }
          wordWriter.writeContent(type,string,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,textFlag,paragraphWidth,rtl);
          textFlag=fontSplitter.hasMore() ? TextFlag.MIDDLE : TextFlag.END;
        }
      }
    }
    if (inlineFlag == InlineFlag.BLOCK) {
      wordWriter.writeContent(type,null,computedStyle,inlineStyle,fontFamily,hyper,inlineFlag,TextFlag.END,paragraphWidth,rtl);
    }
  }
 else {
    wordWriter.writeContent(type,txt,computedStyle,inlineStyle,computedStyle.getFontFamily(),hyper,inlineFlag,TextFlag.WHOLE,paragraphWidth,rtl);
  }
}