Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 59799 Details for
Bug 171124
Find function doesn't work properly in AGR macro editor
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
Second version of the patch
171124_patch-v2.txt (text/plain), 5.03 KB, created by
amehrega
on 2007-02-26 11:28:46 EST
(
hide
)
Description:
Second version of the patch
Filename:
MIME Type:
Creator:
amehrega
Created:
2007-02-26 11:28:46 EST
Size:
5.03 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.tptp.test.auto.gui >Index: src/org/eclipse/tptp/test/auto/gui/internal/editor/AutoGUITestCasesForm.java >=================================================================== >RCS file: /cvsroot/tptp/test/org.eclipse.tptp.test.auto.gui/src/org/eclipse/tptp/test/auto/gui/internal/editor/AutoGUITestCasesForm.java,v >retrieving revision 1.15 >diff -u -r1.15 AutoGUITestCasesForm.java >--- src/org/eclipse/tptp/test/auto/gui/internal/editor/AutoGUITestCasesForm.java 30 Jan 2007 16:15:52 -0000 1.15 >+++ src/org/eclipse/tptp/test/auto/gui/internal/editor/AutoGUITestCasesForm.java 26 Feb 2007 16:23:04 -0000 >@@ -1598,41 +1598,79 @@ > char[] findStringChar = findString.toCharArray(); > int firstCharacterInx = -1; > char currentCharacter; >+ > >- for (int i = 0, macroLength = macro.length(); i < macroLength; i++) >- { >- currentCharacter = macro.charAt(i); >- if ((currentCharacter == findStringChar[0] || >- (!caseSensitive && (currentCharacter <= 90 ? currentCharacter + 32 == findStringChar[0] : currentCharacter - 32 == findStringChar[0]))) && >- (wholeWord ? macro.charAt(i - 1) == 32 && macro.charAt(i + findStringChar.length) == 32 : true)) >+ if(searchForward) >+ { >+ for (int i = 0, macroLength = macro.length(); i < macroLength; i++) > { >- firstCharacterInx = i; >+ currentCharacter = macro.charAt(i); >+ firstCharacterInx = findFirstCharInx(currentCharacter, i, macro, findStringChar, searchForward, caseSensitive, wholeWord); >+ firstCharacterInx = findSuccessiveCharacters(firstCharacterInx, findStringChar, macroLength, macro, i, 0, currentCharacter, searchForward, caseSensitive); >+ >+ if (firstCharacterInx != -1) >+ { >+ widgetOffset = widgetOffset < 0 ? 0 : widgetOffset; >+ input.setSelection( i + widgetOffset, i + findStringChar.length + widgetOffset ); >+ return i; >+ } > } >+ } >+ >+ else{ >+ // searching backward requires a different search (need to go match last character first and traversal is already based on widgetOffset >+ // added for defect 171124 Liz D. > >- for (int j = 1; firstCharacterInx != -1 && j < findStringChar.length; j++) >+ for (int k = macro.length()-1, macroLength = macro.length(); k > 0; k--) > { >- if (i + j >= macroLength) >+ currentCharacter = macro.charAt(k); >+ int lastChar = findStringChar.length-1; >+ firstCharacterInx = findFirstCharInx(currentCharacter, k, macro, findStringChar, searchForward, caseSensitive, wholeWord); >+ firstCharacterInx = findSuccessiveCharacters(firstCharacterInx, findStringChar, macroLength, macro, k, lastChar, currentCharacter, searchForward, caseSensitive); >+ >+ if (firstCharacterInx != -1) > { >- firstCharacterInx = -1; >- break; >- } >- currentCharacter = macro.charAt(i + j); >- if (currentCharacter != findStringChar[j] && >- (caseSensitive ? true : (currentCharacter <= 90 ? currentCharacter + 32 != findStringChar[j] : currentCharacter - 32 != findStringChar[j]))) >- { >- firstCharacterInx = -1; >- break; >+ k++; >+ input.setSelection(k , k - findStringChar.length ); >+ return k; > } > } >- >- if (firstCharacterInx != -1) >+ } >+ >+ >+ return -1; >+ } >+ >+ private int findSuccessiveCharacters(int firstCharacterInx, char[] findStringChar, int macroLength, String macro, int macroInx, int lastChar, char currentCharacter, boolean searchForward, boolean caseSensitive) >+ { >+ for (int j = 1; firstCharacterInx != -1 && j < findStringChar.length; j++) >+ { >+ if ((searchForward ? macroInx + j : macroInx - j) >= macroLength) >+ { >+ firstCharacterInx = -1; >+ break; >+ } >+ currentCharacter = macro.charAt((searchForward ? macroInx + j : macroInx - j)); >+ if (currentCharacter != findStringChar[searchForward ? j : lastChar - j] && >+ (caseSensitive ? true : (currentCharacter <= 90 ? currentCharacter + 32 != findStringChar[searchForward ? j : lastChar - j] : currentCharacter - 32 != findStringChar[searchForward ? j : lastChar - j]))) > { >- widgetOffset = widgetOffset < 0 ? 0 : widgetOffset; >- input.setSelection(searchForward ? i + widgetOffset: i - widgetOffset, searchForward ? i + findStringChar.length + widgetOffset : i + findStringChar.length - widgetOffset); >- return i; >+ firstCharacterInx = -1; >+ break; > } > } > >+ return firstCharacterInx; >+ } >+ >+ private int findFirstCharInx(char currentCharacter, int i, String macro, char[] findStringChar, boolean searchForward, boolean caseSensitive, boolean wholeWord) >+ { >+ if ((currentCharacter == findStringChar[searchForward ? 0 : findStringChar.length-1] || >+ (!caseSensitive && (currentCharacter <= 90 ? currentCharacter + 32 == findStringChar[0] : currentCharacter - 32 == findStringChar[0]))) && >+ (wholeWord ? macro.charAt(i - 1) == 32 && macro.charAt(i + findStringChar.length) == 32 : true)) >+ { >+ return i; >+ } >+ > return -1; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 171124
:
58366
| 59799