Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKai Maetzel2003-02-11 09:46:56 -0500
committerKai Maetzel2003-02-11 09:46:56 -0500
commit19232e7cb4c7f0bc23dfb5d285b5cba87900b421 (patch)
tree50c89a8eaca0a6391f8544219d4914b3daf14865 /org.eclipse.jface.text/src/org/eclipse/jface/text/formatter
parente0aa49c212a14b6ddad02be6ff9e60e94154fa1d (diff)
downloadeclipse.platform.text-19232e7cb4c7f0bc23dfb5d285b5cba87900b421.tar.gz
eclipse.platform.text-19232e7cb4c7f0bc23dfb5d285b5cba87900b421.tar.xz
eclipse.platform.text-19232e7cb4c7f0bc23dfb5d285b5cba87900b421.zip
bug fixing
Diffstat (limited to 'org.eclipse.jface.text/src/org/eclipse/jface/text/formatter')
-rw-r--r--org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContentFormatter.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContentFormatter.java b/org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContentFormatter.java
index 4827b11f3..15d1340c1 100644
--- a/org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContentFormatter.java
+++ b/org.eclipse.jface.text/src/org/eclipse/jface/text/formatter/ContentFormatter.java
@@ -609,8 +609,6 @@ public class ContentFormatter implements IContentFormatter {
if (positions.length == 0)
return;
- Map added= new HashMap(positions.length * 2);
-
for (int i= 0; i < positions.length; i++) {
PositionReference r= (PositionReference) fOverlappingPositionReferences.get(i);
@@ -620,10 +618,10 @@ public class ContentFormatter implements IContentFormatter {
else
r.setLength((offset + positions[i]) - r.getOffset());
- if (added.get(r.getPosition()) == null) {
+ Position p= r.getPosition();
+ if (!document.containsPosition(r.getCategory(), p.offset, p.length)) {
try {
- document.addPosition(r.getCategory(), r.getPosition());
- added.put(r.getPosition(), r.getPosition());
+ document.addPosition(r.getCategory(), p);
} catch (BadPositionCategoryException x) {
// can not happen
} catch (BadLocationException x) {

Back to the top