diff options
Diffstat (limited to 'sw/source/core/text/porlay.cxx')
-rw-r--r-- | sw/source/core/text/porlay.cxx | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx index 3db6a07600e9..d1e4b967f235 100644 --- a/sw/source/core/text/porlay.cxx +++ b/sw/source/core/text/porlay.cxx @@ -1509,10 +1509,9 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, { const OUString& rWord = aScanner.GetWord(); - 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 @@ -1560,7 +1559,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, // check if character is connectable to previous character, if ( lcl_ConnectToPrev( cCh, cPrevCh ) ) { - nKashidaPos = aScanner.GetBegin() + nIdx - 1; + nKashidaPos = aScanner.GetBegin() + nPrevIdx; nPriorityLevel = 2; } } @@ -1581,7 +1580,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, // check if character is connectable to previous character, if ( lcl_ConnectToPrev( cCh, cPrevCh ) ) { - nKashidaPos = aScanner.GetBegin() + nIdx - 1; + nKashidaPos = aScanner.GetBegin() + nPrevIdx; nPriorityLevel = 3; } } @@ -1601,7 +1600,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, // check if character is connectable to previous character, if ( lcl_ConnectToPrev( cCh, cPrevCh ) ) { - nKashidaPos = aScanner.GetBegin() + nIdx - 1; + nKashidaPos = aScanner.GetBegin() + nPrevIdx; nPriorityLevel = 4; } } @@ -1623,7 +1622,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, // check if character is connectable to previous character, if ( lcl_ConnectToPrev( cCh, cPrevCh ) ) { - nKashidaPos = aScanner.GetBegin() + nIdx - 1; + nKashidaPos = aScanner.GetBegin() + nPrevIdx; nPriorityLevel = 5; } } @@ -1639,7 +1638,7 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, // check if character is connectable to previous character, if ( lcl_ConnectToPrev( cCh, cPrevCh ) ) { - nKashidaPos = aScanner.GetBegin() + nIdx - 1; + nKashidaPos = aScanner.GetBegin() + nPrevIdx; nPriorityLevel = 6; } } @@ -1648,7 +1647,10 @@ void SwScriptInfo::InitScriptInfo(const SwTextNode& rNode, // 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 |