Index: source/editeng/impedit2.cxx =================================================================== RCS file: /cvs/graphics/svx/source/editeng/impedit2.cxx,v retrieving revision 1.114 diff -u -r1.114 impedit2.cxx --- openoffice.org.orig/svx/source/editeng/impedit2.cxx 12 Oct 2006 12:39:14 -0000 1.114 +++ openoffice.org/svx/source/editeng/impedit2.cxx 31 May 2007 15:56:08 -0000 @@ -1764,9 +1764,21 @@ USHORT nS = ( nPara == nStartPara ) ? aSel.Min().GetIndex() : 0; USHORT nE = ( nPara == nEndPara ) ? aSel.Max().GetIndex() : pParaPortion->GetNode()->Len(); + + // Find all the scripts types that intersect the selection. + // For moving cursor from char to char then we have no selection, + // so use a selection over the previous character if there was one. + // If there is no previous character, then we'll eventually fallback + // to the input language. + if ( !rSel.HasRange() && nS ) + { + DBG_ASSERT( nS == nE && nStartPara == nEndPara, "Move in sich selbst ?" ); + --nS; + } + for ( USHORT n = 0; n < rTypes.Count(); n++ ) { - if ( ( rTypes[n].nStartPos <= nE ) && ( rTypes[n].nEndPos >= nS ) ) + if ( ( nS < rTypes[n].nEndPos ) && ( nE > rTypes[n].nStartPos ) ) { if ( rTypes[n].nScriptType != i18n::ScriptType::WEAK ) {