summaryrefslogtreecommitdiff
path: root/editeng/source
diff options
context:
space:
mode:
Diffstat (limited to 'editeng/source')
-rw-r--r--editeng/source/editeng/impedit3.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index d7129999dfa5..6195b0e8e606 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -2339,10 +2339,9 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// restore selection for proper iteration at the end of the function
aWordSel.Max().SetIndex( nSavPos );
- sal_Int32 nIdx = 0;
+ sal_Int32 nIdx = 0, nPrevIdx = 0;
sal_Int32 nKashidaPos = -1;
- sal_Unicode cCh;
- sal_Unicode cPrevCh = 0;
+ sal_Unicode cCh, cPrevCh = 0;
int nPriorityLevel = 7; // 0..6 = level found
// 7 not found
@@ -2390,7 +2389,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
- nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+ nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
nPriorityLevel = 2;
}
}
@@ -2411,7 +2410,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
- nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+ nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
nPriorityLevel = 3;
}
}
@@ -2431,7 +2430,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
- nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+ nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
nPriorityLevel = 4;
}
}
@@ -2453,7 +2452,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
- nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+ nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
nPriorityLevel = 5;
}
}
@@ -2469,7 +2468,7 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// check if character is connectable to previous character,
if ( lcl_ConnectToPrev( cCh, cPrevCh ) )
{
- nKashidaPos = aWordSel.Min().GetIndex() + nIdx - 1;
+ nKashidaPos = aWordSel.Min().GetIndex() + nPrevIdx;
nPriorityLevel = 6;
}
}
@@ -2478,7 +2477,10 @@ void ImpEditEngine::ImpFindKashidas( ContentNode* pNode, sal_Int32 nStart, sal_I
// Do not consider vowel marks when checking if a character
// can be connected to previous character.
if ( !isTransparentChar ( cCh) )
+ {
cPrevCh = cCh;
+ nPrevIdx = nIdx;
+ }
++nIdx;
} // end of current word