[Libreoffice-commits] core.git: Branch 'feature/cib_contract138c' - 12 commits - download.lst external/liborcus external/pdfium include/vcl shell/source solenv/flatpak-manifest.in svtools/source svx/source sw/qa sw/source vcl/Module_vcl.mk writerfilter/source xmlsecurity/qa xmlsecurity/source
Miklos Vajna (via logerrit)
logerrit at kemper.freedesktop.org
Tue Apr 13 13:49:50 UTC 2021
download.lst | 4
external/liborcus/inc/pch/precompiled_orcus.hxx | 109 +++++
external/pdfium/Library_pdfium.mk | 153 ++++---
external/pdfium/UnpackedTarball_pdfium.mk | 15
external/pdfium/build.patch.1 | 119 -----
external/pdfium/c++20-comparison.patch | 13
external/pdfium/configs/build_config.h | 6
external/pdfium/msvc2015.patch.1 | 202 ++++++++++
external/pdfium/ubsan.patch | 26 -
external/pdfium/visibility.patch.1 | 30 -
external/pdfium/windows7.patch.1 | 34 +
include/vcl/filter/PDFiumLibrary.hxx | 2
shell/source/win32/SysShExec.cxx | 31 -
solenv/flatpak-manifest.in | 6
svtools/source/svhtml/parhtml.cxx | 19
svx/source/svdraw/svdpdf.cxx | 31 -
sw/qa/core/data/ww5/pass/ofz18526-1.doc |binary
sw/source/core/unocore/unocrsrhelper.cxx | 14
sw/source/filter/ww8/ww8par.cxx | 56 ++
sw/source/filter/ww8/ww8par.hxx | 2
sw/source/filter/ww8/ww8par5.cxx | 37 +
vcl/Module_vcl.mk | 5
writerfilter/source/rtftok/rtfdocumentimpl.cxx | 25 +
xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf |binary
xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx | 16
xmlsecurity/qa/unit/signing/signing.cxx | 1
xmlsecurity/source/pdfio/pdfdocument.cxx | 63 ++-
xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx | 4
28 files changed, 743 insertions(+), 280 deletions(-)
New commits:
commit 3d3e6a47b2b38e8660fe5d23c585fa438c5a7af6
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Mon Apr 8 21:37:23 2019 +0200
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 16:29:38 2021 +0300
tdf#123747 xmlsecurity, ODF sign roundtrip: preserve invalid reference type
Only add the correct type to new signatures to avoid breaking the hash
of old ones.
Change-Id: I30f892b292f84a0575a3d4ef5ccf3eddbe0090ca
Reviewed-on: https://gerrit.libreoffice.org/70424
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx
index f9cdead4ae7f..25aa13c806f8 100644
--- a/xmlsecurity/qa/unit/signing/signing.cxx
+++ b/xmlsecurity/qa/unit/signing/signing.cxx
@@ -861,6 +861,7 @@ void SigningTest::testXAdESNotype()
"Type", "http://uri.etsi.org/01903#SignedProperties");
}
+/// Creates a XAdES signature from scratch.
void SigningTest::testXAdES()
{
// Create an empty document, store it to a tempfile and load it as a storage.
commit 1c18dfadb0ad236986c4b21aac4edb0ba674ae48
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Feb 8 17:05:28 2021 +0000
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 16:00:53 2021 +0300
default to CertificateValidity::INVALID
so if CertGetCertificateChain fails we don't want validity to be
css::security::CertificateValidity::VALID which is what the old default
of 0 equates to
notably
commit 1e0bc66d16aee28ce8bd9582ea32178c63841902
Date: Thu Nov 5 16:55:26 2009 +0100
jl137: #103420# better logging
turned the nss equivalent of SecurityEnvironment_NssImpl::verifyCertificate
from 0 to CertificateValidity::INVALID like this change does
Change-Id: I5350dbc22d1b9b378da2976d3b0abd728f1f4c27
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110561
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
(cherry picked from commit edeb164c1d8ab64116afee4e2140403a362a1358)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113090
Tested-by: Michael Stahl <michael.stahl at allotropia.de>
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
index 2a8ab3603de1..f339c1be480d 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/securityenvironment_mscryptimpl.cxx
@@ -782,7 +782,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
const uno::Reference< css::security::XCertificate >& aCert,
const uno::Sequence< uno::Reference< css::security::XCertificate > >& seqCerts)
{
- sal_Int32 validity = 0;
+ sal_Int32 validity = css::security::CertificateValidity::INVALID;
PCCERT_CHAIN_CONTEXT pChainContext = nullptr;
PCCERT_CONTEXT pCertContext = nullptr;
@@ -927,7 +927,7 @@ sal_Int32 SecurityEnvironment_MSCryptImpl::verifyCertificate(
}
else
{
- SAL_INFO("xmlsecurity.xmlsec", "CertGetCertificateChaine failed.");
+ SAL_INFO("xmlsecurity.xmlsec", "CertGetCertificateChain failed.");
}
}
commit c6990bcf801fbb192ce0bb90278388d4edca6d29
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Tue Feb 16 09:30:09 2021 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:55:07 2021 +0300
Improve checkExtension
Change-Id: Iff416a9c5930ad5903f7ee51a2abbc94d5f40800
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110970
Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
Tested-by: Jenkins
(cherry picked from commit f456c4dacf700e064e112ef068ff7edb04239754)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110922
Reviewed-by: Michael Stahl <michael.stahl at allotropia.de>
(cherry picked from commit f19d95986756412e5d72047656eec17a720c5e57)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113049
Tested-by: Michael Stahl <michael.stahl at allotropia.de>
diff --git a/shell/source/win32/SysShExec.cxx b/shell/source/win32/SysShExec.cxx
index 394f7a4f42d3..cc035c45a2d9 100644
--- a/shell/source/win32/SysShExec.cxx
+++ b/shell/source/win32/SysShExec.cxx
@@ -397,21 +397,28 @@ void SAL_CALL CSysShExec::execute( const OUString& aCommand, const OUString& aPa
{}, 0);
}
}
+ // ShellExecuteExW appears to ignore trailing dots, so remove them:
+ while (pathname.endsWith(".", &pathname)) {}
auto const n = pathname.lastIndexOf('.');
if (n > pathname.lastIndexOf('\\')) {
auto const ext = pathname.copy(n + 1);
- OUString env;
- if (osl_getEnvironment(OUString("PATHEXT").pData, &env.pData) != osl_Process_E_None)
- {
- SAL_INFO("shell", "osl_getEnvironment(PATHEXT) failed");
- }
- if (!(checkExtension(ext, env)
- && checkExtension(
- ext,
- ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;.JAR")))
- {
- throw css::lang::IllegalArgumentException(
- "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {}, 0);
+ if (!ext.isEmpty()) {
+ OUString env;
+ if (osl_getEnvironment(OUString("PATHEXT").pData, &env.pData)
+ != osl_Process_E_None)
+ {
+ SAL_INFO("shell", "osl_getEnvironment(PATHEXT) failed");
+ }
+ if (!(checkExtension(ext, env)
+ && checkExtension(
+ ext,
+ ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.CLASS;"
+ ".JAR;.APPLICATION;.LNK;.SCR")))
+ {
+ throw css::lang::IllegalArgumentException(
+ "XSystemShellExecute.execute, cannot process <" + aCommand + ">", {},
+ 0);
+ }
}
}
}
commit 5ade1dbcae1942a4127e5cbd78a14fadad1a5f3b
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Oct 30 16:06:02 2019 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:55:06 2021 +0300
sw: WW8 import: filter control characters in GetFieldResult()
Triggers the assert in SwSubFont::GetTextSize_() on ooo58234-1.doc,
which has a field result with ^G cell separators that is converted to
SwInputField, which inserts the field result into SwTextNode.
Change-Id: Ibdb93390862a11462d62cf744bac912d6009777e
Reviewed-on: https://gerrit.libreoffice.org/81788
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit 3a9d504b01c061f60a915b5681c8313859294118)
Reviewed-on: https://gerrit.libreoffice.org/81831
Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 963364531d19..bca57b2455f0 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/task/InteractionHandler.hpp>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <svl/lngmisc.hxx>
#include <svl/urihelper.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
@@ -1210,7 +1211,35 @@ OUString SwWW8ImplReader::GetFieldResult( WW8FieldDesc const * pF )
m_pStrm->Seek( nOldPos );
//replace both CR 0x0D and VT 0x0B with LF 0x0A
- return sRes.replace(0x0D, 0x0A).replace(0x0B, 0x0A);
+ // at least in the cases where the result is added to an SwInputField
+ // there must not be control characters in it
+ OUStringBuffer buf(sRes.getLength());
+ for (sal_Int32 i = 0; i < sRes.getLength(); ++i)
+ {
+ sal_Unicode const ch(sRes[i]);
+ if (!linguistic::IsControlChar(ch))
+ {
+ buf.append(ch);
+ }
+ else
+ {
+ switch (ch)
+ {
+ case 0x0B:
+ case '\r':
+ buf.append('\n');
+ break;
+ case '\n':
+ case '\t':
+ buf.append(ch);
+ break;
+ default:
+ SAL_INFO("sw.ww8", "GetFieldResult(): filtering control character");
+ break;
+ }
+ }
+ }
+ return buf.makeStringAndClear();
}
/*
commit c0fd4549d478350bdbdd75a070be013066588e71
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Nov 12 18:57:58 2019 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:55:06 2021 +0300
ofz#18526 sw: WW8 import: don't insert control characters
Sanitize string before calling InsertString().
This segfaults since:
commit b522fc0646915d4da94df38dd249c88b28f25be7
Date: Tue Sep 24 18:11:45 2019 +0200
sw: maintain fieldmarks in DeleteRange()/DeleteAndJoin()/ReplaceRange()
Change-Id: I9ef73d924420686f6838fa21900ec57b4d25c905
Reviewed-on: https://gerrit.libreoffice.org/81949
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 7ecda38cdaa2361e8510bf3e7206863c4936deab)
Reviewed-on: https://gerrit.libreoffice.org/82759
(cherry picked from commit d494a4c0ead7db481757d8d67fbce9e1b02e65df)
diff --git a/sw/qa/core/data/ww5/pass/ofz18526-1.doc b/sw/qa/core/data/ww5/pass/ofz18526-1.doc
new file mode 100644
index 000000000000..e651650f9a26
Binary files /dev/null and b/sw/qa/core/data/ww5/pass/ofz18526-1.doc differ
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 98569b059863..efb4b2942920 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -115,6 +115,8 @@
#include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/document/IndexedPropertyValues.hpp>
+
+#include <svl/lngmisc.hxx>
#include <svl/itemiter.hxx>
#include <comphelper/processfactory.hxx>
@@ -3391,13 +3393,37 @@ void SwWW8ImplReader::emulateMSWordAddTextToParagraph(const OUString& rAddString
}
}
+namespace sw {
+
+auto FilterControlChars(OUString const& rString) -> OUString
+{
+ OUStringBuffer buf(rString.getLength());
+ for (sal_Int32 i = 0; i < rString.getLength(); ++i)
+ {
+ sal_Unicode const ch(rString[i]);
+ if (!linguistic::IsControlChar(ch) || ch == '\r' || ch == '\n' || ch == '\t')
+ {
+ buf.append(ch);
+ }
+ else
+ {
+ SAL_INFO("sw.ww8", "filtering control character");
+ }
+ }
+ return buf.makeStringAndClear();
+}
+
+} // namespace sw
+
void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString)
{
- if (rAddString.isEmpty())
+ OUString const addString(sw::FilterControlChars(rAddString));
+
+ if (addString.isEmpty())
return;
#if OSL_DEBUG_LEVEL > 1
- SAL_INFO("sw.ww8", "<addTextToParagraph>" << rAddString << "</addTextToParagraph>");
+ SAL_INFO("sw.ww8", "<addTextToParagraph>" << addString << "</addTextToParagraph>");
#endif
const SwContentNode *pCntNd = m_pPaM->GetContentNode();
@@ -3411,21 +3437,21 @@ void SwWW8ImplReader::simpleAddTextToParagraph(const OUString& rAddString)
const sal_Int32 nCharsLeft = SAL_MAX_INT32 - pNd->GetText().getLength();
if (nCharsLeft > 0)
{
- if (rAddString.getLength() <= nCharsLeft)
+ if (addString.getLength() <= nCharsLeft)
{
- m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, rAddString);
+ m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString);
}
else
{
- m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, rAddString.copy(0, nCharsLeft));
+ m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString.copy(0, nCharsLeft));
AppendTextNode(*m_pPaM->GetPoint());
- m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, rAddString.copy(nCharsLeft));
+ m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString.copy(nCharsLeft));
}
}
else
{
AppendTextNode(*m_pPaM->GetPoint());
- m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, rAddString);
+ m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, addString);
}
m_bReadTable = false;
@@ -3451,13 +3477,17 @@ bool SwWW8ImplReader::ReadChars(WW8_CP& rPos, WW8_CP nNextAttr, long nTextEnd,
nRequested = nMaxPossible;
}
- for (WW8_CP nCh = 0; nCh < nRequested; ++nCh)
+ if (!linguistic::IsControlChar(m_cSymbol)
+ || m_cSymbol == '\r' || m_cSymbol == '\n' || m_cSymbol == '\t')
{
- m_rDoc.getIDocumentContentOperations().InsertString( *m_pPaM, OUString(m_cSymbol) );
+ for (WW8_CP nCh = 0; nCh < nRequested; ++nCh)
+ {
+ m_rDoc.getIDocumentContentOperations().InsertString(*m_pPaM, OUString(m_cSymbol));
+ }
+ m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_FONT);
+ m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_CJK_FONT);
+ m_xCtrlStck->SetAttr(*m_pPaM->GetPoint(), RES_CHRATR_CTL_FONT);
}
- m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_FONT );
- m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CJK_FONT );
- m_xCtrlStck->SetAttr( *m_pPaM->GetPoint(), RES_CHRATR_CTL_FONT );
}
m_pStrm->SeekRel(nRequested);
rPos = nEnd; // Ignore until attribute end
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index ee5a8b68b795..676745d07078 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -550,6 +550,8 @@ namespace sw
sal_Int32 GetPtContent() { return mnPtContent; };
};
}
+
+ auto FilterControlChars(OUString const& rString) -> OUString;
}
class WW8FieldEntry
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 1d2430db8d69..963364531d19 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -34,6 +34,7 @@
#include <svl/urihelper.hxx>
#include <svl/zforlist.hxx>
#include <svl/zformat.hxx>
+#include <svl/lngmisc.hxx>
#include <sfx2/linkmgr.hxx>
#include <rtl/character.hxx>
#include <unotools/charclass.hxx>
@@ -1906,7 +1907,8 @@ eF_ResT SwWW8ImplReader::Read_F_Symbol( WW8FieldDesc*, OUString& rStr )
if( aQ.isEmpty() )
return eF_ResT::TAGIGN; // -> no 0-char in text
- if (sal_Unicode cChar = static_cast<sal_Unicode>(aQ.toInt32()))
+ sal_Unicode const cChar = static_cast<sal_Unicode>(aQ.toInt32());
+ if (!linguistic::IsControlChar(cChar) || cChar == '\r' || cChar == '\n' || cChar == '\t')
{
if (!aName.isEmpty()) // Font Name set ?
{
@@ -2686,11 +2688,11 @@ void SwWW8ImplReader::Read_SubF_Ruby( WW8ReadFieldParams& rReadParam)
if ((nBegin != -1) && (nEnd != -1) && (nBegin < nEnd))
{
sText = sPart.copy(nBegin+1,nEnd-nBegin-1);
+ sText = sw::FilterControlChars(sText);
}
}
}
}
-
}
break;
}
commit 0f7130769d3e6578c4cd718ed8823c0e1a821dd8
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Nov 14 17:37:17 2019 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:55:06 2021 +0300
sw: WW8 import: instead of control character insert '?' for footnote
SwWW8ImplReader::ReadChar() inserts a U+0002 control character to
temporarily mark a footnote anchor; this is then deleted and replaced
with a real footnote hint by SwWW8ImplReader::End_Footnote().
The assumption is that it is necessary to insert a placeholder
character to be able to apply formatting to it.
But if the document is corrupted, the control character could survive
the import, which sounds less than ideal.
So either make this magic character more explicit by documenting it in
hintids.hxx and removing any outstanding ones at the end of the import,
or use a non-offensive character instead; since this should only affect
invalid documents, choose the solution with the least effort.
Change-Id: I76d396258b32e0f0fb6393942a58a4dc57912211
Reviewed-on: https://gerrit.libreoffice.org/82760
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 13ba765c444713b0b0b2f4b4231bdafcbbef6ad0)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 056aedfcc895..98569b059863 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3727,7 +3727,7 @@ bool SwWW8ImplReader::ReadChar(long nPosCp, long nCpOfs)
break;
case 0x2: // TODO: Auto-Footnote-Number, should be replaced by SwWW8ImplReader::End_Footnote later
if (!m_aFootnoteStack.empty())
- cInsert = 0x2;
+ cInsert = '?';
break;
default:
SAL_INFO( "sw.ww8.level2", "<unknownValue val=\"" << nWCharVal << "\">" );
commit 638edce46faaef3e2799ad154acc21076c7d6d9a
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Oct 29 15:54:41 2019 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:54:46 2021 +0300
writerfilter: rtftok: filter control characters
... in RTFDocumentImpl::checkUnicode(); see ooo86460-1.xls [sic]
for an example.
There is another caller of text() in rtfdispatchdestination.cxx:311 but
it turns out that buffered text was created by text() in the first
place.
This shouldn't be a problem for DOCX because XML 1.0 doesn't allow the
bad control characters anyway so the sax parser should report an error
in that case.
(cherry picked from commit a6516c76c01b92f7d35bfb352b63af7de42b5707)
Change-Id: Ice45e1c3c8c7db668a4cfb8364e42addea1777ce
Reviewed-on: https://gerrit.libreoffice.org/81780
Tested-by: Jenkins
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 6c97111bed71..80ef494e52cb 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -26,6 +26,7 @@
#include <tools/datetimeutils.hxx>
#include <comphelper/classids.hxx>
#include <comphelper/embeddedobjectcontainer.hxx>
+#include <svl/lngmisc.hxx>
#include <sfx2/sfxbasemodel.hxx>
#include <sfx2/classificationhelper.hxx>
#include <oox/mathml/import.hxx>
@@ -3466,11 +3467,34 @@ bool RTFDocumentImpl::getSkipUnknown() { return m_bSkipUnknown; }
void RTFDocumentImpl::setSkipUnknown(bool bSkipUnknown) { m_bSkipUnknown = bSkipUnknown; }
+static auto FilterControlChars(Destination const destination, OUString const& rString) -> OUString
+{
+ if (destination == Destination::LEVELNUMBERS || destination == Destination::LEVELTEXT)
+ { // control characters are magic here!
+ return rString;
+ }
+ OUStringBuffer buf(rString.getLength());
+ for (sal_Int32 i = 0; i < rString.getLength(); ++i)
+ {
+ sal_Unicode const ch(rString[i]);
+ if (!linguistic::IsControlChar(ch) || ch == '\r' || ch == '\n' || ch == '\t')
+ {
+ buf.append(ch);
+ }
+ else
+ {
+ SAL_INFO("writerfilter.rtf", "filtering control character");
+ }
+ }
+ return buf.makeStringAndClear();
+}
+
void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex)
{
if (bUnicode && !m_aUnicodeBuffer.isEmpty())
{
OUString aString = m_aUnicodeBuffer.makeStringAndClear();
+ aString = FilterControlChars(m_aStates.top().eDestination, aString);
text(aString);
}
if (bHex && !m_aHexBuffer.isEmpty())
@@ -3480,6 +3504,7 @@ void RTFDocumentImpl::checkUnicode(bool bUnicode, bool bHex)
&& m_aStates.top().nCurrentEncoding == RTL_TEXTENCODING_SYMBOL)
nEncoding = RTL_TEXTENCODING_MS_1252;
OUString aString = OStringToOUString(m_aHexBuffer.makeStringAndClear(), nEncoding);
+ aString = FilterControlChars(m_aStates.top().eDestination, aString);
text(aString);
}
}
commit a9a79503ff58471c03433df53a24e93510b5d205
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Tue Oct 29 15:52:34 2019 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:27:26 2021 +0300
sw: UNO API: do not allow inserting control characters into nodes
Refuse invalid input in DocInsertStringSplitCR().
Reviewed-on: https://gerrit.libreoffice.org/81696
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit 9b1e3e9bfdc0639630a367e45e4bdc2e9f22e503)
Change-Id: I097c1b3a1f70b0cf1fa3fc33fc1d965ee6c96280
diff --git a/sw/source/core/unocore/unocrsrhelper.cxx b/sw/source/core/unocore/unocrsrhelper.cxx
index da1facfad0ab..dd5122379dab 100644
--- a/sw/source/core/unocore/unocrsrhelper.cxx
+++ b/sw/source/core/unocore/unocrsrhelper.cxx
@@ -65,6 +65,7 @@
#include <cntfrm.hxx>
#include <pagefrm.hxx>
#include <svl/eitem.hxx>
+#include <svl/lngmisc.hxx>
#include <docary.hxx>
#include <swtable.hxx>
#include <tox.hxx>
@@ -1105,7 +1106,18 @@ bool DocInsertStringSplitCR(
{
bool bOK = true;
- const SwInsertFlags nInsertFlags =
+ for (sal_Int32 i = 0; i < rText.getLength(); ++i)
+ {
+ sal_Unicode const ch(rText[i]);
+ if (linguistic::IsControlChar(ch)
+ && ch != '\r' && ch != '\n' && ch != '\t')
+ {
+ SAL_WARN("sw.uno", "DocInsertStringSplitCR: refusing to insert control character " << int(ch));
+ return false;
+ }
+ }
+
+ const SwInsertFlags nInsertFlags =
bForceExpandHints
? ( SwInsertFlags::FORCEHINTEXPAND | SwInsertFlags::EMPTYEXPAND)
: SwInsertFlags::EMPTYEXPAND;
commit c8e04eb4455eb412466b65a085464a81bd2519fa
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Mon Oct 28 14:31:23 2019 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:25:11 2021 +0300
svl: HTMLParser: stop inserting control character garbage into Writer
E.g. rhbz433940-1.html contains literal ^G characters that are inserted
as-is into SwTextNodes.
This now triggers assert about CH_TXT_ATR_FIELDSTART in
SwSubFont::GetTextSize_() that was added in
19a559b0ec9b806519c405651d6d2b2e14712b4a.
Change-Id: I6aa7de41a04069e15b40865fd57894dae0fc10db
Reviewed-on: https://gerrit.libreoffice.org/81606
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
Tested-by: Michael Stahl <michael.stahl at cib.de>
(cherry picked from commit 35d248cab1f0d4800f72abb5cb6afb56f40d9083)
Reviewed-on: https://gerrit.libreoffice.org/81652
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svtools/source/svhtml/parhtml.cxx b/svtools/source/svhtml/parhtml.cxx
index 6f9e33a8bd2e..42cd5d1295cd 100644
--- a/svtools/source/svhtml/parhtml.cxx
+++ b/svtools/source/svhtml/parhtml.cxx
@@ -31,6 +31,7 @@
#include <tools/datetime.hxx>
#include <unotools/datetime.hxx>
#include <svl/inettype.hxx>
+#include <svl/lngmisc.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/document/XDocumentProperties.hpp>
@@ -456,8 +457,12 @@ HtmlTokenId HTMLParser::ScanText( const sal_Unicode cBreak )
else
nNextCh = 0U;
- if ( ! rtl::isUnicodeCodePoint( cChar ) )
+ if (!rtl::isUnicodeCodePoint(cChar)
+ || (linguistic::IsControlChar(cChar)
+ && cChar != '\r' && cChar != '\n' && cChar != '\t'))
+ {
cChar = '?';
+ }
}
else if( rtl::isAsciiAlpha( nNextCh ) )
{
@@ -753,8 +758,11 @@ HtmlTokenId HTMLParser::ScanText( const sal_Unicode cBreak )
else
{
do {
+ if (!linguistic::IsControlChar(nNextCh))
+ {
// All remaining characters make their way into the text.
- sTmpBuffer.appendUtf32( nNextCh );
+ sTmpBuffer.appendUtf32( nNextCh );
+ }
if( MAX_LEN == sTmpBuffer.getLength() )
{
aToken += sTmpBuffer;
@@ -989,8 +997,11 @@ HtmlTokenId HTMLParser::GetNextRawToken()
}
SAL_FALLTHROUGH;
default:
- // all remaining characters are appended to the buffer
- sTmpBuffer.appendUtf32( nNextCh );
+ if (!linguistic::IsControlChar(nNextCh) || nNextCh == '\t')
+ {
+ // all remaining characters are appended to the buffer
+ sTmpBuffer.appendUtf32( nNextCh );
+ }
break;
}
commit 4ebc328779539d9bc0cb0d7759c27e1e155c129e
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Wed Nov 4 21:39:04 2020 +0100
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 15:22:37 2021 +0300
xmlsecurity: reject a few dangerous annotation types during pdf sig verify
(cherry picked from commit f231dacde9df1c4aa5f4e0970535c4f4093364a7)
Conflicts:
xmlsecurity/source/helper/pdfsignaturehelper.cxx
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105926
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit fcab45e0e22f4cf46e71856dba7ae5abd6f99bc5)
Change-Id: I950b49a6e7181639daf27348ddfa0f36586baa65
Conflicts:
xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
(cherry-picked from 363997c76749219b900f47043d1b17ba8ec9bccd)
Change-Id: I7096222bc2547046d988e0ba28df725859270790
diff --git a/external/liborcus/inc/pch/precompiled_orcus.hxx b/external/liborcus/inc/pch/precompiled_orcus.hxx
new file mode 100644
index 000000000000..28e1bc8119d8
--- /dev/null
+++ b/external/liborcus/inc/pch/precompiled_orcus.hxx
@@ -0,0 +1,109 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+/*
+ This file has been autogenerated by update_pch.sh. It is possible to edit it
+ manually (such as when an include file has been moved/renamed/removed). All such
+ manual changes will be rewritten by the next run of update_pch.sh (which presumably
+ also fixes all possible problems, so it's usually better to use it).
+
+ Generated on 2020-02-01 12:22:35 using:
+ ./bin/update_pch external/liborcus orcus --cutoff=1 --exclude:system --include:module --include:local
+
+ If after updating build fails, use the following command to locate conflicting headers:
+ ./bin/update_pch_bisect ./external/liborcus/inc/pch/precompiled_orcus.hxx "make external/liborcus.build" --find-conflicts
+*/
+
+#if PCH_LEVEL >= 1
+#include <algorithm>
+#include <cassert>
+#include <codecvt>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <deque>
+#include <fstream>
+#include <functional>
+#include <iostream>
+#include <iterator>
+#include <limits>
+#include <locale>
+#include <map>
+#include <memory>
+#include <ostream>
+#include <sstream>
+#include <string>
+#include <unordered_map>
+#include <unordered_set>
+#include <vector>
+#include <boost/current_function.hpp>
+#include <boost/filesystem.hpp>
+#include <boost/iostreams/filter/gzip.hpp>
+#include <boost/iostreams/filtering_stream.hpp>
+#include <boost/optional.hpp>
+#include <boost/pool/object_pool.hpp>
+#endif // PCH_LEVEL >= 1
+#if PCH_LEVEL >= 2
+#endif // PCH_LEVEL >= 2
+#if PCH_LEVEL >= 3
+#include <mdds/global.hpp>
+#include <mdds/sorted_string_map.hpp>
+#include <orcus/config.hpp>
+#include <orcus/css_document_tree.hpp>
+#include <orcus/css_parser.hpp>
+#include <orcus/css_selector.hpp>
+#include <orcus/csv_parser.hpp>
+#include <orcus/dom_tree.hpp>
+#include <orcus/exception.hpp>
+#include <orcus/format_detection.hpp>
+#include <orcus/global.hpp>
+#include <orcus/info.hpp>
+#include <orcus/interface.hpp>
+#include <orcus/json_document_tree.hpp>
+#include <orcus/json_global.hpp>
+#include <orcus/json_parser.hpp>
+#include <orcus/json_structure_tree.hpp>
+#include <orcus/measurement.hpp>
+#include <orcus/orcus_csv.hpp>
+#include <orcus/orcus_gnumeric.hpp>
+#include <orcus/orcus_import_ods.hpp>
+#include <orcus/orcus_import_xlsx.hpp>
+#include <orcus/orcus_json.hpp>
+#include <orcus/orcus_ods.hpp>
+#include <orcus/orcus_xls_xml.hpp>
+#include <orcus/orcus_xlsx.hpp>
+#include <orcus/orcus_xml.hpp>
+#include <orcus/parser_base.hpp>
+#include <orcus/parser_global.hpp>
+#include <orcus/pstring.hpp>
+#include <orcus/sax_ns_parser.hpp>
+#include <orcus/sax_parser.hpp>
+#include <orcus/sax_parser_base.hpp>
+#include <orcus/sax_token_parser.hpp>
+#include <orcus/spreadsheet/export_interface.hpp>
+#include <orcus/spreadsheet/import_interface.hpp>
+#include <orcus/spreadsheet/import_interface_pivot.hpp>
+#include <orcus/spreadsheet/import_interface_view.hpp>
+#include <orcus/spreadsheet/styles.hpp>
+#include <orcus/spreadsheet/types.hpp>
+#include <orcus/stream.hpp>
+#include <orcus/string_pool.hpp>
+#include <orcus/threaded_sax_token_parser.hpp>
+#include <orcus/tokens.hpp>
+#include <orcus/xml_namespace.hpp>
+#include <orcus/xml_structure_tree.hpp>
+#include <orcus/yaml_document_tree.hpp>
+#include <orcus/yaml_parser.hpp>
+#include <orcus/zip_archive.hpp>
+#include <orcus/zip_archive_stream.hpp>
+#endif // PCH_LEVEL >= 3
+#if PCH_LEVEL >= 4
+#endif // PCH_LEVEL >= 4
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/vcl/filter/PDFiumLibrary.hxx b/include/vcl/filter/PDFiumLibrary.hxx
index 783b9a6da8b4..027e4939fab1 100644
--- a/include/vcl/filter/PDFiumLibrary.hxx
+++ b/include/vcl/filter/PDFiumLibrary.hxx
@@ -59,6 +59,8 @@ public:
FPDF_ClosePage(mpPage);
}
+ FPDF_PAGE getPointer() { return mpPage; }
+
/// Get bitmap checksum of the page, without annotations/commenting.
BitmapChecksum getChecksum(int nMDPPerm);
};
diff --git a/xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf b/xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf
new file mode 100644
index 000000000000..b30f5b03867c
Binary files /dev/null and b/xmlsecurity/qa/unit/pdfsigning/data/bad-cert-p3-stamp.pdf differ
diff --git a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
index b35a1cd9a528..4eee048b52f9 100644
--- a/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
+++ b/xmlsecurity/qa/unit/pdfsigning/pdfsigning.cxx
@@ -456,6 +456,22 @@ void PDFSigningTest::testBadCertP1()
rInformation.nStatus);
}
+CPPUNIT_TEST_FIXTURE(PDFSigningTest, testBadCertP3Stamp)
+{
+ std::vector<SignatureInformation> aInfos
+ = verify(m_directories.getURLFromSrc(DATA_DIRECTORY) + "bad-cert-p3-stamp.pdf", 1,
+ /*rExpectedSubFilter=*/OString());
+ CPPUNIT_ASSERT(!aInfos.empty());
+ SignatureInformation& rInformation = aInfos[0];
+
+ // Without the accompanying fix in place, this test would have failed with:
+ // - Expected: 0 (SecurityOperationStatus_UNKNOWN)
+ // - Actual : 1 (SecurityOperationStatus_OPERATION_SUCCEEDED)
+ // i.e. adding a stamp annotation was not considered as a bad modification.
+ CPPUNIT_ASSERT_EQUAL(xml::crypto::SecurityOperationStatus::SecurityOperationStatus_UNKNOWN,
+ rInformation.nStatus);
+}
+
/// Test writing a PAdES signature.
void PDFSigningTest::testSigningCertificateAttribute()
{
diff --git a/xmlsecurity/source/pdfio/pdfdocument.cxx b/xmlsecurity/source/pdfio/pdfdocument.cxx
index 9d056de0a15c..51eac91495a7 100644
--- a/xmlsecurity/source/pdfio/pdfdocument.cxx
+++ b/xmlsecurity/source/pdfio/pdfdocument.cxx
@@ -24,6 +24,11 @@
#include <svl/cryptosign.hxx>
#include <vcl/filter/pdfdocument.hxx>
#include <vcl/bitmap.hxx>
+#include <basegfx/range/b2drectangle.hxx>
+
+#if HAVE_FEATURE_PDFIUM
+#include <fpdf_annot.h>
+#endif
using namespace com::sun::star;
@@ -138,8 +143,29 @@ bool IsCompleteSignature(SvStream& rStream, vcl::filter::PDFDocument& rDocument,
return std::find(rAllEOFs.begin(), rAllEOFs.end(), nFileEnd) != rAllEOFs.end();
}
+/**
+ * Contains checksums of a PDF page, which is rendered without annotations. It also contains
+ * the geometry of a few dangerous annotation types.
+ */
+struct PageChecksum
+{
+ BitmapChecksum m_nPageContent;
+ std::vector<basegfx::B2DRectangle> m_aAnnotations;
+ bool operator==(const PageChecksum& rChecksum) const;
+};
+
+bool PageChecksum::operator==(const PageChecksum& rChecksum) const
+{
+ if (m_nPageContent != rChecksum.m_nPageContent)
+ {
+ return false;
+ }
+
+ return m_aAnnotations == rChecksum.m_aAnnotations;
+}
+
/// Collects the checksum of each page of one version of the PDF.
-void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<BitmapChecksum>& rPageChecksums,
+void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<PageChecksum>& rPageChecksums,
int nMDPPerm)
{
#if HAVE_FEATURE_PDFIUM
@@ -156,8 +182,35 @@ void AnalyizeSignatureStream(SvMemoryStream& rStream, std::vector<BitmapChecksum
return;
}
- BitmapChecksum nPageChecksum = pPdfPage->getChecksum(nMDPPerm);
- rPageChecksums.push_back(nPageChecksum);
+ PageChecksum aPageChecksum;
+ aPageChecksum.m_nPageContent = pPdfPage->getChecksum(nMDPPerm);
+ for (int i = 0; i < FPDFPage_GetAnnotCount(pPdfPage->getPointer()); ++i)
+ {
+ FPDF_ANNOTATION pAnnotation = FPDFPage_GetAnnot(pPdfPage->getPointer(), i);
+ int nType = FPDFAnnot_GetSubtype(pAnnotation);
+ switch (nType)
+ {
+ case FPDF_ANNOT_UNKNOWN:
+ case FPDF_ANNOT_FREETEXT:
+ case FPDF_ANNOT_STAMP:
+ case FPDF_ANNOT_REDACT:
+ {
+ basegfx::B2DRectangle aB2DRectangle;
+ FS_RECTF aRect;
+ if (FPDFAnnot_GetRect(pAnnotation, &aRect))
+ {
+ aB2DRectangle = basegfx::B2DRectangle(aRect.left, aRect.top, aRect.right,
+ aRect.bottom);
+ }
+ aPageChecksum.m_aAnnotations.push_back(aB2DRectangle);
+ break;
+ }
+ default:
+ break;
+ }
+ FPDFPage_CloseAnnot(pAnnotation);
+ }
+ rPageChecksums.push_back(aPageChecksum);
}
#else
(void)rStream;
@@ -182,7 +235,7 @@ bool IsValidSignature(SvStream& rStream, vcl::filter::PDFObjectElement* pSignatu
aSignatureStream.WriteStream(rStream, nSignatureEOF);
rStream.Seek(nPos);
aSignatureStream.Seek(0);
- std::vector<BitmapChecksum> aSignedPages;
+ std::vector<PageChecksum> aSignedPages;
AnalyizeSignatureStream(aSignatureStream, aSignedPages, nMDPPerm);
SvMemoryStream aFullStream;
@@ -191,7 +244,7 @@ bool IsValidSignature(SvStream& rStream, vcl::filter::PDFObjectElement* pSignatu
aFullStream.WriteStream(rStream);
rStream.Seek(nPos);
aFullStream.Seek(0);
- std::vector<BitmapChecksum> aAllPages;
+ std::vector<PageChecksum> aAllPages;
AnalyizeSignatureStream(aFullStream, aAllPages, nMDPPerm);
// Fail if any page looks different after signing and at the end. Annotations/commenting doesn't
commit 8a1ee2fa05aaf72f998eaedfda4efe060d75be36
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Tue Jul 21 21:25:26 2020 +0200
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 14:41:06 2021 +0300
external: update pdfium to handle redact annotations
external: update pdfium to 4203
(cherry picked from commit 4488be8a9279be0bd0aebd476589a49d2b95da6e)
Update one mention of pdfium-4137.tar.bz2
...left behind by 4488be8a9279be0bd0aebd476589a49d2b95da6e "external: update
pdfium to 4203"
(cherry picked from commit ba4b3d5f7a0fe8d0d985e98897e041d59093d8b0)
external: update pdfium to 4260
(cherry picked from commit f19381e46930bb496e7331754843920933fb4be2)
external: update pdfium to 4306
(cherry picked from commit fe531957e3dcd42927cf15ab31d04473433d81f9)
Conflicts:
include/vcl/pdf/PDFAnnotationSubType.hxx
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105913
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
(cherry picked from commit b4f50e78e9cd391964128bd0d1446d4dca110cef)
Change-Id: Ic10cf99fa412f8f0b3475e82d0a1839a7f04bd08
diff --git a/download.lst b/download.lst
index e2cb3002a8a2..248efc6701a5 100644
--- a/download.lst
+++ b/download.lst
@@ -200,8 +200,8 @@ export OWNCLOUD_ANDROID_LIB_SHA256SUM := b18b3e3ef7fae6a79b62f2bb43cc47a5346b633
export OWNCLOUD_ANDROID_LIB_TARBALL := owncloud-android-library-0.9.4-no-binary-deps.tar.gz
export PAGEMAKER_SHA256SUM := 66adacd705a7d19895e08eac46d1e851332adf2e736c566bef1164e7a442519d
export PAGEMAKER_TARBALL := libpagemaker-0.0.4.tar.xz
-export PDFIUM_SHA256SUM := 572460f7f9e2f86d022a9c6a82f1e2ded6c3c29ba352d4b9fac60b87e2159679
-export PDFIUM_TARBALL := pdfium-3550.tar.bz2
+export PDFIUM_SHA256SUM := eca406d47ac7e2a84dcc86f93c08f96e591d409589e881477fa75e488e4851d8
+export PDFIUM_TARBALL := pdfium-4306.tar.bz2
export PIXMAN_SHA256SUM := 21b6b249b51c6800dc9553b65106e1e37d0e25df942c90531d4c3997aa20a88e
export PIXMAN_TARBALL := e80ebae4da01e77f68744319f01d52a3-pixman-0.34.0.tar.gz
export LIBPNG_SHA256SUM := 505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca
diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk
index f9a62bf75b46..3b37143c4599 100644
--- a/external/pdfium/Library_pdfium.mk
+++ b/external/pdfium/Library_pdfium.mk
@@ -20,13 +20,15 @@ $(eval $(call gb_Library_set_include,pdfium,\
))
$(eval $(call gb_Library_add_defs,pdfium,\
- -DPDFIUM_DLLIMPLEMENTATION \
+ -DFPDF_IMPLEMENTATION \
-DUSE_SYSTEM_LCMS2 \
-DUSE_SYSTEM_LIBJPEG \
-DUSE_SYSTEM_ZLIB \
-DUSE_SYSTEM_ICUUC \
-DMEMORY_TOOL_REPLACES_ALLOCATOR \
-DUNICODE \
+ -DWIN32_LEAN_AND_MEAN \
+ -DCOMPONENT_BUILD \
))
# Don't show warnings upstream doesn't care about.
@@ -41,15 +43,12 @@ $(eval $(call gb_Library_set_generated_cxx_suffix,pdfium,cpp))
# pdfium
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/fpdfsdk/cfx_systemhandler \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annot \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annothandlermgr \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_annotiteration \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_baannot \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_baannothandler \
- UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_datetime \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_formfillenvironment \
- UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interform \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pageview \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widget \
UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_widgethandler \
@@ -79,20 +78,21 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/fpdfsdk/fpdf_save \
UnpackedTarball/pdfium/fpdfsdk/fpdf_text \
UnpackedTarball/pdfium/fpdfsdk/fpdf_view \
- UnpackedTarball/pdfium/fpdfsdk/ipdfsdk_pauseadapter \
- UnpackedTarball/pdfium/fpdfsdk/cpdf_annotcontext \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_pauseadapter \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_interactiveform \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_renderpage \
+ UnpackedTarball/pdfium/fpdfsdk/fpdf_signature \
))
# fdrm
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/core/fdrm/crypto/fx_crypt \
- UnpackedTarball/pdfium/core/fdrm/crypto/fx_crypt_aes \
- UnpackedTarball/pdfium/core/fdrm/crypto/fx_crypt_sha \
+ UnpackedTarball/pdfium/core/fdrm/fx_crypt \
+ UnpackedTarball/pdfium/core/fdrm/fx_crypt_aes \
+ UnpackedTarball/pdfium/core/fdrm/fx_crypt_sha \
))
# formfiller
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/fpdfsdk/formfiller/cba_fontmap \
UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_checkbox \
UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_combobox \
UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_formfiller \
@@ -103,6 +103,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_textfield \
UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_button \
UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_textobject \
+ UnpackedTarball/pdfium/fpdfsdk/formfiller/cffl_privatedata \
))
# fpdfapi
@@ -169,8 +170,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/cmaps/Korea1/UniKS-UTF16-H_0 \
UnpackedTarball/pdfium/core/fpdfapi/cmaps/Korea1/cmaps_korea1 \
UnpackedTarball/pdfium/core/fpdfapi/cmaps/fpdf_cmaps \
- UnpackedTarball/pdfium/core/fpdfapi/cpdf_modulemgr \
- UnpackedTarball/pdfium/core/fpdfapi/cpdf_pagerendercontext \
UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_pagecontentgenerator \
UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cidfont \
UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_font \
@@ -185,7 +184,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_color \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_colorspace \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_colorstate \
- UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentmark \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentmarks \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentmarkitem \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_contentparser \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_docpagedata \
@@ -200,7 +199,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pagemodule \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobject \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobjectholder \
- UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pageobjectlist \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_path \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pathobject \
UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_pattern \
@@ -237,9 +235,8 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/parser/fpdf_parser_utility \
UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_object_walker \
UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_read_validator \
- UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_charposlist \
+ UnpackedTarball/pdfium/core/fpdfapi/render/charposlist \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_devicebuffer \
- UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_dibtransferfunc \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_docrenderdata \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imagecacheentry \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_imageloader \
@@ -251,12 +248,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_renderstatus \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_scaledrenderbuffer \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_textrenderer \
- UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_transferfunc \
UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_type3cache \
- UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_type3glyphs \
+ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_type3glyphmap \
+ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_rendershading \
+ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_rendertiling \
UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_creator \
- UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_encryptor \
- UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_flateencoder \
+ UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_encryptor \
+ UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_flateencoder \
UnpackedTarball/pdfium/core/fpdfapi/font/cfx_cttgsubtable \
UnpackedTarball/pdfium/core/fpdfapi/font/cfx_stockfontarray \
UnpackedTarball/pdfium/core/fpdfapi/font/cpdf_cid2unicodemap \
@@ -278,11 +276,17 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_page_object_avail \
UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_cross_ref_avail \
UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_pagecontentmanager \
- UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_transparency \
- UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_dibbase \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transparency \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_dib \
UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_object_stream \
UnpackedTarball/pdfium/core/fpdfapi/parser/cpdf_cross_ref_table \
UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_stringarchivestream \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_occontext \
+ UnpackedTarball/pdfium/core/fpdfapi/edit/cpdf_contentstream_write_utils \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_annotcontext \
+ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_pagerendercontext \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfuncdib \
+ UnpackedTarball/pdfium/core/fpdfapi/page/cpdf_transferfunc \
))
# fpdfdoc
@@ -290,7 +294,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfdoc/cline \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_aaction \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_action \
- UnpackedTarball/pdfium/core/fpdfdoc/cpdf_actionfields \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_annot \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_annotlist \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_apsettings \
@@ -298,18 +301,16 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_bookmarktree \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_defaultappearance \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_dest \
- UnpackedTarball/pdfium/core/fpdfdoc/cpdf_docjsactions \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_filespec \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_formcontrol \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_formfield \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_iconfit \
- UnpackedTarball/pdfium/core/fpdfdoc/cpdf_interform \
+ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_interactiveform \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_link \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_linklist \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_metadata \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_nametree \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_numbertree \
- UnpackedTarball/pdfium/core/fpdfdoc/cpdf_occontext \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_pagelabel \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_variabletext \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_viewerpreferences \
@@ -320,6 +321,9 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fpdfdoc/ctypeset \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structelement \
UnpackedTarball/pdfium/core/fpdfdoc/cpdf_structtree \
+ UnpackedTarball/pdfium/core/fpdfdoc/cba_fontmap \
+ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_color_utils \
+ UnpackedTarball/pdfium/core/fpdfdoc/cpdf_icon \
))
# fpdftext
@@ -332,7 +336,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
# fxcodec
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/core/fxcodec/codec/fx_codec \
+ UnpackedTarball/pdfium/core/fxcodec/fx_codec \
UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_ArithDecoder \
UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_ArithIntDecoder \
UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_BitStream \
@@ -349,18 +353,20 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_Segment \
UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_SymbolDict \
UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_TrdProc \
- UnpackedTarball/pdfium/core/fxcodec/bmp/fx_bmp \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_scanlinedecoder \
UnpackedTarball/pdfium/core/fxcodec/gif/cfx_gif \
- UnpackedTarball/pdfium/core/fxcodec/gif/cfx_gifcontext \
UnpackedTarball/pdfium/core/fxcodec/gif/cfx_lzwdecompressor \
- UnpackedTarball/pdfium/core/fxcodec/codec/cfx_codec_memory \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_faxmodule \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_iccmodule \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_jbig2module \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_jpxmodule \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_jpegmodule \
- UnpackedTarball/pdfium/core/fxcodec/codec/ccodec_flatemodule \
+ UnpackedTarball/pdfium/core/fxcodec/cfx_codec_memory \
+ UnpackedTarball/pdfium/core/fxcodec/fax/faxmodule \
+ UnpackedTarball/pdfium/core/fxcodec/scanlinedecoder \
+ UnpackedTarball/pdfium/core/fxcodec/jpeg/jpegmodule \
+ UnpackedTarball/pdfium/core/fxcodec/jpx/cjpx_decoder \
+ UnpackedTarball/pdfium/core/fxcodec/jpx/jpx_decode_utils \
+ UnpackedTarball/pdfium/core/fxcodec/jbig2/JBig2_DocumentContext \
+ UnpackedTarball/pdfium/core/fxcodec/basic/basicmodule \
+ UnpackedTarball/pdfium/core/fxcodec/flate/flatemodule \
+ UnpackedTarball/pdfium/core/fxcodec/icc/iccmodule \
+ UnpackedTarball/pdfium/core/fxcodec/jbig2/jbig2_decoder \
+ UnpackedTarball/pdfium/core/fxcodec/jpeg/jpeg_common \
))
# fxcrt
@@ -373,7 +379,6 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxcrt/fx_memory \
UnpackedTarball/pdfium/core/fxcrt/fx_stream \
UnpackedTarball/pdfium/core/fxcrt/fx_system \
- UnpackedTarball/pdfium/core/fxcrt/fx_ucddata \
UnpackedTarball/pdfium/core/fxcrt/fx_unicode \
UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmldocument \
UnpackedTarball/pdfium/core/fxcrt/xml/cfx_xmlelement \
@@ -410,11 +415,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxcrt/fx_random \
UnpackedTarball/pdfium/core/fxcrt/fx_string \
UnpackedTarball/pdfium/core/fxcrt/widestring \
- UnpackedTarball/pdfium/core/fxcrt/cfx_seekablemultistream \
UnpackedTarball/pdfium/core/fxcrt/css/cfx_cssdata \
UnpackedTarball/pdfium/core/fxcrt/fx_codepage \
+ UnpackedTarball/pdfium/core/fxcrt/fx_number \
UnpackedTarball/pdfium/core/fxcrt/cfx_utf8encoder \
UnpackedTarball/pdfium/core/fxcrt/cfx_readonlymemorystream \
+ UnpackedTarball/pdfium/core/fxcrt/observed_ptr \
+ UnpackedTarball/pdfium/core/fxcrt/string_data_template \
))
# fxge
@@ -423,13 +430,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/dib/cfx_bitmapstorer \
UnpackedTarball/pdfium/core/fxge/dib/cfx_dibextractor \
UnpackedTarball/pdfium/core/fxge/dib/cfx_dibitmap \
- UnpackedTarball/pdfium/core/fxge/dib/cfx_filtereddib \
+ UnpackedTarball/pdfium/core/fxge/cfx_drawutils \
UnpackedTarball/pdfium/core/fxge/dib/cfx_imagerenderer \
UnpackedTarball/pdfium/core/fxge/dib/cfx_imagestretcher \
UnpackedTarball/pdfium/core/fxge/dib/cfx_imagetransformer \
UnpackedTarball/pdfium/core/fxge/dib/cfx_scanlinecompositor \
UnpackedTarball/pdfium/core/fxge/dib/cstretchengine \
- UnpackedTarball/pdfium/core/fxge/dib/fx_dib_main \
+ UnpackedTarball/pdfium/core/fxge/dib/fx_dib \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitDingbats \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixed \
UnpackedTarball/pdfium/core/fxge/fontdata/chromefontdata/FoxitFixedBold \
@@ -451,7 +458,7 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/agg/fx_agg_driver \
UnpackedTarball/pdfium/core/fxge/cfx_cliprgn \
UnpackedTarball/pdfium/core/fxge/cfx_color \
- UnpackedTarball/pdfium/core/fxge/cfx_facecache \
+ UnpackedTarball/pdfium/core/fxge/cfx_glyphcache \
UnpackedTarball/pdfium/core/fxge/cfx_folderfontinfo \
UnpackedTarball/pdfium/core/fxge/cfx_font \
UnpackedTarball/pdfium/core/fxge/cfx_fontcache \
@@ -464,11 +471,14 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/cfx_renderdevice \
UnpackedTarball/pdfium/core/fxge/cfx_substfont \
UnpackedTarball/pdfium/core/fxge/cfx_unicodeencoding \
- UnpackedTarball/pdfium/core/fxge/cttfontdesc \
- UnpackedTarball/pdfium/core/fxge/fx_ge_fontmap \
- UnpackedTarball/pdfium/core/fxge/fx_ge_linux \
- UnpackedTarball/pdfium/core/fxge/fx_ge_text \
+ UnpackedTarball/pdfium/core/fxge/cfx_glyphbitmap \
+ UnpackedTarball/pdfium/core/fxge/scoped_font_transform \
+ UnpackedTarball/pdfium/core/fxge/text_glyph_pos \
+ UnpackedTarball/pdfium/core/fxge/fx_font \
UnpackedTarball/pdfium/core/fxge/dib/cfx_dibbase \
+ UnpackedTarball/pdfium/core/fxge/dib/cfx_cmyk_to_srgb \
+ UnpackedTarball/pdfium/core/fxge/text_char_pos \
+ UnpackedTarball/pdfium/core/fxge/cfx_face \
))
# javascript, build with pdf_enable_v8 disabled.
@@ -480,21 +490,21 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
# pwl
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
- UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_appstream \
+ UnpackedTarball/pdfium/fpdfsdk/cpdfsdk_appstream \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_button \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_caret \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_combo_box \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit_ctrl \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_edit_impl \
- UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_font_map \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_icon \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_box \
- UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_impl \
+ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_cbbutton \
+ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_cblistbox \
+ UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_list_ctrl \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_scroll_bar \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_special_button \
- UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_timer \
- UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_timer_handler \
+ UnpackedTarball/pdfium/core/fxcrt/cfx_timer \
UnpackedTarball/pdfium/fpdfsdk/pwl/cpwl_wnd \
))
@@ -539,6 +549,10 @@ $(eval $(call gb_Library_add_generated_cobjects,pdfium,\
UnpackedTarball/pdfium/third_party/libopenjpeg20/sparse_array \
))
+$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+ UnpackedTarball/pdfium/third_party/libopenjpeg20/opj_malloc \
+))
+
# pdfium_base
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/address_space_randomization \
@@ -546,6 +560,13 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/spin_lock \
UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_alloc \
UnpackedTarball/pdfium/third_party/base/debug/alias \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/oom_callback \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_bucket \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_oom \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_page \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/partition_root_base \
+ UnpackedTarball/pdfium/third_party/base/allocator/partition_allocator/random \
+ UnpackedTarball/pdfium/third_party/base/memory/aligned_memory \
))
# skia_shared
@@ -565,7 +586,6 @@ ifneq (,$(filter LINUX ANDROID,$(OS)))
$(eval $(call gb_Library_add_libs,pdfium,\
-ldl \
-lrt \
- -lpthread \
))
$(eval $(call gb_Library_use_external,pdfium,freetype))
@@ -619,23 +639,33 @@ ifeq ($(OS),WNT)
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/win32/cfx_psrenderer \
UnpackedTarball/pdfium/core/fxge/win32/cpsoutput \
- UnpackedTarball/pdfium/core/fxge/win32/fx_win32_device \
- UnpackedTarball/pdfium/core/fxge/win32/fx_win32_dib \
- UnpackedTarball/pdfium/core/fxge/win32/fx_win32_gdipext \
- UnpackedTarball/pdfium/core/fxge/win32/fx_win32_print \
+ UnpackedTarball/pdfium/core/fxge/win32/cgdi_device_driver \
+ UnpackedTarball/pdfium/core/fxge/win32/cgdi_display_driver \
+ UnpackedTarball/pdfium/core/fxge/win32/cgdi_plus_ext \
+ UnpackedTarball/pdfium/core/fxge/win32/cgdi_printer_driver \
+ UnpackedTarball/pdfium/core/fxge/win32/cps_printer_driver \
+ UnpackedTarball/pdfium/core/fxge/win32/ctext_only_printer_driver \
+ UnpackedTarball/pdfium/core/fxge/win32/cwin32_platform \
+ UnpackedTarball/pdfium/core/fxge/cfx_windowsrenderdevice \
UnpackedTarball/pdfium/core/fxcrt/cfx_fileaccess_windows \
+ UnpackedTarball/pdfium/third_party/base/win/win_util \
+ UnpackedTarball/pdfium/core/fpdfapi/render/cpdf_windowsrenderdevice \
))
$(eval $(call gb_Library_use_system_win32_libs,pdfium,\
gdi32 \
))
+
+$(eval $(call gb_Library_add_defs,pdfium,\
+ -DWIN32 \
+))
endif
ifeq ($(OS),MACOSX)
# fxge
$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/apple/fx_apple_platform \
- UnpackedTarball/pdfium/core/fxge/apple/fx_mac_imp \
+ UnpackedTarball/pdfium/core/fxge/apple/fx_mac_impl \
UnpackedTarball/pdfium/core/fxge/apple/fx_quartz_device \
))
@@ -652,9 +682,16 @@ $(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
UnpackedTarball/pdfium/core/fxge/android/cfpf_skiafont \
UnpackedTarball/pdfium/core/fxge/android/cfpf_skiafontmgr \
UnpackedTarball/pdfium/core/fxge/android/cfx_androidfontinfo \
- UnpackedTarball/pdfium/core/fxge/android/fx_android_imp \
+ UnpackedTarball/pdfium/core/fxge/android/fx_android_impl \
UnpackedTarball/pdfium/core/fxge/android/cfpf_skiapathfont \
))
endif
+ifeq ($(OS),LINUX)
+# fxge
+$(eval $(call gb_Library_add_generated_exception_objects,pdfium,\
+ UnpackedTarball/pdfium/core/fxge/fx_ge_linux \
+))
+endif
+
# vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk
index aaaab0c25ac1..f4643376cee0 100644
--- a/external/pdfium/UnpackedTarball_pdfium.mk
+++ b/external/pdfium/UnpackedTarball_pdfium.mk
@@ -8,10 +8,12 @@
#
pdfium_patches :=
-pdfium_patches += visibility.patch.1
pdfium_patches += ubsan.patch
# Fixes build on our baseline.
pdfium_patches += build.patch.1
+# Avoids Windows 8 build dependency.
+pdfium_patches += windows7.patch.1
+pdfium_patches += c++20-comparison.patch
$(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium))
@@ -36,7 +38,16 @@ $(eval $(call gb_UnpackedTarball_set_post_action,pdfium,\
mv third_party/base/allocator/partition_allocator/page_allocator.cc third_party/base/allocator/partition_allocator/page_allocator.cpp && \
mv third_party/base/allocator/partition_allocator/partition_alloc.cc third_party/base/allocator/partition_allocator/partition_alloc.cpp && \
mv third_party/base/allocator/partition_allocator/spin_lock.cc third_party/base/allocator/partition_allocator/spin_lock.cpp && \
- mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp \
+ mv third_party/base/debug/alias.cc third_party/base/debug/alias.cpp && \
+ mv third_party/base/allocator/partition_allocator/oom_callback.cc third_party/base/allocator/partition_allocator/oom_callback.cpp && \
+ mv third_party/base/allocator/partition_allocator/partition_bucket.cc third_party/base/allocator/partition_allocator/partition_bucket.cpp && \
+ mv third_party/base/allocator/partition_allocator/partition_oom.cc third_party/base/allocator/partition_allocator/partition_oom.cpp && \
+ mv third_party/base/allocator/partition_allocator/partition_page.cc third_party/base/allocator/partition_allocator/partition_page.cpp && \
+ mv third_party/base/allocator/partition_allocator/partition_root_base.cc third_party/base/allocator/partition_allocator/partition_root_base.cpp && \
+ mv third_party/base/allocator/partition_allocator/random.cc third_party/base/allocator/partition_allocator/random.cpp && \
+ mv third_party/base/memory/aligned_memory.cc third_party/base/memory/aligned_memory.cpp && \
+ mv third_party/base/win/win_util.cc third_party/base/win/win_util.cpp && \
+ mv third_party/libopenjpeg20/opj_malloc.cc third_party/libopenjpeg20/opj_malloc.cpp \
))
# vim: set noet sw=4 ts=4:
diff --git a/external/pdfium/build.patch.1 b/external/pdfium/build.patch.1
index 721c1784719d..7cf1021938f5 100644
--- a/external/pdfium/build.patch.1
+++ b/external/pdfium/build.patch.1
@@ -1,24 +1,3 @@
-diff --git a/core/fxge/dib/cfx_imagetransformer.cpp b/core/fxge/dib/cfx_imagetransformer.cpp
-index 8e01127b0..f4ce4d915 100644
---- a/core/fxge/dib/cfx_imagetransformer.cpp
-+++ b/core/fxge/dib/cfx_imagetransformer.cpp
-@@ -315,14 +315,14 @@ bool CFX_ImageTransformer::Continue(IFX_PauseIndicator* pPause) {
- } else if (pDestMask) {
- CalcData cdata = {
- pDestMask.Get(), result2stretch, pSrcMaskBuf,
-- m_Storer.GetBitmap()->m_pAlphaMask->GetPitch(),
-+ static_cast<uint32_t>(m_Storer.GetBitmap()->m_pAlphaMask->GetPitch()),
- };
- CalcMask(cdata);
- }
-
- CalcData cdata = {pTransformed.Get(), result2stretch,
- m_Storer.GetBitmap()->GetBuffer(),
-- m_Storer.GetBitmap()->GetPitch()};
-+ static_cast<uint32_t>(m_Storer.GetBitmap()->GetPitch())};
- if (m_Storer.GetBitmap()->IsAlphaMask()) {
- CalcAlpha(cdata);
- } else {
diff --git a/core/fpdfdoc/cpdf_metadata.cpp b/core/fpdfdoc/cpdf_metadata.cpp
index 323de4ffc..f11a0b0ad 100644
--- a/core/fpdfdoc/cpdf_metadata.cpp
@@ -32,38 +11,6 @@ index 323de4ffc..f11a0b0ad 100644
std::vector<UnsupportedFeature> unsupported;
CheckForSharedFormInternal(doc->GetRoot(), &unsupported);
-diff --git a/fpdfsdk/cpdf_annotcontext.cpp b/fpdfsdk/cpdf_annotcontext.cpp
-index 20c5fc343..a40cd1eae 100644
---- a/fpdfsdk/cpdf_annotcontext.cpp
-+++ b/fpdfsdk/cpdf_annotcontext.cpp
-@@ -16,12 +16,12 @@ CPDF_AnnotContext::CPDF_AnnotContext(CPDF_Dictionary* pAnnotDict,
- CPDF_Page* pPage,
- CPDF_Stream* pStream)
- : m_pAnnotDict(pAnnotDict), m_pPage(pPage) {
-- SetForm(pStream);
-+ SetForm_(pStream);
- }
-
- CPDF_AnnotContext::~CPDF_AnnotContext() = default;
-
--void CPDF_AnnotContext::SetForm(CPDF_Stream* pStream) {
-+void CPDF_AnnotContext::SetForm_(CPDF_Stream* pStream) {
- if (!pStream)
- return;
-
-diff --git a/fpdfsdk/cpdf_annotcontext.h b/fpdfsdk/cpdf_annotcontext.h
-index 38cc91e03..7904ae044 100644
---- a/fpdfsdk/cpdf_annotcontext.h
-+++ b/fpdfsdk/cpdf_annotcontext.h
-@@ -23,7 +23,7 @@ class CPDF_AnnotContext {
- CPDF_Stream* pStream);
- ~CPDF_AnnotContext();
-
-- void SetForm(CPDF_Stream* pStream);
-+ void SetForm_(CPDF_Stream* pStream);
- bool HasForm() const { return !!m_pAnnotForm; }
- CPDF_Form* GetForm() const { return m_pAnnotForm.get(); }
- CPDF_Dictionary* GetAnnotDict() const { return m_pAnnotDict.Get(); }
diff --git a/third_party/base/span.h b/third_party/base/span.h
index 0fb627ba8..f71c362e2 100644
--- a/third_party/base/span.h
@@ -77,37 +24,6 @@ index 0fb627ba8..f71c362e2 100644
span& operator=(const span& other) noexcept = default;
~span() noexcept {
if (!size_) {
-diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp
-index d3bf38d31..e8aea9707 100644
---- a/fpdfsdk/fpdf_annot.cpp
-+++ b/fpdfsdk/fpdf_annot.cpp
-@@ -389,7 +389,7 @@ FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) {
-
- // Get the annotation's corresponding form object for parsing its AP stream.
- if (!pAnnot->HasForm())
-- pAnnot->SetForm(pStream);
-+ pAnnot->SetForm_(pStream);
-
- // Check that the object did not come from the same annotation. If this check
- // succeeds, then it is assumed that the object came from
-@@ -425,7 +425,7 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) {
- if (!pStream)
- return 0;
-
-- pAnnot->SetForm(pStream);
-+ pAnnot->SetForm_(pStream);
- }
- return pdfium::CollectionSize<int>(*pAnnot->GetForm()->GetPageObjectList());
- }
-@@ -442,7 +442,7 @@ FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index) {
- if (!pStream)
- return nullptr;
-
-- pAnnot->SetForm(pStream);
-+ pAnnot->SetForm_(pStream);
- }
-
- return FPDFPageObjectFromCPDFPageObject(
diff --git a/third_party/base/span.h b/third_party/base/span.h
index 0fb627ba8..dda1fc8bc 100644
--- a/third_party/base/span.h
@@ -121,29 +37,14 @@ index 0fb627ba8..dda1fc8bc 100644
: span(container.data(), container.size()) {}
template <
typename Container,
-diff --git a/core/fpdfdoc/cpdf_dest.h b/core/fpdfdoc/cpdf_dest.h
-index 7f4eb86c0..5e227f86e 100644
---- a/core/fpdfdoc/cpdf_dest.h
-+++ b/core/fpdfdoc/cpdf_dest.h
-@@ -41,7 +41,7 @@
- float* pZoom) const;
-
- private:
-- UnownedPtr<const CPDF_Array> const m_pArray;
-+ UnownedPtr<const CPDF_Array> m_pArray;
- };
-
- #endif // CORE_FPDFDOC_CPDF_DEST_H_
-diff --git a/core/fpdfdoc/cpdf_filespec.h b/core/fpdfdoc/cpdf_filespec.h
-index 7050f695b..916afed8b 100644
---- a/core/fpdfdoc/cpdf_filespec.h
-+++ b/core/fpdfdoc/cpdf_filespec.h
-@@ -41,7 +41,7 @@ class CPDF_FileSpec {
-
- private:
- UnownedPtr<const CPDF_Object> const m_pObj;
-- UnownedPtr<CPDF_Object> const m_pWritableObj;
-+ UnownedPtr<CPDF_Object> m_pWritableObj;
- };
+--- a/core/fxcodec/jpx/cjpx_decoder.cpp
++++ b/core/fxcodec/jpx/cjpx_decoder.cpp
+@@ -70,7 +70,7 @@ Optional<OpjImageRgbData> alloc_rgb(size_t size) {
+ if (!data.b)
+ return {};
+
+- return data;
++ return std::move(data);
+ }
- #endif // CORE_FPDFDOC_CPDF_FILESPEC_H_
+ void sycc_to_rgb(int offset,
diff --git a/external/pdfium/c++20-comparison.patch b/external/pdfium/c++20-comparison.patch
new file mode 100644
index 000000000000..025f9ba010db
--- /dev/null
+++ b/external/pdfium/c++20-comparison.patch
@@ -0,0 +1,13 @@
+--- core/fxcrt/fx_memory_wrappers.h
++++ core/fxcrt/fx_memory_wrappers.h
+@@ -70,8 +70,8 @@
+ }
+
+ // There's no state, so they are all the same,
+- bool operator==(const FxAllocAllocator& that) { return true; }
+- bool operator!=(const FxAllocAllocator& that) { return false; }
++ bool operator==(const FxAllocAllocator& that) const { return true; }
++ bool operator!=(const FxAllocAllocator& that) const { return false; }
+ };
+
+ #endif // CORE_FXCRT_FX_MEMORY_WRAPPERS_H_
diff --git a/external/pdfium/configs/build_config.h b/external/pdfium/configs/build_config.h
index edd70af53034..ec93c278767c 100644
--- a/external/pdfium/configs/build_config.h
+++ b/external/pdfium/configs/build_config.h
@@ -6,7 +6,7 @@
// This file adds defines about the platform we're currently building on.
// Operating System:
-// OS_WIN / OS_MACOSX / OS_LINUX / OS_POSIX (MACOSX or LINUX)
+// OS_WIN / OS_APPLE / OS_LINUX / OS_POSIX (MACOSX or LINUX)
// Compiler:
// COMPILER_MSVC / COMPILER_GCC
// Processor:
@@ -21,7 +21,7 @@
#define OS_ANDROID 1
#define OS_LINUX 1
#elif defined(__APPLE__)
-#define OS_MACOSX 1
+#define OS_APPLE 1
#elif defined(__linux__)
#define OS_LINUX 1
#elif defined(__DragonFly__)
@@ -48,7 +48,7 @@
// For access to standard POSIX features, use OS_POSIX instead of a more
// specific macro.
-#if defined(OS_MACOSX) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
+#if defined(OS_APPLE) || defined(OS_LINUX) || defined(OS_BSD) || defined(OS_SOLARIS)
#define OS_POSIX 1
#endif
diff --git a/external/pdfium/msvc2015.patch.1 b/external/pdfium/msvc2015.patch.1
new file mode 100644
index 000000000000..36cb5332c7b0
--- /dev/null
+++ b/external/pdfium/msvc2015.patch.1
@@ -0,0 +1,202 @@
+Fix MSVC 2015 build
+
+--- pdfium/third_party/base/optional.h.orig 2020-10-26 19:26:04.000000000 +0100
++++ pdfium/third_party/base/optional.h 2020-12-03 16:00:54.879883100 +0100
+@@ -36,7 +36,7 @@
+ struct OptionalStorageBase {
+ // Provide non-defaulted default ctor to make sure it's not deleted by
+ // non-trivial T::T() in the union.
+- constexpr OptionalStorageBase() : dummy_() {}
++ OptionalStorageBase() : dummy_() {}
+
+ template <class... Args>
+ constexpr explicit OptionalStorageBase(in_place_t, Args&&... args)
+@@ -88,7 +88,7 @@
+ struct OptionalStorageBase<T, true /* trivially destructible */> {
+ // Provide non-defaulted default ctor to make sure it's not deleted by
+ // non-trivial T::T() in the union.
+- constexpr OptionalStorageBase() : dummy_() {}
++ OptionalStorageBase() : dummy_() {}
+
+ template <class... Args>
+ constexpr explicit OptionalStorageBase(in_place_t, Args&&... args)
+@@ -607,32 +607,32 @@
+ return *this;
+ }
+
+- constexpr const T* operator->() const {
++ const T* operator->() const {
+ CHECK(storage_.is_populated_);
+ return &storage_.value_;
+ }
+
+- constexpr T* operator->() {
++ T* operator->() {
+ CHECK(storage_.is_populated_);
+ return &storage_.value_;
+ }
+
+- constexpr const T& operator*() const & {
++ const T& operator*() const & {
+ CHECK(storage_.is_populated_);
+ return storage_.value_;
+ }
+
+- constexpr T& operator*() & {
++ T& operator*() & {
+ CHECK(storage_.is_populated_);
+ return storage_.value_;
+ }
+
+- constexpr const T&& operator*() const && {
++ const T&& operator*() const && {
+ CHECK(storage_.is_populated_);
+ return std::move(storage_.value_);
+ }
+
+- constexpr T&& operator*() && {
++ T&& operator*() && {
+ CHECK(storage_.is_populated_);
+ return std::move(storage_.value_);
+ }
+@@ -641,22 +641,22 @@
+
+ constexpr bool has_value() const { return storage_.is_populated_; }
+
+- constexpr T& value() & {
++ T& value() & {
+ CHECK(storage_.is_populated_);
+ return storage_.value_;
+ }
+
+- constexpr const T& value() const & {
++ const T& value() const & {
+ CHECK(storage_.is_populated_);
+ return storage_.value_;
+ }
+
+- constexpr T&& value() && {
++ T&& value() && {
+ CHECK(storage_.is_populated_);
+ return std::move(storage_.value_);
+ }
+
+- constexpr const T&& value() const && {
++ const T&& value() const && {
+ CHECK(storage_.is_populated_);
+ return std::move(storage_.value_);
+ }
+--- pdfium/third_party/base/span.h.orig 2020-10-26 19:26:04.000000000 +0100
++++ pdfium/third_party/base/span.h 2020-12-03 16:28:15.642138100 +0100
+@@ -193,7 +193,7 @@
+
+ // TODO(dcheng): Implement construction from a |begin| and |end| pointer.
+ template <size_t N>
+- constexpr span(T (&array)[N]) noexcept : span(array, N) {}
++ span(T (&array)[N]) noexcept : span(array, N) {}
+ // TODO(dcheng): Implement construction from std::array.
+ // Conversion from a container that provides |T* data()| and |integral_type
+ // size()|.
+--- pdfium/core/fpdfapi/page/cpdf_colorspace.cpp.orig 2020-12-03 16:54:15.514659400 +0100
++++ pdfium/core/fpdfapi/page/cpdf_colorspace.cpp 2020-12-03 16:38:52.167650200 +0100
+@@ -905,7 +905,7 @@
+ float R;
+ float G;
+ float B;
+- GetRGB(lab, &R, &G, &B);
++ GetRGB(pdfium::span<float>(lab), &R, &G, &B);
+ pDestBuf[0] = static_cast<int32_t>(B * 255);
+ pDestBuf[1] = static_cast<int32_t>(G * 255);
+ pDestBuf[2] = static_cast<int32_t>(R * 255);
+--- pdfium/core/fpdfapi/page/cpdf_meshstream.cpp.orig 2020-12-03 16:54:09.233498800 +0100
++++ pdfium/core/fpdfapi/page/cpdf_meshstream.cpp 2020-12-03 16:41:29.173766500 +0100
+@@ -209,7 +209,7 @@
+ func->Call(color_value, 1, result, &nResults);
+ }
+
+- m_pCS->GetRGB(result, &r, &g, &b);
++ m_pCS->GetRGB(pdfium::span<float>(result), &r, &g, &b);
+ return std::tuple<float, float, float>(r, g, b);
+ }
+
+--- pdfium/core/fpdfapi/parser/cpdf_security_handler.cpp.orig 2020-12-03 16:53:56.077095400 +0100
++++ pdfium/core/fpdfapi/parser/cpdf_security_handler.cpp 2020-12-03 16:44:23.951334200 +0100
+@@ -481,7 +481,7 @@
+ uint8_t passcode[32];
+ GetPassCode(owner_password, passcode);
+ uint8_t digest[16];
+- CRYPT_MD5Generate(passcode, digest);
++ CRYPT_MD5Generate(pdfium::span<uint8_t>(passcode), digest);
+ if (m_Revision >= 3) {
+ for (uint32_t i = 0; i < 50; i++)
+ CRYPT_MD5Generate(digest, digest);
+@@ -570,10 +570,10 @@
+ uint8_t passcode[32];
+ GetPassCode(owner_password_copy, passcode);
+ uint8_t digest[16];
+- CRYPT_MD5Generate(passcode, digest);
++ CRYPT_MD5Generate(pdfium::span<uint8_t>(passcode), digest);
+ if (m_Revision >= 3) {
+ for (uint32_t i = 0; i < 50; i++)
+- CRYPT_MD5Generate(digest, digest);
++ CRYPT_MD5Generate(pdfium::span<uint8_t>(digest), digest);
+ }
+ uint8_t enckey[32];
+ memcpy(enckey, digest, key_len);
+--- pdfium/core/fpdfapi/page/cpdf_dib.cpp.orig 2020-12-03 16:53:44.548444600 +0100
++++ pdfium/core/fpdfapi/page/cpdf_dib.cpp 2020-12-03 16:49:11.937584700 +0100
+@@ -874,7 +874,7 @@
+ color_values[0] += m_CompData[0].m_DecodeStep;
+ color_values[1] += m_CompData[0].m_DecodeStep;
+ color_values[2] += m_CompData[0].m_DecodeStep;
+- m_pColorSpace->GetRGB(color_values, &R, &G, &B);
++ m_pColorSpace->GetRGB(pdfium::span<float>(color_values), &R, &G, &B);
+ FX_ARGB argb1 = ArgbEncode(255, FXSYS_roundf(R * 255),
+ FXSYS_roundf(G * 255), FXSYS_roundf(B * 255));
+ if (argb0 != 0xFF000000 || argb1 != 0xFFFFFFFF) {
+--- pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc.orig 2020-12-03 17:09:02.887283800 +0100
++++ pdfium/third_party/base/allocator/partition_allocator/partition_alloc.cc 2020-12-03 17:07:22.198993800 +0100
+@@ -67,12 +67,12 @@
+ // Chained hooks are not supported. Registering a non-null hook when a
+ // non-null hook is already registered indicates somebody is trying to
+ // overwrite a hook.
+- CHECK((!allocation_observer_hook_ && !free_observer_hook_) ||
++ CHECK((!allocation_observer_hook_.load() && !free_observer_hook_.load()) ||
+ (!alloc_hook && !free_hook));
+ allocation_observer_hook_ = alloc_hook;
+ free_observer_hook_ = free_hook;
+
+- hooks_enabled_ = allocation_observer_hook_ || allocation_override_hook_;
++ hooks_enabled_ = allocation_observer_hook_.load() || allocation_override_hook_.load();
+ }
+
+ void PartitionAllocHooks::SetOverrideHooks(AllocationOverrideHook* alloc_hook,
+@@ -80,14 +80,14 @@
+ ReallocOverrideHook realloc_hook) {
+ subtle::SpinLock::Guard guard(set_hooks_lock_);
+
+- CHECK((!allocation_override_hook_ && !free_override_hook_ &&
+- !realloc_override_hook_) ||
++ CHECK((!allocation_override_hook_.load() && !free_override_hook_.load() &&
++ !realloc_override_hook_.load()) ||
+ (!alloc_hook && !free_hook && !realloc_hook));
+ allocation_override_hook_ = alloc_hook;
+ free_override_hook_ = free_hook;
+ realloc_override_hook_ = realloc_hook;
+
+- hooks_enabled_ = allocation_observer_hook_ || allocation_override_hook_;
++ hooks_enabled_ = allocation_observer_hook_.load() || allocation_override_hook_.load();
+ }
+
+ void PartitionAllocHooks::AllocationObserverHookIfEnabled(
+--- pdfium/third_party/base/allocator/partition_allocator/partition_page.h.orig 2020-12-03 17:13:56.944624000 +0100
++++ pdfium/third_party/base/allocator/partition_allocator/partition_page.h 2020-12-03 17:13:34.385932300 +0100
+@@ -25,6 +25,8 @@
+ struct DeferredUnmap {
+ void* ptr = nullptr;
+ size_t size = 0;
++ DeferredUnmap(void* const p, size_t const s) : ptr(p), size(s) {}
++ DeferredUnmap() = default;
+ // In most cases there is no page to unmap and ptr == nullptr. This function
+ // is inlined to avoid the overhead of a function call in the common case.
+ ALWAYS_INLINE void Run();
diff --git a/external/pdfium/ubsan.patch b/external/pdfium/ubsan.patch
index 91428326fc5d..8610e24f2828 100644
--- a/external/pdfium/ubsan.patch
+++ b/external/pdfium/ubsan.patch
@@ -1,18 +1,18 @@
---- core/fxcrt/string_data_template.h
-+++ core/fxcrt/string_data_template.h
-@@ -78,7 +78,8 @@
+--- core/fxcrt/string_data_template.cpp
++++ core/fxcrt/string_data_template.cpp
+@@ -82,7 +82,8 @@ void StringDataTemplate<CharType>::CopyContentsAt(size_t offset,
+ ASSERT(nLen >= 0);
+ ASSERT(offset + nLen <= m_nAllocLength);
- void CopyContentsAt(size_t offset, const CharType* pStr, size_t nLen) {
- ASSERT(offset >= 0 && nLen >= 0 && offset + nLen <= m_nAllocLength);
-- memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
-+ if (nLen != 0)
-+ memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
- m_String[offset + nLen] = 0;
- }
+- memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
++ if (nLen != 0)
++ memcpy(m_String + offset, pStr, nLen * sizeof(CharType));
+ m_String[offset + nLen] = 0;
+ }
---- core/fxge/cfx_facecache.cpp
-+++ core/fxge/cfx_facecache.cpp
-@@ -183,7 +183,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_FaceCache::RenderGlyph(
+--- core/fxge/cfx_glyphcache.cpp
++++ core/fxge/cfx_glyphcache.cpp
+@@ -183,7 +183,8 @@ std::unique_ptr<CFX_GlyphBitmap> CFX_GlyphCache::RenderGlyph(
}
}
} else {
diff --git a/external/pdfium/visibility.patch.1 b/external/pdfium/visibility.patch.1
deleted file mode 100644
index 04e89b38ab10..000000000000
--- a/external/pdfium/visibility.patch.1
+++ /dev/null
@@ -1,30 +0,0 @@
-diff --git a/public/fpdfview.h b/public/fpdfview.h
-index 1ff0aeb26..f48036f2b 100644
---- a/public/fpdfview.h
-+++ b/public/fpdfview.h
-@@ -129,14 +129,20 @@ typedef int FPDF_ANNOTATION_SUBTYPE;
- // Dictionary value types.
- typedef int FPDF_OBJECT_TYPE;
-
--#if defined(_WIN32) && defined(FPDFSDK_EXPORTS)
--// On Windows system, functions are exported in a DLL
-+#if defined(PDFIUM_DLLIMPLEMENTATION)
-+#ifdef _WIN32
- #define FPDF_EXPORT __declspec(dllexport)
--#define FPDF_CALLCONV __stdcall
- #else
--#define FPDF_EXPORT
--#define FPDF_CALLCONV
-+#define FPDF_EXPORT __attribute__ ((visibility("default")))
-+#endif
-+#else
-+#ifdef _WIN32
-+#define FPDF_EXPORT __declspec(dllimport)
-+#else
-+#define FPDF_EXPORT __attribute__ ((visibility("default")))
- #endif
-+#endif
-+#define FPDF_CALLCONV
-
- // Exported Functions
- #ifdef __cplusplus
diff --git a/external/pdfium/windows7.patch.1 b/external/pdfium/windows7.patch.1
new file mode 100644
index 000000000000..d33f273ff4ca
--- /dev/null
+++ b/external/pdfium/windows7.patch.1
@@ -0,0 +1,34 @@
+diff --git a/third_party/base/win/win_util.cc b/third_party/base/win/win_util.cc
+index ae2dba84d..7a3718848 100644
+--- a/third_party/base/win/win_util.cc
++++ b/third_party/base/win/win_util.cc
+@@ -12,28 +12,7 @@ namespace base {
+ namespace win {
+
+ bool IsUser32AndGdi32Available() {
+- static auto is_user32_and_gdi32_available = []() {
+- // If win32k syscalls aren't disabled, then user32 and gdi32 are available.
+-
+- typedef decltype(
+- GetProcessMitigationPolicy)* GetProcessMitigationPolicyType;
+- GetProcessMitigationPolicyType get_process_mitigation_policy_func =
+- reinterpret_cast<GetProcessMitigationPolicyType>(GetProcAddress(
+- GetModuleHandle(L"kernel32.dll"), "GetProcessMitigationPolicy"));
+-
+- if (!get_process_mitigation_policy_func)
+- return true;
+-
+- PROCESS_MITIGATION_SYSTEM_CALL_DISABLE_POLICY policy = {};
+- if (get_process_mitigation_policy_func(GetCurrentProcess(),
+- ProcessSystemCallDisablePolicy,
+- &policy, sizeof(policy))) {
+- return policy.DisallowWin32kSystemCalls == 0;
+- }
+-
+- return true;
+- }();
+- return is_user32_and_gdi32_available;
++ return true;
+ }
+
+ } // namespace win
diff --git a/solenv/flatpak-manifest.in b/solenv/flatpak-manifest.in
index 0a26b353e3bf..a211b4e3291f 100644
--- a/solenv/flatpak-manifest.in
+++ b/solenv/flatpak-manifest.in
@@ -54,10 +54,10 @@
"type": "shell"
},
{
- "url": "https://dev-www.libreoffice.org/src/pdfium-3550.tar.bz2",
- "sha256": "572460f7f9e2f86d022a9c6a82f1e2ded6c3c29ba352d4b9fac60b87e2159679",
+ "url": "https://dev-www.libreoffice.org/src/pdfium-4306.tar.bz2",
+ "sha256": "eca406d47ac7e2a84dcc86f93c08f96e591d409589e881477fa75e488e4851d8",
"type": "file",
- "dest-filename": "external/tarballs/pdfium-3550.tar.bz2"
+ "dest-filename": "external/tarballs/pdfium-4306.tar.bz2"
},
{
"url": "https://dev-www.libreoffice.org/src/0168229624cfac409e766913506961a8-ucpp-1.3.2.tar.gz",
diff --git a/svx/source/svdraw/svdpdf.cxx b/svx/source/svdraw/svdpdf.cxx
index 881880255f90..3d46fcdd55fc 100644
--- a/svx/source/svdraw/svdpdf.cxx
+++ b/svx/source/svdraw/svdpdf.cxx
@@ -218,7 +218,7 @@ void ImpSdrPdfImport::DoObjects(SvdProgressInfo* pProgrInfo, sal_uInt32* pAction
// Load the page text to extract it when we get text elements.
FPDF_TEXTPAGE pTextPage = FPDFText_LoadPage(pPdfPage);
- const int nPageObjectCount = FPDFPage_CountObject(pPdfPage);
+ const int nPageObjectCount = FPDFPage_CountObjects(pPdfPage);
if (pProgrInfo)
pProgrInfo->SetActionCount(nPageObjectCount);
@@ -767,9 +767,9 @@ void ImpSdrPdfImport::ImportForm(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex
// Get the form matrix to perform correct translation/scaling of the form sub-objects.
const Matrix aOldMatrix = mCurMatrix;
- double a, b, c, d, e, f;
- FPDFFormObj_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f);
- mCurMatrix = Matrix(a, b, c, d, e, f);
+ FS_MATRIX matrix;
+ FPDFFormObj_GetMatrix(pPageObject, &matrix);
+ mCurMatrix = Matrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
const int nCount = FPDFFormObj_CountObjects(pPageObject);
for (int nIndex = 0; nIndex < nCount; ++nIndex)
@@ -797,8 +797,8 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex
if (left == right || top == bottom)
return;
- double a, b, c, d, e, f;
- FPDFText_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f);
+ FS_MATRIX matrix;
+ FPDFTextObj_GetMatrix(pPageObject, &matrix);
Matrix aTextMatrix(mCurMatrix);
aTextMatrix.Transform(left, right, top, bottom);
@@ -816,8 +816,8 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex
OUString sText(pText.get(), nActualChars);
const double dFontSize = FPDFTextObj_GetFontSize(pPageObject);
- double dFontSizeH = fabs(sqrt2(a, c) * dFontSize);
- double dFontSizeV = fabs(sqrt2(b, d) * dFontSize);
+ double dFontSizeH = fabs(sqrt2(matrix.a, matrix.c) * dFontSize);
+ double dFontSizeV = fabs(sqrt2(matrix.b, matrix.d) * dFontSize);
dFontSizeH = lcl_PointToPixel(dFontSizeH);
dFontSizeV = lcl_PointToPixel(dFontSizeV);
dFontSizeH = lcl_ToLogic(dFontSizeH);
@@ -850,7 +850,7 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex
Color aTextColor(COL_TRANSPARENT);
bool bFill = false;
bool bUse = true;
- switch (FPDFText_GetTextRenderMode(pPageObject))
+ switch (FPDFTextObj_GetTextRenderMode(pPageObject))
{
case FPDF_TEXTRENDERMODE_FILL:
case FPDF_TEXTRENDERMODE_FILL_CLIP:
@@ -860,6 +860,7 @@ void ImpSdrPdfImport::ImportText(FPDF_PAGEOBJECT pPageObject, FPDF_TEXTPAGE pTex
break;
case FPDF_TEXTRENDERMODE_STROKE:
case FPDF_TEXTRENDERMODE_STROKE_CLIP:
+ case FPDF_TEXTRENDERMODE_UNKNOWN:
break;
case FPDF_TEXTRENDERMODE_INVISIBLE:
case FPDF_TEXTRENDERMODE_CLIP:
@@ -939,7 +940,7 @@ void ImpSdrPdfImport::ImportText(const Point& rPos, const Size& rSize, const OUS
if (nAngle)
{
nAngle *= 10;
- double a = nAngle * nPi180;
+ double a = nAngle * F_PI18000;
double nSin = sin(a);
double nCos = cos(a);
pText->NbcRotate(aPos, nAngle, nSin, nCos);
@@ -1032,9 +1033,9 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int /*nPageObject
void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int /*nPageObjectIndex*/)
{
- double a, b, c, d, e, f;
- FPDFPath_GetMatrix(pPageObject, &a, &b, &c, &d, &e, &f);
- Matrix aPathMatrix(a, b, c, d, e, f);
+ FS_MATRIX matrix;
+ FPDFPath_GetMatrix(pPageObject, &matrix);
+ Matrix aPathMatrix(matrix.a, matrix.b, matrix.c, matrix.d, matrix.e, matrix.f);
aPathMatrix.Concatinate(mCurMatrix);
basegfx::B2DPolyPolygon aPolyPoly;
@@ -1137,12 +1138,12 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int /*nPageObjectI
unsigned int nG;
unsigned int nB;
unsigned int nA;
- FPDFPath_GetFillColor(pPageObject, &nR, &nG, &nB, &nA);
+ FPDFPageObj_GetFillColor(pPageObject, &nR, &nG, &nB, &nA);
mpVD->SetFillColor(Color(nR, nG, nB));
if (bStroke)
{
- FPDFPath_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA);
+ FPDFPageObj_GetStrokeColor(pPageObject, &nR, &nG, &nB, &nA);
mpVD->SetLineColor(Color(nR, nG, nB));
}
else
commit ade3ff3bc3732d30ec74cdcdff37d34db6ffda8e
Author: Miklos Vajna <vmiklos at collabora.com>
AuthorDate: Fri Oct 16 18:15:21 2020 +0200
Commit: Vasily Melenchuk <vasily.melenchuk at cib.de>
CommitDate: Tue Apr 13 10:25:13 2021 +0300
vcl pdf tokenizer: fix handling of dict -> array -> dict tokens
Needed to be able to parse the /Reference key of signatures.
(cherry picked from commit 056c1284d6a68525002c54bef10834cc135385db)
Conflicts:
vcl/qa/cppunit/filter/ipdf/ipdf.cxx
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105626
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
(cherry picked from commit 8f46af565680bef0ff8ca32781e6d813a7446543)
Change-Id: I6b81089a3f58a2de461ad92ca5a891c284f8686a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107084
Tested-by: Michael Stahl <michael.stahl at cib.de>
Reviewed-by: Michael Stahl <michael.stahl at cib.de>
diff --git a/vcl/Module_vcl.mk b/vcl/Module_vcl.mk
index 380393498fe6..c83502d476d1 100644
--- a/vcl/Module_vcl.mk
+++ b/vcl/Module_vcl.mk
@@ -254,11 +254,6 @@ $(eval $(call gb_Module_add_screenshot_targets,vcl,\
ifneq ($(DISPLAY),)
$(eval $(call gb_Module_add_slowcheck_targets,vcl,\
CppunitTest_vcl_gen \
-))
-endif
-
-ifneq (,$(filter PDFIUM,$(BUILD_TYPE)))
-$(eval $(call gb_Module_add_slowcheck_targets,vcl,\
CppunitTest_vcl_filter_ipdf \
))
endif
More information about the Libreoffice-commits
mailing list