#668: text tags fixed

This commit is contained in:
honfika@gmail.com
2014-09-07 23:26:20 +02:00
parent c9907ef4d1
commit 06b3deda28
2 changed files with 27 additions and 23 deletions

View File

@@ -758,8 +758,7 @@ public final class MethodInfoLexer {
*
* @return the next token
* @exception java.io.IOException if any I/O-Error occurs
* @throws
* com.jpexs.decompiler.flash.abc.methodinfo_parser.MethodInfoParseException
* @throws MethodInfoParseException
*/
public ParsedSymbol yylex() throws java.io.IOException, MethodInfoParseException {
int zzInput;

View File

@@ -12,7 +12,8 @@
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library.
* License along with this library.
*/
package com.jpexs.decompiler.flash.tags.base;
import com.jpexs.decompiler.flash.SWF;
@@ -166,29 +167,33 @@ public abstract class FontTag extends CharacterTag implements AloneTag, Drawable
}
public void shiftGlyphIndices(int fontId, int startIndex) {
public void shiftGlyphIndices(int fontId, int startIndex) {
for (Tag t : swf.tags) {
List<TEXTRECORD> textRecords = null;
if (t instanceof DefineTextTag) {
if (t instanceof DefineTextTag) {
textRecords = ((DefineTextTag) t).textRecords;
} else if (t instanceof DefineText2Tag) {
textRecords = ((DefineText2Tag) t).textRecords;
}
}
if (t instanceof DefineText2Tag) {
textRecords.addAll(((DefineText2Tag) t).textRecords);
}
}
int curFontId = 0;
for (TEXTRECORD tr : textRecords) {
if (tr.styleFlagsHasFont) {
curFontId = tr.fontId;
}
if (curFontId != fontId) {
continue;
}
for (GLYPHENTRY en : tr.glyphEntries) {
if (en == null) { //Currently edited
continue;
}
if (en.glyphIndex >= startIndex) {
if (textRecords != null) {
int curFontId = 0;
for (TEXTRECORD tr : textRecords) {
if (tr.styleFlagsHasFont) {
curFontId = tr.fontId;
}
if (curFontId != fontId) {
continue;
}
for (GLYPHENTRY en : tr.glyphEntries) {
if (en == null) { //Currently edited
continue;
}
if (en.glyphIndex >= startIndex) {
en.glyphIndex++;
}
}
t.setModified(true);
}
}
}