2
1
mirror of https://github.com/qpdf/qpdf.git synced 2025-01-22 22:58:33 +00:00

Resolve QPDF{Name,Number} tree helper linker issues (fixes #745)

This is a guess...I'm not sure exactly why there are linker issues or
how to reproduce them.
This commit is contained in:
Jay Berkenbilt 2022-08-07 09:09:04 -04:00
parent b90adb1c6c
commit 32e30a3af2
4 changed files with 22 additions and 8 deletions

View File

@ -42,7 +42,7 @@ class NNTreeImpl;
class NNTreeIterator;
class NNTreeDetails;
class QPDFNameTreeObjectHelper: public QPDFObjectHelper
class QPDF_DLL_CLASS QPDFNameTreeObjectHelper: public QPDFObjectHelper
{
public:
// The qpdf object is required so that this class can issue
@ -55,7 +55,7 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper
static QPDFNameTreeObjectHelper newEmpty(QPDF&, bool auto_repair = true);
QPDF_DLL
virtual ~QPDFNameTreeObjectHelper() = default;
virtual ~QPDFNameTreeObjectHelper();
// Return whether the number tree has an explicit entry for this
// number.
@ -67,7 +67,7 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper
QPDF_DLL
bool findObject(std::string const& utf8, QPDFObjectHandle& oh);
class iterator
class QPDF_DLL_PRIVATE iterator
{
friend class QPDFNameTreeObjectHelper;
@ -181,7 +181,7 @@ class QPDFNameTreeObjectHelper: public QPDFObjectHelper
void setSplitThreshold(int);
private:
class Members
class QPDF_DLL_PRIVATE Members
{
friend class QPDFNameTreeObjectHelper;

View File

@ -39,7 +39,7 @@ class NNTreeImpl;
class NNTreeIterator;
class NNTreeDetails;
class QPDFNumberTreeObjectHelper: public QPDFObjectHelper
class QPDF_DLL_CLASS QPDFNumberTreeObjectHelper: public QPDFObjectHelper
{
public:
// The qpdf object is required so that this class can issue
@ -49,7 +49,7 @@ class QPDFNumberTreeObjectHelper: public QPDFObjectHelper
QPDFObjectHandle, QPDF&, bool auto_repair = true);
QPDF_DLL
virtual ~QPDFNumberTreeObjectHelper() = default;
virtual ~QPDFNumberTreeObjectHelper();
// Create an empty number tree
QPDF_DLL
@ -85,7 +85,7 @@ class QPDFNumberTreeObjectHelper: public QPDFObjectHelper
bool findObjectAtOrBelow(
numtree_number idx, QPDFObjectHandle& oh, numtree_number& offset);
class iterator
class QPDF_DLL_PRIVATE iterator
{
friend class QPDFNumberTreeObjectHelper;
@ -200,7 +200,7 @@ class QPDFNumberTreeObjectHelper: public QPDFObjectHelper
void setSplitThreshold(int);
private:
class Members
class QPDF_DLL_PRIVATE Members
{
friend class QPDFNumberTreeObjectHelper;
typedef QPDFNumberTreeObjectHelper::numtree_number numtree_number;

View File

@ -34,6 +34,13 @@ namespace
static NameTreeDetails name_tree_details;
QPDFNameTreeObjectHelper::~QPDFNameTreeObjectHelper()
{
// Must be explicit and not inline -- see QPDF_DLL_CLASS in
// README-maintainer. For this specific class, see github issue
// #745.
}
QPDFNameTreeObjectHelper::Members::Members(
QPDFObjectHandle& oh, QPDF& q, bool auto_repair) :
impl(std::make_shared<NNTreeImpl>(name_tree_details, q, oh, auto_repair))

View File

@ -35,6 +35,13 @@ namespace
static NumberTreeDetails number_tree_details;
QPDFNumberTreeObjectHelper::~QPDFNumberTreeObjectHelper()
{
// Must be explicit and not inline -- see QPDF_DLL_CLASS in
// README-maintainer. For this specific class, see github issue
// #745.
}
QPDFNumberTreeObjectHelper::Members::Members(
QPDFObjectHandle& oh, QPDF& q, bool auto_repair) :
impl(std::make_shared<NNTreeImpl>(number_tree_details, q, oh, auto_repair))