summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2011-09-29 13:31:39 +0200
committerQt by Nokia <qt-info@nokia.com>2011-09-29 15:22:07 +0200
commit7fb90066b3aa7e602466a61e0ffaadbf9002525c (patch)
tree2b8186c7fb45a8fc6f9ef53a77f17b83747684c6 /src/gui/text
parent87ae97c11ab9b298c0ce6701873b45fc3992b385 (diff)
Move Qt::escape to QtCore
Merge-request: 56 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Change-Id: I25c5f46cf53a653db26dbeb92865e61f69980bfd Reviewed-on: http://codereview.qt-project.org/5792 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@nokia.com> Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qtextdocument.cpp34
-rw-r--r--src/gui/text/qtextdocument.h1
2 files changed, 1 insertions, 34 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index c1714edb0c..c44e98b77e 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -142,38 +142,6 @@ bool Qt::mightBeRichText(const QString& text)
}
/*!
- Converts the plain text string \a plain to a HTML string with
- HTML metacharacters \c{<}, \c{>}, \c{&}, and \c{"} replaced by HTML
- entities.
-
- Example:
-
- \snippet doc/src/snippets/code/src_gui_text_qtextdocument.cpp 0
-
- This function is defined in the \c <QTextDocument> header file.
-
- \sa convertFromPlainText(), mightBeRichText()
-*/
-QString Qt::escape(const QString& plain)
-{
- QString rich;
- rich.reserve(int(plain.length() * 1.1));
- for (int i = 0; i < plain.length(); ++i) {
- if (plain.at(i) == QLatin1Char('<'))
- rich += QLatin1String("&lt;");
- else if (plain.at(i) == QLatin1Char('>'))
- rich += QLatin1String("&gt;");
- else if (plain.at(i) == QLatin1Char('&'))
- rich += QLatin1String("&amp;");
- else if (plain.at(i) == QLatin1Char('"'))
- rich += QLatin1String("&quot;");
- else
- rich += plain.at(i);
- }
- return rich;
-}
-
-/*!
\fn QString Qt::convertFromPlainText(const QString &plain, WhiteSpaceMode mode)
Converts the plain text string \a plain to an HTML-formatted
@@ -3002,7 +2970,7 @@ void QTextHtmlExporter::emitFrameStyle(const QTextFrameFormat &format, FrameType
The \a encoding parameter specifies the value for the charset attribute
in the html header. For example if 'utf-8' is specified then the
beginning of the generated html will look like this:
- \snippet doc/src/snippets/code/src_gui_text_qtextdocument.cpp 1
+ \snippet doc/src/snippets/code/src_gui_text_qtextdocument.cpp 0
If no encoding is specified then no such meta information is generated.
diff --git a/src/gui/text/qtextdocument.h b/src/gui/text/qtextdocument.h
index 363d7abb21..9d9af2b5bb 100644
--- a/src/gui/text/qtextdocument.h
+++ b/src/gui/text/qtextdocument.h
@@ -84,7 +84,6 @@ namespace Qt
};
Q_GUI_EXPORT bool mightBeRichText(const QString&);
- Q_GUI_EXPORT QString escape(const QString& plain);
Q_GUI_EXPORT QString convertFromPlainText(const QString &plain, WhiteSpaceMode mode = WhiteSpacePre);
#ifndef QT_NO_TEXTCODEC