summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authoraavit <qt-info@nokia.com>2011-04-26 08:28:04 (GMT)
committeraavit <qt-info@nokia.com>2011-04-26 08:28:04 (GMT)
commitff8c99eb54f33108709f9f3107b35780a80f3f17 (patch)
tree11d4c08809bf90fd8b25b175b4903ab00d36e3d6 /src/gui/text
parent28c7e17d9eeb8264ad9e26a5b93e5ff744add9a6 (diff)
parent7ef9f99301a7c71fdb835f9e1f27d3111557aa2e (diff)
downloadQt-ff8c99eb54f33108709f9f3107b35780a80f3f17.zip
Qt-ff8c99eb54f33108709f9f3107b35780a80f3f17.tar.gz
Qt-ff8c99eb54f33108709f9f3107b35780a80f3f17.tar.bz2
Merge remote branch 'qt-mainline/master'
Conflicts: configure
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qfragmentmap_p.h5
-rw-r--r--src/gui/text/qtextobject.cpp5
-rw-r--r--src/gui/text/qtextobject.h2
-rw-r--r--src/gui/text/qzip.cpp2
-rw-r--r--src/gui/text/qzipwriter_p.h2
5 files changed, 13 insertions, 3 deletions
diff --git a/src/gui/text/qfragmentmap_p.h b/src/gui/text/qfragmentmap_p.h
index 501bfff..4057142 100644
--- a/src/gui/text/qfragmentmap_p.h
+++ b/src/gui/text/qfragmentmap_p.h
@@ -195,6 +195,10 @@ public:
head->root = new_root;
}
+ inline bool isValid(uint n) const {
+ return n > 0 && n != head->freelist;
+ }
+
union {
Header *head;
Fragment *fragments;
@@ -854,6 +858,7 @@ public:
return data.fragment(index);
}
inline uint position(uint node, uint field = 0) const { return data.position(node, field); }
+ inline bool isValid(uint n) const { return data.isValid(n); }
inline uint next(uint n) const { return data.next(n); }
inline uint previous(uint n) const { return data.previous(n); }
inline uint size(uint node, uint field = 0) const { return data.size(node, field); }
diff --git a/src/gui/text/qtextobject.cpp b/src/gui/text/qtextobject.cpp
index 0a9dff8..5c1c8b9 100644
--- a/src/gui/text/qtextobject.cpp
+++ b/src/gui/text/qtextobject.cpp
@@ -891,6 +891,11 @@ QTextBlockUserData::~QTextBlockUserData()
Returns true if this text block is valid; otherwise returns false.
*/
+bool QTextBlock::isValid() const
+{
+ return p != 0 && p->blockMap().isValid(n);
+}
+
/*!
\fn QTextBlock &QTextBlock::operator=(const QTextBlock &other)
diff --git a/src/gui/text/qtextobject.h b/src/gui/text/qtextobject.h
index 2e588c2..ad8e657 100644
--- a/src/gui/text/qtextobject.h
+++ b/src/gui/text/qtextobject.h
@@ -205,7 +205,7 @@ public:
inline QTextBlock(const QTextBlock &o) : p(o.p), n(o.n) {}
inline QTextBlock &operator=(const QTextBlock &o) { p = o.p; n = o.n; return *this; }
- inline bool isValid() const { return p != 0 && n != 0; }
+ bool isValid() const;
inline bool operator==(const QTextBlock &o) const { return p == o.p && n == o.n; }
inline bool operator!=(const QTextBlock &o) const { return p != o.p || n != o.n; }
diff --git a/src/gui/text/qzip.cpp b/src/gui/text/qzip.cpp
index 0f7edae..9f21886 100644
--- a/src/gui/text/qzip.cpp
+++ b/src/gui/text/qzip.cpp
@@ -572,7 +572,7 @@ void QZipWriterPrivate::addEntry(EntryType type, const QString &fileName, const
"directory",
"file ",
"symlink " };
- ZDEBUG() << "adding" << entryTypes[type] <<":" << fileName.toUtf8().data() << (type == 2 ? (" -> " + contents).constData() : "");
+ ZDEBUG() << "adding" << entryTypes[type] <<":" << fileName.toUtf8().data() << (type == 2 ? QByteArray(" -> " + contents).constData() : "");
#endif
if (! (device->isOpen() || device->open(QIODevice::WriteOnly))) {
diff --git a/src/gui/text/qzipwriter_p.h b/src/gui/text/qzipwriter_p.h
index 0ee445e..153ef19 100644
--- a/src/gui/text/qzipwriter_p.h
+++ b/src/gui/text/qzipwriter_p.h
@@ -61,7 +61,7 @@ QT_BEGIN_NAMESPACE
class QZipWriterPrivate;
-class Q_AUTOTEST_EXPORT QZipWriter
+class Q_GUI_EXPORT QZipWriter
{
public:
QZipWriter(const QString &fileName, QIODevice::OpenMode mode = (QIODevice::WriteOnly | QIODevice::Truncate) );