Index: TXM/trunk/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java
===================================================================
--- TXM/trunk/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java	(revision 3391)
+++ TXM/trunk/org.txm.properties.core/src/org/txm/properties/core/functions/CorpusPropertiesComputer.java	(revision 3392)
@@ -152,8 +152,8 @@
 		int s = Math.min(props.pMaxPropertiesToDisplay, numberOfWords);
 		int[] positions = new int[s];
 		int n = 0;
-		List<Match> matches = result.getMatches();
-		for (Match m : matches) {
+		List<? extends org.txm.objects.Match> matches = result.getMatches();
+		for (org.txm.objects.Match m : matches) {
 			if (n >= s) break;
 			for (int i = m.getStart(); i < m.getEnd(); i++) {
 				if (n >= s) break;
Index: TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java
===================================================================
--- TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java	(revision 3391)
+++ TXM/trunk/org.txm.connlu.core/src/org/txm/conllu/core/function/UDSearch.java	(revision 3392)
@@ -60,8 +60,8 @@
 			//File file = File.createTempFile("txm", ".svg", new File(Toolbox.getTxmHomePath(), "results"));
 			
 			Match match = this.matches.getMatches().get(sent);
-			Match sentence = null;
-			for (Match s : udSentences.getMatches()) {
+			org.txm.objects.Match sentence = null;
+			for (org.txm.objects.Match s : udSentences.getMatches()) {
 				if (s.getStart() <= match.getStart() && match.getEnd() <= s.getEnd()) {
 					sentence = s;
 					break;
@@ -294,7 +294,7 @@
 		WordProperty pid = corpus.getProperty("id");
 		StructuralUnitProperty ptextid = corpus.getStructuralUnitProperty("text_id");
 		
-		Match match = this.udSentences.getMatches().get(this.index);
+		org.txm.objects.Match match = this.udSentences.getMatches().get(this.index);
 		int[] positions = new int[match.size()];
 		for (int i = 0 ; i < match.size() ; i++) {
 			positions[i] = match.getStart() + i;
Index: TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java
===================================================================
--- TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java	(revision 3391)
+++ TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesTableLabelProvider.java	(revision 3392)
@@ -30,7 +30,6 @@
 import org.eclipse.jface.viewers.ITableLabelProvider;
 import org.eclipse.jface.viewers.LabelProvider;
 import org.eclipse.swt.graphics.Image;
-import org.txm.core.preferences.TXMPreferences;
 import org.txm.searchengine.cqp.corpus.Subcorpus;
 import org.txm.specificities.core.preferences.SpecificitiesPreferences;
 
Index: TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java
===================================================================
--- TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java	(revision 3391)
+++ TXM/trunk/org.txm.specificities.rcp/src/org/txm/specificities/rcp/editors/SpecificitiesEditor.java	(revision 3392)
@@ -155,7 +155,8 @@
 			GLComposite resultArea = this.getResultArea();
 			
 			// create table viewer
-			viewer = new TableViewer(resultArea, SWT.VIRTUAL | SWT.MULTI | SWT.FULL_SELECTION);
+			viewer = new TableViewer(resultArea, SWT.VIRTUAL);
+			viewer.setUseHashlookup(false);
 			viewer.getTable().addKeyListener(new TableKeyListener(viewer));
 			viewer.getTable().setLinesVisible(true);
 			viewer.getTable().setHeaderVisible(true);
Index: TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java
===================================================================
--- TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 3391)
+++ TXM/trunk/org.txm.cooccurrence.core/src/org/txm/cooccurrence/core/functions/Cooccurrence.java	(revision 3392)
@@ -53,6 +53,7 @@
 import org.txm.core.results.TXMResult;
 import org.txm.index.core.functions.Index;
 import org.txm.lexicaltable.core.statsengine.r.data.LexicalTableImpl;
+import org.txm.searchengine.core.QueryBasedTXMResult;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.UnexpectedAnswerException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -78,7 +79,7 @@
  * @author mdecorde
  * 
  */
-public class Cooccurrence extends TXMResult {
+public class Cooccurrence extends QueryBasedTXMResult {
 
 	boolean debug = false;
 	
Index: TXM/trunk/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Train.java
===================================================================
--- TXM/trunk/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Train.java	(revision 3391)
+++ TXM/trunk/org.txm.treetagger.rcp/src/org/txm/treetagger/rcp/handlers/Train.java	(revision 3392)
@@ -232,7 +232,7 @@
 					LinkedHashSet<Integer> positions = new LinkedHashSet<Integer>();
 					Property word = corpus.getProperty("word");
 					AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-					for (Match m : corpus.getMatches()) {
+					for (org.txm.objects.Match m : corpus.getMatches()) {
 						for (int i = m.getStart(); i <= m.getEnd(); i++) { // end match must be included
 							positions.add(i);
 							
Index: TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java
===================================================================
--- TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java	(revision 3391)
+++ TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/function/tigersearch/TSIndex.java	(revision 3392)
@@ -342,12 +342,12 @@
 		
 		// one word per match ! the word is inside one of the CQP (sub-)Corpus matches
 		List<Match> finalMatches = new ArrayList<>();
-		List<Match> corpusMatches = corp.getMatches();
+		List<? extends org.txm.objects.Match> corpusMatches = corp.getMatches();
 		int iCorpusStart = 0;
 		for (int iMatch = 0; iMatch < matches.size(); iMatch++) {
 			Match m1 = matches.get(iMatch);
 			for (int iCorpus = iCorpusStart; iCorpus < corpusMatches.size(); iCorpus++) {
-				Match m2 = corpusMatches.get(iCorpus);
+				org.txm.objects.Match m2 = corpusMatches.get(iCorpus);
 				if (m2.getStart() <= m1.getStart() && m1.getEnd() <= m2.getEnd()) {
 					finalMatches.add(m1);
 					iCorpusStart = iCorpus; // optimizing ! \o/
Index: TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java
===================================================================
--- TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java	(revision 3391)
+++ TXM/trunk/org.txm.tigersearch.rcp/src/org/txm/searchengine/ts/TIGERSearchEngine.java	(revision 3392)
@@ -100,7 +100,7 @@
 	 * @throws CqiClientException
 	 */
 	public static int[] getSentMinMax(CQPCorpus cqpCorpus) throws UnexpectedAnswerException, IOException, CqiServerError, CqiClientException {
-		List<org.txm.searchengine.cqp.corpus.query.Match> matches = cqpCorpus.getMatches();
+		List<? extends org.txm.objects.Match> matches = cqpCorpus.getMatches();
 		if (matches.size() == 0) {
 			return new int[] { 0, 0 };
 		}
@@ -120,7 +120,7 @@
 	 */
 	public static int[] getSentMinMax(CQPCorpus cqpCorpus, int start, int end) throws UnexpectedAnswerException, IOException, CqiServerError, CqiClientException {
 		AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-		List<org.txm.searchengine.cqp.corpus.query.Match> matches = cqpCorpus.getMatches();
+		List<? extends org.txm.objects.Match> matches = cqpCorpus.getMatches();
 		if (matches.size() == 0) {
 			return new int[] { 0, 0 };
 		}
@@ -176,7 +176,7 @@
 		else {
 			CQPCorpus cqpCorpus = (CQPCorpus) corpus;
 			AbstractCqiClient CQI = CQPSearchEngine.getCqiClient();
-			List<org.txm.searchengine.cqp.corpus.query.Match> matches = cqpCorpus.getMatches();
+			List<? extends Match> matches = cqpCorpus.getMatches();
 			if (matches.size() == 0) {
 				return new EmptySelection(query);
 			}
Index: TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java
===================================================================
--- TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 3391)
+++ TXM/trunk/org.txm.index.rcp/src/org/txm/index/rcp/handlers/SendIndexTo.java	(revision 3392)
@@ -88,18 +88,24 @@
 			
 			CQPCorpus subcorpus = null;
 			try {
-				for (Subcorpus c : corpus.getChildren(Subcorpus.class)) {
+				for (Subcorpus c : index.getChildren(Subcorpus.class)) {
 					if (c.getQuery().equals(cqlQuery) && !c.isAltered()) {
 						subcorpus = c;
 						break;
 					}
 				}
 				if (subcorpus == null) {
-					subcorpus = corpus.createSubcorpus(cqlQuery, cqlQuery.getQueryString());
-					subcorpus.setVisible(true);
+					//subcorpus = corpus.createSubcorpus(cqlQuery, cqlQuery.getQueryString());
+					subcorpus = new Subcorpus(index) {
+						public boolean isInternalPersistable() {
+							return false; // disable the internal persistable state of the Subcorpus
+						}
+					};
+					subcorpus.setVisible(false);
+					subcorpus.compute(false);
 				}
 			}
-			catch (CqiClientException e) {
+			catch (Exception e) {
 				Log.printStackTrace(e);
 				return null;
 			}
Index: TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java
===================================================================
--- TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java	(revision 3391)
+++ TXM/trunk/org.txm.edition.rcp/src/org/txm/edition/rcp/handlers/BackToText.java	(revision 3392)
@@ -53,7 +53,6 @@
 import org.txm.objects.Text;
 import org.txm.rcp.StatusLine;
 import org.txm.rcp.utils.SWTEditorsUtils;
-import org.txm.searchengine.core.SearchEngine;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -157,13 +156,13 @@
 		}
 		
 		SynopticEditionEditor editor = null;
-		boolean newEditor = false;
+		//boolean newEditor = false;
 		if (ieditor != null && ieditor instanceof SynopticEditionEditor) {
 			editor = (SynopticEditionEditor) ieditor;
 		}
 		else {
 			editor = OpenEdition.openEdition(corpus, editions);
-			newEditor = true;
+			//newEditor = true;
 		}
 		
 		Text text = null;
@@ -201,7 +200,7 @@
 	public boolean backToText(ConcordanceEditor editor, Match match) {
 		Concordance conc = editor.getConcordance();
 		CQPCorpus corpus = editor.getCorpus();
-		SearchEngine se = conc.getQuery().getSearchEngine();
+		//SearchEngine se = conc.getQuery().getSearchEngine();
 		
 		try {
 			if (match == null) return false;
Index: TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 3391)
+++ TXM/trunk/org.txm.core/src/java/org/txm/core/preferences/TXMPreferences.java	(revision 3392)
@@ -196,7 +196,7 @@
 	
 	
 	/**
-	 * Number of lines to display per page.
+	 * Number of lines to display per result page.
 	 */
 	public static final String N_LINES_PER_PAGE = "n_lines_per_page"; //$NON-NLS-1$
 	
@@ -228,6 +228,7 @@
 	
 	public static final String PERSITABLE = "persistable";
 
+	public static final String INTERNAL_PERSITABLE = "internal_persistable";
 	
 	/**
 	 * Preferences node qualifier of the instance.
@@ -1724,8 +1725,7 @@
 			ClassNotFoundException {
 		
 		byte[] data = Base64.getDecoder().decode(s);
-		ObjectInputStream ois = new ObjectInputStream(
-				new ByteArrayInputStream(data));
+		ObjectInputStream ois = new ObjectInputStream(new ByteArrayInputStream(data));
 		Object o = ois.readObject();
 		ois.close();
 		return (Serializable) o;
Index: TXM/trunk/org.txm.core/src/java/org/txm/core/results/TXMResult.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 3391)
+++ TXM/trunk/org.txm.core/src/java/org/txm/core/results/TXMResult.java	(revision 3392)
@@ -320,7 +320,7 @@
 			}
 		}
 		catch (Exception e) {
-			Log.severe("Fail to load " + parametersNodePath + "result: " + e); //$NON-NLS-1$ //$NON-NLS-2$
+			Log.severe("Fail to load the " + parametersNodePath + " result: " + e); //$NON-NLS-1$ //$NON-NLS-2$
 			Log.printStackTrace(e);
 		}
 		
@@ -1071,7 +1071,11 @@
 		Log.finest("TXMResult.autoSaveParametersFromAnnotations(): " + this.getClass().getSimpleName() + ": saving parameters to local node...");
 		
 		// internal data to save for unserialization
-		this.saveParameter(TXMPreferences.CLASS, this.getClass().getName());
+		if (this.getClass().isAnonymousClass()) {
+			this.saveParameter(TXMPreferences.CLASS, this.getClass().getSuperclass().getName()); // avoid bug later if an anonymous class has been used.
+		} else {
+			this.saveParameter(TXMPreferences.CLASS, this.getClass().getName());
+		}
 		this.saveParameter(TXMPreferences.RESULT_PARAMETERS_NODE_PATH, this.parametersNodePath);
 		this.saveParameter(TXMPreferences.BUNDLE_ID, FrameworkUtil.getBundle(getClass()).getSymbolicName());
 		
Index: TXM/trunk/org.txm.core/src/java/org/txm/objects/CorpusBuild.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 3391)
+++ TXM/trunk/org.txm.core/src/java/org/txm/objects/CorpusBuild.java	(revision 3392)
@@ -188,6 +188,11 @@
 		super(parametersNodePath);
 	}
 	
+	public CorpusBuild(TXMResult result) {
+		
+		super(result);
+	}
+
 	public String getID() {
 		return pID;
 	}
Index: TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java
===================================================================
--- TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java	(revision 3391)
+++ TXM/trunk/org.txm.core/src/java/org/txm/objects/Project.java	(revision 3392)
@@ -509,7 +509,7 @@
 			try {
 				Preferences node = TXMPreferences.preferencesRootNode.node(resultNodePath);
 				
-				String className = node.get("class", ""); //$NON-NLS-1$ //$NON-NLS-2$
+				String className = node.get(TXMPreferences.CLASS, ""); //$NON-NLS-1$ //$NON-NLS-2$
 				
 				// Skip Project object
 				if (Project.class.getName().equals(className)) { // already loaded in loadProjectFromProjectScope
@@ -1505,7 +1505,7 @@
 				
 				// Log.finest("Toolbox.initialize(): checking result type linked to node path " + parametersNodePath);
 				Preferences node = TXMPreferences.preferencesRootNode.node(parametersNodePath);
-				String className = node.get("class", ""); //$NON-NLS-1$
+				String className = node.get(TXMPreferences.CLASS, ""); //$NON-NLS-1$
 				
 				if (className == null || className.length() == 0) {
 					Log.warning(NLS.bind("Warning: can not restore object with no class name set with path={0}.", parametersNodePath)); //$NON-NLS-1$
Index: TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java
===================================================================
--- TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 3391)
+++ TXM/trunk/org.txm.progression.core/src/org/txm/progression/core/functions/Progression.java	(revision 3392)
@@ -374,8 +374,8 @@
 			return true;
 		}
 		else {
-			Match previousMatch = null;
-			for (Match m : corpus.getMatches()) {
+			org.txm.objects.Match previousMatch = null;
+			for (org.txm.objects.Match m : corpus.getMatches()) {
 				if (previousMatch == null) {
 					previousMatch = m;
 					continue;
@@ -573,7 +573,7 @@
 	 */
 	public boolean stepFinalize() throws CqiClientException {
 		if (this.getCorpus() instanceof Subcorpus) {
-			List<Match> matches = ((Subcorpus) getCorpus()).getMatches();
+			List<? extends org.txm.objects.Match> matches = ((Subcorpus) getCorpus()).getMatches();
 			if (matches.size() == 0) {
 				Log.severe(ProgressionCoreMessages.errorColonSubcorpusWithSize0);
 				return false;
Index: TXM/trunk/org.txm.searchengine.core/src/org/txm/searchengine/core/QueryBasedTXMResult.java
===================================================================
--- TXM/trunk/org.txm.searchengine.core/src/org/txm/searchengine/core/QueryBasedTXMResult.java	(revision 0)
+++ TXM/trunk/org.txm.searchengine.core/src/org/txm/searchengine/core/QueryBasedTXMResult.java	(revision 3392)
@@ -0,0 +1,34 @@
+package org.txm.searchengine.core;
+
+import org.txm.core.results.TXMResult;
+
+/**
+ * abstract class of result built on query
+ * 
+ * @author mdecorde
+ *
+ */
+public abstract class QueryBasedTXMResult extends TXMResult {
+	
+
+	public QueryBasedTXMResult(String parametersNodePath) {
+		
+		super(parametersNodePath);
+	}
+	
+	public QueryBasedTXMResult(String parametersNodePath, TXMResult parent) {
+		
+		super(parametersNodePath, parent);
+	}
+	
+	public QueryBasedTXMResult(TXMResult parent) {
+		
+		super(parent);
+	}
+
+	/**
+	 * 
+	 * @return a query based on the result parameters
+	 */
+	public abstract IQuery getQuery();
+}

Property changes on: TXM/trunk/org.txm.searchengine.core/src/org/txm/searchengine/core/QueryBasedTXMResult.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java	(revision 3391)
+++ TXM/trunk/org.txm.searchengine.cqp.rcp/src/org/txm/searchengine/cqp/rcp/editor/SubcorpusEditor.java	(revision 3392)
@@ -228,7 +228,7 @@
 	@Override
 	public void updateEditorFromResult(boolean update) throws Exception {
 
-		List<Match> matches = getResult().getMatches();
+		List<? extends org.txm.objects.Match> matches = getResult().getMatches();
 		if (matches == null || matches.size() == 0) {
 
 			if (getResult().hasBeenComputedOnce()) {
Index: TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3391)
+++ TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 3392)
@@ -1094,7 +1094,7 @@
 		propertiesPanel.getLayout().numColumns = 5;
 		propertiesPanel.getLayout().makeColumnsEqualWidth = false;
 		
-		ArrayList<WordProperty> tmp; // tmp to store properties
+		//ArrayList<WordProperty> tmp; // tmp to store properties
 		
 		try {
 			Label l = new Label(propertiesPanel, SWT.NONE);
@@ -2304,7 +2304,8 @@
 		}
 		
 		// System.out.println("Size="+queryLabel.getSize().x +" label="+queryLabel.getText()+" l size"+ queryLabel.getText().length());
-		float W = 1f + queryLabel.getSize().x / (float) queryLabel.getText().length();
+		float X = queryLabel.computeSize(SWT.DEFAULT, SWT.DEFAULT).x;
+		float W = 1f + X / (float) queryLabel.getText().length();
 		// System.out.println("W= "+W+" Maxs "+refMax+ " " +leftMax+" " +keywordMax+" "+rightMax);
 		
 		if (sash == null) return; // there was a problem during initialization
Index: TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/BackToText.java
===================================================================
--- TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/BackToText.java	(revision 3391)
+++ TXM/trunk/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/BackToText.java	(revision 3392)
@@ -34,7 +34,9 @@
 import org.txm.rcp.messages.TXMUIMessages;
 // TODO: Auto-generated Javadoc
 /**
- * action called to set the complex sort of the concordance @ author mdecorde.
+ * action called to set the complex sort of the concordance 
+ * 
+ * @author mdecorde.
  */
 public class BackToText extends Action implements IWorkbenchAction {
 
@@ -42,7 +44,7 @@
 	private static final String ID = "org.txm.rcp.editors.concordances.backtotext"; //$NON-NLS-1$
 	
 	/** The window. */
-	private IWorkbenchWindow window;
+	//private IWorkbenchWindow window;
 	
 	/** The concordance editor. */
 	private ConcordanceEditor concordanceEditor;
@@ -54,7 +56,7 @@
 	 * @param concordanceEditor the concordance editor
 	 */
 	public BackToText(IWorkbenchWindow window, ConcordanceEditor concordanceEditor) {
-		this.window = window;
+		//this.window = window;
 		this.concordanceEditor = concordanceEditor;
 		setId(ID);
 		setText(TXMUIMessages.displayInFullText);
@@ -66,6 +68,7 @@
 	 */
 	@Override
 	public void dispose() {
+		
 	}
 
 	/* (non-Javadoc)
@@ -73,7 +76,7 @@
 	 */
 	@Override
 	public void run() {
+		
 		concordanceEditor.backToText();
-
 	}
 }
\ No newline at end of file
Index: TXM/trunk/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/OriflammsFunction.java
===================================================================
--- TXM/trunk/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/OriflammsFunction.java	(revision 3391)
+++ TXM/trunk/org.txm.oriflamms.rcp/src/org/txm/oriflamms/functions/OriflammsFunction.java	(revision 3392)
@@ -99,10 +99,9 @@
 	
 	boolean processText(CQPCorpus corpus, String text_id) throws CqiClientException, IOException, CqiServerError {
 
-		List<Match> matches = corpus.getMatches();
-		Match last_match = matches.get(matches.size()-1);
+		List<? extends org.txm.objects.Match> matches = corpus.getMatches();
+		org.txm.objects.Match last_match = matches.get(matches.size()-1);
 		int end = last_match.getEnd();
-
 		
 		QueryResult r = corpus.query(new CQLQuery("[pbstart=\"0\"]"), "ABBRORI1", false);
 		int[] pb_pos = r.getStarts();
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java	(revision 3391)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/EditionSection.java	(revision 3392)
@@ -18,13 +18,11 @@
 import org.eclipse.ui.forms.widgets.TableWrapData;
 import org.eclipse.ui.forms.widgets.TableWrapLayout;
 import org.txm.Toolbox;
-import org.txm.core.preferences.TBXPreferences;
 import org.txm.objects.EditionDefinition;
 import org.txm.objects.Project;
 import org.txm.rcp.editors.imports.ImportModuleCustomization;
 import org.txm.rcp.messages.TXMUIMessages;
 import org.txm.rcp.swt.dialog.LastOpened;
-import org.w3c.dom.Element;
 
 public class EditionSection extends ImportEditorSection {
 	
@@ -134,7 +132,7 @@
 			buildFacsEditionCheckButton.setSelection(false);
 			TableWrapData gdata22 = getButtonLayoutData();
 			gdata22.colspan = 4; // one line
-			gdata22.indent = 20;
+			gdata22.indent = 40;
 			buildFacsEditionCheckButton.setLayoutData(gdata22);
 			buildFacsEditionCheckButton.addSelectionListener(new SelectionListener() {
 				
@@ -147,9 +145,9 @@
 				public void widgetDefaultSelected(SelectionEvent e) {}
 			});
 			// image directory
-			tmpLabel = toolkit.createLabel(sectionClient, "Images directory: ");
+			tmpLabel = toolkit.createLabel(sectionClient, "Images directory ");
 			TableWrapData gdata = getLabelGridData();
-			gdata.indent = 40;
+			gdata.indent = 60;
 			tmpLabel.setLayoutData(gdata);
 			imageDirectoryText = toolkit.createText(sectionClient, "", SWT.BORDER); //$NON-NLS-1$
 			gdata = getTextGridData();
Index: TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java
===================================================================
--- TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java	(revision 3391)
+++ TXM/trunk/org.txm.rcp/src/main/java/org/txm/rcp/editors/imports/sections/LangSection.java	(revision 3392)
@@ -71,7 +71,7 @@
 		sectionClient.setLayout(slayout);
 		this.section.setClient(sectionClient);
 		
-		Label l = toolkit.createLabel(sectionClient, "Corpus language"); //$NON-NLS-1$
+		Label l = toolkit.createLabel(sectionClient, "Language/Langue"); //$NON-NLS-1$
 		TableWrapData gdata = getTextGridData();
 		gdata.colspan = 2;
 		l.setLayoutData(gdata);
@@ -206,7 +206,7 @@
 	public boolean saveFields(Project project) {
 		if (!this.section.isDisposed()) {
 			// LANGUAGE
-			String lang = null, annotate = null;
+			String lang = null;
 			
 			if (btnGuessLang != null && btnGuessLang.getSelection()) {
 				lang = "??"; //$NON-NLS-1$
Index: TXM/trunk/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java
===================================================================
--- TXM/trunk/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java	(revision 3391)
+++ TXM/trunk/org.txm.internalview.core/src/org/txm/internalview/core/functions/InternalView.java	(revision 3392)
@@ -184,6 +184,7 @@
 	
 	@Override
 	public boolean canCompute() {
+		
 		return getCorpus() != null &&
 				pStructuralUnit != null &&
 				pWordProperties != null &&
@@ -202,6 +203,7 @@
 	 * @throws CqiClientException
 	 */
 	protected LinkedHashMap<Property, List<String>> getPageContent(int i) throws CqiClientException {
+		
 		LinkedHashMap<Property, List<String>> rez = new LinkedHashMap<>();
 		
 		if (i >= 0 && i < nmatches) {
@@ -229,6 +231,7 @@
 	 * @throws CqiClientException
 	 */
 	public HashMap<Property, List<String>> getCurrentPageContent() throws CqiClientException {
+		
 		HashMap<Property, List<String>> current = this.getPageContent(pCurrentPage);
 		return current;
 	}
@@ -242,11 +245,13 @@
 	 * @return the current page number
 	 */
 	public int getCurrentPage() {
+		
 		return pCurrentPage;
 	}
 	
 	@Override
 	public boolean saveParameters() {
+		
 		if (pStructuralUnit != null) {
 			this.saveParameter(InternalViewPreferences.STRUCTURAL_UNIT, pStructuralUnit.getName());
 		}
@@ -264,6 +269,7 @@
 	
 	@Override
 	public String getComputingStartMessage() {
+		
 		if (this.hasBeenComputedOnce()) {
 			return TXMCoreMessages.bind("Updating the browser of {0}", this.getParent().getSimpleName());
 		} else {
@@ -284,12 +290,14 @@
 	 * @return
 	 */
 	public CQPCorpus getCorpus() {
+		
 		return (CQPCorpus) getParent();
 	}
 	
 	
 	@Override
 	public String getDetails() {
+		
 		return getCorpus().getName() + " " + this.pStructuralUnit.getName() + " " + (this.pCurrentPage + 1); //$NON-NLS-1$ //$NON-NLS-2$
 	}
 	
@@ -307,6 +315,7 @@
 	
 	@Override
 	public String getName() {
+		
 		return this.getCorpus().getName() + TXMPreferences.PARENT_NAME_SEPARATOR + this.getSimpleName();
 	}
 	
Index: TXM/trunk/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java
===================================================================
--- TXM/trunk/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 3391)
+++ TXM/trunk/org.txm.textsbalance.core/src/org/txm/textsbalance/core/functions/TextsBalance.java	(revision 3392)
@@ -182,7 +182,7 @@
 					supLimits.add(new Match(l[0], l[1]));
 				}
 				//System.out.println("All sup limits are "+sup_limits);
-				List<Match> corpus_matches = this.getCorpus().getMatches();
+				List<? extends org.txm.objects.Match> corpus_matches = this.getCorpus().getMatches();
 				//System.out.println("corpus matches: "+corpus_matches);
 				ArrayList<Integer> inter = intersect(corpus_matches, supLimits);
 				//System.out.println( "No of $sup that covers $corpus: "+inter);
@@ -242,7 +242,7 @@
 	 * @param structs
 	 * @return
 	 */
-	public static ArrayList<Integer> intersect(List<Match> corpus, List<Match> structs) {
+	public static ArrayList<Integer> intersect(List<? extends org.txm.objects.Match> corpus, List<? extends org.txm.objects.Match> structs) {
 		int ai=0, bi=0;
 		ArrayList<Integer> result = new ArrayList<Integer>();
 
Index: TXM/trunk/org.txm.index.core/src/org/txm/index/core/functions/Index.java
===================================================================
--- TXM/trunk/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 3391)
+++ TXM/trunk/org.txm.index.core/src/org/txm/index/core/functions/Index.java	(revision 3392)
@@ -52,6 +52,8 @@
 import org.txm.index.core.preferences.IndexPreferences;
 import org.txm.objects.Match;
 import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.Query;
+import org.txm.searchengine.core.QueryBasedTXMResult;
 import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -72,7 +74,7 @@
  * 
  * @author mdecorde
  */
-public class Index extends TXMResult {
+public class Index extends QueryBasedTXMResult {
 	
 	/** The counts. */
 	protected LinkedHashMap<String, ArrayList<Integer>> counts = new LinkedHashMap<>();
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3391)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/CQPCorpus.java	(revision 3392)
@@ -43,6 +43,7 @@
 import org.txm.core.results.TXMResult;
 import org.txm.objects.CorpusCommandPreferences;
 import org.txm.objects.Project;
+import org.txm.searchengine.core.QueryBasedTXMResult;
 import org.txm.searchengine.core.messages.SearchEngineCoreMessages;
 import org.txm.searchengine.cqp.CQPSearchEngine;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
@@ -388,6 +389,11 @@
 	// }
 	// }
 	
+	public CQPCorpus(QueryBasedTXMResult result) {
+		
+		super(result);
+	}
+
 	/*
 	 * (non-Javadoc)
 	 * @see org.txm.objects.TxmObject#load()
@@ -923,7 +929,7 @@
 	}
 	
 	@Override
-	abstract public List<Match> getMatches();
+	abstract public List<? extends org.txm.objects.Match> getMatches();
 	
 	@Override
 	public String getName() {
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java	(revision 3391)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/query/Match.java	(revision 3392)
@@ -36,7 +36,6 @@
 import org.txm.searchengine.cqp.corpus.CorpusManager;
 import org.txm.searchengine.cqp.corpus.Property;
 import org.txm.searchengine.cqp.corpus.StructuralUnitProperty;
-import org.txm.searchengine.cqp.corpus.WordProperty;
 
 /**
  * A Match of a query on a corpus = [start -> end]
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 3391)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/corpus/Subcorpus.java	(revision 3392)
@@ -41,6 +41,10 @@
 import org.txm.core.results.Parameter;
 import org.txm.core.results.TXMParameters;
 import org.txm.objects.CorpusBuild;
+import org.txm.objects.Match;
+import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.QueryBasedTXMResult;
+import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.core.messages.SearchEngineCoreMessages;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPSearchEngine;
@@ -51,7 +55,6 @@
 import org.txm.searchengine.cqp.core.functions.selection.SelectionResult;
 import org.txm.searchengine.cqp.core.messages.CQPSearchEngineCoreMessages;
 import org.txm.searchengine.cqp.corpus.query.CQLQuery;
-import org.txm.searchengine.cqp.corpus.query.Match;
 import org.txm.searchengine.cqp.corpus.query.SubcorpusCQLQuery;
 import org.txm.searchengine.cqp.serverException.CqiServerError;
 import org.txm.utils.TXMProgressMonitor;
@@ -70,9 +73,9 @@
 	 * Query used to build the corpus.
 	 */
 	@Parameter(key = TXMPreferences.QUERY)
-	protected CQLQuery pQuery;
+	protected IQuery pQuery;
 	
-	protected QueryResult qresult;
+	protected Selection qresult;
 	
 	protected SelectionResult selectionResult;
 	
@@ -101,6 +104,16 @@
 	
 	/**
 	 * 
+	 * @param partition
+	 */
+	public Subcorpus(QueryBasedTXMResult result) {
+		super(result);
+		this.pQuery = result.getQuery();
+		this.setUserName(pQuery.toString());
+	}
+	
+	/**
+	 * 
 	 * @param parametersNodePath
 	 */
 	public Subcorpus(String parametersNodePath) {
@@ -121,6 +134,11 @@
 	 */
 	@Override
 	protected boolean __compute(TXMProgressMonitor monitor) throws Exception {
+		
+		if (this.getParent() instanceof QueryBasedTXMResult) { // update the pQuery
+			this.pQuery = ((QueryBasedTXMResult)this.getParent()).getQuery();
+		}
+		
 		if (pID == null || pID.length() == 0) {
 			pID = subcorpusNamePrefix + getNextSubcorpusCounter().toString();
 		}
@@ -153,7 +171,9 @@
 //				}
 			}
 			
-			this.qresult = new QueryResult(this.pID, this.getUserName(), this.getCorpusParent(), this.pQuery); // getCorpusParent().query(pQuery, this.pID, true);
+			this.qresult = this.pQuery.getSearchEngine().query(this.getCorpusParent(), this.pQuery, this.getUserName(), true);
+			
+			//this.qresult = new QueryResult(this.pID, this.getUserName(), this.getCorpusParent(), this.pQuery); // getCorpusParent().query(pQuery, this.pID, true);
 		}
 		
 		cqpTextIDS = null; // reset text ids cache
@@ -280,15 +300,14 @@
 	
 	
 	@Override
-	public List<Match> getMatches() {
+	public List<? extends Match> getMatches() {
 		if (qresult == null) { // not computed
 			return new ArrayList<>();
 		}
 		try {
 			return qresult.getMatches();
 		}
-		catch (CqiClientException e) {
-			// TODO Auto-generated catch block
+		catch (Exception e) {
 			org.txm.utils.logger.Log.printStackTrace(e);
 			return new ArrayList<>();
 		}
@@ -298,7 +317,7 @@
 		try {
 			return qresult.getNMatch();
 		}
-		catch (CqiClientException e) {
+		catch (Exception e) {
 			// TODO Auto-generated catch block
 			org.txm.utils.logger.Log.printStackTrace(e);
 			return 0;
@@ -368,7 +387,7 @@
 	 *
 	 * @return the query
 	 */
-	public CQLQuery getQuery() {
+	public IQuery getQuery() {
 		return pQuery;
 	}
 	
@@ -670,7 +689,7 @@
 		
 		List<Integer> structsIncorpus = new ArrayList<>();
 		// filter structs with matches
-		List<Match> matches = this.getMatches();
+		List<? extends Match> matches = this.getMatches();
 		int iText = 0;
 		int iMatch = 0;
 		nbtext = 0;
Index: TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/preview/Preview.java
===================================================================
--- TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/preview/Preview.java	(revision 3391)
+++ TXM/trunk/org.txm.searchengine.cqp.core/src/org/txm/searchengine/cqp/core/functions/preview/Preview.java	(revision 3392)
@@ -39,8 +39,8 @@
 	
 	protected boolean computePartition() {
 		boolean ok = false;
-		List<Match> matches = corpus.getMatches();
-		for (Match m : matches) {
+		List<? extends org.txm.objects.Match> matches = corpus.getMatches();
+		for (org.txm.objects.Match m : matches) {
 			if (m.size() >= n) {
 				ok = true;
 			}
@@ -49,11 +49,11 @@
 	}
 	
 	private String getLine(CQPCorpus corpus) {
-		List<Match> matches = corpus.getMatches();
+		List<? extends org.txm.objects.Match> matches = corpus.getMatches();
 		if (matches.size() == 0) return ""; //$NON-NLS-1$
 		
-		Match firstOkMatch = matches.get(0);
-		for (Match m : matches) {
+		org.txm.objects.Match firstOkMatch = matches.get(0);
+		for (org.txm.objects.Match m : matches) {
 			if (m.size() >= n) {
 				Collection<? extends Integer> positions = m.getRange();
 				
Index: TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java
===================================================================
--- TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java	(revision 3391)
+++ TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/preferences/ConcordancePreferences.java	(revision 3392)
@@ -14,10 +14,6 @@
  */
 public class ConcordancePreferences extends TXMPreferences {
 	
-	// FIXME; Should be stored at an higher level, eg. "Pagination"
-	@Deprecated
-	public static final String N_LINES_PER_PAGE = "n_lines_per_page"; //$NON-NLS-1$
-	
 	public static final String LEFT_CONTEXT_SIZE = "left_context_size"; //$NON-NLS-1$
 	
 	public static final String RIGHT_CONTEXT_SIZE = "right_context_size"; //$NON-NLS-1$
Index: TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java
===================================================================
--- TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java	(revision 3391)
+++ TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Line.java	(revision 3392)
@@ -28,7 +28,6 @@
 package org.txm.concordance.core.functions;
 
 import java.util.ArrayList;
-import java.util.Collection;
 import java.util.HashMap;
 import java.util.HashSet;
 import java.util.List;
@@ -341,7 +340,7 @@
 		List<String> words = new ArrayList<>();
 		Map<Property, List<String>> values = getKeywordsViewProperties();
 		int s = values.get(concordance.getKeywordViewProperties().get(0)).size();
-		int keywordEndPos = keywordpos + s - 1;
+		//int keywordEndPos = keywordpos + s - 1;
 		// System.out.println("Build STR of currentpos="+currentPos+" length="+s);
 		for (int i = 0; i < s; i++) {
 			List<String> word = new ArrayList<>();
Index: TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java
===================================================================
--- TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 3391)
+++ TXM/trunk/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 3392)
@@ -54,6 +54,7 @@
 import org.txm.core.results.TXMResult;
 import org.txm.objects.Match;
 import org.txm.searchengine.core.IQuery;
+import org.txm.searchengine.core.QueryBasedTXMResult;
 import org.txm.searchengine.core.Selection;
 import org.txm.searchengine.cqp.AbstractCqiClient;
 import org.txm.searchengine.cqp.CQPSearchEngine;
@@ -79,7 +80,7 @@
  * 
  * @author jmague, mdecorde
  */
-public class Concordance extends TXMResult {
+public class Concordance extends QueryBasedTXMResult {
 	
 	public static final String TARGET_SELECT = "Select";
 	public static final String TARGET_SHOW = "Show";
