Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Aeschlimann2008-05-14 10:47:50 +0000
committerMartin Aeschlimann2008-05-14 10:47:50 +0000
commit41511097d7d44af85cd3dd8e0ce2fc7051869e0a (patch)
treee184b6eab90daad239b68adca895329f7780bc51
parent077b28876ccd0a8866990c07734f3699707c426c (diff)
downloadeclipse.platform.text-41511097d7d44af85cd3dd8e0ce2fc7051869e0a.tar.gz
eclipse.platform.text-41511097d7d44af85cd3dd8e0ce2fc7051869e0a.tar.xz
eclipse.platform.text-41511097d7d44af85cd3dd8e0ce2fc7051869e0a.zip
155782 History limit dialog behaves strange when preference is > 100
-rw-r--r--org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchHistorySelectionDialog.java4
-rw-r--r--org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java8
2 files changed, 9 insertions, 3 deletions
diff --git a/org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchHistorySelectionDialog.java b/org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchHistorySelectionDialog.java
index 753d745015b..e13ddb5ccae 100644
--- a/org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchHistorySelectionDialog.java
+++ b/org.eclipse.search/new search/org/eclipse/search2/internal/ui/SearchHistorySelectionDialog.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -160,7 +160,7 @@ public class SearchHistorySelectionDialog extends SelectionDialog {
try {
String historySize= fHistorySizeTextField.getText();
int size= Integer.parseInt(historySize);
- if (size < 1) {
+ if (size < 1 || size >= 100) {
status= new Status(IStatus.ERROR, SearchPlugin.getID(), IStatus.ERROR, SearchMessages.SearchHistorySelectionDialog_history_size_error, null);
} else {
fHistorySize= size;
diff --git a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
index 5c3afc727e8..0a66973fcea 100644
--- a/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
+++ b/org.eclipse.search/search/org/eclipse/search/internal/ui/SearchPreferencePage.java
@@ -241,7 +241,13 @@ public class SearchPreferencePage extends FieldEditorPreferencePage implements I
public static int getHistoryLimit() {
IPreferenceStore store= SearchPlugin.getDefault().getPreferenceStore();
- return store.getInt(LIMIT_HISTORY);
+ int limit= store.getInt(LIMIT_HISTORY);
+ if (limit < 1) {
+ limit= 1;
+ } else if (limit >= 100) {
+ limit= 99;
+ }
+ return limit;
}
}

Back to the top