Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndre Weinand2004-06-03 07:44:02 -0400
committerAndre Weinand2004-06-03 07:44:02 -0400
commit3d2b269f5806a3be850247b39dc4b7914745384b (patch)
treed51286aa3fa33b3054eebef42c417358a4c902de /bundles/org.eclipse.compare/compare
parent5d40d0a53c681e3d8a813ac3589e40baa60d0998 (diff)
downloadeclipse.platform.team-3d2b269f5806a3be850247b39dc4b7914745384b.tar.gz
eclipse.platform.team-3d2b269f5806a3be850247b39dc4b7914745384b.tar.xz
eclipse.platform.team-3d2b269f5806a3be850247b39dc4b7914745384b.zip
fixed #65515
Diffstat (limited to 'bundles/org.eclipse.compare/compare')
-rw-r--r--bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java14
1 files changed, 11 insertions, 3 deletions
diff --git a/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java b/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java
index 31188a10d..9e1b4bddf 100644
--- a/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java
+++ b/bundles/org.eclipse.compare/compare/org/eclipse/compare/HistoryItem.java
@@ -15,8 +15,12 @@ import java.io.BufferedInputStream;
import org.eclipse.swt.graphics.Image;
+import org.eclipse.core.resources.IEncodedStorage;
import org.eclipse.core.resources.IFileState;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IPath;
/**
* A combination <code>IFileState</code> and <code>ITypedElement</code> that can be used as
@@ -84,9 +88,13 @@ public class HistoryItem implements IEncodedStreamContentAccessor, ITypedElement
* @see org.eclipse.compare.IEncodedStreamContentAccessor#getCharset()
*/
public String getCharset() throws CoreException {
- String charset= fFileState.getCharset();
- if (charset == null && fBase instanceof IEncodedStreamContentAccessor)
- charset= ((IEncodedStreamContentAccessor)fBase).getCharset();
+ String charset= fFileState.getCharset();
+ if (charset == null) {
+ IPath fullPath = fFileState.getFullPath();
+ IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(fullPath);
+ if (resource instanceof IEncodedStorage)
+ charset= ((IEncodedStorage)resource).getCharset();
+ }
return charset;
}
}

Back to the top