restore modified state even when something goes wrong

This commit is contained in:
honfika@gmail.com
2015-06-29 12:18:28 +02:00
parent 27f3b61dd5
commit e630374e4e
4 changed files with 24 additions and 8 deletions

View File

@@ -29,7 +29,6 @@ import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.HideInRawEdit;
import com.jpexs.decompiler.flash.types.annotations.SWFType;
import com.jpexs.decompiler.flash.types.filters.FILTER;
import com.jpexs.helpers.ByteArrayRange;
@@ -418,7 +417,12 @@ public class PlaceObject2Tag extends PlaceObjectTypeTag implements ASMSourceCont
matrix = m;
boolean mod = isModified();
setModified(true);
super.writeTag(sos);
try {
super.writeTag(sos);
} finally {
setModified(mod);
}
setModified(mod);
matrix = old;
}

View File

@@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.HideInRawEdit;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
@@ -565,7 +564,12 @@ public class PlaceObject3Tag extends PlaceObjectTypeTag implements ASMSourceCont
matrix = m;
boolean mod = isModified();
setModified(true);
super.writeTag(sos);
try {
super.writeTag(sos);
} finally {
setModified(mod);
}
setModified(mod);
matrix = old;
}

View File

@@ -30,7 +30,6 @@ import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RGBA;
import com.jpexs.decompiler.flash.types.annotations.Conditional;
import com.jpexs.decompiler.flash.types.annotations.HideInRawEdit;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.annotations.Reserved;
import com.jpexs.decompiler.flash.types.annotations.SWFArray;
@@ -568,8 +567,12 @@ public class PlaceObject4Tag extends PlaceObjectTypeTag implements ASMSourceCont
matrix = m;
boolean mod = isModified();
setModified(true);
super.writeTag(sos);
setModified(mod);
try {
super.writeTag(sos);
} finally {
setModified(mod);
}
matrix = old;
}
}

View File

@@ -236,7 +236,12 @@ public class PlaceObjectTag extends PlaceObjectTypeTag {
matrix = m;
boolean mod = isModified();
setModified(true);
super.writeTag(sos);
try {
super.writeTag(sos);
} finally {
setModified(mod);
}
setModified(mod);
matrix = old;
}