From 1d60889ad37f14a1b6e1a7058fc268d6571d5104 Mon Sep 17 00:00:00 2001 From: Chris Wiebe Date: Fri, 27 Aug 2004 23:42:22 +0000 Subject: [PATCH] fix call to PathUtil.makeRelativePath() --- .../cdt/internal/ui/editor/AddIncludeOnSelectionAction.java | 2 +- .../src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java index 7b862713b65..ce48fc4470a 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/editor/AddIncludeOnSelectionAction.java @@ -414,7 +414,7 @@ public class AddIncludeOnSelectionAction extends Action implements IUpdate { isSystemIncludePath = true; } else if (projectLocation.isPrefixOf(typeLocation) && projectLocation.isPrefixOf(headerLocation)) { - includePath = PathUtil.makeRelativePath(typeLocation, headerLocation); + includePath = PathUtil.makeRelativePath(typeLocation, headerLocation.removeLastSegments(1)); } if (includePath == null) includePath = typeLocation; diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java index 28d6d26c4de..826e08fc59e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassWizardPage.java @@ -926,7 +926,7 @@ public class NewClassWizardPage extends WizardPage implements Listener { systemIncludePath = true; } else { if (projectPath.isPrefixOf(location.getPath()) && projectPath.isPrefixOf(header.getPath())) - relativePath = location.getRelativePath(header.getPath()); + relativePath = location.getRelativePath(header.getPath().removeLastSegments(1)); } baseClassFileName = relativePath.toString(); }