diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-27 11:53:19 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-06-27 11:53:19 +0000 |
commit | 5fe804aefd0ddec8264403dc6747005e44306a59 (patch) | |
tree | 4d51d6f4d0643c74889caf2cff439cad1a645554 /svx/source/editeng/impedit2.cxx | |
parent | INTEGRATION: CWS tl37 (1.44.182); FILE MERGED (diff) | |
download | core-5fe804aefd0ddec8264403dc6747005e44306a59.tar.gz core-5fe804aefd0ddec8264403dc6747005e44306a59.zip |
INTEGRATION: CWS tl37 (1.114.180); FILE MERGED
2007/04/11 15:23:13 tl 1.114.180.2: RESYNC: (1.114-1.115); FILE MERGED
2007/02/01 10:09:05 tl 1.114.180.1: #i72349# detection of script type fixed
Diffstat (limited to 'svx/source/editeng/impedit2.cxx')
-rw-r--r-- | svx/source/editeng/impedit2.cxx | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/svx/source/editeng/impedit2.cxx b/svx/source/editeng/impedit2.cxx index 3168deca647c..dea087987713 100644 --- a/svx/source/editeng/impedit2.cxx +++ b/svx/source/editeng/impedit2.cxx @@ -4,9 +4,9 @@ * * $RCSfile: impedit2.cxx,v $ * - * $Revision: 1.115 $ + * $Revision: 1.116 $ * - * last change: $Author: rt $ $Date: 2007-01-30 15:26:23 $ + * last change: $Author: hr $ $Date: 2007-06-27 12:53:19 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -1762,11 +1762,14 @@ USHORT ImpEditEngine::GetScriptType( const EditSelection& rSel ) const ScriptTypePosInfos& rTypes = pParaPortion->aScriptInfos; + // find the first(!) script type position that holds the + // complete selection. Thus it will work for selections as + // well as with just moving the cursor from char to char. USHORT nS = ( nPara == nStartPara ) ? aSel.Min().GetIndex() : 0; USHORT nE = ( nPara == nEndPara ) ? aSel.Max().GetIndex() : pParaPortion->GetNode()->Len(); for ( USHORT n = 0; n < rTypes.Count(); n++ ) { - if ( ( rTypes[n].nStartPos <= nE ) && ( rTypes[n].nEndPos >= nS ) ) + if (rTypes[n].nStartPos <= nS && nE <= rTypes[n].nEndPos) { if ( rTypes[n].nScriptType != i18n::ScriptType::WEAK ) { @@ -1780,6 +1783,7 @@ USHORT ImpEditEngine::GetScriptType( const EditSelection& rSel ) const nScriptType = rTypes[n-1].nScriptType; } } + break; } } } |