From c79f8eb661f17f6e47a8ca9174f3bd8d98ccd70f Mon Sep 17 00:00:00 2001 From: Bogdan Gheorghe Date: Mon, 27 Jun 2005 19:13:00 +0000 Subject: [PATCH] Fix for 101903: Junit failures for RC1 --- .../org/eclipse/cdt/core/search/DOMSearchUtil.java | 3 ++- .../eclipse/cdt/internal/ui/search/CSearchPage.java | 13 ++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java index f0a9ebc4721..204293cf8c2 100644 --- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java +++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/core/search/DOMSearchUtil.java @@ -337,7 +337,8 @@ public class DOMSearchUtil { private static IASTName[] getNames(IASTTranslationUnit tu, IBinding binding, LimitTo limitTo) { IASTName[] names = null; - if (limitTo == ICSearchConstants.DECLARATIONS) { + if (limitTo == ICSearchConstants.DECLARATIONS || + limitTo == ICSearchConstants.DECLARATIONS_DEFINITIONS) { names = tu.getDeclarations(binding); } else if (limitTo == ICSearchConstants.REFERENCES) { names = tu.getReferences(binding); diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java index a787ec9c76a..84f7c625d2e 100644 --- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java +++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java @@ -513,8 +513,19 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons String text; try { text= reader.readLine(); - if (text == null) + if (text == null){ text= ""; //$NON-NLS-1$ + } else { + //The user has selected something - we don't want to "redo" too much of the selection + //but we need to ensure that it has the maximum chance of matching something in the index. + //So we need to: i) get rid of any semi-colons if there are any + + int indexSemi = text.indexOf(';'); + //Check to see if there are any semi-colons in the selected string, if there are select up to the semi colon + if (indexSemi != -1){ + text = text.substring(0, indexSemi); + } + } } catch (IOException ex) { text= ""; //$NON-NLS-1$ }