-rw-r--r-- | noncore/apps/opie-write/qrichtext.cpp | 44 |
1 files changed, 9 insertions, 35 deletions
diff --git a/noncore/apps/opie-write/qrichtext.cpp b/noncore/apps/opie-write/qrichtext.cpp index 768da44..b457cd6 100644 --- a/noncore/apps/opie-write/qrichtext.cpp +++ b/noncore/apps/opie-write/qrichtext.cpp | |||
@@ -191,8 +191,5 @@ QTextCursor *QTextDeleteCommand::execute( QTextCursor *c ) | |||
191 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; | 191 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; |
192 | if ( !s && doc ) { | 192 | if ( !s ) { |
193 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; | 193 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; |
194 | return 0; | 194 | return 0; |
195 | } else if ( !doc ) { | ||
196 | owarn << "No valid doc" << oendl; | ||
197 | return 0; | ||
198 | } | 195 | } |
@@ -222,8 +219,5 @@ QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) | |||
222 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; | 219 | QTextParagraph *s = doc ? doc->paragAt( id ) : parag; |
223 | if ( !s && doc ) { | 220 | if ( !s ) { |
224 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; | 221 | owarn << "can't locate parag at " << id << ", last parag: " << doc->lastParagraph()->paragId() << "" << oendl; |
225 | return 0; | 222 | return 0; |
226 | } else if ( !doc ) { | ||
227 | owarn << "No valid doc" << oendl; | ||
228 | return 0; | ||
229 | } | 223 | } |
@@ -241,5 +235,2 @@ QTextCursor *QTextDeleteCommand::unexecute( QTextCursor *c ) | |||
241 | c->gotoNextLetter(); | 235 | c->gotoNextLetter(); |
242 | } else { | ||
243 | owarn << "No valid cursor" << oendl; | ||
244 | return 0; | ||
245 | } | 236 | } |
@@ -1403,17 +1394,6 @@ struct Q_EXPORT QTextDocumentTag { | |||
1403 | 1394 | ||
1404 | #define NEWPAR do { \ | 1395 | #define NEWPAR do{ if ( !hasNewPar) { \ |
1405 | if ( !hasNewPar) { \ | ||
1406 | if ( !curpar ) { \ | ||
1407 | owarn << "no current paragraph" << oendl; \ | ||
1408 | return; \ | ||
1409 | } \ | ||
1410 | if ( !textEditMode && curpar && curpar->length()>1 && curpar->at( curpar->length()-2)->c == QChar_linesep ) \ | 1396 | if ( !textEditMode && curpar && curpar->length()>1 && curpar->at( curpar->length()-2)->c == QChar_linesep ) \ |
1411 | curpar->remove( curpar->length()-2, 1 ); \ | 1397 | curpar->remove( curpar->length()-2, 1 ); \ |
1412 | curpar = createParagraph( this, curpar, curpar->next() ); styles.append( vec ); \ | 1398 | curpar = createParagraph( this, curpar, curpar->next() ); styles.append( vec ); vec = 0;} \ |
1413 | if ( !curpar ) { \ | ||
1414 | owarn << "failed in creating a new paragraph" << oendl; \ | ||
1415 | return; \ | ||
1416 | } \ | ||
1417 | vec = 0; \ | ||
1418 | } \ | ||
1419 | hasNewPar = TRUE; \ | 1399 | hasNewPar = TRUE; \ |
@@ -1425,4 +1405,3 @@ struct Q_EXPORT QTextDocumentTag { | |||
1425 | space = TRUE; \ | 1405 | space = TRUE; \ |
1426 | delete vec; \ | 1406 | delete vec; vec = new QPtrVector<QStyleSheetItem>( (uint)tags.count() + 1); \ |
1427 | vec = new QPtrVector<QStyleSheetItem>( (uint)tags.count() + 1); \ | ||
1428 | int i = 0; \ | 1407 | int i = 0; \ |
@@ -1433,2 +1412,3 @@ struct Q_EXPORT QTextDocumentTag { | |||
1433 | 1412 | ||
1413 | |||
1434 | void QTextDocument::setRichText( const QString &text, const QString &context ) | 1414 | void QTextDocument::setRichText( const QString &text, const QString &context ) |
@@ -1917,7 +1897,4 @@ void QTextDocument::setRichTextMarginsInternal( QPtrList< QPtrVector<QStyleSheet | |||
1917 | int i, mar; | 1897 | int i, mar; |
1918 | QStyleSheetItem* mainStyle = (*curStyle)[curStyle->size()-1]; | 1898 | QStyleSheetItem* mainStyle = curStyle->size() ? (*curStyle)[curStyle->size()-1] : 0; |
1919 | if ( !mainStyle ) | 1899 | if ( mainStyle && mainStyle->displayMode() == QStyleSheetItem::DisplayListItem ) |
1920 | return; | ||
1921 | |||
1922 | if ( mainStyle->displayMode() == QStyleSheetItem::DisplayListItem ) | ||
1923 | stylesPar->setListItem( TRUE ); | 1900 | stylesPar->setListItem( TRUE ); |
@@ -3072,3 +3049,2 @@ QTextParagraph *QTextDocument::draw( QPainter *p, int cx, int cy, int cw, int ch | |||
3072 | 3049 | ||
3073 | bool fullWidthSelection = FALSE; | ||
3074 | while ( parag ) { | 3050 | while ( parag ) { |
@@ -3079,4 +3055,2 @@ QTextParagraph *QTextDocument::draw( QPainter *p, int cx, int cy, int cw, int ch | |||
3079 | QRect pr = parag->rect(); | 3055 | QRect pr = parag->rect(); |
3080 | if ( fullWidthSelection ) | ||
3081 | pr.setWidth( parag->document()->width() ); | ||
3082 | if ( pr.y() > cy + ch ) | 3056 | if ( pr.y() > cy + ch ) |
@@ -5366,3 +5340,3 @@ int QTextFormatterBreakWords::format( QTextDocument *doc, QTextParagraph *parag, | |||
5366 | // ### next line should not be needed | 5340 | // ### next line should not be needed |
5367 | if ( c && painter ) | 5341 | if ( painter ) |
5368 | c->format()->setPainter( painter ); | 5342 | c->format()->setPainter( painter ); |