summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSune Vuorela <sune@vuorela.dk>2025-01-15 14:20:25 +0100
committerSune Vuorela <sune@vuorela.dk>2025-01-15 14:47:03 +0100
commit5a3689a023718647257b4c32542b06bea4ea6872 (patch)
treeb420bafef540a22d792a17cf616f9575513cd38d
parent50dd001dba665c9fa08316c26e28c2b906eec78a (diff)
remove guiData
No one seems to be using it; always hardcoded as nullptr.
-rw-r--r--poppler/CurlPDFDocBuilder.cc4
-rw-r--r--poppler/CurlPDFDocBuilder.h2
-rw-r--r--poppler/FDPDFDocBuilder.cc2
-rw-r--r--poppler/FDPDFDocBuilder.h2
-rw-r--r--poppler/LocalPDFDocBuilder.cc6
-rw-r--r--poppler/LocalPDFDocBuilder.h2
-rw-r--r--poppler/PDFDoc.cc7
-rw-r--r--poppler/PDFDoc.h11
-rw-r--r--poppler/PDFDocBuilder.h3
-rw-r--r--poppler/PDFDocFactory.cc4
-rw-r--r--poppler/PDFDocFactory.h3
-rw-r--r--qt5/src/poppler-private.h8
-rw-r--r--qt6/src/poppler-private.h8
13 files changed, 27 insertions, 35 deletions
diff --git a/poppler/CurlPDFDocBuilder.cc b/poppler/CurlPDFDocBuilder.cc
index 83fd54ac..44b5b920 100644
--- a/poppler/CurlPDFDocBuilder.cc
+++ b/poppler/CurlPDFDocBuilder.cc
@@ -22,7 +22,7 @@
// CurlPDFDocBuilder
//------------------------------------------------------------------------
-std::unique_ptr<PDFDoc> CurlPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA)
+std::unique_ptr<PDFDoc> CurlPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword)
{
CachedFile *cachedFile = new CachedFile(new CurlCachedFileLoader(uri.toStr()));
@@ -33,7 +33,7 @@ std::unique_ptr<PDFDoc> CurlPDFDocBuilder::buildPDFDoc(const GooString &uri, con
BaseStream *str = new CachedFileStream(cachedFile, 0, false, cachedFile->getLength(), Object(objNull));
- return std::make_unique<PDFDoc>(str, ownerPassword, userPassword, guiDataA);
+ return std::make_unique<PDFDoc>(str, ownerPassword, userPassword);
}
bool CurlPDFDocBuilder::supports(const GooString &uri)
diff --git a/poppler/CurlPDFDocBuilder.h b/poppler/CurlPDFDocBuilder.h
index f1106b35..e5037508 100644
--- a/poppler/CurlPDFDocBuilder.h
+++ b/poppler/CurlPDFDocBuilder.h
@@ -25,7 +25,7 @@ class CurlPDFDocBuilder : public PDFDocBuilder
{
public:
- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override;
+ std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}) override;
bool supports(const GooString &uri) override;
};
diff --git a/poppler/FDPDFDocBuilder.cc b/poppler/FDPDFDocBuilder.cc
index dcfbbacc..c12a74f1 100644
--- a/poppler/FDPDFDocBuilder.cc
+++ b/poppler/FDPDFDocBuilder.cc
@@ -34,7 +34,7 @@ int FileDescriptorPDFDocBuilder::parseFdFromUri(const GooString &uri)
return fd;
}
-std::unique_ptr<PDFDoc> FileDescriptorPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA)
+std::unique_ptr<PDFDoc> FileDescriptorPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword)
{
const auto fd = parseFdFromUri(uri);
if (fd == -1) {
diff --git a/poppler/FDPDFDocBuilder.h b/poppler/FDPDFDocBuilder.h
index 42c0ff6b..d13684f4 100644
--- a/poppler/FDPDFDocBuilder.h
+++ b/poppler/FDPDFDocBuilder.h
@@ -26,7 +26,7 @@ class FileDescriptorPDFDocBuilder : public PDFDocBuilder
{
public:
- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override;
+ std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}) override;
bool supports(const GooString &uri) override;
private:
diff --git a/poppler/LocalPDFDocBuilder.cc b/poppler/LocalPDFDocBuilder.cc
index c8552fe1..31801b8d 100644
--- a/poppler/LocalPDFDocBuilder.cc
+++ b/poppler/LocalPDFDocBuilder.cc
@@ -18,14 +18,14 @@
// LocalPDFDocBuilder
//------------------------------------------------------------------------
-std::unique_ptr<PDFDoc> LocalPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA)
+std::unique_ptr<PDFDoc> LocalPDFDocBuilder::buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword)
{
if (uri.cmpN("file://", 7) == 0) {
std::unique_ptr<GooString> fileName = uri.copy();
fileName->del(0, 7);
- return std::make_unique<PDFDoc>(std::move(fileName), ownerPassword, userPassword, guiDataA);
+ return std::make_unique<PDFDoc>(std::move(fileName), ownerPassword, userPassword);
} else {
- return std::make_unique<PDFDoc>(uri.copy(), ownerPassword, userPassword, guiDataA);
+ return std::make_unique<PDFDoc>(uri.copy(), ownerPassword, userPassword);
}
}
diff --git a/poppler/LocalPDFDocBuilder.h b/poppler/LocalPDFDocBuilder.h
index 0595d1e6..f58f046b 100644
--- a/poppler/LocalPDFDocBuilder.h
+++ b/poppler/LocalPDFDocBuilder.h
@@ -25,7 +25,7 @@ class LocalPDFDocBuilder : public PDFDocBuilder
{
public:
- std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) override;
+ std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}) override;
bool supports(const GooString &uri) override;
};
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index 9de83920..d2d20508 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -137,8 +137,7 @@ struct FILECloser
PDFDoc::PDFDoc() = default;
-PDFDoc::PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback)
- : fileName(std::move(fileNameA)), guiData(guiDataA)
+PDFDoc::PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback) : fileName(std::move(fileNameA))
{
#ifdef _WIN32
const int n = fileName->getLength();
@@ -172,7 +171,7 @@ PDFDoc::PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooSt
}
#ifdef _WIN32
-PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) : guiData(guiDataA)
+PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback)
{
OSVERSIONINFO version;
@@ -208,7 +207,7 @@ PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooStrin
}
#endif
-PDFDoc::PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA, const std::function<void()> &xrefReconstructedCallback) : guiData(guiDataA)
+PDFDoc::PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, const std::function<void()> &xrefReconstructedCallback)
{
if (strA->getFileName()) {
fileName = strA->getFileName()->copy();
diff --git a/poppler/PDFDoc.h b/poppler/PDFDoc.h
index 417fe5af..0129e047 100644
--- a/poppler/PDFDoc.h
+++ b/poppler/PDFDoc.h
@@ -133,14 +133,13 @@ enum PDFSubtypeConformance
class POPPLER_PRIVATE_EXPORT PDFDoc
{
public:
- explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr,
- const std::function<void()> &xrefReconstructedCallback = {});
+ explicit PDFDoc(std::unique_ptr<GooString> &&fileNameA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, const std::function<void()> &xrefReconstructedCallback = {});
#ifdef _WIN32
- PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
+ PDFDoc(wchar_t *fileNameA, int fileNameLen, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, const std::function<void()> &xrefReconstructedCallback = {});
#endif
- explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr, const std::function<void()> &xrefReconstructedCallback = {});
+ explicit PDFDoc(BaseStream *strA, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, const std::function<void()> &xrefReconstructedCallback = {});
~PDFDoc();
PDFDoc(const PDFDoc &) = delete;
@@ -316,9 +315,6 @@ public:
// Save this file in the given output stream without saving changes
int saveWithoutChangesAs(OutStream *outStr);
- // Return a pointer to the GUI (XPDFCore or WinPDFCore object).
- void *getGUIData() { return guiData; }
-
// rewrite pageDict with MediaBox, CropBox and new page CTM
bool replacePageDict(int pageNo, int rotate, const PDFRectangle *mediaBox, const PDFRectangle *cropBox);
bool markPageObjects(Dict *pageDict, XRef *xRef, XRef *countRef, unsigned int numOffset, int oldRefNum, int newRefNum, std::set<Dict *> *alreadyMarkedDicts = nullptr);
@@ -409,7 +405,6 @@ private:
#endif
std::unique_ptr<GooFile> file;
BaseStream *str = nullptr;
- void *guiData = nullptr;
int headerPdfMajorVersion;
int headerPdfMinorVersion;
PDFSubtype pdfSubtype;
diff --git a/poppler/PDFDocBuilder.h b/poppler/PDFDocBuilder.h
index d0bd1ea6..b9cff731 100644
--- a/poppler/PDFDocBuilder.h
+++ b/poppler/PDFDocBuilder.h
@@ -37,8 +37,7 @@ public:
// Builds a new PDFDoc. Returns a PDFDoc. You should check this PDFDoc
// with PDFDoc::isOk() for failures.
- // The caller is responsible for deleting ownerPassword, userPassWord and guiData.
- virtual std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr) = 0;
+ virtual std::unique_ptr<PDFDoc> buildPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}) = 0;
// Returns true if the builder supports building a PDFDoc from the URI.
virtual bool supports(const GooString &uri) = 0;
diff --git a/poppler/PDFDocFactory.cc b/poppler/PDFDocFactory.cc
index ccca9be1..9bf7978d 100644
--- a/poppler/PDFDocFactory.cc
+++ b/poppler/PDFDocFactory.cc
@@ -54,12 +54,12 @@ PDFDocFactory::~PDFDocFactory()
}
}
-std::unique_ptr<PDFDoc> PDFDocFactory::createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword, void *guiDataA)
+std::unique_ptr<PDFDoc> PDFDocFactory::createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword)
{
for (int i = builders->size() - 1; i >= 0; i--) {
PDFDocBuilder *builder = (*builders)[i];
if (builder->supports(uri)) {
- return builder->buildPDFDoc(uri, ownerPassword, userPassword, guiDataA);
+ return builder->buildPDFDoc(uri, ownerPassword, userPassword);
}
}
diff --git a/poppler/PDFDocFactory.h b/poppler/PDFDocFactory.h
index e84aca46..20a0dcce 100644
--- a/poppler/PDFDocFactory.h
+++ b/poppler/PDFDocFactory.h
@@ -45,8 +45,7 @@ public:
// Create a PDFDoc. Returns a PDFDoc. You should check this PDFDoc
// with PDFDoc::isOk() for failures.
- // The caller is responsible for deleting ownerPassword, userPassWord and guiData.
- std::unique_ptr<PDFDoc> createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {}, void *guiDataA = nullptr);
+ std::unique_ptr<PDFDoc> createPDFDoc(const GooString &uri, const std::optional<GooString> &ownerPassword = {}, const std::optional<GooString> &userPassword = {});
// Extend supported URIs with the ones from the PDFDocBuilder.
void registerPDFDocBuilder(PDFDocBuilder *pdfDocBuilder);
diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h
index 03475ab8..e0331644 100644
--- a/qt5/src/poppler-private.h
+++ b/qt5/src/poppler-private.h
@@ -113,9 +113,9 @@ public:
m_filePath = filePath;
#ifdef _WIN32
- doc = new PDFDoc((wchar_t *)filePath.utf16(), filePath.length(), ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc((wchar_t *)filePath.utf16(), filePath.length(), ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
#else
- doc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(filePath).constData()), ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(filePath).constData()), ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
#endif
}
@@ -124,7 +124,7 @@ public:
m_device = device;
QIODeviceInStream *str = new QIODeviceInStream(device, 0, false, device->size(), Object(objNull));
init();
- doc = new PDFDoc(str, ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc(str, ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
}
DocumentData(const QByteArray &data, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt5ErrorFunction)
@@ -133,7 +133,7 @@ public:
fileContents = data;
MemStream *str = new MemStream((char *)fileContents.data(), 0, fileContents.length(), Object(objNull));
init();
- doc = new PDFDoc(str, ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc(str, ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
}
void init();
diff --git a/qt6/src/poppler-private.h b/qt6/src/poppler-private.h
index 09c1c14c..0d2934b4 100644
--- a/qt6/src/poppler-private.h
+++ b/qt6/src/poppler-private.h
@@ -112,9 +112,9 @@ public:
m_filePath = filePath;
#ifdef _WIN32
- doc = new PDFDoc((wchar_t *)filePath.utf16(), filePath.length(), ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc((wchar_t *)filePath.utf16(), filePath.length(), ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
#else
- doc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(filePath).constData()), ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc(std::make_unique<GooString>(QFile::encodeName(filePath).constData()), ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
#endif
}
@@ -123,7 +123,7 @@ public:
m_device = device;
QIODeviceInStream *str = new QIODeviceInStream(device, 0, false, device->size(), Object(objNull));
init();
- doc = new PDFDoc(str, ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc(str, ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
}
DocumentData(const QByteArray &data, const std::optional<GooString> &ownerPassword, const std::optional<GooString> &userPassword) : GlobalParamsIniter(qt6ErrorFunction)
@@ -132,7 +132,7 @@ public:
fileContents = data;
MemStream *str = new MemStream((char *)fileContents.data(), 0, fileContents.length(), Object(objNull));
init();
- doc = new PDFDoc(str, ownerPassword, userPassword, nullptr, std::bind(&DocumentData::noitfyXRefReconstructed, this));
+ doc = new PDFDoc(str, ownerPassword, userPassword, std::bind(&DocumentData::noitfyXRefReconstructed, this));
}
void init();