[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: kdenetwork/kopete/kopete/chatwindow
From: Olivier Goffart <ogoffart () tiscalinet ! be>
Date: 2005-01-09 17:19:47
Message-ID: 20050109171947.602851BAB1 () office ! kde ! org
[Download RAW message or body]
CVS commit by ogoffart:
RangeImpl::toHTML is implemented in KDE CVS, no need to work around anymore
M +14 -11 chatmessagepart.cpp 1.11
--- kdenetwork/kopete/kopete/chatwindow/chatmessagepart.cpp #1.10:1.11
@@ -2,9 +2,9 @@
chatmessagepart.cpp - Chat Message KPart
- Copyright (c) 2002-2004 by Olivier Goffart <ogoffart@tiscalinet.be>
+ Copyright (c) 2002-2005 by Olivier Goffart <ogoffart@tiscalinet.be>
Copyright (c) 2002-2003 by Martijn Klingens <klingens@kde.org>
Copyright (c) 2004 by Richard Smith <kde@metafoo.co.uk>
- Kopete (c) 2002-2004 by the Kopete developers <kopete-devel@kde.org>
+ Kopete (c) 2002-2005 by the Kopete developers <kopete-devel@kde.org>
*************************************************************************
@@ -59,4 +59,5 @@
#define TRANSFORM_ALL_MESSAGES
+#if !(KDE_IS_VERSION(3,3,90))
//From kdelibs/khtml/misc/htmltags.h
// used in ChatMessagePart::copy()
@@ -84,4 +85,5 @@
#define ID_TT 97
#define ID_UL 99
+#endif
@@ -616,14 +618,14 @@ void ChatMessagePart::copy()
* The objective of this function is to keep the text of emoticons (of or latex \
image) when copying.
* see Bug 61676
- * It could be done in a single line if RangeImpl::toHTML was implemented \
(see the #if 0 bellow)
- * But since it doesn't work, i have to handle it myself with KHTML some \
internals.
- * I copied a big part of the code bellow from KHTMLPart::selectedText. only a \
bit modified to add the img's title + * RangeImpl::toHTML was not implemented before \
KDE 3.4
*/
QString text;
- #if 0 //This doesn't work because RangeImpl::toHTML is not yet implemented
- text=Kopete::Message::unescape( selection().toHTML().string() );
- #endif
+#if KDE_IS_VERSION(3,3,90)
+ text=Kopete::Message::unescape( selection().toHTML().string() ).stripWhiteSpace();
+ // Message::unsescape will replace image by his title attribute
+ // stripWhiteSpace is for removing the newline added by the <!DOCTYPE> and other xml \
things of RangeImpl::toHTML +#else
DOM::Node startNode, endNode;
@@ -734,4 +736,5 @@ void ChatMessagePart::copy()
//END: copied from KHTMLPart::selectedText
+#endif
QApplication::clipboard()->setText( text, QClipboard::Clipboard );
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic