summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-write/qrichtext_p.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-write/qrichtext_p.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-write/qrichtext_p.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/noncore/apps/opie-write/qrichtext_p.cpp b/noncore/apps/opie-write/qrichtext_p.cpp
index 6783e0b..2e8b09c 100644
--- a/noncore/apps/opie-write/qrichtext_p.cpp
+++ b/noncore/apps/opie-write/qrichtext_p.cpp
@@ -14,48 +14,51 @@
** LICENSE.QPL included in the packaging of this file.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
** licenses may use this file in accordance with the Qt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
** Contact info@trolltech.com if any conditions of this licensing are
** not clear to you.
**
**********************************************************************/
+#include <opie2/odebug.h>
+using namespace Opie::Core;
+
#include "qrichtext_p.h"
using namespace Qt3;
QTextCommand::~QTextCommand() {}
QTextCommand::Commands QTextCommand::type() const { return Invalid; }
QTextCustomItem::~QTextCustomItem() {}
void QTextCustomItem::adjustToPainter( QPainter* p){ if ( p ) width = 0; }
QTextCustomItem::Placement QTextCustomItem::placement() const { return PlaceInline; }
bool QTextCustomItem::ownLine() const { return FALSE; }
void QTextCustomItem::resize( int nwidth ){ width = nwidth; }
void QTextCustomItem::invalidate() {}
bool QTextCustomItem::isNested() const { return FALSE; }
int QTextCustomItem::minimumWidth() const { return 0; }
QString QTextCustomItem::richText() const { return QString::null; }
bool QTextCustomItem::enter( QTextCursor *, QTextDocument*&, QTextParagraph *&, int &, int &, int &, bool )
{
return TRUE;
@@ -116,49 +119,49 @@ int QTextCursor::y() const
{
int dummy, line;
para->lineStartOfChar( idx, &dummy, &line );
return para->lineY( line );
}
int QTextCursor::globalX() const { return totalOffsetX() + para->rect().x() + x(); }
int QTextCursor::globalY() const { return totalOffsetY() + para->rect().y() + y(); }
QTextDocument *QTextCursor::document() const
{
return para ? para->document() : 0;
}
void QTextCursor::gotoPosition( QTextParagraph* p, int index )
{
if ( para && p != para ) {
while ( para->document() != p->document() && !indices.isEmpty() )
pop();
Q_ASSERT( indices.isEmpty() || para->document() == p->document() );
}
para = p;
if ( index < 0 || index >= para->length() ) {
#if defined(QT_CHECK_RANGE)
- qWarning( "QTextCursor::gotoParagraph Index: %d out of range", index );
+ owarn << "QTextCursor::gotoParagraph Index: " << index << " out of range" << oendl;
#endif
index = index < 0 ? 0 : para->length() - 1;
}
tmpIndex = -1;
idx = index;
}
bool QTextDocument::hasSelection( int id, bool visible ) const
{
return ( selections.find( id ) != selections.end() &&
( !visible ||
( (QTextDocument*)this )->selectionStartCursor( id ) !=
( (QTextDocument*)this )->selectionEndCursor( id ) ) );
}
void QTextDocument::setSelectionStart( int id, const QTextCursor &cursor )
{
QTextDocumentSelection sel;
sel.startCursor = cursor;
sel.endCursor = cursor;
sel.swapped = FALSE;
selections[ id ] = sel;
}
@@ -456,98 +459,98 @@ int QTextParagraph::selectionEnd( int id ) const
QMap<int, QTextParagraphSelection>::ConstIterator it = mSelections->find( id );
if ( it == mSelections->end() )
return -1;
return ( *it ).end;
}
bool QTextParagraph::hasSelection( int id ) const
{
return mSelections ? mSelections->contains( id ) : FALSE;
}
bool QTextParagraph::fullSelected( int id ) const
{
if ( !mSelections )
return FALSE;
QMap<int, QTextParagraphSelection>::ConstIterator it = mSelections->find( id );
if ( it == mSelections->end() )
return FALSE;
return ( *it ).start == 0 && ( *it ).end == str->length() - 1;
}
int QTextParagraph::lineY( int l ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineY: line %d out of range!", l );
+ owarn << "QTextParagraph::lineY: line " << l << " out of range!" << oendl;
return 0;
}
if ( !isValid() )
( (QTextParagraph*)this )->format();
QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->y;
}
int QTextParagraph::lineBaseLine( int l ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineBaseLine: line %d out of range!", l );
+ owarn << "QTextParagraph::lineBaseLine: line " << l << " out of range!" << oendl;
return 10;
}
if ( !isValid() )
( (QTextParagraph*)this )->format();
QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->baseLine;
}
int QTextParagraph::lineHeight( int l ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineHeight: line %d out of range!", l );
+ owarn << "QTextParagraph::lineHeight: line " << l << " out of range!" << oendl;
return 15;
}
if ( !isValid() )
( (QTextParagraph*)this )->format();
QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
return ( *it )->h;
}
void QTextParagraph::lineInfo( int l, int &y, int &h, int &bl ) const
{
if ( l > (int)lineStarts.count() - 1 ) {
- qWarning( "QTextParagraph::lineInfo: line %d out of range!", l );
- qDebug( "%d %d", (int)lineStarts.count() - 1, l );
+ owarn << "QTextParagraph::lineInfo: line " << l << " out of range!" << oendl;
+ odebug << "" << (int)lineStarts.count() - 1 << " " << l << "" << oendl;
y = 0;
h = 15;
bl = 10;
return;
}
if ( !isValid() )
( (QTextParagraph*)this )->format();
QMap<int, QTextLineStart*>::ConstIterator it = lineStarts.begin();
while ( l-- > 0 )
++it;
y = ( *it )->y;
h = ( *it )->h;
bl = ( *it )->baseLine;
}
void QTextParagraph::setAlignment( int a )
{
if ( a == (int)align )
return;
align = a;
invalidate( 0 );