Commit cf0873de authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Fix clazy warning

parent 08c7940a
Pipeline #21075 passed with stage
in 4 minutes and 34 seconds
......@@ -373,7 +373,7 @@ void RichTextComposerTest::testImageHtmlCode()
KPIMTextEdit::EmbeddedImage *image2 = images.last().data();
QString startHtml = QStringLiteral("<img src=\"arrow-up.png\"><img src=\"folder-new.png\">Bla<b>Blub</b>");
QString endHtml = QStringLiteral("<img src=\"cid:%1\"><img src=\"cid:%2\">Bla<b>Blub</b>")
.arg(image2->contentID).arg(image1->contentID);
.arg(image2->contentID, image1->contentID);
QCOMPARE(KPIMTextEdit::RichTextComposerImages::imageNamesToContentIds(startHtml.toLatin1(), images), endHtml.toLatin1());
}
......
......@@ -31,6 +31,7 @@ class RichTextComposer;
*/
class KPIMTEXTEDIT_EXPORT RichTextComposerEmailQuoteDecorator : public Sonnet::SpellCheckDecorator
{
Q_OBJECT
public:
explicit RichTextComposerEmailQuoteDecorator(RichTextComposer *textEdit);
~RichTextComposerEmailQuoteDecorator() override;
......
......@@ -234,7 +234,7 @@ MarkupDirector::processFragment(QTextBlock::iterator it, const QTextFragment &fr
void MarkupDirector::processDocumentContents(QTextFrame::iterator start,
QTextFrame::iterator end)
const QTextFrame::iterator &end)
{
while (!start.atEnd() && start != end) {
auto frame = start.currentFrame();
......@@ -304,7 +304,7 @@ QTextFrame::iterator MarkupDirector::processTable(QTextFrame::iterator it,
const auto headerRowCount = format.headerRowCount();
QList<QTextTableCell> alreadyProcessedCells;
QVector<QTextTableCell> alreadyProcessedCells;
for (int row = 0, total = table->rows(); row < total; ++row) {
// Put a thead element around here somewhere?
......@@ -467,7 +467,7 @@ MarkupDirector::skipBlockGroup(QTextFrame::iterator it,
}
QPair<QTextFrame::iterator, QTextBlock>
MarkupDirector::processBlockGroup(QTextFrame::iterator it,
MarkupDirector::processBlockGroup(const QTextFrame::iterator &it,
const QTextBlock &block,
QTextBlockGroup *blockGroup)
{
......@@ -512,7 +512,7 @@ MarkupDirector::processImage(QTextBlock::iterator it,
return it;
}
void MarkupDirector::processClosingElements(QTextBlock::iterator it)
void MarkupDirector::processClosingElements(const QTextBlock::iterator &it)
{
Q_D(MarkupDirector);
// The order of closing elements is determined by the order they were opened
......@@ -588,7 +588,7 @@ void MarkupDirector::processClosingElements(QTextBlock::iterator it)
}
}
void MarkupDirector::processOpeningElements(QTextBlock::iterator it)
void MarkupDirector::processOpeningElements(const QTextBlock::iterator &it)
{
Q_D(MarkupDirector);
auto fragment = it.fragment();
......@@ -667,7 +667,7 @@ void MarkupDirector::processOpeningElements(QTextBlock::iterator it)
}
}
QSet<int> MarkupDirector::getElementsToClose(QTextBlock::iterator it) const
QSet<int> MarkupDirector::getElementsToClose(const QTextBlock::iterator &it) const
{
Q_D(const MarkupDirector);
QSet<int> closedElements;
......@@ -780,7 +780,7 @@ QSet<int> MarkupDirector::getElementsToClose(QTextBlock::iterator it) const
return closedElements;
}
QList<int> MarkupDirector::getElementsToOpen(QTextBlock::iterator it)
QList<int> MarkupDirector::getElementsToOpen(const QTextBlock::iterator &it)
{
Q_D(MarkupDirector);
auto fragment = it.fragment();
......
......@@ -139,7 +139,7 @@ public:
The block @p block is the first block in the @p textBlockGroup.
*/
virtual QPair<QTextFrame::iterator, QTextBlock>
processBlockGroup(QTextFrame::iterator it, const QTextBlock &block,
processBlockGroup(const QTextFrame::iterator &it, const QTextBlock &block,
QTextBlockGroup *textBlockGroup);
/**
......@@ -221,7 +221,7 @@ protected:
Processes the document between @p begin and @p end
*/
void processDocumentContents(QTextFrame::iterator begin,
QTextFrame::iterator end);
const QTextFrame::iterator &end);
/**
Iterates the iterator @p it to the first block after @p blockGroup. @p
......@@ -248,22 +248,22 @@ protected:
Directs the builder to close the appropriate tags at the position of @p
it.
*/
virtual void processClosingElements(QTextBlock::iterator it);
virtual void processClosingElements(const QTextBlock::iterator &it);
/**
Directs the builder to open the appropriate tags at the position of @p it.
*/
virtual void processOpeningElements(QTextBlock::iterator it);
virtual void processOpeningElements(const QTextBlock::iterator &it);
/**
Returns the tags that should be closed at the position of @p it.
*/
virtual QSet<int> getElementsToClose(QTextBlock::iterator it) const;
virtual QSet<int> getElementsToClose(const QTextBlock::iterator &it) const;
/**
Returns the tags that should be opened at the position of @p it.
*/
virtual QList<int> getElementsToOpen(QTextBlock::iterator it);
virtual QList<int> getElementsToOpen(const QTextBlock::iterator &it);
/**
Flags for the tags that may be open.
......
......@@ -74,7 +74,7 @@ TestGenerateHTMLBuilderGui::TestGenerateHTMLBuilderGui(QWidget *parent)
mainLayout->addWidget(generatedHtmlFromGrantleeToTextEdit);
connect(generateHtmlFromQTextEditButton, &QPushButton::clicked, [=]{
connect(generateHtmlFromQTextEditButton, &QPushButton::clicked, this, [=]{
generatedHtml->setHtml(htmlEdit->toPlainText());
generatedHtmlFromTextEdit->setPlainText(generatedHtml->document()->toHtml());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment