Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-03-12 10:56:07 +0000
committerAndre Weinand2002-03-12 10:56:07 +0000
commit7ef336c3135b4372e9e09b1d1779877de81ef32b (patch)
treeb7c479623f5bd057b12daf6d752dc6782b979c7c
parent86a6d867816054d2220b7f69825449db5b54e35d (diff)
downloadeclipse.platform.team-7ef336c3135b4372e9e09b1d1779877de81ef32b.tar.gz
eclipse.platform.team-7ef336c3135b4372e9e09b1d1779877de81ef32b.tar.xz
eclipse.platform.team-7ef336c3135b4372e9e09b1d1779877de81ef32b.zip
restoring old state
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java32
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java32
2 files changed, 6 insertions, 58 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
index 5d64f1f83..80b6409f1 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
@@ -4,10 +4,9 @@
*/
package org.eclipse.compare.internal;
-import org.eclipse.swt.SWTError;
import org.eclipse.jface.text.*;
-import org.eclipse.compare.rangedifferencer.IRangeComparator;
import org.eclipse.compare.contentmergeviewer.ITokenComparator;
+import org.eclipse.compare.rangedifferencer.IRangeComparator;
/**
* Implements the <code>IRangeComparator</code> interface for lines in a document.
@@ -24,7 +23,6 @@ public class DocLineComparator implements ITokenComparator {
private int fLineCount;
private int fLength;
private boolean fIgnoreWhiteSpace;
- private IRegion fRegion;
/**
* Creates a <code>DocLineComparator</code> for the given document range.
@@ -41,7 +39,6 @@ public class DocLineComparator implements ITokenComparator {
fIgnoreWhiteSpace= ignoreWhiteSpace;
fLineOffset= 0;
- fRegion= region;
if (region != null) {
fLength= region.getLength();
int start= region.getOffset();
@@ -93,19 +90,7 @@ public class DocLineComparator implements ITokenComparator {
* see ITokenComparator.getTokenLength
*/
public int getTokenLength(int line) {
- int s= getTokenStart(line);
- int e= getTokenStart(line+1);
- if (fRegion != null) {
- if (e > fRegion.getOffset()+fRegion.getLength())
- e= fRegion.getOffset()+fRegion.getLength();
- }
- return e - s;
-// try {
-// IRegion r= fDocument.getLineInformation(fLineOffset + line);
-// return r.getLength();
-// } catch (BadLocationException ex) {
-// }
-// return 0;
+ return getTokenStart(line+1) - getTokenStart(line);
}
/**
@@ -160,18 +145,7 @@ public class DocLineComparator implements ITokenComparator {
if (line < fLineCount) {
try {
IRegion r= fDocument.getLineInformation(fLineOffset + line);
- int s= r.getOffset();
- int l= r.getLength();
- if (fRegion != null) {
- int e= s+l;
- int ee= fRegion.getOffset()+fRegion.getLength();
- if (e > ee) {
- System.out.println("********** extract");
- e= ee;
- l= e-s;
- }
- }
- return fDocument.get(s, l);
+ return fDocument.get(r.getOffset(), r.getLength());
} catch(BadLocationException e) {
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
index 5d64f1f83..80b6409f1 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/DocLineComparator.java
@@ -4,10 +4,9 @@
*/
package org.eclipse.compare.internal;
-import org.eclipse.swt.SWTError;
import org.eclipse.jface.text.*;
-import org.eclipse.compare.rangedifferencer.IRangeComparator;
import org.eclipse.compare.contentmergeviewer.ITokenComparator;
+import org.eclipse.compare.rangedifferencer.IRangeComparator;
/**
* Implements the <code>IRangeComparator</code> interface for lines in a document.
@@ -24,7 +23,6 @@ public class DocLineComparator implements ITokenComparator {
private int fLineCount;
private int fLength;
private boolean fIgnoreWhiteSpace;
- private IRegion fRegion;
/**
* Creates a <code>DocLineComparator</code> for the given document range.
@@ -41,7 +39,6 @@ public class DocLineComparator implements ITokenComparator {
fIgnoreWhiteSpace= ignoreWhiteSpace;
fLineOffset= 0;
- fRegion= region;
if (region != null) {
fLength= region.getLength();
int start= region.getOffset();
@@ -93,19 +90,7 @@ public class DocLineComparator implements ITokenComparator {
* see ITokenComparator.getTokenLength
*/
public int getTokenLength(int line) {
- int s= getTokenStart(line);
- int e= getTokenStart(line+1);
- if (fRegion != null) {
- if (e > fRegion.getOffset()+fRegion.getLength())
- e= fRegion.getOffset()+fRegion.getLength();
- }
- return e - s;
-// try {
-// IRegion r= fDocument.getLineInformation(fLineOffset + line);
-// return r.getLength();
-// } catch (BadLocationException ex) {
-// }
-// return 0;
+ return getTokenStart(line+1) - getTokenStart(line);
}
/**
@@ -160,18 +145,7 @@ public class DocLineComparator implements ITokenComparator {
if (line < fLineCount) {
try {
IRegion r= fDocument.getLineInformation(fLineOffset + line);
- int s= r.getOffset();
- int l= r.getLength();
- if (fRegion != null) {
- int e= s+l;
- int ee= fRegion.getOffset()+fRegion.getLength();
- if (e > ee) {
- System.out.println("********** extract");
- e= ee;
- l= e-s;
- }
- }
- return fDocument.get(s, l);
+ return fDocument.get(r.getOffset(), r.getLength());
} catch(BadLocationException e) {
}
}

Back to the top