parent
4b7c515635
commit
c4f611e09d
@ -0,0 +1,22 @@
|
||||
--- a/src/lib/processors/mimedocumentprocessor.cpp 2024-08-16 07:00:56.000000000 +0200
|
||||
+++ b/src/lib/processors/mimedocumentprocessor.cpp 2025-02-24 14:03:09.980662872 +0100
|
||||
@@ -142,13 +142,14 @@
|
||||
}
|
||||
|
||||
// special handling of multipart/related to add images to the corresponding HTML document
|
||||
- if (ct && ct->isMultipart() && ct->isSubtype("related") && ct->parameter("type"_L1) == "text/html"_L1 && children.size() >= 2) {
|
||||
- const auto child = children.front();
|
||||
- if (child->contentType(false) && child->contentType(false)->isHTMLText()) {
|
||||
+ if (ct && ct->isMultipart() && ct->isSubtype("related") && ct->parameter("type") == "text/html"_L1 && children.size() >= 2) {
|
||||
+ const KMime::Content *child = children.front();
|
||||
+ if (child->contentType() && child->contentType()->isHTMLText()) {
|
||||
auto htmlNode = expandContentNode(node, child, engine);
|
||||
for (auto it = std::next(children.begin()); it != children.end(); ++it) {
|
||||
- auto imgNode = expandContentNode(htmlNode, (*it), engine);
|
||||
- const auto cid = (*it)->contentID(false);
|
||||
+ const KMime::Content *imgChild = *it;
|
||||
+ auto imgNode = expandContentNode(htmlNode, imgChild, engine);
|
||||
+ const auto cid = imgChild->contentID();
|
||||
if (cid) {
|
||||
imgNode.setLocation(cid->identifier());
|
||||
}
|
49
srcpkgs/kitinerary/patches/poppler_25.02.0.patch
Normal file
49
srcpkgs/kitinerary/patches/poppler_25.02.0.patch
Normal file
@ -0,0 +1,49 @@
|
||||
--- a/src/lib/pdf/pdfdocument.cpp 2024-08-16 07:00:56.000000000 +0200
|
||||
+++ b/src/lib/pdf/pdfdocument.cpp 2025-02-23 22:41:15.141361948 +0100
|
||||
@@ -39,10 +39,15 @@
|
||||
m_doc->m_popplerDoc->displayPageSlice(&device, m_pageNum + 1, 72, 72, 0, false, true, false, -1, -1, -1, -1);
|
||||
m_doc->m_popplerDoc->processLinks(&device, m_pageNum + 1);
|
||||
device.finalize();
|
||||
- const auto pageRect = m_doc->m_popplerDoc->getPage(m_pageNum + 1)->getCropBox();
|
||||
- std::unique_ptr<GooString> s(device.getText(pageRect->x1, pageRect->y1, pageRect->x2, pageRect->y2));
|
||||
|
||||
+ const auto pageRect = m_doc->m_popplerDoc->getPage(m_pageNum + 1)->getCropBox();
|
||||
+#if KPOPPLER_VERSION < QT_VERSION_CHECK(25, 1, 0)
|
||||
+ std::unique_ptr<GooString> s(device.getText(pageRect->x1, pageRect->y1, pageRect->x2, pageRect->y2));
|
||||
m_text = QString::fromUtf8(s->c_str());
|
||||
+#else
|
||||
+ const auto s = device.getText(pageRect->x1, pageRect->y1, pageRect->x2, pageRect->y2);
|
||||
+ m_text = QString::fromUtf8(s.c_str());
|
||||
+#endif
|
||||
m_images = std::move(device.m_images);
|
||||
for (auto it = m_images.begin(); it != m_images.end(); ++it) {
|
||||
(*it).d->m_page = this;
|
||||
@@ -107,8 +112,13 @@
|
||||
|
||||
TextOutputDev device(nullptr, false, 0, false, false);
|
||||
d->m_doc->m_popplerDoc->displayPageSlice(&device, d->m_pageNum + 1, 72, 72, 0, false, true, false, -1, -1, -1, -1);
|
||||
+#if KPOPPLER_VERSION <QT_VERSION_CHECK(25, 1, 0)
|
||||
std::unique_ptr<GooString> s(device.getText(l, t, r, b));
|
||||
return QString::fromUtf8(s->c_str());
|
||||
+#else
|
||||
+ const auto s = device.getText(l, t, r, b);
|
||||
+ return QString::fromUtf8(s.c_str());
|
||||
+#endif
|
||||
}
|
||||
|
||||
int PdfPage::imageCount() const
|
||||
@@ -314,9 +324,14 @@
|
||||
#endif
|
||||
return QString::fromUtf16(reinterpret_cast<const char16_t*>(s->toStr().c_str()), s->toStr().size() / 2);
|
||||
} else {
|
||||
+#if KPOPPLER_VERSION >= QT_VERSION_CHECK(25, 2, 0)
|
||||
+ const auto utf16Data = pdfDocEncodingToUTF16(s->toStr());
|
||||
+ return QString::fromUtf16(reinterpret_cast<const char16_t *>(utf16Data.c_str()), utf16Data.size() / 2);
|
||||
+#else
|
||||
int len = 0;
|
||||
std::unique_ptr<const char[]> utf16Data(pdfDocEncodingToUTF16(s->toStr(), &len));
|
||||
return QString::fromUtf16(reinterpret_cast<const char16_t*>(utf16Data.get()), len / 2);
|
||||
+#endif
|
||||
}
|
||||
|
||||
return QString::fromUtf8(s->c_str());
|
@ -1,7 +1,7 @@
|
||||
# Template file for 'kitinerary'
|
||||
pkgname=kitinerary
|
||||
version=24.08.0
|
||||
revision=1
|
||||
revision=2
|
||||
build_style=cmake
|
||||
configure_args="-DBUILD_TESTING=OFF -DKF6_HOST_TOOLING=/usr/lib/cmake
|
||||
-DKDE_INSTALL_QTPLUGINDIR=lib/qt6/plugins
|
||||
|
Loading…
x
Reference in New Issue
Block a user