fix for bug 56714
diff --git a/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java b/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
index 221dd24..29d5657 100644
--- a/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
+++ b/org.eclipse.search/new search/org/eclipse/search/ui/text/AbstractTextSearchViewPage.java
@@ -119,10 +119,7 @@
 	 */
 	protected AbstractTextSearchViewPage(int supportedLayouts) {
 		fSupportedLayouts= supportedLayouts;
-		if (supportsFlatLayout())
-			fCurrentLayout= FLAG_LAYOUT_FLAT;
-		else 
-			fCurrentLayout= FLAG_LAYOUT_TREE;
+		initLayout();
 		
 		fRemoveAllResultsAction= new RemoveAllResultsAction(this);
 		fRemoveResultsAction= new RemoveMatchAction(this);
@@ -141,6 +138,17 @@
 	
 	
 	/**
+	 * 
+	 */
+	private void initLayout() {
+		if (supportsFlatLayout())
+			fCurrentLayout= FLAG_LAYOUT_FLAT;
+		else 
+			fCurrentLayout= FLAG_LAYOUT_TREE;
+	}
+
+
+	/**
 	 * Constructs this page with the default layout flags.
 	 * @see #AbstractTextSearchViewPage(int)
 	 */
@@ -742,6 +750,9 @@
 		if (countBits(fSupportedLayouts) > 1) {
 			try {
 				fCurrentLayout= getSettings().getInt(KEY_LAYOUT);
+				// workaround because the saved value may be 0
+				if (fCurrentLayout == 0)
+					initLayout();
 			} catch (NumberFormatException e) {
 				// ignore, signals no value stored.
 			}
@@ -749,6 +760,9 @@
 				Integer layout= memento.getInteger(KEY_LAYOUT);
 				if (layout != null) {
 					fCurrentLayout= layout.intValue();
+					// workaround because the saved value may be 0
+					if (fCurrentLayout == 0)
+						initLayout();
 				} 
 			}
 		}