Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/ComplexSort.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/ComplexSort.java	(revision 2945)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/actions/ComplexSort.java	(revision 2946)
@@ -97,15 +97,13 @@
 	 */
 	@Override
 	public void run() {
-		SelectComplexSortDialog d = new SelectComplexSortDialog(window
-				.getShell());
+		SelectComplexSortDialog d = new SelectComplexSortDialog(window.getShell());
+		
 		if (d.open() == Window.OK) {
-			concordanceEditor.setUserDefinedComparators(d
-					.getUserDefinedComparators());
+			concordanceEditor.setUserDefinedComparators(d.getUserDefinedComparators());
 			concordanceEditor.setCurrentComparator(d.getSelectedComparator());
 			concordanceEditor.sort();
 		}
-
 	}
 
 	/**
@@ -243,8 +241,7 @@
 		 */
 		protected CompositeSorterCreationDialog(Shell shell) {
 			super(shell);
-			this.availableComparators = new ArrayList<LineComparator>(
-					concordanceEditor.getStandardComparators());
+			this.availableComparators = new ArrayList<LineComparator>(concordanceEditor.getStandardComparators());
 			this.selectedComparators = new ArrayList<LineComparator>();
 		}
 
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/widgets/ComplexSortSelector.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/widgets/ComplexSortSelector.java	(revision 2945)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/widgets/ComplexSortSelector.java	(revision 2946)
@@ -175,8 +175,8 @@
 	public void setComparators(ConcordanceEditor editor) {
 		this.editor = editor;
 
-		List<LineComparator> standardComparatorslist = editor
-				.getStandardComparators();
+		List<LineComparator> standardComparatorslist = editor.getStandardComparators();
+		
 		comparatorsNames = new ArrayList<String>(standardComparatorslist.size());
 		String[] tcomparatorsNames = new String[standardComparatorslist.size()];
 		for (int i = 0; i < standardComparatorslist.size(); i++) {
@@ -223,8 +223,7 @@
 		}
 
 		// no default comparator found -> create one
-		defaultComparator = new CompositeComparator(
-				TXMUIMessages._default, standardComparatorslist);
+		defaultComparator = new CompositeComparator( TXMUIMessages._default, standardComparatorslist);
 		firstKey.select(0);
 		secondKey.select(0);
 		thirdKey.select(0);
Index: tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java
===================================================================
--- tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 2945)
+++ tmp/org.txm.concordance.rcp/src/org/txm/concordance/rcp/editors/ConcordanceEditor.java	(revision 2946)
@@ -26,6 +26,7 @@
 package org.txm.concordance.rcp.editors;
 
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.List;
 import java.util.Locale;
 
@@ -93,7 +94,7 @@
 import org.txm.concordance.core.functions.comparators.LexicographicLeftContextComparator;
 import org.txm.concordance.core.functions.comparators.LexicographicRightContextComparator;
 import org.txm.concordance.core.functions.comparators.LineComparator;
-import org.txm.concordance.core.functions.comparators.NullComparator;
+import org.txm.concordance.core.functions.comparators.WordPositionComparator;
 import org.txm.concordance.core.functions.comparators.PropertiesReferenceComparator;
 import org.txm.concordance.core.functions.comparators.ReverseComparator;
 import org.txm.concordance.core.preferences.ConcordancePreferences;
@@ -168,7 +169,7 @@
 	
 	/** The standard comparator class name. */
 	private LineComparator[] standardComparatorClassName = {
-			new NullComparator(), new LexicographicKeywordComparator(),
+			new WordPositionComparator(), new LexicographicKeywordComparator(),
 			new LexicographicLeftContextComparator(),
 			new LexicographicRightContextComparator(),
 			new PropertiesReferenceComparator() };
@@ -395,8 +396,16 @@
 			@Override
 			public void widgetSelected(SelectionEvent e) {
 				
+				
+				
+				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingReferenceColumn);
 				LineComparator comparator = new PropertiesReferenceComparator();
