mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 17:05:26 +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;
|
||||
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
|
@ -157,7 +158,7 @@ public class EditorUtility {
|
|||
}
|
||||
|
||||
private static IEditorPart openInEditor(IFile file, boolean activate) throws PartInitException {
|
||||
if (file == null)
|
||||
if (file == null)
|
||||
return null;
|
||||
if (!file.getProject().isAccessible()) {
|
||||
closedProject(file.getProject());
|
||||
|
@ -712,7 +713,7 @@ public class EditorUtility {
|
|||
try {
|
||||
IBuffer buffer = bin.getBuffer();
|
||||
if (buffer != null) {
|
||||
store = new EFSFileStorage (bin.getLocationURI());
|
||||
store = new FileStorage (new ByteArrayInputStream(buffer.getContents().getBytes()), bin.getPath());
|
||||
}
|
||||
} catch (CModelException e) {
|
||||
// nothing;
|
||||
|
@ -720,10 +721,6 @@ public class EditorUtility {
|
|||
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
|
||||
* C project exists.
|
||||
|
|
Loading…
Add table
Reference in a new issue