summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-12-13 06:47:57 +0100
committerMontel Laurent <[email protected]>2017-12-13 06:47:57 +0100
commitd5d9d7458d906f13023617e0e2a6ecb0083ea738 (patch)
tree0916fd96187ff45a22ee6eb43639888997b1c095
parentc1d32254baacda8d995b08059d487142031ffaa6 (diff)
Minor
-rw-r--r--plugins/messageviewer/bodypartformatter/semantic/extractor.cpp7
-rw-r--r--plugins/messageviewer/bodypartformatter/semantic/extractorpreprocessor.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/messageviewer/bodypartformatter/semantic/extractor.cpp b/plugins/messageviewer/bodypartformatter/semantic/extractor.cpp
index 0d0d8c7..2acf7c8 100644
--- a/plugins/messageviewer/bodypartformatter/semantic/extractor.cpp
+++ b/plugins/messageviewer/bodypartformatter/semantic/extractor.cpp
@@ -62,11 +62,12 @@ bool Extractor::load(const QString &fileName)
}
std::unique_ptr<ExtractorRule> rule;
- if (reader.name() == QLatin1String("variable")) {
+ QStringRef readerName = reader.name();
+ if (readerName == QLatin1String("variable")) {
rule.reset(new ExtractorVariableRule);
- } else if (reader.name() == QLatin1String("class")) {
+ } else if (readerName == QLatin1String("class")) {
rule.reset(new ExtractorClassRule);
- } else if (reader.name() == QLatin1String("property")) {
+ } else if (readerName == QLatin1String("property")) {
rule.reset(new ExtractorPropertyRule);
} else {
return false;
diff --git a/plugins/messageviewer/bodypartformatter/semantic/extractorpreprocessor.cpp b/plugins/messageviewer/bodypartformatter/semantic/extractorpreprocessor.cpp
index 4f06e54..215b211 100644
--- a/plugins/messageviewer/bodypartformatter/semantic/extractorpreprocessor.cpp
+++ b/plugins/messageviewer/bodypartformatter/semantic/extractorpreprocessor.cpp
@@ -72,7 +72,7 @@ void ExtractorPreprocessor::preprocessPdf(const QByteArray &input)
return;
}
- for (int i = 0; i < doc->numPages(); ++i) {
+ for (int i = 0, total = doc->numPages(); i < total; ++i) {
std::unique_ptr<Poppler::Page> page(doc->page(i));
m_buffer += page->text({}, Poppler::Page::PhysicalLayout);
}