OpenXML Filter: DOCX: empty referent runs cause a crash when a character is added

Create issue
Issue #1157 resolved
Denis Konovalyenko created an issue

UI:

XLIFF:

?xml version="1.0" encoding="UTF-8"?>
<xliff version="1.2" xmlns="urn:oasis:names:tc:xliff:document:1.2" xmlns:okp="okapi-framework:xliff-extensions" xml
ns:its="http://www.w3.org/2005/11/its" xmlns:itsxlf="http://www.w3.org/ns/its-xliff/" its:version="2.0">
<file original="word/document.xml" source-language="en" target-language="es" datatype="x-undefined">
<body>
<trans-unit id="NFDBB2FA9-tu1" xml:space="preserve">
<source xml:lang="en"></source>
<target xml:lang="es"></target>
</trans-unit>
<trans-unit id="NBAE5E0BB-sub1" xml:space="preserve">
<source xml:lang="en">Text 1.</source>
<target xml:lang="es">Text 1.</target>
</trans-unit>
</body>
</file>
<file original="word/settings.xml" source-language="en" target-language="es" datatype="x-undefined">
<body>
</body>
</file>
</xliff>

If the first TU tagret is adjusted to contain a space or anything else, the following error can be observed on merge:

Caused by: java.lang.IllegalStateException: no text name set
    at net.sf.okapi.filters.openxml.BlockTextUnitWriter.writeRunText(BlockTextUnitWriter.java:237)
    at net.sf.okapi.filters.openxml.BlockTextUnitWriter.flushText(BlockTextUnitWriter.java:215)
    at net.sf.okapi.filters.openxml.BlockTextUnitWriter.write(BlockTextUnitWriter.java:87)
    at net.sf.okapi.filters.openxml.StyledTextSkeletonWriter.processTextUnit(StyledTextSkeletonWriter.java:176)
    at net.sf.okapi.common.filterwriter.GenericFilterWriter.processTextUnit(GenericFilterWriter.java:259)
    at net.sf.okapi.common.filterwriter.GenericFilterWriter.handleEvent(GenericFilterWriter.java:195)
    at net.sf.okapi.filters.openxml.OpenXMLFilterWriter.handleEvent(OpenXMLFilterWriter.java:278)

For more grained details please refer to the attached document.

Comments (2)

  1. Log in to comment