+				comparator.initialize(concordance.getCorpus());
+				
+				// add the corpus order key
+				LineComparator cComparator = new CompositeComparator("current", Arrays.asList(comparator, standardComparatorClassName[0]));
+				
 				if (viewerLeft.getTable().getSortColumn() != referenceColumn) {
 					viewerLeft.getTable().setSortColumn(null);
 					viewerLeft.getTable().setSortColumn(referenceColumn);
@@ -404,13 +413,14 @@
 				}
 				else if (viewerLeft.getTable().getSortDirection() == SWT.UP) {
 					viewerLeft.getTable().setSortDirection(SWT.DOWN);
-					comparator = new ReverseComparator(comparator);
+					cComparator = new ReverseComparator(cComparator);
 				}
 				else {
 					viewerLeft.getTable().setSortDirection(SWT.UP);
 				}
-				comparator.initialize(concordance.getCorpus());
-				currentComparator = comparator;
+				
+				currentComparator = cComparator;
+
 				complexsorter.setKey(4);// set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
@@ -517,18 +527,25 @@
 				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingLeftContextColumn);
 				LineComparator comparator = new LexicographicLeftContextComparator();
+				comparator.initialize(concordance.getCorpus());
+				
+				// add the corpus order key
+				LineComparator cComparator = new CompositeComparator("current", Arrays.asList(comparator, standardComparatorClassName[0]));
+				
 				if (viewerRight.getTable().getSortColumn() != leftContextColumn) {
 					viewerRight.getTable().setSortColumn(leftContextColumn);
 					viewerRight.getTable().setSortDirection(SWT.UP);
 				}
 				else if (viewerRight.getTable().getSortDirection() == SWT.UP) {
 					viewerRight.getTable().setSortDirection(SWT.DOWN);
-					comparator = new ReverseComparator(comparator);
+					cComparator = new ReverseComparator(cComparator);
 				}
-				else
+				else {
 					viewerRight.getTable().setSortDirection(SWT.UP);
-				comparator.initialize(concordance.getCorpus());
-				currentComparator = comparator;
+				}
+				
+				currentComparator = cComparator;
+				
 				complexsorter.setKey(2);// set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
@@ -560,19 +577,25 @@
 				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingKeywordColumn);
 				LineComparator comparator = new LexicographicKeywordComparator();
+				comparator.initialize(concordance.getCorpus());
+				
+				// add the corpus order key
+				LineComparator cComparator = new CompositeComparator("current", Arrays.asList(comparator, standardComparatorClassName[0]));
+				
 				if (viewerRight.getTable().getSortColumn() != keywordColumn) {
 					viewerRight.getTable().setSortColumn(keywordColumn);
 					viewerRight.getTable().setSortDirection(SWT.UP);
 				}
 				else if (viewerRight.getTable().getSortDirection() == SWT.UP) {
 					viewerRight.getTable().setSortDirection(SWT.DOWN);
-					comparator = new ReverseComparator(comparator);
+					cComparator = new ReverseComparator(cComparator);
 				}
 				else {
 					viewerRight.getTable().setSortDirection(SWT.UP);
 				}
-				comparator.initialize(concordance.getCorpus());
-				currentComparator = comparator;
+				
+				currentComparator = cComparator;
+				
 				complexsorter.setKey(1);// set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
@@ -603,19 +626,24 @@
 				
 				StatusLine.setMessage(ConcordanceUIMessages.sortingRightContextColumn);
 				LineComparator comparator = new LexicographicRightContextComparator();
+				comparator.initialize(concordance.getCorpus());
 				
+				// add the corpus order key
+				LineComparator cComparator = new CompositeComparator("current", Arrays.asList(comparator, standardComparatorClassName[0]));
+				
 				if (viewerRight.getTable().getSortColumn() != rightContextColumn) {
 					viewerRight.getTable().setSortColumn(rightContextColumn);
 				}
 				else if (viewerRight.getTable().getSortDirection() == SWT.UP) {
 					viewerRight.getTable().setSortDirection(SWT.DOWN);
-					comparator = new ReverseComparator(comparator);
+					cComparator = new ReverseComparator(cComparator);
 				}
 				else {
 					viewerRight.getTable().setSortDirection(SWT.UP);
 				}
