summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan BrĂ¼ns <stefan.bruens@rwth-aachen.de>2024-04-10 20:38:34 +0200
committerAlbert Astals Cid <aacid@kde.org>2024-12-18 22:34:12 +0000
commitafcfac2fd0838448b3fa0bf90c1c22c142fa90e1 (patch)
tree24fa5222a349c4ceed12b4c91a126429b61bb51a
parentab35ab3c8ba75f776f81a530cae036c4c662312f (diff)
qt: Use std::string instead of plain C string for QString initialization
Both are mostly equivalent, but using the std::string avoids the implicit strlen call.
-rw-r--r--qt5/src/poppler-page.cc2
-rw-r--r--qt6/src/poppler-page.cc2
2 files changed, 2 insertions, 2 deletions
diff --git a/qt5/src/poppler-page.cc b/qt5/src/poppler-page.cc
index 6cec0454..96ff2875 100644
--- a/qt5/src/poppler-page.cc
+++ b/qt5/src/poppler-page.cc
@@ -695,7 +695,7 @@ QString Page::text(const QRectF &r, TextLayout textLayout) const
s = output_dev->getText(r.left(), r.top(), r.right(), r.bottom());
}
- result = QString::fromUtf8(s->c_str());
+ result = QString::fromStdString(s->toStr());
delete output_dev;
delete s;
diff --git a/qt6/src/poppler-page.cc b/qt6/src/poppler-page.cc
index 912302e7..8b99894b 100644
--- a/qt6/src/poppler-page.cc
+++ b/qt6/src/poppler-page.cc
@@ -695,7 +695,7 @@ QString Page::text(const QRectF &r, TextLayout textLayout) const
s = output_dev->getText(r.left(), r.top(), r.right(), r.bottom());
}
- result = QString::fromUtf8(s->c_str());
+ result = QString::fromStdString(s->toStr());
delete output_dev;
delete s;