From 74c63e682bff8cc4131eee38163cc5a8e930c935 Mon Sep 17 00:00:00 2001 From: Alain Magloire Date: Mon, 7 Jun 2004 20:54:06 +0000 Subject: [PATCH] Check the BaseRef when saving --- .../internal/core/model/PathEntryManager.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java index 659bc176c67..dccb52d3107 100644 --- a/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java +++ b/core/org.eclipse.cdt.core/model/org/eclipse/cdt/internal/core/model/PathEntryManager.java @@ -635,8 +635,13 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange switch(kind) { case IPathEntry.CDT_INCLUDE: { IIncludeEntry include = (IIncludeEntry)entries[i]; - entry = CoreModel.newIncludeEntry(resourcePath, include.getBasePath(), include.getIncludePath(), - include.isSystemInclude(), include.getExclusionPatterns(), include.isExported()); + IPath baseRef = include.getBaseReference(); + if (baseRef == null || baseRef.isEmpty()) { + entry = CoreModel.newIncludeEntry(resourcePath, include.getBasePath(), include.getIncludePath(), + include.isSystemInclude(), include.getExclusionPatterns(), include.isExported()); + } else { + entry = CoreModel.newIncludeRefEntry(resourcePath, baseRef, include.getIncludePath()); + } break; } case IPathEntry.CDT_LIBRARY: { @@ -651,15 +656,25 @@ public class PathEntryManager implements IPathEntryStoreListener, IElementChange } } } - entry = CoreModel.newLibraryEntry(resourcePath, library.getBasePath(), - library.getLibraryPath(), sourcePath, library.getSourceAttachmentRootPath(), - library.getSourceAttachmentPrefixMapping(), library.isExported()); + IPath baseRef = library.getBaseReference(); + if (baseRef == null || baseRef.isEmpty()) { + entry = CoreModel.newLibraryEntry(resourcePath, library.getBasePath(), + library.getLibraryPath(), sourcePath, library.getSourceAttachmentRootPath(), + library.getSourceAttachmentPrefixMapping(), library.isExported()); + } else { + entry = CoreModel.newLibraryRefEntry(resourcePath, baseRef, library.getLibraryPath()); + } break; } case IPathEntry.CDT_MACRO: { IMacroEntry macro = (IMacroEntry)entries[i]; - entry = CoreModel.newMacroEntry(resourcePath, macro.getMacroName(), macro.getMacroValue(), - macro.getExclusionPatterns(), macro.isExported()); + IPath baseRef = macro.getBaseReference(); + if (baseRef == null || baseRef.isEmpty()) { + entry = CoreModel.newMacroEntry(resourcePath, macro.getMacroName(), macro.getMacroValue(), + macro.getExclusionPatterns(), macro.isExported()); + } else { + entry = CoreModel.newMacroRefEntry(resourcePath, baseRef, macro.getMacroName()); + } break; } case IPathEntry.CDT_OUTPUT: {