| 1 |
Index: source/core/text/frmcrsr.cxx
|
| 2 |
===================================================================
|
| 3 |
RCS file: /cvs/sw/sw/source/core/text/frmcrsr.cxx,v
|
| 4 |
retrieving revision 1.42
|
| 5 |
diff -u -r1.42 frmcrsr.cxx
|
| 6 |
--- openoffice.org.orig/sw/source/core/text/frmcrsr.cxx 16 Sep 2006 21:33:39 -0000 1.42
|
| 7 |
+++ openoffice.org/sw/source/core/text/frmcrsr.cxx 5 Feb 2007 13:42:51 -0000
|
| 8 |
@@ -60,6 +60,10 @@
|
| 9 |
#include "swfntcch.hxx" // SwFontAccess
|
| 10 |
#include "flyfrm.hxx"
|
| 11 |
|
| 12 |
+#include <com/sun/star/i18n/ScriptType.hdl>
|
| 13 |
+#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
|
| 14 |
+#include "breakit.hxx"
|
| 15 |
+
|
| 16 |
#if OSL_DEBUG_LEVEL > 1
|
| 17 |
#include "txtpaint.hxx"
|
| 18 |
#endif
|
| 19 |
@@ -289,7 +293,33 @@
|
| 20 |
nMaxY = pFrm->SwitchVerticalToHorizontal( nMaxY );
|
| 21 |
|
| 22 |
sal_Bool bGoOn = sal_True;
|
| 23 |
- xub_StrLen nOffset = rPos.nContent.GetIndex();
|
| 24 |
+ xub_StrLen nOffset = rPos.nContent.GetIndex();
|
| 25 |
+
|
| 26 |
+ // #i74188 Ensure that the cursor is not drawn inside a combined char
|
| 27 |
+ const SwTxtNode* pTxtNd = ((const SwTxtFrm*)this)->GetTxtNode();
|
| 28 |
+ if( pTxtNd && ::com::sun::star::i18n::ScriptType::COMPLEX ==
|
| 29 |
+ pBreakIt->GetBreakIter()->getScriptType( pTxtNd->GetTxt(), nOffset ) )
|
| 30 |
+ {
|
| 31 |
+ sal_Int32 nCount = 1;
|
| 32 |
+ const ::com::sun::star::lang::Locale &rLocale =
|
| 33 |
+ pBreakIt->GetLocale( pTxtNd->GetLang( nOffset ) );
|
| 34 |
+ xub_StrLen nRight = (xub_StrLen)pBreakIt->GetBreakIter()->nextCharacters(
|
| 35 |
+ pTxtNd->GetTxt(), nOffset, rLocale,
|
| 36 |
+ ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL,
|
| 37 |
+ nCount, nCount );
|
| 38 |
+
|
| 39 |
+ xub_StrLen nLeft = (xub_StrLen)pBreakIt->GetBreakIter()->previousCharacters(
|
| 40 |
+ pTxtNd->GetTxt(), nRight, rLocale,
|
| 41 |
+ ::com::sun::star::i18n::CharacterIteratorMode::SKIPCELL,
|
| 42 |
+ nCount, nCount );
|
| 43 |
+
|
| 44 |
+ if ( ( nLeft != nOffset ) && ( nRight != nOffset ) )
|
| 45 |
+ {
|
| 46 |
+ nOffset = ( Abs( nRight - nOffset ) < Abs( nLeft - nOffset ) ) ?
|
| 47 |
+ nRight : nLeft;
|
| 48 |
+ }
|
| 49 |
+ }
|
| 50 |
+
|
| 51 |
xub_StrLen nNextOfst;
|
| 52 |
|
| 53 |
do
|