[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/kate/part
From:       John Tapsell <john () geola ! co ! uk>
Date:       2004-12-31 16:52:26
Message-ID: 20041231165226.D156A18682 () office ! kde ! org
[Download RAW message or body]

CVS commit by johnflux: 

Optimization of my own code - Don't do an html-copy (which is expensive) when you \
just select text.  I put this fix in khtml as well.


  M +12 -5     katedocument.cpp   1.779


--- kdelibs/kate/part/katedocument.cpp  #1.778:1.779
@@ -3363,11 +3363,18 @@ void KateDocument::copy()
     return;
 #ifndef QT_NO_MIMECLIPBOARD
+  QClipboard *cb = QApplication::clipboard();
+  
   KMultipleDrag *drag = new KMultipleDrag();
-  QTextDrag *htmltextdrag = new QTextDrag(selectionAsHtml()) ;
+  QString htmltext;
+  if(!cb->selectionModeEnabled())
+    htmltext = selectionAsHtml();
 
+  if(!htmltext.isEmpty()) {
+    QTextDrag *htmltextdrag = new QTextDrag(htmltext) ;
   htmltextdrag->setSubtype("html");
 
-  drag->addDragObject( new QTextDrag( selection()));
   drag->addDragObject( htmltextdrag);
+  }
+  drag->addDragObject( new QTextDrag( selection()));
 
   QApplication::clipboard()->setData(drag);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic