mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-09 17:25:38 +02:00
Fix regression of bug 217727
This commit is contained in:
parent
477fe21a13
commit
c14f495a34
1 changed files with 3 additions and 6 deletions
|
@ -14,6 +14,7 @@
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.internal.ui.util;
|
package org.eclipse.cdt.internal.ui.util;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.URI;
|
import java.net.URI;
|
||||||
|
@ -157,7 +158,7 @@ public class EditorUtility {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static IEditorPart openInEditor(IFile file, boolean activate) throws PartInitException {
|
private static IEditorPart openInEditor(IFile file, boolean activate) throws PartInitException {
|
||||||
if (file == null)
|
if (file == null)
|
||||||
return null;
|
return null;
|
||||||
if (!file.getProject().isAccessible()) {
|
if (!file.getProject().isAccessible()) {
|
||||||
closedProject(file.getProject());
|
closedProject(file.getProject());
|
||||||
|
@ -712,7 +713,7 @@ public class EditorUtility {
|
||||||
try {
|
try {
|
||||||
IBuffer buffer = bin.getBuffer();
|
IBuffer buffer = bin.getBuffer();
|
||||||
if (buffer != null) {
|
if (buffer != null) {
|
||||||
store = new EFSFileStorage (bin.getLocationURI());
|
store = new FileStorage (new ByteArrayInputStream(buffer.getContents().getBytes()), bin.getPath());
|
||||||
}
|
}
|
||||||
} catch (CModelException e) {
|
} catch (CModelException e) {
|
||||||
// nothing;
|
// nothing;
|
||||||
|
@ -720,10 +721,6 @@ public class EditorUtility {
|
||||||
return store;
|
return store;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static IStorage getStorage(ITranslationUnit tu) {
|
|
||||||
return new EFSFileStorage (tu.getLocationURI());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the C project for a given editor input or <code>null</code> if no corresponding
|
* Returns the C project for a given editor input or <code>null</code> if no corresponding
|
||||||
* C project exists.
|
* C project exists.
|
||||||
|
|
Loading…
Add table
Reference in a new issue