Skip to main content
summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorJohn Camelon2003-10-01 17:33:23 -0400
committerJohn Camelon2003-10-01 17:33:23 -0400
commit77fbc604e7f8a8c6569e31c12b04c4e4fc7b7bf3 (patch)
treededa597bde42ba8fb71d9a87064ab84cd9fa836e /core
parente63b06fc5fb272921fc03697c3b8acb14d3f7283 (diff)
downloadorg.eclipse.cdt-77fbc604e7f8a8c6569e31c12b04c4e4fc7b7bf3.tar.gz
org.eclipse.cdt-77fbc604e7f8a8c6569e31c12b04c4e4fc7b7bf3.tar.xz
org.eclipse.cdt-77fbc604e7f8a8c6569e31c12b04c4e4fc7b7bf3.zip
Patch for Andrew Niefer
core: - fix bug 44026 by checking scope before reporting match in MatchLocator.report ui: -bug44032 - deleting/moving files breaks search * modified src/org/eclipse/cdt/ui/CSearchResultLabelProvider getText to return empty string instead of null -bug43130 - Selected resources is disabled but selected * src/org/eclipse/cdt/internal/ui/search/CSearchPage
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.core/search/ChangeLog3
-rw-r--r--core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java4
-rw-r--r--core/org.eclipse.cdt.ui/ChangeLog6
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java11
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java6
5 files changed, 23 insertions, 7 deletions
diff --git a/core/org.eclipse.cdt.core/search/ChangeLog b/core/org.eclipse.cdt.core/search/ChangeLog
index 0bb6106106..162118f66b 100644
--- a/core/org.eclipse.cdt.core/search/ChangeLog
+++ b/core/org.eclipse.cdt.core/search/ChangeLog
@@ -1,4 +1,7 @@
2003-10-01 Andrew Niefer
+ - fix bug 44026 by checking scope before reporting match in MatchLocator.report
+
+2003-10-01 Andrew Niefer
- fix BasicSearchMatch.equals() for bug43988
2003-09-30 Bogdan Gheorghe
diff --git a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
index 6a2a25bebb..9da2c6e629 100644
--- a/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
+++ b/core/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
@@ -441,6 +441,10 @@ public class MatchLocator implements ISourceElementRequestor, ICSearchConstants
protected void report( ISourceElementCallbackDelegate node, int accuracyLevel ){
try {
+ if( currentResource != null && !searchScope.encloses(currentResource.getFullPath().toOSString() ) ){
+ return;
+ }
+
int offset = 0;
int end = 0;
diff --git a/core/org.eclipse.cdt.ui/ChangeLog b/core/org.eclipse.cdt.ui/ChangeLog
index dcaa9014f3..3fc6d6b8be 100644
--- a/core/org.eclipse.cdt.ui/ChangeLog
+++ b/core/org.eclipse.cdt.ui/ChangeLog
@@ -1,3 +1,9 @@
+2003-10-01 Andrew Niefer
+ -bug44032 - deleting/moving files breaks search
+ * modified src/org/eclipse/cdt/ui/CSearchResultLabelProvider getText to return empty string instead of null
+ -bug43130 - Selected resources is disabled but selected
+ * src/org/eclipse/cdt/internal/ui/search/CSearchPage
+
2003-10-01 Alain Magloire
Fix PR 44013, not defining a resource.
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 18e9215f50..dc302f910d 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
@@ -86,14 +86,17 @@ public class CSearchPage extends DialogPage implements ISearchPage, ICSearchCons
String scopeDescription = ""; //$NON-NLS-1$
switch( getContainer().getSelectedScope() ) {
+ case ISearchPageContainer.SELECTION_SCOPE:
+ if( fStructuredSelection != null && fStructuredSelection.iterator().hasNext() ){
+ scopeDescription = CSearchMessages.getString("SelectionScope"); //$NON-NLS-1$
+ scope = CSearchScopeFactory.getInstance().createCSearchScope(fStructuredSelection);
+ break;
+ }
+ /* else fall through to workspace scope */
case ISearchPageContainer.WORKSPACE_SCOPE:
scopeDescription = CSearchMessages.getString("WorkspaceScope"); //$NON-NLS-1$
scope = SearchEngine.createWorkspaceScope();
break;
- case ISearchPageContainer.SELECTION_SCOPE:
- scopeDescription = CSearchMessages.getString("SelectionScope"); //$NON-NLS-1$
- scope = CSearchScopeFactory.getInstance().createCSearchScope(fStructuredSelection);
- break;
case ISearchPageContainer.WORKING_SET_SCOPE:
IWorkingSet[] workingSets= getContainer().getSelectedWorkingSets();
// should not happen - just to be sure
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java
index 967095c6f0..9d936faeac 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java
@@ -120,18 +120,18 @@ public class CSearchResultLabelProvider extends LabelProvider {
try {
match = (IMatch) marker.getAttribute(CSearchResultCollector.IMATCH);
} catch (CoreException e) {
- return null;
+ return "";
}
} else if( element instanceof IMatch ){
match = (IMatch) element;
}
if( match == null )
- return null;
+ return "";
IResource resource = match.getResource();
- String result = null;
+ String result = "";
String path = (resource != null ) ? resource.getFullPath().toString() : "";
switch( getOrder() ){

Back to the top