-				comparator.initialize(concordance.getCorpus());
-				currentComparator = comparator;
+				
+				currentComparator = cComparator;
+				
 				complexsorter.setKey(3); // set ref key
 				sort();
 				StatusLine.setMessage(""); //$NON-NLS-1$
@@ -819,7 +847,6 @@
 						
 						JobsTimer.start();
 						try {
-							
 							concordance.sort(currentComparator, new TXMProgressMonitor(monitor));
 							concordance.setTopIndex(0);
 							
@@ -1687,8 +1714,7 @@
 	 *
 	 * @param userDefinedComparators the new user defined comparators
 	 */
-	public void setUserDefinedComparators(
-			List<LineComparator> userDefinedComparators) {
+	public void setUserDefinedComparators(List<LineComparator> userDefinedComparators) {
 		
 		this.userDefinedComparators = userDefinedComparators;
 	}
@@ -2162,6 +2188,7 @@
 		// }
 	}
 	
+	public static int MAX_CHARS_LENGTH_TO_SHOW = 75;
 	public void resetLeftTableColumnWidths() {
 		
 		int refMax = referenceColumn.getText().length();
@@ -2169,6 +2196,10 @@
 			if (refMax < item.getText(0).length()) refMax = item.getText(0).length();
 		}
 		
+		if (refMax > MAX_CHARS_LENGTH_TO_SHOW) {
+			refMax = MAX_CHARS_LENGTH_TO_SHOW;
+		}
+		
 		// 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();
 		// System.out.println("W= "+W+" Maxs "+refMax+ " " +leftMax+" " +keywordMax+" "+rightMax);
@@ -2177,6 +2208,7 @@
 		if (sash.getLayoutData() == null) return; // there was a problem during initialization
 		
 		((FormData) sash.getLayoutData()).left = new FormAttachment(0, 25 + (int) (refMax * W));
+		
 		referenceColumn.setWidth(2 * (int) (refMax * W));
 		getResultArea().layout(true, true);
 	}
@@ -2202,6 +2234,10 @@
 				if (n++ > 100) break; // stop testing after 100 lines
 			}
 			
+			if (max > MAX_CHARS_LENGTH_TO_SHOW) {
+				max = MAX_CHARS_LENGTH_TO_SHOW;
+			}
+			
 			column.setWidth(15 + (int) (max * W));
 		}
 		
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/tests/TestConcordance.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/tests/TestConcordance.java	(revision 2945)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/tests/TestConcordance.java	(revision 2946)
@@ -11,7 +11,7 @@
 import org.txm.concordance.core.functions.comparators.LexicographicLeftContextComparator;
 import org.txm.concordance.core.functions.comparators.LexicographicRightContextComparator;
 import org.txm.concordance.core.functions.comparators.LineComparator;
-import org.txm.concordance.core.functions.comparators.NullComparator;
+import org.txm.concordance.core.functions.comparators.WordPositionComparator;
 import org.txm.concordance.core.functions.comparators.PropertiesReferenceComparator;
 import org.txm.searchengine.cqp.ReferencePattern;
 import org.txm.searchengine.cqp.corpus.CQPCorpus;
@@ -123,12 +123,12 @@
 			
 			if (sortBy != null) {
 				LineComparator comparator;
-				if ("null".equals(sortBy)) comparator = new NullComparator(); //$NON-NLS-1$
+				if ("null".equals(sortBy)) comparator = new WordPositionComparator(); //$NON-NLS-1$
 				else if ("lexicographic".equals(sortBy)) comparator = new LexicographicKeywordComparator(); //$NON-NLS-1$
 				else if ("leftcontext".equals(sortBy)) comparator = new LexicographicLeftContextComparator(); //$NON-NLS-1$
 				else if ("rightcontext".equals(sortBy)) comparator = new LexicographicRightContextComparator(); //$NON-NLS-1$
 				else if ("reference".equals(sortBy)) comparator = new PropertiesReferenceComparator(); //$NON-NLS-1$
-				else comparator = new NullComparator();
+				else comparator = new WordPositionComparator();
 				conc.sort(comparator, new TXMProgressMonitor(new LogMonitor()));
 			}
 			conc.toTxt(outfile, "UTF-8", "\t", ""); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/ConcordanceCoreMessages.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/ConcordanceCoreMessages.java	(revision 2945)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/ConcordanceCoreMessages.java	(revision 2946)
@@ -13,10 +13,12 @@
 public class ConcordanceCoreMessages extends NLS {
 
 	private static final String BUNDLE_NAME = "org.txm.concordance.core.messages.messages"; //$NON-NLS-1$
+
 	
+	
 	public static String RESULT_TYPE;
 
-	
+	public static String wordCorpusOrder;
 	public static String failedToRetrieveTextidPropertyFromLines; 
 	public static String failedToExportConcordanceColonP0; 
 	public static String reference; 
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages.properties
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages.properties	(revision 2945)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages.properties	(revision 2946)
@@ -3,6 +3,8 @@
 #Tue Dec 18 10:24:08 CET 2018
 
 RESULT_TYPE = Concordance
+
+wordCorpusOrder = Corpus order
 
 compositeColon = Composite: 
 
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages_fr.properties
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages_fr.properties	(revision 2945)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/messages/messages_fr.properties	(revision 2946)
@@ -4,6 +4,8 @@
 
 RESULT_TYPE = Concordance
 
+wordCorpusOrder = Ordre du corpus
+
 compositeColon = Composé : 
 
 concordanceOfP0InTheP1Corpus = Concordance de {0} dans le corpus {1}...
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/NullComparator.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/NullComparator.java	(revision 2945)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/NullComparator.java	(revision 2946)
@@ -1,58 +0,0 @@
-// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
-// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
-// Lyon 2, University of Franche-Comté, University of Nice
-// Sophia Antipolis, University of Paris 3.
-// 
-// The TXM platform is free software: you can redistribute it
-// and/or modify it under the terms of the GNU General Public
-// License as published by the Free Software Foundation,
-// either version 2 of the License, or (at your option) any
-// later version.
-// 
-// The TXM platform is distributed in the hope that it will be
-// useful, but WITHOUT ANY WARRANTY; without even the implied
-// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
-// PURPOSE. See the GNU General Public License for more
-// details.
-// 
-// You should have received a copy of the GNU General
-// Public License along with the TXM platform. If not, see
-// http://www.gnu.org/licenses.
-// 
-// 
-// 
-// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
-// $LastChangedRevision: 2386 $
-// $LastChangedBy: mdecorde $ 
-//
-package org.txm.concordance.core.functions.comparators;
-
-import org.txm.concordance.core.functions.Line;
-import org.txm.concordance.core.messages.ConcordanceCoreMessages;
-
-// TODO: Auto-generated Javadoc
-/**
- * return the order of the text.
- *
- * @author mdecorde
- */
-public class NullComparator extends LocalizedLineComparator {
-
-	/** The Constant NAME. */
-	private static final String NAME = ConcordanceCoreMessages.none;
-
-	/**
-	 * Instantiates a new null comparator.
-	 */
-	public NullComparator() {
-		super(NAME);
-	}
-
-	/* (non-Javadoc)
-	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
-	 */
-	@Override
-	public int compare(Line l1, Line l2) {
-		return l1.getKeywordPosition() - l2.getKeywordPosition();
-	}
-}
\ No newline at end of file
Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/WordPositionComparator.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/WordPositionComparator.java	(revision 0)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/WordPositionComparator.java	(revision 2946)
@@ -0,0 +1,58 @@
+// Copyright © 2010-2020 ENS de Lyon., University of Franche-Comté
+// Copyright © 2007-2010 ENS de Lyon, CNRS, INRP, University of
+// Lyon 2, University of Franche-Comté, University of Nice
+// Sophia Antipolis, University of Paris 3.
+// 
+// The TXM platform is free software: you can redistribute it
+// and/or modify it under the terms of the GNU General Public
+// License as published by the Free Software Foundation,
+// either version 2 of the License, or (at your option) any
+// later version.
+// 
+// The TXM platform is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied
+// warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+// PURPOSE. See the GNU General Public License for more
+// details.
+// 
+// You should have received a copy of the GNU General
+// Public License along with the TXM platform. If not, see
+// http://www.gnu.org/licenses.
+// 
+// 
+// 
+// $LastChangedDate: 2013-05-06 17:38:43 +0200 (lun., 06 mai 2013) $
+// $LastChangedRevision: 2386 $
+// $LastChangedBy: mdecorde $ 
+//
+package org.txm.concordance.core.functions.comparators;
+
+import org.txm.concordance.core.functions.Line;
+import org.txm.concordance.core.messages.ConcordanceCoreMessages;
+
+// TODO: Auto-generated Javadoc
+/**
+ * return the order of the text.
+ *
+ * @author mdecorde
+ */
+public class WordPositionComparator extends LocalizedLineComparator {
+
+	/** The Constant NAME. */
+	private static final String NAME = ConcordanceCoreMessages.wordCorpusOrder;
+
+	/**
+	 * Instantiates a new null comparator.
+	 */
+	public WordPositionComparator() {
+		super(NAME);
+	}
+
+	/* (non-Javadoc)
+	 * @see java.util.Comparator#compare(java.lang.Object, java.lang.Object)
+	 */
+	@Override
+	public int compare(Line l1, Line l2) {
+		return l1.getKeywordPosition() - l2.getKeywordPosition();
+	}
+}
\ No newline at end of file

Property changes on: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/comparators/WordPositionComparator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java
===================================================================
--- tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 2945)
+++ tmp/org.txm.concordance.core/src/org/txm/concordance/core/functions/Concordance.java	(revision 2946)
@@ -1504,7 +1504,7 @@
 		if (getNLines() == 0) {
 			return;
 		}
-		getLines(0, nLines - 1);
+		getLines(0, nLines - 1); // all lines are necessary to sort TODO: if fact only the sort properties are needed
 		if (lines.size() > 0) {
 			Collections.sort(lines, comparator);
 		}
Index: tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy
===================================================================
--- tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy	(revision 2945)
+++ tmp/org.txm.groovy.core/src/groovy/org/txm/macro/projects/antract/BuildAFMetadataMacro.groovy	(revision 2946)
@@ -37,6 +37,8 @@
 	HashMap<String, String> columnsToRenameRules = new HashMap<>();
 	HashMap<String, String[]> searchAndReplaceRules = new HashMap<>();
 	
+	String normalizePattern = "[ \p{P}\p{L}]"
+	
 	columnsSelection = Arrays.asList(
 	"Identifiant de la notice", "Titre propre", "Notes du titre", "Date de diffusion", "Durée", "Nom fichier segmenté (info)", "antract_video",
 	"antract_debut","antract_fin","antract_duree","antract_tc_type","antract_tc_date");
@@ -64,14 +66,21 @@
 	HashMap<String, String> columnsToRenameRules = new HashMap<>();
 	HashMap<String, String[]> searchAndReplaceRules = new HashMap<>();
 	
+	String normalizePattern = "[ \p{P}\p{L}]"
+	
 	columnsSelection = Arrays.asList(
 		"Identifiant de la notice", "Titre propre", "Notes du titre", "Lien notice principale",
 		"Date de diffusion", "Type de date", "Durée", "Genre", "Langue VO / VE", "Nature de production", "Producteurs (Aff.)", "Thématique",
 		"Nom fichier segmenté (info)", "antract_video", "antract_debut", "antract_fin", "antract_duree", "antract_tc_type", "antract_tc_date",
 		"Résumé", "Séquences", "Descripteurs (Aff. Lig.)", "Générique (Aff. Lig.)");
 	
+	
+	
 	lineRules.put("Type de notice", "Notice sujet");
-	
+
+	searchAndReplaceRules.put("textorder", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3$2$1'] as String[]); // not working yet
+	searchAndReplaceRules.put("annee", ["([0-9][0-9])/([0-9][0-9])/([0-9][0-9][0-9][0-9])", '$3'] as String[]); // not working yet
+		
 	process(excel, table2File, lineRules, columnsSelection, columnsToCopy, searchAndReplaceRules, columnsToRenameRules)
 }
 
