Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-patch] bugs 44032, 43130, 44026

fix 44032 - deleting/moving file breaks search
 - return empty string instead of null in 
CSearchResultLabelProvider.getText
partial fix for 43130 - Selected resource is disabled but selected
 - depends on eclipse framework bug, but workaround is to default back to 
workspace scope if this happens
fix 44026 - Working set scope allows matches outside scope
 - check matches before reporting them

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

no new tests, this is all involves the UI,
but suite tests run on windows & linux

-Andrew

Index: search/ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/ChangeLog,v
retrieving revision 1.36
diff -u -r1.36 ChangeLog
--- search/ChangeLog	1 Oct 2003 19:55:00 -0000	1.36
+++ search/ChangeLog	1 Oct 2003 21:09:55 -0000
@@ -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
Index: search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.core/search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java,v
retrieving revision 1.35
diff -u -r1.35 MatchLocator.java
--- search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java	30 Sep 2003 13:42:39 -0000	1.35
+++ search/org/eclipse/cdt/internal/core/search/matching/MatchLocator.java	1 Oct 2003 21:09:55 -0000
@@ -441,6 +441,10 @@
 	
 	protected void report( ISourceElementCallbackDelegate node, int accuracyLevel ){
 		try {
+			if( currentResource != null && !searchScope.encloses(currentResource.getFullPath().toOSString() ) ){
+				return;
+			}
+			
 			int offset = 0;
 			int end = 0;
 			
Index: ChangeLog
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/ChangeLog,v
retrieving revision 1.202
diff -u -r1.202 ChangeLog
--- ChangeLog	1 Oct 2003 20:27:22 -0000	1.202
+++ ChangeLog	1 Oct 2003 21:08:31 -0000
@@ -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.
Index: src/org/eclipse/cdt/internal/ui/search/CSearchPage.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/search/CSearchPage.java,v
retrieving revision 1.11
diff -u -r1.11 CSearchPage.java
--- src/org/eclipse/cdt/internal/ui/search/CSearchPage.java	26 Sep 2003 14:58:08 -0000	1.11
+++ src/org/eclipse/cdt/internal/ui/search/CSearchPage.java	1 Oct 2003 21:08:32 -0000
@@ -86,13 +86,16 @@
 		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();
Index: src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java
===================================================================
RCS file: /home/tools/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java,v
retrieving revision 1.5
diff -u -r1.5 CSearchResultLabelProvider.java
--- src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java	15 Sep 2003 17:31:28 -0000	1.5
+++ src/org/eclipse/cdt/ui/CSearchResultLabelProvider.java	1 Oct 2003 21:08:32 -0000
@@ -120,18 +120,18 @@
 			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