author | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2004-04-04 13:54:40 (UTC) |
commit | 16cf79e90b5217f8d4bfce2a0fa817ae4b73db36 (patch) (side-by-side diff) | |
tree | 0701eae15aa606a0211a2fccfde0eafdac69357c /noncore/apps/opie-write/qrichtext.cpp | |
parent | 8d2d2664e5f544b8292806e617deb7a0e4170dc0 (diff) | |
download | opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.zip opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.gz opie-16cf79e90b5217f8d4bfce2a0fa817ae4b73db36.tar.bz2 |
convert to Opie Debugging Framework
Diffstat (limited to 'noncore/apps/opie-write/qrichtext.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-write/qrichtext.cpp | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp index b77a0fc..c27eb1e 100644 --- a/noncore/apps/opie-write/qrichtext.cpp +++ b/noncore/apps/opie-write/qrichtext.cpp @@ -34,17 +34,23 @@ ** not clear to you. ** **********************************************************************/ #include "qrichtext_p.h" +/* OPIE */ +#include <opie2/odebug.h> +using namespace Opie::Core; + +/* QT */ #include "qdragobject.h" #include "qpaintdevicemetrics.h" #include "qdrawutil.h" #include "qcleanuphandler.h" +/* STD */ #include <stdlib.h> using namespace Qt3; static QTextCursor* richTextExportStart = 0; static QTextCursor* richTextExportEnd = 0; @@ -181,13 +187,13 @@ QTextDeleteCommand::~QTextDeleteCommand() } QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) { QTextParagraph *s = doc ? doc->paragAt( id ) : parag; if ( !s ) { - qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); + owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; return 0; } cursor.setParagraph( s ); cursor.setIndex( index ); int len = text.size(); @@ -209,13 +215,13 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) } QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) { QTextParagraph *s = doc ? doc->paragAt( id ) : parag; if ( !s ) { - qWarning( "can't locate parag at %d, last parag: %d", id, doc->lastParagraph()->paragId() ); + owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; return 0; } cursor.setParagraph( s ); cursor.setIndex( index ); QString str = QTextString::toString( text ); @@ -1541,16 +1547,16 @@ void QTextDocument::setRichTextInternal( const QString &text, QTextCursor* curso } if ( attr.contains( "background" ) ) { QImage img; QString bg = attr["background"]; const QMimeSource* m = factory_->data( bg, contxt ); if ( !m ) { - qWarning("QRichText: no mimesource for %s", bg.latin1() ); + owarn << "QRichText: no mimesource for " << bg.latin1() << "" << oendl; } else { if ( !QImageDrag::decode( m, img ) ) { - qWarning("QTextImage: cannot decode %s", bg.latin1() ); + owarn << "QTextImage: cannot decode " << bg.latin1() << "" << oendl; } } if ( !img.isNull() ) { QPixmap pm; pm.convertFromImage( img ); QBrush *b = new QBrush( QColor(), pm ); @@ -2149,13 +2155,13 @@ QString QTextDocument::richText() const QStyleSheetItem* item_p = styleSheet()->item("p"); QStyleSheetItem* item_ul = styleSheet()->item("ul"); QStyleSheetItem* item_ol = styleSheet()->item("ol"); QStyleSheetItem* item_li = styleSheet()->item("li"); if ( !item_p || !item_ul || !item_ol || !item_li ) { - qWarning( "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" ); + owarn << "QTextEdit: cannot export HTML due to insufficient stylesheet (lack of p, ul, ol, or li)" << oendl; return QString::null; } int pastListDepth = 0; int listDepth = 0; int futureListDepth = 0; QMemArray<int> listStyles(10); @@ -4093,13 +4099,13 @@ int QTextParagraph::lineHeightOfChar( int i, int *bl, int *y ) const } if ( it == lineStarts.begin() ) break; --it; } - qWarning( "QTextParagraph::lineHeightOfChar: couldn't find lh for %d", i ); + owarn << "QTextParagraph::lineHeightOfChar: couldn't find lh for " << i << "" << oendl; return 15; } QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) const { if ( !isValid() ) @@ -4119,13 +4125,13 @@ QTextStringChar *QTextParagraph::lineStartOfChar( int i, int *index, int *line ) if ( it == lineStarts.begin() ) break; --it; --l; } - qWarning( "QTextParagraph::lineStartOfChar: couldn't find %d", i ); + owarn << "QTextParagraph::lineStartOfChar: couldn't find " << i << "" << oendl; return 0; } int QTextParagraph::lines() const { if ( !isValid() ) @@ -4146,13 +4152,13 @@ QTextStringChar *QTextParagraph::lineStartOfLine( int line, int *index ) const int i = it.key(); if ( index ) *index = i; return &str->at( i ); } - qWarning( "QTextParagraph::lineStartOfLine: couldn't find %d", line ); + owarn << "QTextParagraph::lineStartOfLine: couldn't find " << line << "" << oendl; return 0; } int QTextParagraph::leftGap() const { if ( !isValid() ) @@ -5694,13 +5700,13 @@ QTextFormat *QTextFormatCollection::format( const QFont &f, const QColor &c ) return defFormat; cachedFormat = createFormat( f, c ); cachedFormat->collection = this; cKey.insert( cachedFormat->key(), cachedFormat ); if ( cachedFormat->key() != key ) - qWarning("ASSERT: keys for format not identical: '%s '%s'", cachedFormat->key().latin1(), key.latin1() ); + owarn << "ASSERT: keys for format not identical: '" << cachedFormat->key().latin1() << " '" << key.latin1() << "'" << oendl; return cachedFormat; } void QTextFormatCollection::remove( QTextFormat *f ) { if ( lastFormat == f ) @@ -6080,17 +6086,17 @@ QTextImage::QTextImage( QTextDocument *p, const QMap<QString, QString> &attr, co height = pm.height(); } else { QImage img; const QMimeSource* m = factory.data( imageName, context ); if ( !m ) { - qWarning("QTextImage: no mimesource for %s", imageName.latin1() ); + owarn << "QTextImage: no mimesource for " << imageName.latin1() << "" << oendl; } else { if ( !QImageDrag::decode( m, img ) ) { - qWarning("QTextImage: cannot decode %s", imageName.latin1() ); + owarn << "QTextImage: cannot decode " << imageName.latin1() << "" << oendl; } } if ( !img.isNull() ) { if ( width == 0 ) { width = img.width(); |