Index: TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotationsAndUpdateCorpus.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotationsAndUpdateCorpus.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/commands/SaveAnnotationsAndUpdateCorpus.java	(revision 3925)
@@ -38,10 +38,10 @@
 	public Object execute(ExecutionEvent event) throws ExecutionException {
 		
 		ISelection sel = HandlerUtil.getCurrentSelection(event);
-//		if (!(sel instanceof IStructuredSelection)) {
-//			Log.info("No available selection to target the corpus annotations to save");	
-//			return null;
-//		}
+		if (!(sel instanceof IStructuredSelection)) {
+			Log.info("No available selection to target the corpus annotations to save");	
+			return null;
+		}
 		IStructuredSelection selection = (IStructuredSelection) sel;
 		
 		List<MainCorpus> corpora = Workspace.getInstance().getDeepChildren(MainCorpus.class);
Index: TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/KRAnnotation.java	(revision 3925)
@@ -182,12 +182,16 @@
 					Annotation a = annotationLine.getAnnotation();
 					if (value == null) value = a.getValue();
 					
-					if (a.getStart() < line.matchGetStart() - line.getLeftContextSize()) {
+					if (a.getStart() < line.matchGetStart()) {
 						value = "… " + value; //$NON-NLS-1$
+					} else if (a.getStart() > line.matchGetStart()) {
+						//value = "> " + value; //$NON-NLS-1$
 					}
 					
-					if (a.getEnd() > line.matchGetEnd() + line.getRightContextSize()) {
+					if (a.getEnd() > line.matchGetEnd()) {
 						value = value + " …"; //$NON-NLS-1$
+					} else if (a.getEnd() < line.matchGetEnd()) {
+						//value = value + " <"; //$NON-NLS-1$
 					}
 					return value;
 				}
Index: TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/WordAnnotationToolbar.java	(revision 3925)
@@ -449,12 +449,16 @@
 					Annotation a = annotationLine.getAnnotation();
 					if (value == null) value = a.getValue();
 					
-					if (a.getStart() < line.matchGetStart() - line.getLeftContextSize()) {
+					if (a.getStart() < line.matchGetStart()) {
 						value = "… " + value; //$NON-NLS-1$
+					} else if (a.getStart() > line.matchGetStart()) {
+						//value = "> " + value; //$NON-NLS-1$
 					}
 					
-					if (a.getEnd() > line.matchGetEnd() + line.getRightContextSize()) {
+					if (a.getEnd() > line.matchGetEnd()) {
 						value = value + " …"; //$NON-NLS-1$
+					} else if (a.getEnd() < line.matchGetEnd()) {
+						//value = value + " <"; //$NON-NLS-1$
 					}
 					return value;
 				}
Index: TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/ConcordanceAnnotations.java	(revision 3925)
@@ -5,7 +5,6 @@
 import java.util.HashMap;
 import java.util.LinkedHashMap;
 import java.util.List;
-import java.util.TreeMap;
 
 import org.eclipse.osgi.util.NLS;
 import org.txm.annotation.kr.core.Annotation;
@@ -148,6 +147,7 @@
 		int nAnnotations = annotations.size();
 
 		while (iMatch < nMatch && iAnnotation < nAnnotations) {
+			
 			if (overlap) {
 				if (matches.get(iMatch).getEnd() < annotations.get(iAnnotation).getStart()) {
 					iMatch++;
@@ -195,7 +195,7 @@
 								hasAnnotations = true;
 							}
 						} else {
-							if (annot.getStart()==m.getStart() && annot.getEnd()==m.getEnd()) {
+							if (annot.getStart() == m.getStart() && annot.getEnd()==m.getEnd()) {
 								annotsList.put(m, annot); 
 								hasAnnotations = true;
 							}
Index: TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.rcp/src/org/txm/annotation/kr/rcp/concordance/SimpleKRAnnotation.java	(revision 3925)
@@ -171,12 +171,16 @@
 					Annotation a = annotationLine.getAnnotation();
 					if (value == null) value = a.getValue();
 					
-					if (a.getStart() < line.matchGetStart() - line.getLeftContextSize()) {
+					if (a.getStart() < line.matchGetStart()) {
 						value = "… " + value; //$NON-NLS-1$
+					} else if (a.getStart() > line.matchGetStart()) {
+						//value = "> " + value; //$NON-NLS-1$
 					}
 					
-					if (a.getEnd() > line.matchGetEnd() + line.getRightContextSize()) {
+					if (a.getEnd() > line.matchGetEnd()) {
 						value = value + " …"; //$NON-NLS-1$
+					} else if (a.getEnd() < line.matchGetEnd()) {
+						//value = value + " <"; //$NON-NLS-1$
 					}
 					return value;
 				}
Index: TXM/trunk/bundles/org.txm.rcp/SUBVERSION
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/SUBVERSION	(revision 3924)
+++ TXM/trunk/bundles/org.txm.rcp/SUBVERSION	(revision 3925)
@@ -1 +0,0 @@
-beta
Index: TXM/trunk/bundles/org.txm.rcp/splash.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/utils/LanguageSwitchHandler.java
===================================================================
--- TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/utils/LanguageSwitchHandler.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.rcp/src/main/java/org/txm/rcp/utils/LanguageSwitchHandler.java	(revision 3925)
@@ -123,13 +123,6 @@
 	 */
 	public static void changeLocaleTXMIni(String locale) {
 		
-		// Location configArea = Platform.getInstallLocation();
-		// //MessageBox.warning(Platform.getInstanceLocation().getURL().toString());
-		// // String product = Platform.getProduct().getName();
-		// if (configArea == null) {
-		// return;
-		// }
-		
 		URL location = null;
 		try {
 			String path = System.getProperty("osgi.instance.area"); //$NON-NLS-1$
Index: TXM/trunk/bundles/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationWriter.java	(revision 3925)
@@ -20,8 +20,6 @@
 import org.txm.annotation.kr.core.repository.AnnotationEffect;
 import org.txm.annotation.kr.core.repository.AnnotationType;
 import org.txm.annotation.kr.core.repository.KnowledgeRepository;
-import org.txm.core.preferences.TBXPreferences;
-import org.txm.core.preferences.TXMPreferences;
 import org.txm.importer.ValidateXml;
 import org.txm.searchengine.cqp.clientExceptions.CqiClientException;
 import org.txm.searchengine.cqp.clientExceptions.InvalidCqpIdException;
@@ -35,6 +33,8 @@
 
 public class AnnotationWriter {
 	
+	boolean debug = false;
+	
 	MainCorpus corpus;
 	
 	private List<AnnotationType> types;
@@ -281,8 +281,8 @@
 			ArrayList<Annotation> segmentAnnotations, ArrayList<Annotation> tokenAnnotations, File tmpXMLTXMDirectory, File previousXMLTXMDirectory) throws CqiClientException, IOException,
 			CqiServerError, InvalidCqpIdException, XMLStreamException {
 		Log.fine("Writing annotations for text " + xmlFile + " segment annotations=" + segmentAnnotations.size() + " token annotations=" + tokenAnnotations.size()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		// System.out.println(segmentAnnotations);
-		// System.out.println(tokenAnnotations);
+		if (debug) System.out.println(segmentAnnotations);
+		if (debug) System.out.println(tokenAnnotations);
 		
 		boolean show_debug = Log.getLevel().intValue() < Level.INFO.intValue();
 		AnnotationInjector annotationInjector = new AnnotationInjector(xmlFile, segmentAnnotations, tokenAnnotations, text_start_position, show_debug);
Index: TXM/trunk/bundles/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationInjector.java
===================================================================
--- TXM/trunk/bundles/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationInjector.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.annotation.kr.core/src/org/txm/annotation/kr/core/AnnotationInjector.java	(revision 3925)
@@ -32,9 +32,7 @@
 	
 	File xmlFile;
 	
-	HashMap<Integer, List<Annotation>> annotationsToAddByStartPos; // contains
-	// annotation
-	// to write
+	HashMap<Integer, List<Annotation>> annotationsToAddByStartPos; // contains  annotation to write
 	
 	HashMap<Integer, List<Annotation>> annotationsToAddByEndPos;
 	
@@ -171,20 +169,16 @@
 		currentStartAnnotations = annotationsToAddByStartPos.get(position_counter);
 		currentEndAnnotations = annotationsToAddByEndPos.get(position_counter);
 		// System.out.println("A Starts: "+currentStartAnnotations+" "+currentEndAnnotations);
-		// if (debug)
-		// System.out.println("----- "+localname+"@"+position_counter+" START ANNOT = "+currentStartAnnotations);
+		if (debug) System.out.println("----- "+localname+"@"+position_counter+" START ANNOT = "+currentStartAnnotations);
 		if ("teiHeader".equals(localname)) { //$NON-NLS-1$
 			super.processStartElement();
-			goToEnd("teiHeader"); // skip teiHeader // will be closed in //$NON-NLS-1$
-			// processEndElement()
+			goToEnd("teiHeader"); //$NON-NLS-1$ // skip teiHeader // will be closed in processEndElement()
 		}
 		else if ("w".equals(localname)) { //$NON-NLS-1$
-			// System.out.println("W START pos="+position_counter+" annots="+currentStartAnnotations);
+			//if (debug) System.out.println("W START pos="+position_counter+" annots="+currentStartAnnotations);
 			if (currentStartAnnotations != null) {// there are still annotations
-				// to write, possible
-				// several for a position
-				// if (debug)
-				// System.out.println("WRITING START at "+position_counter+": "+currentStartAnnotations);
+				// to write, possible  several for a position
+				//if (debug) System.out.println("WRITING START at "+position_counter+": "+currentStartAnnotations);
 				for (Annotation a : currentStartAnnotations) {
 					if (!"#del".equals(a.getValue())) { //$NON-NLS-1$
 						if (debug) {
@@ -293,7 +287,7 @@
 				super.processStartElement();
 			}
 		}
-		else if (currentStartAnnotations != null) { // is it an annotations ?
+		else if (currentStartAnnotations != null) { // is their any annotations to write ?
 			// System.out.println("A START="+localname);
 			
 			String s_end = parser.getAttributeValue(null, "end"); //$NON-NLS-1$
@@ -317,15 +311,13 @@
 				// this is not an annotation
 			}
 			else {
+				
 				for (int i = 0; i < currentStartAnnotations.size(); i++) {
 					Annotation a = currentStartAnnotations.get(i);
-					// if (debug)
-					// System.out.println("=============== Start annot : "+a);
-					if (a.getType().equals(localname)) { // force delete, will be
-						// written in the "w"
-						// case
+					if (debug)  System.out.println("=============== Start annot : "+a);
+					if (a.getType().equals(localname)) { // force delete, will be  written in the "w"  case
 						
-						if (a.getStart() == start && a.getEnd() == end) {
+						if (a.getStart() == start && a.getEnd() == end && a.getAnnotator().equals(s_author)) { // this is the right annotation to process
 							// updated = true;
 							// if (debug)
 							// System.out.println(" found existing annotation "+a);
@@ -334,13 +326,12 @@
 								// currentEndAnnotations.remove(a); // MAYBE NOT TO
 								// DO THIS HERE ?
 								if (debug) {
-									Log.finer(" force delete start annotation " + a); //$NON-NLS-1$
+									System.out.println(" force delete start annotation " + a); //$NON-NLS-1$
 								}
 							}
-							else { // update existing annotation, no need to store
-									 // the end of annotation
+							else { // update existing annotation, no need to store the end of annotation
 								writeStartAnnotation(a);
-								toDelete = true;
+								toDelete = true; // set true to avoid re-writing the annotation XML start element
 								if (debug) {
 									Log.finer(" update annotation " + a); //$NON-NLS-1$
 								}
@@ -361,45 +352,46 @@
 							
 							currentStartAnnotations.remove(i);
 							i--;
+							
+							break; // no need to continue
 						}
-						
-						break; // no need to continue
 					}
 					else {
-						// System.out.println("------- with same start pos");
-						
-						if (s_start != null && s_end != null && s_author != null && s_ref != null) {
-							if (a.getEnd() >= end) { // must write a
-								if (!"#del".equals(a.getValue())) { //$NON-NLS-1$
-									if (debug) {
-										Log.finer(NLS.bind(" writing of start annotation {0}.", a)); //$NON-NLS-1$
-									}
-									writeStartAnnotation(a);
-									
-								}
-								else {
-									toDelete = true;
-									if (debug) {
-										Log.finer(NLS.bind(" no writing of start annotation {0}.", a)); //$NON-NLS-1$
-									}
-									currentEndAnnotations = annotationsToAddByEndPos.get(a.getEnd());
-									// System.out.println(" shall we need to change annotation attribute : "+a.getValue()+
-									// " | currentEndAnnotations : "+currentEndAnnotations);
-									if (currentEndAnnotations == null) {
-										Log.warning(NLS.bind(Messages.ErrorNPEForEndPositionOfAnnotationP0, a));
-									}
-									else {
-										currentEndAnnotations.remove(a);
-									}
-								}
-								currentStartAnnotations.remove(i);
-								i--;
-								// break;
-							}
-						}
+//						if (debug) System.out.println("------- with same start pos");
+//						
+//						if (s_start != null && s_end != null && s_author != null && s_ref != null) {
+//							if (a.getEnd() >= end) { // must write a
+//								if (!"#del".equals(a.getValue())) { //$NON-NLS-1$
+//									if (debug) {
+//										System.out.println(NLS.bind(" writing of start annotation {0}.", a)); //$NON-NLS-1$
+//									}
+//									writeStartAnnotation(a);
+//									
+//								}
+//								else {
+//									toDelete = true;
+//									if (debug) {
+//										System.out.println(NLS.bind(" no writing of start annotation {0}.", a)); //$NON-NLS-1$
+//									}
+//									currentEndAnnotations = annotationsToAddByEndPos.get(a.getEnd());
+//									// System.out.println(" shall we need to change annotation attribute : "+a.getValue()+
+//									// " | currentEndAnnotations : "+currentEndAnnotations);
+//									if (currentEndAnnotations == null) {
+//										Log.warning(NLS.bind(Messages.ErrorNPEForEndPositionOfAnnotationP0, a));
+//									}
+//									else {
+//										currentEndAnnotations.remove(a);
+//									}
+//								}
+//								currentStartAnnotations.remove(i);
+//								i--;
+//								// break;
+//							}
+//						}
 					}
 				}
 			}
+			
 			if (!toDelete) { // the structure or annotation was not modified
 				super.processStartElement();
 			}
@@ -523,6 +515,7 @@
 					break; // no need to continue
 				}
 			}
+			
 			if (!toDelete) { // the structure or annotation was not modified
 				super.processEndElement();
 			}
Index: TXM/trunk/bundles/org.txm.core/META-INF/MANIFEST.MF
===================================================================
--- TXM/trunk/bundles/org.txm.core/META-INF/MANIFEST.MF	(revision 3924)
+++ TXM/trunk/bundles/org.txm.core/META-INF/MANIFEST.MF	(revision 3925)
@@ -472,7 +472,7 @@
  org.txm.libs.msoffice;bundle-version="0.0.0";visibility:=reexport,
  org.txm.libs.hsqldb;bundle-version="1.0.0";visibility:=reexport,
  org.txm.tokenizer.core;bundle-version="1.0.0";visibility:=reexport,
- org.txm.libs.jodconverter;bundle-version="1.0.0"
+ org.txm.libs.jodconverter;bundle-version="4.4.6"
 Bundle-ActivationPolicy: lazy
 Bundle-ManifestVersion: 2
 Bundle-Activator: org.txm.core.Activator
Index: TXM/trunk/bundles/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java
===================================================================
--- TXM/trunk/bundles/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 3924)
+++ TXM/trunk/bundles/org.txm.groovy.core/src/java/org/txm/groovy/core/InstallGroovyFiles.java	(revision 3925)
@@ -91,20 +91,37 @@
 		// copy modified files in the backup directory
 		backupFiles(userDirectory, systemDirectory , userDirectory.getParentFile());
 		
-		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", systemDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", userDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
+		try {
+			Thread.sleep(1000);
+		}
+		catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		BundleUtils.copyFiles(bundle_id, "", "src/groovy", "", systemDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		
 		bundle_id = "org.txm.core"; //$NON-NLS-1$
 		
 		// copy additional Groovy files from the src/java directory of 
-		File scriptsPackageDirectory = new File(userDirectory, "org/txm/scripts/importer"); //$NON-NLS-1$
+		File scriptsPackageDirectory = new File(systemDirectory, "org/txm/scripts/importer"); //$NON-NLS-1$
 		scriptsPackageDirectory.mkdirs();
 		BundleUtils.copyFiles(bundle_id, "src/java/", "org/txm/scripts/importer", "", scriptsPackageDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
 		
-		scriptsPackageDirectory = new File(systemDirectory, "org/txm/scripts/importer"); //$NON-NLS-1$
+		try {
+			Thread.sleep(1000);
+		}
+		catch (InterruptedException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		scriptsPackageDirectory = new File(userDirectory, "org/txm/scripts/importer"); //$NON-NLS-1$
 		scriptsPackageDirectory.mkdirs();
 		BundleUtils.copyFiles(bundle_id, "src/java/", "org/txm/scripts/importer", "", scriptsPackageDirectory, true); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-		
+				
 		return scriptsDirectory.exists();
 	}
 	
