Subfiltering step: Move the code specific to OpenXMLZipFilterWriter to the filter code
Issue #824
new
This issue is for the Subfiltering step that will be added when pull request #300 is merged. Creation of this issue is one of the the code review comments by @Denis Konovalyenko .
In okapi/steps/rainbowkit/src/main/java/net/sf/okapi/steps/rainbowkit/postprocess/Merger.java, inside the body of mergeStartDocumentEvent(), there is a block of code that looks like this:
// Hack: This extra step is needed for OpenXMLZipFilterWriter.
// Attempt was made to move the em.updateEncoder code to OpenXMLZipFilterWriter#getEncoderManager
// but that caused "&" in hyperlink to become "&". So it's here for now.
if (writer instanceof OpenXMLZipFilterWriter) {
EncoderManager em = writer.getEncoderManager();
em.updateEncoder(internalEvent.getStartDocument().getMimeType());
}
As the comment reads, this special handling code shouldn’t be here but somewhere inside OpenXMLZipFilterWriter. The author did not have enough knowledge to find a good place to put this code. But a little bit more effort should be made to move this to OpenXMLZipFilterWriter.