mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Bugzilla 253090.
This commit is contained in:
parent
4e2105bd6a
commit
77b28bc8d7
1 changed files with 31 additions and 5 deletions
|
@ -194,6 +194,10 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
BigInteger value;
|
BigInteger value;
|
||||||
if(element.toUpperCase().startsWith("0X")) //$NON-NLS-1$
|
if(element.toUpperCase().startsWith("0X")) //$NON-NLS-1$
|
||||||
value = new BigInteger(element.substring(2), 16);
|
value = new BigInteger(element.substring(2), 16);
|
||||||
|
else if(element.toUpperCase().startsWith("0B")) //$NON-NLS-1$
|
||||||
|
value = new BigInteger(element.substring(2), 2);
|
||||||
|
else if(element.toUpperCase().startsWith("0")) //$NON-NLS-1$
|
||||||
|
value = new BigInteger(element.substring(1), 8);
|
||||||
else
|
else
|
||||||
value = new BigInteger(element, 10);
|
value = new BigInteger(element, 10);
|
||||||
Byte b = new Byte(value.byteValue());
|
Byte b = new Byte(value.byteValue());
|
||||||
|
@ -383,12 +387,26 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
{
|
{
|
||||||
BigInteger endAddress = getEndAddress();
|
BigInteger endAddress = getEndAddress();
|
||||||
BigInteger startAddress = getStartAddress();
|
BigInteger startAddress = getStartAddress();
|
||||||
if(getSearchPhrase() != null && getSearchPhrase().getByteLength() > 0)
|
|
||||||
valid = true;
|
|
||||||
|
|
||||||
if(getReplaceData() != null && getReplaceData().length > 0)
|
/*
|
||||||
|
* The end-address must be larger that the start-address.
|
||||||
|
*/
|
||||||
|
if ( startAddress.compareTo(endAddress) == -1 ) {
|
||||||
|
/*
|
||||||
|
* Validate the search phrase.
|
||||||
|
*/
|
||||||
|
if(getSearchPhrase() != null && getSearchPhrase().getByteLength() > 0) {
|
||||||
|
valid = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Validate the replacement phrase.
|
||||||
|
*/
|
||||||
|
if(getReplaceData() != null && getReplaceData().length > 0) {
|
||||||
replaceValid = true;
|
replaceValid = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
catch(Throwable ex)
|
catch(Throwable ex)
|
||||||
{
|
{
|
||||||
// do nothing
|
// do nothing
|
||||||
|
@ -703,6 +721,7 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
|
|
||||||
public void widgetSelected(SelectionEvent e) {
|
public void widgetSelected(SelectionEvent e) {
|
||||||
fCaseInSensitiveCheckbox.setEnabled(false);
|
fCaseInSensitiveCheckbox.setEnabled(false);
|
||||||
|
validate();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
fFormatHexButton.addSelectionListener(nonAsciiListener);
|
fFormatHexButton.addSelectionListener(nonAsciiListener);
|
||||||
|
@ -1090,8 +1109,13 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
|
|
||||||
public int getByteLength()
|
public int getByteLength()
|
||||||
{
|
{
|
||||||
|
if ( fBytes != null ) {
|
||||||
return fBytes.length;
|
return fBytes.length;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public String toString()
|
public String toString()
|
||||||
{
|
{
|
||||||
|
@ -1105,6 +1129,8 @@ public class FindReplaceDialog extends SelectionDialog
|
||||||
|
|
||||||
public boolean isMatch(MemoryByte[] bytes)
|
public boolean isMatch(MemoryByte[] bytes)
|
||||||
{
|
{
|
||||||
|
if ( fBytes == null )
|
||||||
|
return false;
|
||||||
for(int i = 0; i < bytes.length; i++)
|
for(int i = 0; i < bytes.length; i++)
|
||||||
if(bytes[i].getValue() != fBytes[i])
|
if(bytes[i].getValue() != fBytes[i])
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Add table
Reference in a new issue