summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpelder2006-03-22 21:41:17 (EST)
committer pelder2006-03-22 21:41:17 (EST)
commit7e6e86d14ad26829e2b9272484f1f8d089479acd (patch)
tree3fac694dc65589d85a3cb5b202cca8732e418e01
parentf2b88c826250903470544f9886f3de43b0a68cab (diff)
downloadorg.eclipse.jet-7e6e86d14ad26829e2b9272484f1f8d089479acd.zip
org.eclipse.jet-7e6e86d14ad26829e2b9272484f1f8d089479acd.tar.gz
org.eclipse.jet-7e6e86d14ad26829e2b9272484f1f8d089479acd.tar.bz2
[132934] BodyContentWriter was creating more than one Position updater for many categories when copying contents from one writer to the other.
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java11
-rw-r--r--plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java1
2 files changed, 3 insertions, 9 deletions
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
index 44bceba..3412911 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/BodyContentWriter.java
@@ -30,7 +30,6 @@ import org.eclipse.jface.text.BadPositionCategoryException;
import org.eclipse.jface.text.DefaultPositionUpdater;
import org.eclipse.jface.text.Document;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IPositionUpdater;
import org.eclipse.jface.text.Position;
@@ -96,17 +95,13 @@ public class BodyContentWriter implements JET2Writer
// transfer position categories, position updaters and positions
IDocument childDocument = bodyContent.getDocument();
- IPositionUpdater[] positionUpdaters = childDocument.getPositionUpdaters();
- for (int i = 0; i < positionUpdaters.length; i++)
- {
- document.addPositionUpdater(positionUpdaters[i]);
- }
-
+ // Position updaters should not be copied, instead, they will be added as part of adding
+ // any new categories.
String categories[] = childDocument.getPositionCategories();
for (int i = 0; i < categories.length; i++)
{
// ensure 'document' has the category - no harm in doing this if the category is already there
- document.addPositionCategory(categories[i]);
+ addPositionCategory(categories[i]);
Position[] positions = childDocument.getPositions(categories[i]);
for (int j = 0; j < positions.length; j++)
{
diff --git a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java
index fe68c3b..052ff3d 100644
--- a/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java
+++ b/plugins/org.eclipse.jet/src/org/eclipse/jet/taglib/UserRegionHelper.java
@@ -176,7 +176,6 @@ public final class UserRegionHelper implements IWriterListener
{
out.addPositionCategory(USERREGION_POSITION_CATEGORY);
out.addPosition(USERREGION_POSITION_CATEGORY, new Position(regionStart, regionEnd - regionStart));
-
out.addEventListener(ROUNDTRIP_LISTENER_CATEGORY, new UserRegionHelper());
}
} \ No newline at end of file