mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
remove ODF format support leftovers
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
8619b09ff1
commit
7e8029a522
2 changed files with 2 additions and 78 deletions
|
@ -2840,13 +2840,8 @@ void QUnicodeControlCharacterMenu::menuActionTriggered()
|
|||
QStringList QTextEditMimeData::formats() const
|
||||
{
|
||||
if (!fragment.isEmpty())
|
||||
return QStringList() << QString::fromLatin1("text/plain") << QString::fromLatin1("text/html")
|
||||
#ifndef QT_NO_TEXTODFWRITER
|
||||
<< QString::fromLatin1("application/vnd.oasis.opendocument.text")
|
||||
#endif
|
||||
;
|
||||
else
|
||||
return QMimeData::formats();
|
||||
return QStringList() << QString::fromLatin1("text/plain") << QString::fromLatin1("text/html");
|
||||
return QMimeData::formats();
|
||||
}
|
||||
|
||||
QVariant QTextEditMimeData::retrieveData(const QString &mimeType, QVariant::Type type) const
|
||||
|
@ -2861,15 +2856,6 @@ void QTextEditMimeData::setup() const
|
|||
QTextEditMimeData *that = const_cast<QTextEditMimeData *>(this);
|
||||
#ifndef QT_NO_TEXTHTMLPARSER
|
||||
that->setData(QLatin1String("text/html"), fragment.toHtml("utf-8").toUtf8());
|
||||
#endif
|
||||
#ifndef QT_NO_TEXTODFWRITER
|
||||
{
|
||||
QBuffer buffer;
|
||||
QTextDocumentWriter writer(&buffer, "ODF");
|
||||
writer.write(fragment);
|
||||
buffer.close();
|
||||
that->setData(QLatin1String("application/vnd.oasis.opendocument.text"), buffer.data());
|
||||
}
|
||||
#endif
|
||||
that->setText(fragment.toPlainText());
|
||||
fragment = QTextDocumentFragment();
|
||||
|
|
|
@ -49,10 +49,6 @@ private slots:
|
|||
void shaping_data();
|
||||
void shaping();
|
||||
|
||||
void odfWriting_empty();
|
||||
void odfWriting_text();
|
||||
void odfWriting_images();
|
||||
|
||||
void constructControl();
|
||||
void constructDocument();
|
||||
|
||||
|
@ -145,64 +141,6 @@ void tst_QText::shaping()
|
|||
}
|
||||
}
|
||||
|
||||
void tst_QText::odfWriting_empty()
|
||||
{
|
||||
QVERIFY(QTextDocumentWriter::supportedDocumentFormats().contains("ODF")); // odf compiled in
|
||||
QTextDocument *doc = new QTextDocument();
|
||||
// write it
|
||||
QBENCHMARK {
|
||||
QBuffer buffer;
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
QTextDocumentWriter writer(&buffer, "ODF");
|
||||
writer.write(doc);
|
||||
}
|
||||
delete doc;
|
||||
}
|
||||
|
||||
void tst_QText::odfWriting_text()
|
||||
{
|
||||
QTextDocument *doc = new QTextDocument();
|
||||
QTextCursor cursor(doc);
|
||||
QTextBlockFormat bf;
|
||||
bf.setIndent(2);
|
||||
cursor.insertBlock(bf);
|
||||
cursor.insertText(m_lorem);
|
||||
bf.setTopMargin(10);
|
||||
cursor.insertBlock(bf);
|
||||
cursor.insertText(m_lorem);
|
||||
bf.setRightMargin(30);
|
||||
cursor.insertBlock(bf);
|
||||
cursor.insertText(m_lorem);
|
||||
|
||||
// write it
|
||||
QBENCHMARK {
|
||||
QBuffer buffer;
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
QTextDocumentWriter writer(&buffer, "ODF");
|
||||
writer.write(doc);
|
||||
}
|
||||
delete doc;
|
||||
}
|
||||
|
||||
void tst_QText::odfWriting_images()
|
||||
{
|
||||
QTextDocument *doc = new QTextDocument();
|
||||
QTextCursor cursor(doc);
|
||||
cursor.insertText(m_lorem);
|
||||
QImage image(400, 200, QImage::Format_ARGB32_Premultiplied);
|
||||
cursor.insertImage(image);
|
||||
cursor.insertText(m_lorem);
|
||||
|
||||
// write it
|
||||
QBENCHMARK {
|
||||
QBuffer buffer;
|
||||
buffer.open(QIODevice::WriteOnly);
|
||||
QTextDocumentWriter writer(&buffer, "ODF");
|
||||
writer.write(doc);
|
||||
}
|
||||
delete doc;
|
||||
}
|
||||
|
||||
QSize tst_QText::setupTextLayout(QTextLayout *layout, bool wrap, int wrapWidth)
|
||||
{
|
||||
layout->setCacheEnabled(true);
|
||||
|
|
Loading…
Add table
Reference in a new issue