Issue #640: 2nd text import bug fixed

This commit is contained in:
honfika
2014-08-16 17:37:30 +02:00
parent bc81826648
commit 14cabef4d6
2 changed files with 6 additions and 2 deletions

View File

@@ -328,6 +328,11 @@ public class DefineText2Tag extends TextTag {
}
break;
case TEXT:
String txt = (texts == null || textIdx >= texts.length) ? (String) s.values[0] : texts[textIdx++];
if (txt == null || (font == null && txt.isEmpty())) {
continue;
}
if (font == null) {
throw new ParseException("Font not defined", lexer.yyline());
}
@@ -354,7 +359,6 @@ public class DefineText2Tag extends TextTag {
tr.styleFlagsHasYOffset = true;
y = null;
}
String txt = (texts == null || textIdx >= texts.length) ? (String) s.values[0] : texts[textIdx++];
tr.glyphEntries = new GLYPHENTRY[txt.length()];
for (int i = 0; i < txt.length(); i++) {
char c = txt.charAt(i);

View File

@@ -335,7 +335,7 @@ public class DefineTextTag extends TextTag {
break;
case TEXT:
String txt = (texts == null || textIdx >= texts.length) ? (String) s.values[0] : texts[textIdx++];
if (txt == null) {
if (txt == null || (font == null && txt.isEmpty())) {
continue;
}