Sophie

Sophie

distrib > Mandriva > cs4.0 > i586 > by-pkgid > 6db27311da393084cc6f2b414a3b666f > files > 19

qt3-3.3.6-1.1.20060mlcs4.src.rpm

--- qt-x11-free-3.3.6/src/widgets/qtextedit.cpp.im	2006-03-22 12:18:30.000000000 +0100
+++ qt-x11-free-3.3.6/src/widgets/qtextedit.cpp	2006-03-22 12:42:49.000000000 +0100
@@ -1035,7 +1035,7 @@
 
     bool drawCur = hasFocus() || viewport()->hasFocus();
     if (( hasSelectedText() && !style().styleHint( QStyle::SH_BlinkCursorWhenTextSelected ) ) ||
-	isReadOnly() || !cursorVisible )
+	isReadOnly() || !cursorVisible || doc->hasSelection( QTextDocument::IMSelectionText ))
 	drawCur = FALSE;
     QColorGroup g = colorGroup();
     const QColorGroup::ColorRole backRole = QPalette::backgroundRoleFromMode(backgroundMode());
@@ -1661,6 +1661,7 @@
 	}
     }
 
+    updateMicroFocusHint();
     repaintChanged();
 
     // microFocusHint is required to place candidate window for Asian
@@ -2177,6 +2178,7 @@
 	 ( !style().styleHint( QStyle::SH_BlinkCursorWhenTextSelected ) &&
 	   ( d->optimMode ? optimHasSelection() : doc->hasSelection( QTextDocument::Standard, TRUE ))) ||
 	 ( visible && !hasFocus() && !viewport()->hasFocus() && !inDnD ) ||
+	 doc->hasSelection( QTextDocument::IMSelectionText ) ||
 	 isReadOnly() )
 	return;
 
@@ -2907,8 +2909,14 @@
     // Asian input methods. Asian input methods need start point of IM
     // selection text to place candidate window as adjacent to the
     // selection text.
-    if ( d->preeditStart != -1 )
-	c.setIndex( d->preeditStart );
+    if ( d->preeditStart != -1 ) {
+      c.setIndex( d->preeditStart );
+      if(doc->hasSelection(QTextDocument::IMSelectionText)) {
+         int para, index;
+         doc->selectionStart(QTextDocument::IMSelectionText, para, index);
+         c.setIndex(index);
+      }
+    }
 #endif
 
     if ( hasFocus() || viewport()->hasFocus() ) {
--- qt-x11-free-3.3.6/src/widgets/qlineedit.cpp.im	2006-03-22 12:13:27.000000000 +0100
+++ qt-x11-free-3.3.6/src/widgets/qlineedit.cpp	2006-03-22 12:15:30.000000000 +0100
@@ -1840,17 +1840,14 @@
     d->imend = d->imstart + e->text().length();
     d->imselstart = d->imstart + e->cursorPos();
     d->imselend = d->imselstart + e->selectionLength();
-#if 0
-    d->cursor = e->selectionLength() ? d->imend : d->imselend;
-#else
     // Cursor placement code is changed for Asian input method that
     // shows candidate window. This behavior is same as Qt/E 2.3.7
     // which supports Asian input methods. Asian input methods need
     // start point of IM selection text to place candidate window as
     // adjacent to the selection text.
     d->cursor = d->imselstart;
-#endif
     d->updateTextLayout();
+    d->updateMicroFocusHint();
     update();
 }