mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2026-09-23 16:49:10 -07:00
app-office/scribus: Fix build w/ IUSE doc
Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
Index: Scribus/scribus/plugins/import/pdf/importpdf.cpp
|
||||
===================================================================
|
||||
--- Scribus/scribus/plugins/import/pdf/importpdf.cpp (revision 27039)
|
||||
+++ Scribus/scribus/plugins/import/pdf/importpdf.cpp (revision 27042)
|
||||
@@ -874,6 +874,44 @@
|
||||
|
||||
QString PdfPlug::UnicodeParsedString(const GooString *s1)
|
||||
{
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 10, 0)
|
||||
+ if (!s1 || s1->size() == 0)
|
||||
+ return QString();
|
||||
+ bool isUnicode;
|
||||
+ int i;
|
||||
+ Unicode u;
|
||||
+ QString result;
|
||||
+ if ((s1->getChar(0) & 0xff) == 0xfe && (s1->size() > 1 && (s1->getChar(1) & 0xff) == 0xff))
|
||||
+ {
|
||||
+ isUnicode = true;
|
||||
+ i = 2;
|
||||
+ result.reserve((s1->size() - 2) / 2);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ isUnicode = false;
|
||||
+ i = 0;
|
||||
+ result.reserve(s1->size());
|
||||
+ }
|
||||
+ while (i < s1->size())
|
||||
+ {
|
||||
+ if (isUnicode)
|
||||
+ {
|
||||
+ u = ((s1->getChar(i) & 0xff) << 8) | (s1->getChar(i + 1) & 0xff);
|
||||
+ i += 2;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ u = s1->getChar(i) & 0xff;
|
||||
+ ++i;
|
||||
+ }
|
||||
+ // #15616: imagemagick may write unicode strings incorrectly in PDF
|
||||
+ if (u == 0)
|
||||
+ continue;
|
||||
+ result += QChar(u);
|
||||
+ }
|
||||
+ return result;
|
||||
+#else
|
||||
if (!s1 || s1->getLength() == 0)
|
||||
return QString();
|
||||
bool isUnicode;
|
||||
@@ -910,6 +948,7 @@
|
||||
result += QChar( u );
|
||||
}
|
||||
return result;
|
||||
+#endif
|
||||
}
|
||||
|
||||
QString PdfPlug::UnicodeParsedString(const std::string& s1)
|
||||
Index: Scribus/scribus/plugins/import/pdf/slaoutput.cpp
|
||||
===================================================================
|
||||
--- Scribus/scribus/plugins/import/pdf/slaoutput.cpp (revision 27039)
|
||||
+++ Scribus/scribus/plugins/import/pdf/slaoutput.cpp (revision 27042)
|
||||
@@ -3883,6 +3883,41 @@
|
||||
|
||||
QString SlaOutputDev::UnicodeParsedString(const GooString *s1) const
|
||||
{
|
||||
+#if POPPLER_ENCODED_VERSION >= POPPLER_VERSION_ENCODE(25, 10, 0)
|
||||
+ if (!s1 || s1->size() == 0)
|
||||
+ return QString();
|
||||
+ bool isUnicode;
|
||||
+ int i;
|
||||
+ Unicode u;
|
||||
+ QString result;
|
||||
+ if ((s1->getChar(0) & 0xff) == 0xfe && (s1->size() > 1 && (s1->getChar(1) & 0xff) == 0xff))
|
||||
+ {
|
||||
+ isUnicode = true;
|
||||
+ i = 2;
|
||||
+ result.reserve((s1->size() - 2) / 2);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ isUnicode = false;
|
||||
+ i = 0;
|
||||
+ result.reserve(s1->size());
|
||||
+ }
|
||||
+ while (i < s1->size())
|
||||
+ {
|
||||
+ if (isUnicode)
|
||||
+ {
|
||||
+ u = ((s1->getChar(i) & 0xff) << 8) | (s1->getChar(i + 1) & 0xff);
|
||||
+ i += 2;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ u = s1->getChar(i) & 0xff;
|
||||
+ ++i;
|
||||
+ }
|
||||
+ result += QChar(u);
|
||||
+ }
|
||||
+ return result;
|
||||
+#else
|
||||
if (!s1 || s1->getLength() == 0)
|
||||
return QString();
|
||||
bool isUnicode;
|
||||
@@ -3916,6 +3951,7 @@
|
||||
result += QChar( u );
|
||||
}
|
||||
return result;
|
||||
+#endif
|
||||
}
|
||||
|
||||
QString SlaOutputDev::UnicodeParsedString(const std::string& s1) const
|
||||
@@ -85,6 +85,7 @@ PATCHES=(
|
||||
"${FILESDIR}"/${PN}-1.7.0-findhyphen.patch
|
||||
"${FILESDIR}"/${PN}-1.7.0-dont-install-qtadvanceddocking.patch # bugs 961290, 960017
|
||||
"${FILESDIR}"/${PN}-1.7.0-fix-icon-version.patch
|
||||
"${FILESDIR}"/${P}-poppler-25.10.0.patch # from trunk
|
||||
)
|
||||
|
||||
src_prepare() {
|
||||
|
||||
Reference in New Issue
Block a user