Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2002-03-14 15:21:08 +0000
committerAndre Weinand2002-03-14 15:21:08 +0000
commit781539afec322e2a7b49577f0dcaedf2db509525 (patch)
tree4a900bc1202ab929166eeaa22f792ed2a2ca0e43
parentfc2778e92bf6f07815b278943ebd9a7488f4ea5f (diff)
downloadeclipse.platform.team-781539afec322e2a7b49577f0dcaedf2db509525.tar.gz
eclipse.platform.team-781539afec322e2a7b49577f0dcaedf2db509525.tar.xz
eclipse.platform.team-781539afec322e2a7b49577f0dcaedf2db509525.zip
#11305: Can't compare a "C" filev20020314
-rw-r--r--bundles/org.eclipse.compare/buildnotes_compare.html3
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java14
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java12
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html3
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java14
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java12
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java12
-rw-r--r--bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties3
10 files changed, 52 insertions, 36 deletions
diff --git a/bundles/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/buildnotes_compare.html
index 96618475f..001b79481 100644
--- a/bundles/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/buildnotes_compare.html
@@ -11,7 +11,7 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
-Eclipse Build Input March 18th 2002
+Eclipse Build Input March 14th 2002
<h2>
What's new in this drop</h2>
@@ -30,6 +30,7 @@ Known deficiencies</h2>
<h2>
Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=11305">#11305</a>: Can't compare a "C" file<br>
<h2>
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index e011a507f..2530338e9 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -207,14 +207,12 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
boolean hadFocus= hasFocus2();
- /*
- try {
- if (fViewer != null)
- fViewer.setInput(null); // force save before switching viewer
- } catch (ViewerSwitchingCancelled ex) {
- return;
- }
- */
+// try {
+// if (fViewer != null)
+// fViewer.setInput(null); // force save before switching viewer
+// } catch (ViewerSwitchingCancelled ex) {
+// return;
+// }
fInput= input;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 8b173a2d6..0538bd864 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -1120,11 +1120,17 @@ public class TextMergeViewer extends ContentMergeViewer {
if (diff != null) {
switch (type) {
case 'A':
- return diff.fAncestorPos.offset;
+ if (diff.fAncestorPos != null)
+ return diff.fAncestorPos.offset;
+ break;
case 'L':
- return diff.fLeftPos.offset;
+ if (diff.fLeftPos != null)
+ return diff.fLeftPos.offset;
+ break;
case 'R':
- return diff.fRightPos.offset;
+ if (diff.fRightPos != null)
+ return diff.fRightPos.offset;
+ break;
}
}
}
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
index efd9eea57..104029ec5 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
@@ -699,8 +699,8 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
/**
* Guesses the file type of the given input.
- * Returns ITypedElement.TEXT_TYPE if no line is longer than 1000 bytes.
- * Returns ITypedElement.UNKNOWN_TYPE if a line is longer that 1000 bytes.
+ * Returns ITypedElement.TEXT_TYPE if none of the first 10 lines is longer than 1000 bytes.
+ * Returns ITypedElement.UNKNOWN_TYPE otherwise.
* Returns <code>null</code> if the input isn't an <code>IStreamContentAccessor</code>.
*/
private static String guessType(ITypedElement input) {
@@ -712,13 +712,15 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
if (is == null)
return null;
int lineLength= 0;
- while (true) {
+ int lines= 0;
+ while (lines < 10) {
int c= is.read();
if (c == -1) // EOF
break;
- if (c == '\n' || c == '\r') // reset line length
+ if (c == '\n' || c == '\r') { // reset line length
lineLength= 0;
- else
+ lines++;
+ } else
lineLength++;
if (lineLength > 1000)
return ITypedElement.UNKNOWN_TYPE;
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties
index 83b21aa59..5e27f1ac1 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties
@@ -27,5 +27,6 @@ todayFormat= Today ({0})
yesterdayFormat= Yesterday ({0})
dayFormat= {0}
-closeButton.label=Done
+closeButton.label=Close
+
noLocalHistoryError= No local history available for selected resource.
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
index 96618475f..001b79481 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/buildnotes_compare.html
@@ -11,7 +11,7 @@
<h1>
Eclipse Platform Build Notes<br>
Compare</h1>
-Eclipse Build Input March 18th 2002
+Eclipse Build Input March 14th 2002
<h2>
What's new in this drop</h2>
@@ -30,6 +30,7 @@ Known deficiencies</h2>
<h2>
Problem reports fixed</h2>
+<a href="http://dev.eclipse.org/bugs/show_bug.cgi?id=11305">#11305</a>: Can't compare a "C" file<br>
<h2>
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
index e011a507f..2530338e9 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/CompareViewerSwitchingPane.java
@@ -207,14 +207,12 @@ public abstract class CompareViewerSwitchingPane extends CompareViewerPane
boolean hadFocus= hasFocus2();
- /*
- try {
- if (fViewer != null)
- fViewer.setInput(null); // force save before switching viewer
- } catch (ViewerSwitchingCancelled ex) {
- return;
- }
- */
+// try {
+// if (fViewer != null)
+// fViewer.setInput(null); // force save before switching viewer
+// } catch (ViewerSwitchingCancelled ex) {
+// return;
+// }
fInput= input;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
index 8b173a2d6..0538bd864 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/contentmergeviewer/TextMergeViewer.java
@@ -1120,11 +1120,17 @@ public class TextMergeViewer extends ContentMergeViewer {
if (diff != null) {
switch (type) {
case 'A':
- return diff.fAncestorPos.offset;
+ if (diff.fAncestorPos != null)
+ return diff.fAncestorPos.offset;
+ break;
case 'L':
- return diff.fLeftPos.offset;
+ if (diff.fLeftPos != null)
+ return diff.fLeftPos.offset;
+ break;
case 'R':
- return diff.fRightPos.offset;
+ if (diff.fRightPos != null)
+ return diff.fRightPos.offset;
+ break;
}
}
}
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
index efd9eea57..104029ec5 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareUIPlugin.java
@@ -699,8 +699,8 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
/**
* Guesses the file type of the given input.
- * Returns ITypedElement.TEXT_TYPE if no line is longer than 1000 bytes.
- * Returns ITypedElement.UNKNOWN_TYPE if a line is longer that 1000 bytes.
+ * Returns ITypedElement.TEXT_TYPE if none of the first 10 lines is longer than 1000 bytes.
+ * Returns ITypedElement.UNKNOWN_TYPE otherwise.
* Returns <code>null</code> if the input isn't an <code>IStreamContentAccessor</code>.
*/
private static String guessType(ITypedElement input) {
@@ -712,13 +712,15 @@ public final class CompareUIPlugin extends AbstractUIPlugin {
if (is == null)
return null;
int lineLength= 0;
- while (true) {
+ int lines= 0;
+ while (lines < 10) {
int c= is.read();
if (c == -1) // EOF
break;
- if (c == '\n' || c == '\r') // reset line length
+ if (c == '\n' || c == '\r') { // reset line length
lineLength= 0;
- else
+ lines++;
+ } else
lineLength++;
if (lineLength > 1000)
return ITypedElement.UNKNOWN_TYPE;
diff --git a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties
index 83b21aa59..5e27f1ac1 100644
--- a/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties
+++ b/bundles/org.eclipse.compare/plugins/org.eclipse.compare/compare/org/eclipse/compare/internal/CompareWithEditionAction.properties
@@ -27,5 +27,6 @@ todayFormat= Today ({0})
yesterdayFormat= Yesterday ({0})
dayFormat= {0}
-closeButton.label=Done
+closeButton.label=Close
+
noLocalHistoryError= No local history available for selected resource.

Back to the top