src/hbwidgets/editors/hbabstractedit_p.cpp
changeset 30 80e4d18b72f5
parent 28 b7da29130b0e
equal deleted inserted replaced
28:b7da29130b0e 30:80e4d18b72f5
   195 
   195 
   196 HbAbstractEditPrivate::HbAbstractEditPrivate () :
   196 HbAbstractEditPrivate::HbAbstractEditPrivate () :
   197     HbWidgetPrivate(),
   197     HbWidgetPrivate(),
   198     doc(0),
   198     doc(0),
   199     placeholderDoc(0),
   199     placeholderDoc(0),
       
   200     previousCursorAnchor(-1),
       
   201     previousCursorPosition(-1),
   200     validator(0),
   202     validator(0),
   201     imEditInProgress(false),
   203     imEditInProgress(false),
   202     imPosition(0),
   204     imPosition(0),
   203     imAdded(0),
   205     imAdded(0),
   204     imRemoved(0),
   206     imRemoved(0),
   364 
   366 
   365     doc->setModified(false);
   367     doc->setModified(false);
   366 
   368 
   367     ensureCursorVisible();
   369     ensureCursorVisible();
   368 
   370 
   369     smileyEngineInstance()->setDocument(doc);
       
   370     if(q->isSmileysEnabled()) {
   371     if(q->isSmileysEnabled()) {
   371         smileyEngineInstance()->insertSmileys();
   372         smileyEngineInstance()->insertSmileys();
   372     }
   373     }
   373 }
   374 }
   374 
   375 
   664 
   665 
   665 void HbAbstractEditPrivate::_q_selectionChanged()
   666 void HbAbstractEditPrivate::_q_selectionChanged()
   666 {
   667 {
   667     Q_Q(HbAbstractEdit);
   668     Q_Q(HbAbstractEdit);
   668 
   669 
   669     if (cursor.hasSelection()) {   
   670     if (cursor.hasSelection()) {
   670         selectionControl = HbSelectionControl::attachEditor(q);
   671         selectionControl = HbSelectionControl::attachEditor(q);
   671         selectionControl->showHandles();
   672         selectionControl->showHandles();
   672     } else if (selectionControl){
   673     } else if (selectionControl){
   673         selectionControl->hideHandles();
   674         selectionControl->hideHandles();
   674     }
   675     }
   675     
   676 
   676     QTextCursor oldSelection(selectionCursor);
   677     QTextCursor oldSelection(selectionCursor);
   677     selectionCursor = cursor;
   678     selectionCursor = cursor;
   678     repaintOldAndNewSelection(oldSelection);
   679     repaintOldAndNewSelection(oldSelection);
   679 }
   680 }
   680 
   681 
  1047 {
  1048 {
  1048     Q_Q(HbAbstractEdit);
  1049     Q_Q(HbAbstractEdit);
  1049 
  1050 
  1050     doc = newDoc;
  1051     doc = newDoc;
  1051     cursor = QTextCursor(doc);
  1052     cursor = QTextCursor(doc);
       
  1053     if(smileysEnabled) {
       
  1054         smileyEngineInstance()->setDocument(doc);
       
  1055     }
  1052 
  1056 
  1053     QObject::connect(doc, SIGNAL(contentsChanged()), q, SLOT(_q_contentsChanged()));
  1057     QObject::connect(doc, SIGNAL(contentsChanged()), q, SLOT(_q_contentsChanged()));
  1054     QObject::connect(doc, SIGNAL(contentsChange(int, int, int)), q, SLOT(_q_contentsChange(int, int, int)));
  1058     QObject::connect(doc, SIGNAL(contentsChange(int, int, int)), q, SLOT(_q_contentsChange(int, int, int)));
  1055     QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(documentLayoutChanged()));
  1059     QObject::connect(doc, SIGNAL(documentLayoutChanged()), q, SLOT(documentLayoutChanged()));
  1056     QObject::connect(doc, SIGNAL(blockCountChanged(int)), q, SLOT(blockCountChanged(int)));
  1060     QObject::connect(doc, SIGNAL(blockCountChanged(int)), q, SLOT(blockCountChanged(int)));