summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorRitt Konstantin <ritt.ks@gmail.com>2009-06-08 08:42:42 (GMT)
committerMarius Storm-Olsen <marius@trolltech.com>2009-06-08 08:43:01 (GMT)
commiteb8789ba06949974eb4108b115a30f96e1500a81 (patch)
tree523aa4541353053454fb3fd307aee4a742653827 /src/gui/text
parentac30cbdceac428fa206a939e5d820b2bd77227fc (diff)
downloadQt-eb8789ba06949974eb4108b115a30f96e1500a81.zip
Qt-eb8789ba06949974eb4108b115a30f96e1500a81.tar.gz
Qt-eb8789ba06949974eb4108b115a30f96e1500a81.tar.bz2
Fix QT_NO_DATASTREAM macro checks and improve readability
Some checks where in the wrong locations, and some endifs where hard to read. Merge-request: 611 Reviewed-by: Marius Storm-Olsen <marius@trolltech.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextformat.cpp4
-rw-r--r--src/gui/text/qtextformat.h4
2 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp
index 38ac4ca..d93f084 100644
--- a/src/gui/text/qtextformat.cpp
+++ b/src/gui/text/qtextformat.cpp
@@ -142,6 +142,7 @@ QTextLength::operator QVariant() const
return QVariant(QVariant::TextLength, this);
}
+#ifndef QT_NO_DATASTREAM
QDataStream &operator<<(QDataStream &stream, const QTextLength &length)
{
return stream << qint32(length.lengthType) << double(length.fixedValueOrPercentage);
@@ -156,6 +157,7 @@ QDataStream &operator>>(QDataStream &stream, QTextLength &length)
length.lengthType = QTextLength::Type(type);
return stream;
}
+#endif // QT_NO_DATASTREAM
class QTextFormatPrivate : public QSharedData
{
@@ -374,6 +376,7 @@ void QTextFormatPrivate::recalcFont() const
fontDirty = false;
}
+#ifndef QT_NO_DATASTREAM
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &stream, const QTextFormat &fmt)
{
stream << fmt.format_type << fmt.properties();
@@ -396,6 +399,7 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt)
return stream;
}
+#endif // QT_NO_DATASTREAM
/*!
\class QTextFormat
diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h
index 8eaeeb1..96c0739 100644
--- a/src/gui/text/qtextformat.h
+++ b/src/gui/text/qtextformat.h
@@ -76,8 +76,10 @@ class QTextCursor;
class QTextDocument;
class QTextLength;
+#ifndef QT_NO_DATASTREAM
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextLength &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextLength &);
+#endif
class Q_GUI_EXPORT QTextLength
{
@@ -119,8 +121,10 @@ private:
inline QTextLength::QTextLength(Type atype, qreal avalue)
: lengthType(atype), fixedValueOrPercentage(avalue) {}
+#ifndef QT_NO_DATASTREAM
Q_GUI_EXPORT QDataStream &operator<<(QDataStream &, const QTextFormat &);
Q_GUI_EXPORT QDataStream &operator>>(QDataStream &, QTextFormat &);
+#endif
class Q_GUI_EXPORT QTextFormat
{