summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGyorgy Sarvari <skandigraun@gmail.com>2025-09-04 17:05:40 +0200
committerAnuj Mittal <anuj.mittal@intel.com>2025-09-12 08:15:13 +0800
commitf2b163a416a1e96b8a4e6f428380fdbfc1fcaaec (patch)
tree86572e4744644493c9a65b02190931b2bfc6949f
parent2ffcfd6a341a1c1e6569f1e8bec0b4008b1057b2 (diff)
downloadmeta-openembedded-f2b163a416a1e96b8a4e6f428380fdbfc1fcaaec.tar.gz
poppler: fix typos in CVE-2025-52886-0001.patch
There were a some accidenal typos in the CVE-2025-52886-0001.patch file that introduced a number of syntactical errors in the qt5/src/poppler-annotation.cc file, which failed the compilation, in case qt5 PACKAGECONFIG is enabled. This change fixes these typos. Since qt6 is not enabled in the recipe, only the qt5 related parts were verified. While reworking the backport, unfortunately some line number differences were introduced, which inflate the size of this patch - just scroll past those. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r--meta-oe/recipes-support/poppler/poppler/CVE-2025-52886-0001.patch144
1 files changed, 69 insertions, 75 deletions
diff --git a/meta-oe/recipes-support/poppler/poppler/CVE-2025-52886-0001.patch b/meta-oe/recipes-support/poppler/poppler/CVE-2025-52886-0001.patch
index 4f0dc61a8b..4de3f8bcdc 100644
--- a/meta-oe/recipes-support/poppler/poppler/CVE-2025-52886-0001.patch
+++ b/meta-oe/recipes-support/poppler/poppler/CVE-2025-52886-0001.patch
@@ -1595,7 +1595,7 @@ index 1f8d756..8970f49 100644
1595 DocumentData *parentDoc; 1595 DocumentData *parentDoc;
1596 1596
1597diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc 1597diff --git a/qt5/src/poppler-annotation.cc b/qt5/src/poppler-annotation.cc
1598index e15523c..f148671 100644 1598index e15523c..4964563 100644
1599--- a/qt5/src/poppler-annotation.cc 1599--- a/qt5/src/poppler-annotation.cc
1600+++ b/qt5/src/poppler-annotation.cc 1600+++ b/qt5/src/poppler-annotation.cc
1601@@ -65,6 +65,12 @@ 1601@@ -65,6 +65,12 @@
@@ -1636,7 +1636,7 @@ index e15523c..f148671 100644
1636+AnnotationPrivate::~AnnotationPrivate() = default; 1636+AnnotationPrivate::~AnnotationPrivate() = default;
1637 1637
1638-void AnnotationPrivate::tieToNativeAnnot(Annot *ann, ::Page *page, Poppler::DocumentData *doc) 1638-void AnnotationPrivate::tieToNativeAnnot(Annot *ann, ::Page *page, Poppler::DocumentData *doc)
1639+void AnnotationPrivate::tieToNativeAnnot(std::shared_ptr<Annot> *ann, ::Page *page, Poppler::DocumentData *doc) 1639+void AnnotationPrivate::tieToNativeAnnot(std::shared_ptr<Annot> ann, ::Page *page, Poppler::DocumentData *doc)
1640 { 1640 {
1641 if (pdfAnnot) { 1641 if (pdfAnnot) {
1642 error(errIO, -1, "Annotation is already tied"); 1642 error(errIO, -1, "Annotation is already tied");
@@ -1661,11 +1661,10 @@ index e15523c..f148671 100644
1661 1661
1662 // Since pdfAnnot has been set, this calls will write in the Annot object 1662 // Since pdfAnnot has been set, this calls will write in the Annot object
1663 q->setAuthor(author); 1663 q->setAuthor(author);
1664@@ -250,13 +245,7 @@ void AnnotationPrivate::flushBaseAnnotationProperties() 1664@@ -251,12 +246,7 @@ void AnnotationPrivate::flushBaseAnnotationProperties()
1665 q->setStyle(style);
1666 q->setPopup(popup); 1665 q->setPopup(popup);
1667 1666
1668- // Flush revisions 1667 // Flush revisions
1669- foreach (Annotation *r, revisions) { 1668- foreach (Annotation *r, revisions) {
1670- // TODO: Flush revision 1669- // TODO: Flush revision
1671- delete r; // Object is no longer needed 1670- delete r; // Object is no longer needed
@@ -1676,12 +1675,13 @@ index e15523c..f148671 100644
1676 1675
1677 // Clear some members to save memory 1676 // Clear some members to save memory
1678 author.clear(); 1677 author.clear();
1679@@ -455,14 +444,14 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1678@@ -455,14 +445,15 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1680 1679
1681 // Create Annotation objects and tie to their native Annot 1680 // Create Annotation objects and tie to their native Annot
1682 QList<Annotation *> res; 1681 QList<Annotation *> res;
1683- for (Annot *ann : annots->getAnnots()) { 1682- for (Annot *ann : annots->getAnnots()) {
1684+ for (const std::shared_ptr<Annot> &ann : annots->getAnnots()) { 1683+ for (const std::shared_ptr<Annot> &ann : annots->getAnnots()) {
1684+
1685 if (!ann) { 1685 if (!ann) {
1686 error(errInternal, -1, "Annot is null"); 1686 error(errInternal, -1, "Annot is null");
1687 continue; 1687 continue;
@@ -1693,7 +1693,7 @@ index e15523c..f148671 100644
1693 if (!markupann) { 1693 if (!markupann) {
1694 // Assume it's a root annotation, and skip if user didn't request it 1694 // Assume it's a root annotation, and skip if user didn't request it
1695 if (parentID != -1) { 1695 if (parentID != -1) {
1696@@ -536,7 +525,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1696@@ -536,7 +527,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1697 continue; 1697 continue;
1698 } 1698 }
1699 // parse Link params 1699 // parse Link params
@@ -1702,7 +1702,7 @@ index e15523c..f148671 100644
1702 LinkAnnotation *l = new LinkAnnotation(); 1702 LinkAnnotation *l = new LinkAnnotation();
1703 annotation = l; 1703 annotation = l;
1704 1704
1705@@ -566,7 +555,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1705@@ -566,7 +557,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1706 if (!wantFileAttachmentAnnotations) { 1706 if (!wantFileAttachmentAnnotations) {
1707 continue; 1707 continue;
1708 } 1708 }
@@ -1711,7 +1711,7 @@ index e15523c..f148671 100644
1711 FileAttachmentAnnotation *f = new FileAttachmentAnnotation(); 1711 FileAttachmentAnnotation *f = new FileAttachmentAnnotation();
1712 annotation = f; 1712 annotation = f;
1713 // -> fileIcon 1713 // -> fileIcon
1714@@ -581,7 +570,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1714@@ -581,7 +572,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1715 if (!wantSoundAnnotations) { 1715 if (!wantSoundAnnotations) {
1716 continue; 1716 continue;
1717 } 1717 }
@@ -1720,7 +1720,7 @@ index e15523c..f148671 100644
1720 SoundAnnotation *s = new SoundAnnotation(); 1720 SoundAnnotation *s = new SoundAnnotation();
1721 annotation = s; 1721 annotation = s;
1722 1722
1723@@ -596,7 +585,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1723@@ -596,7 +587,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1724 if (!wantMovieAnnotations) { 1724 if (!wantMovieAnnotations) {
1725 continue; 1725 continue;
1726 } 1726 }
@@ -1729,7 +1729,7 @@ index e15523c..f148671 100644
1729 MovieAnnotation *m = new MovieAnnotation(); 1729 MovieAnnotation *m = new MovieAnnotation();
1730 annotation = m; 1730 annotation = m;
1731 1731
1732@@ -614,7 +603,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1732@@ -614,7 +605,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1733 if (!wantScreenAnnotations) { 1733 if (!wantScreenAnnotations) {
1734 continue; 1734 continue;
1735 } 1735 }
@@ -1738,7 +1738,7 @@ index e15523c..f148671 100644
1738 // TODO Support other link types than Link::Rendition in ScreenAnnotation 1738 // TODO Support other link types than Link::Rendition in ScreenAnnotation
1739 if (!screenann->getAction() || screenann->getAction()->getKind() != actionRendition) { 1739 if (!screenann->getAction() || screenann->getAction()->getKind() != actionRendition) {
1740 continue; 1740 continue;
1741@@ -644,7 +633,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document 1741@@ -644,7 +635,7 @@ QList<Annotation *> AnnotationPrivate::findAnnotations(::Page *pdfPage, Document
1742 annotation = new WidgetAnnotation(); 1742 annotation = new WidgetAnnotation();
1743 break; 1743 break;
1744 case Annot::typeRichMedia: { 1744 case Annot::typeRichMedia: {
@@ -1747,7 +1747,7 @@ index e15523c..f148671 100644
1747 1747
1748 RichMediaAnnotation *richMediaAnnotation = new RichMediaAnnotation; 1748 RichMediaAnnotation *richMediaAnnotation = new RichMediaAnnotation;
1749 1749
1750@@ -852,9 +841,9 @@ Link *AnnotationPrivate::additionalAction(Annotation::AdditionalActionType type) 1750@@ -852,9 +843,9 @@ Link *AnnotationPrivate::additionalAction(Annotation::AdditionalActionType type)
1751 1751
1752 std::unique_ptr<::LinkAction> linkAction = nullptr; 1752 std::unique_ptr<::LinkAction> linkAction = nullptr;
1753 if (pdfAnnot->getType() == Annot::typeScreen) { 1753 if (pdfAnnot->getType() == Annot::typeScreen) {
@@ -1759,7 +1759,7 @@ index e15523c..f148671 100644
1759 } 1759 }
1760 1760
1761 Link *link = nullptr; 1761 Link *link = nullptr;
1762@@ -875,7 +864,7 @@ void AnnotationPrivate::addAnnotationToPage(::Page *pdfPage, DocumentData *doc, 1762@@ -875,7 +866,7 @@ void AnnotationPrivate::addAnnotationToPage(::Page *pdfPage, DocumentData *doc,
1763 1763
1764 // Unimplemented annotations can't be created by the user because their ctor 1764 // Unimplemented annotations can't be created by the user because their ctor
1765 // is private. Therefore, createNativeAnnot will never return 0 1765 // is private. Therefore, createNativeAnnot will never return 0
@@ -1768,18 +1768,18 @@ index e15523c..f148671 100644
1768 Q_ASSERT(nativeAnnot); 1768 Q_ASSERT(nativeAnnot);
1769 1769
1770 if (ann->d_ptr->annotationAppearance.isStream()) { 1770 if (ann->d_ptr->annotationAppearance.isStream()) {
1771@@ -908,8 +897,8 @@ class TextAnnotationPrivate : public AnnotationPrivate 1771@@ -908,8 +899,8 @@ class TextAnnotationPrivate : public AnnotationPrivate
1772 { 1772 {
1773 public: 1773 public:
1774 TextAnnotationPrivate(); 1774 TextAnnotationPrivate();
1775- Annotation *makeAlias() override; 1775- Annotation *makeAlias() override;
1776- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override; 1776- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override;
1777+ std::unique_ptr<Annotation> makeAlias() override; 1777+ std::unique_ptr<Annotation> makeAlias() override;
1778+ std::unique_ptr<Annot> createNativeAnnot(::Page *destPage, DocumentData *doc) override; 1778+ std::shared_ptr<Annot> createNativeAnnot(::Page *destPage, DocumentData *doc) override;
1779 void setDefaultAppearanceToNative(); 1779 void setDefaultAppearanceToNative();
1780 std::unique_ptr<DefaultAppearance> getDefaultAppearanceFromNative() const; 1780 std::unique_ptr<DefaultAppearance> getDefaultAppearanceFromNative() const;
1781 1781
1782@@ -1419,7 +1408,7 @@ QString Annotation::author() const 1782@@ -1419,7 +1410,7 @@ QString Annotation::author() const
1783 return d->author; 1783 return d->author;
1784 } 1784 }
1785 1785
@@ -1788,7 +1788,7 @@ index e15523c..f148671 100644
1788 return markupann ? UnicodeParsedString(markupann->getLabel()) : QString(); 1788 return markupann ? UnicodeParsedString(markupann->getLabel()) : QString();
1789 } 1789 }
1790 1790
1791@@ -1432,7 +1421,7 @@ void Annotation::setAuthor(const QString &author) 1791@@ -1432,7 +1423,7 @@ void Annotation::setAuthor(const QString &author)
1792 return; 1792 return;
1793 } 1793 }
1794 1794
@@ -1797,7 +1797,7 @@ index e15523c..f148671 100644
1797 if (markupann) { 1797 if (markupann) {
1798 markupann->setLabel(std::unique_ptr<GooString>(QStringToUnicodeGooString(author))); 1798 markupann->setLabel(std::unique_ptr<GooString>(QStringToUnicodeGooString(author)));
1799 } 1799 }
1800@@ -1535,7 +1524,7 @@ QDateTime Annotation::creationDate() const 1800@@ -1535,7 +1526,7 @@ QDateTime Annotation::creationDate() const
1801 return d->creationDate; 1801 return d->creationDate;
1802 } 1802 }
1803 1803
@@ -1806,7 +1806,7 @@ index e15523c..f148671 100644
1806 1806
1807 if (markupann && markupann->getDate()) { 1807 if (markupann && markupann->getDate()) {
1808 return convertDate(markupann->getDate()->c_str()); 1808 return convertDate(markupann->getDate()->c_str());
1809@@ -1553,7 +1542,7 @@ void Annotation::setCreationDate(const QDateTime &date) 1809@@ -1553,7 +1544,7 @@ void Annotation::setCreationDate(const QDateTime &date)
1810 return; 1810 return;
1811 } 1811 }
1812 1812
@@ -1815,7 +1815,7 @@ index e15523c..f148671 100644
1815 if (markupann) { 1815 if (markupann) {
1816 if (date.isValid()) { 1816 if (date.isValid()) {
1817 const time_t t = date.toSecsSinceEpoch(); 1817 const time_t t = date.toSecsSinceEpoch();
1818@@ -1686,7 +1675,7 @@ Annotation::Style Annotation::style() const 1818@@ -1686,7 +1677,7 @@ Annotation::Style Annotation::style() const
1819 Style s; 1819 Style s;
1820 s.setColor(convertAnnotColor(d->pdfAnnot->getColor())); 1820 s.setColor(convertAnnotColor(d->pdfAnnot->getColor()));
1821 1821
@@ -1824,7 +1824,7 @@ index e15523c..f148671 100644
1824 if (markupann) { 1824 if (markupann) {
1825 s.setOpacity(markupann->getOpacity()); 1825 s.setOpacity(markupann->getOpacity());
1826 } 1826 }
1827@@ -1713,11 +1702,11 @@ Annotation::Style Annotation::style() const 1827@@ -1713,11 +1704,11 @@ Annotation::Style Annotation::style() const
1828 AnnotBorderEffect *border_effect; 1828 AnnotBorderEffect *border_effect;
1829 switch (d->pdfAnnot->getType()) { 1829 switch (d->pdfAnnot->getType()) {
1830 case Annot::typeFreeText: 1830 case Annot::typeFreeText:
@@ -1838,7 +1838,7 @@ index e15523c..f148671 100644
1838 break; 1838 break;
1839 default: 1839 default:
1840 border_effect = nullptr; 1840 border_effect = nullptr;
1841@@ -1741,7 +1730,7 @@ void Annotation::setStyle(const Annotation::Style &style) 1841@@ -1741,7 +1732,7 @@ void Annotation::setStyle(const Annotation::Style &style)
1842 1842
1843 d->pdfAnnot->setColor(convertQColor(style.color())); 1843 d->pdfAnnot->setColor(convertQColor(style.color()));
1844 1844
@@ -1847,7 +1847,7 @@ index e15523c..f148671 100644
1847 if (markupann) { 1847 if (markupann) {
1848 markupann->setOpacity(style.opacity()); 1848 markupann->setOpacity(style.opacity());
1849 } 1849 }
1850@@ -1765,9 +1754,9 @@ Annotation::Popup Annotation::popup() const 1850@@ -1765,9 +1756,9 @@ Annotation::Popup Annotation::popup() const
1851 AnnotPopup *popup = nullptr; 1851 AnnotPopup *popup = nullptr;
1852 int flags = -1; // Not initialized 1852 int flags = -1; // Not initialized
1853 1853
@@ -1859,7 +1859,7 @@ index e15523c..f148671 100644
1859 w.setSummary(UnicodeParsedString(markupann->getSubject())); 1859 w.setSummary(UnicodeParsedString(markupann->getSubject()));
1860 } 1860 }
1861 1861
1862@@ -1783,7 +1772,7 @@ Annotation::Popup Annotation::popup() const 1862@@ -1783,7 +1774,7 @@ Annotation::Popup Annotation::popup() const
1863 } 1863 }
1864 1864
1865 if (d->pdfAnnot->getType() == Annot::typeText) { 1865 if (d->pdfAnnot->getType() == Annot::typeText) {
@@ -1868,7 +1868,7 @@ index e15523c..f148671 100644
1868 1868
1869 // Text annotations default to same rect as annotation 1869 // Text annotations default to same rect as annotation
1870 if (flags == -1) { 1870 if (flags == -1) {
1871@@ -1839,7 +1828,7 @@ Annotation::RevScope Annotation::revisionScope() const 1871@@ -1839,7 +1830,7 @@ Annotation::RevScope Annotation::revisionScope() const
1872 return d->revisionScope; 1872 return d->revisionScope;
1873 } 1873 }
1874 1874
@@ -1877,7 +1877,7 @@ index e15523c..f148671 100644
1877 1877
1878 if (markupann && markupann->isInReplyTo()) { 1878 if (markupann && markupann->isInReplyTo()) {
1879 switch (markupann->getReplyTo()) { 1879 switch (markupann->getReplyTo()) {
1880@@ -1861,7 +1850,7 @@ Annotation::RevType Annotation::revisionType() const 1880@@ -1861,7 +1852,7 @@ Annotation::RevType Annotation::revisionType() const
1881 return d->revisionType; 1881 return d->revisionType;
1882 } 1882 }
1883 1883
@@ -1886,7 +1886,7 @@ index e15523c..f148671 100644
1886 1886
1887 if (textann && textann->isInReplyTo()) { 1887 if (textann && textann->isInReplyTo()) {
1888 switch (textann->getState()) { 1888 switch (textann->getState()) {
1889@@ -1892,8 +1881,9 @@ QList<Annotation *> Annotation::revisions() const 1889@@ -1892,8 +1883,9 @@ QList<Annotation *> Annotation::revisions() const
1890 if (!d->pdfAnnot) { 1890 if (!d->pdfAnnot) {
1891 /* Return aliases, whose ownership goes to the caller */ 1891 /* Return aliases, whose ownership goes to the caller */
1892 QList<Annotation *> res; 1892 QList<Annotation *> res;
@@ -1898,7 +1898,7 @@ index e15523c..f148671 100644
1898 return res; 1898 return res;
1899 } 1899 }
1900 1900
1901@@ -1910,7 +1900,7 @@ std::unique_ptr<AnnotationAppearance> Annotation::annotationAppearance() const 1901@@ -1910,7 +1902,7 @@ std::unique_ptr<AnnotationAppearance> Annotation::annotationAppearance() const
1902 { 1902 {
1903 Q_D(const Annotation); 1903 Q_D(const Annotation);
1904 1904
@@ -1907,7 +1907,7 @@ index e15523c..f148671 100644
1907 } 1907 }
1908 1908
1909 void Annotation::setAnnotationAppearance(const AnnotationAppearance &annotationAppearance) 1909 void Annotation::setAnnotationAppearance(const AnnotationAppearance &annotationAppearance)
1910@@ -1934,15 +1924,15 @@ void Annotation::setAnnotationAppearance(const AnnotationAppearance &annotationA 1910@@ -1934,15 +1926,15 @@ void Annotation::setAnnotationAppearance(const AnnotationAppearance &annotationA
1911 1911
1912 TextAnnotationPrivate::TextAnnotationPrivate() : AnnotationPrivate(), textType(TextAnnotation::Linked), textIcon(QStringLiteral("Note")), inplaceAlign(0), inplaceIntent(TextAnnotation::Unknown) { } 1912 TextAnnotationPrivate::TextAnnotationPrivate() : AnnotationPrivate(), textType(TextAnnotation::Linked), textIcon(QStringLiteral("Note")), inplaceAlign(0), inplaceIntent(TextAnnotation::Unknown) { }
1913 1913
@@ -1915,20 +1915,19 @@ index e15523c..f148671 100644
1915+std::unique_ptr<Annotation> TextAnnotationPrivate::makeAlias() 1915+std::unique_ptr<Annotation> TextAnnotationPrivate::makeAlias()
1916 { 1916 {
1917- return new TextAnnotation(*this); 1917- return new TextAnnotation(*this);
1918+ return std::unique_ptr<Annotation>(new TextAnnotation(*this); 1918+ return std::unique_ptr<Annotation>(new TextAnnotation(*this));
1919 } 1919 }
1920 1920
1921-Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 1921-Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
1922+std::shared_ptr<Annot> *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 1922+std::shared_ptr<Annot> TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
1923 { 1923 {
1924- // Setters are defined in the public class 1924 // Setters are defined in the public class
1925- TextAnnotation *q = static_cast<TextAnnotation *>(makeAlias()); 1925- TextAnnotation *q = static_cast<TextAnnotation *>(makeAlias());
1926+ // Setters are defined in the public clas 1926+ std::unique_ptr<TextAnnotation> q = static_pointer_cast<TextAnnotation>(makeAlias());
1927+ std::unique_ptr<TextAnnotation> q = static_pointer_cast<TextAnnotation *>(makeAlias());
1928 1927
1929 // Set page and contents 1928 // Set page and contents
1930 pdfPage = destPage; 1929 pdfPage = destPage;
1931@@ -1951,13 +1941,13 @@ Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData * 1930@@ -1951,13 +1943,13 @@ Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *
1932 // Set pdfAnnot 1931 // Set pdfAnnot
1933 PDFRectangle rect = boundaryToPdfRectangle(boundary, flags); 1932 PDFRectangle rect = boundaryToPdfRectangle(boundary, flags);
1934 if (textType == TextAnnotation::Linked) { 1933 if (textType == TextAnnotation::Linked) {
@@ -1944,7 +1943,7 @@ index e15523c..f148671 100644
1944 } 1943 }
1945 1944
1946 // Set properties 1945 // Set properties
1947@@ -1967,8 +1957,6 @@ Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData * 1946@@ -1967,8 +1959,6 @@ Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *
1948 q->setCalloutPoints(inplaceCallout); 1947 q->setCalloutPoints(inplaceCallout);
1949 q->setInplaceIntent(inplaceIntent); 1948 q->setInplaceIntent(inplaceIntent);
1950 1949
@@ -1953,7 +1952,7 @@ index e15523c..f148671 100644
1953 inplaceCallout.clear(); // Free up memory 1952 inplaceCallout.clear(); // Free up memory
1954 1953
1955 setDefaultAppearanceToNative(); 1954 setDefaultAppearanceToNative();
1956@@ -1979,7 +1967,7 @@ Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData * 1955@@ -1979,7 +1969,7 @@ Annot *TextAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *
1957 void TextAnnotationPrivate::setDefaultAppearanceToNative() 1956 void TextAnnotationPrivate::setDefaultAppearanceToNative()
1958 { 1957 {
1959 if (pdfAnnot && pdfAnnot->getType() == Annot::typeFreeText) { 1958 if (pdfAnnot && pdfAnnot->getType() == Annot::typeFreeText) {
@@ -1962,7 +1961,7 @@ index e15523c..f148671 100644
1962 const double pointSize = textFont ? textFont->pointSizeF() : AnnotFreeText::undefinedFontPtSize; 1961 const double pointSize = textFont ? textFont->pointSizeF() : AnnotFreeText::undefinedFontPtSize;
1963 if (pointSize < 0) { 1962 if (pointSize < 0) {
1964 qWarning() << "TextAnnotationPrivate::createNativeAnnot: font pointSize < 0"; 1963 qWarning() << "TextAnnotationPrivate::createNativeAnnot: font pointSize < 0";
1965@@ -2008,7 +1996,7 @@ void TextAnnotationPrivate::setDefaultAppearanceToNative() 1964@@ -2008,7 +1998,7 @@ void TextAnnotationPrivate::setDefaultAppearanceToNative()
1966 std::unique_ptr<DefaultAppearance> TextAnnotationPrivate::getDefaultAppearanceFromNative() const 1965 std::unique_ptr<DefaultAppearance> TextAnnotationPrivate::getDefaultAppearanceFromNative() const
1967 { 1966 {
1968 if (pdfAnnot && pdfAnnot->getType() == Annot::typeFreeText) { 1967 if (pdfAnnot && pdfAnnot->getType() == Annot::typeFreeText) {
@@ -1971,7 +1970,7 @@ index e15523c..f148671 100644
1971 return ftextann->getDefaultAppearance(); 1970 return ftextann->getDefaultAppearance();
1972 } else { 1971 } else {
1973 return {}; 1972 return {};
1974@@ -2165,7 +2153,7 @@ QString TextAnnotation::textIcon() const 1973@@ -2165,7 +2155,7 @@ QString TextAnnotation::textIcon() const
1975 } 1974 }
1976 1975
1977 if (d->pdfAnnot->getType() == Annot::typeText) { 1976 if (d->pdfAnnot->getType() == Annot::typeText) {
@@ -1980,7 +1979,7 @@ index e15523c..f148671 100644
1980 return QString::fromLatin1(textann->getIcon()->c_str()); 1979 return QString::fromLatin1(textann->getIcon()->c_str());
1981 } 1980 }
1982 1981
1983@@ -2182,7 +2170,7 @@ void TextAnnotation::setTextIcon(const QString &icon) 1982@@ -2182,7 +2172,7 @@ void TextAnnotation::setTextIcon(const QString &icon)
1984 } 1983 }
1985 1984
1986 if (d->pdfAnnot->getType() == Annot::typeText) { 1985 if (d->pdfAnnot->getType() == Annot::typeText) {
@@ -1989,7 +1988,7 @@ index e15523c..f148671 100644
1989 QByteArray encoded = icon.toLatin1(); 1988 QByteArray encoded = icon.toLatin1();
1990 GooString s(encoded.constData()); 1989 GooString s(encoded.constData());
1991 textann->setIcon(&s); 1990 textann->setIcon(&s);
1992@@ -2256,7 +2244,7 @@ int TextAnnotation::inplaceAlign() const 1991@@ -2256,7 +2246,7 @@ int TextAnnotation::inplaceAlign() const
1993 } 1992 }
1994 1993
1995 if (d->pdfAnnot->getType() == Annot::typeFreeText) { 1994 if (d->pdfAnnot->getType() == Annot::typeFreeText) {
@@ -1998,7 +1997,7 @@ index e15523c..f148671 100644
1998 return static_cast<int>(ftextann->getQuadding()); 1997 return static_cast<int>(ftextann->getQuadding());
1999 } 1998 }
2000 1999
2001@@ -2273,7 +2261,7 @@ void TextAnnotation::setInplaceAlign(int align) 2000@@ -2273,7 +2263,7 @@ void TextAnnotation::setInplaceAlign(int align)
2002 } 2001 }
2003 2002
2004 if (d->pdfAnnot->getType() == Annot::typeFreeText) { 2003 if (d->pdfAnnot->getType() == Annot::typeFreeText) {
@@ -2007,7 +2006,7 @@ index e15523c..f148671 100644
2007 ftextann->setQuadding((VariableTextQuadding)align); 2006 ftextann->setQuadding((VariableTextQuadding)align);
2008 } 2007 }
2009 } 2008 }
2010@@ -2300,7 +2288,7 @@ QVector<QPointF> TextAnnotation::calloutPoints() const 2009@@ -2300,7 +2290,7 @@ QVector<QPointF> TextAnnotation::calloutPoints() const
2011 return QVector<QPointF>(); 2010 return QVector<QPointF>();
2012 } 2011 }
2013 2012
@@ -2016,7 +2015,7 @@ index e15523c..f148671 100644
2016 const AnnotCalloutLine *callout = ftextann->getCalloutLine(); 2015 const AnnotCalloutLine *callout = ftextann->getCalloutLine();
2017 2016
2018 if (!callout) { 2017 if (!callout) {
2019@@ -2332,7 +2320,7 @@ void TextAnnotation::setCalloutPoints(const QVector<QPointF> &points) 2018@@ -2332,7 +2322,7 @@ void TextAnnotation::setCalloutPoints(const QVector<QPointF> &points)
2020 return; 2019 return;
2021 } 2020 }
2022 2021
@@ -2025,7 +2024,7 @@ index e15523c..f148671 100644
2025 const int count = points.size(); 2024 const int count = points.size();
2026 2025
2027 if (count == 0) { 2026 if (count == 0) {
2028@@ -2345,7 +2333,7 @@ void TextAnnotation::setCalloutPoints(const QVector<QPointF> &points) 2027@@ -2345,7 +2335,7 @@ void TextAnnotation::setCalloutPoints(const QVector<QPointF> &points)
2029 return; 2028 return;
2030 } 2029 }
2031 2030
@@ -2034,7 +2033,7 @@ index e15523c..f148671 100644
2034 double x1, y1, x2, y2; 2033 double x1, y1, x2, y2;
2035 double MTX[6]; 2034 double MTX[6];
2036 d->fillTransformationMTX(MTX); 2035 d->fillTransformationMTX(MTX);
2037@@ -2355,12 +2343,12 @@ void TextAnnotation::setCalloutPoints(const QVector<QPointF> &points) 2036@@ -2355,13 +2345,12 @@ void TextAnnotation::setCalloutPoints(const QVector<QPointF> &points)
2038 if (count == 3) { 2037 if (count == 3) {
2039 double x3, y3; 2038 double x3, y3;
2040 XPDFReader::invTransform(MTX, points[2], x3, y3); 2039 XPDFReader::invTransform(MTX, points[2], x3, y3);
@@ -2046,11 +2045,12 @@ index e15523c..f148671 100644
2046 } 2045 }
2047 2046
2048- ftextann->setCalloutLine(callout); 2047- ftextann->setCalloutLine(callout);
2048- delete callout;
2049+ ftextann->setCalloutLine(std::move(callout)); 2049+ ftextann->setCalloutLine(std::move(callout));
2050 delete callout;
2051 } 2050 }
2052 2051
2053@@ -2373,7 +2361,7 @@ TextAnnotation::InplaceIntent TextAnnotation::inplaceIntent() const 2052 TextAnnotation::InplaceIntent TextAnnotation::inplaceIntent() const
2053@@ -2373,7 +2362,7 @@ TextAnnotation::InplaceIntent TextAnnotation::inplaceIntent() const
2054 } 2054 }
2055 2055
2056 if (d->pdfAnnot->getType() == Annot::typeFreeText) { 2056 if (d->pdfAnnot->getType() == Annot::typeFreeText) {
@@ -2059,7 +2059,7 @@ index e15523c..f148671 100644
2059 return (TextAnnotation::InplaceIntent)ftextann->getIntent(); 2059 return (TextAnnotation::InplaceIntent)ftextann->getIntent();
2060 } 2060 }
2061 2061
2062@@ -2390,7 +2378,7 @@ void TextAnnotation::setInplaceIntent(TextAnnotation::InplaceIntent intent) 2062@@ -2390,7 +2379,7 @@ void TextAnnotation::setInplaceIntent(TextAnnotation::InplaceIntent intent)
2063 } 2063 }
2064 2064
2065 if (d->pdfAnnot->getType() == Annot::typeFreeText) { 2065 if (d->pdfAnnot->getType() == Annot::typeFreeText) {
@@ -2068,7 +2068,7 @@ index e15523c..f148671 100644
2068 ftextann->setIntent((AnnotFreeText::AnnotFreeTextIntent)intent); 2068 ftextann->setIntent((AnnotFreeText::AnnotFreeTextIntent)intent);
2069 } 2069 }
2070 } 2070 }
2071@@ -2400,8 +2388,8 @@ class LineAnnotationPrivate : public AnnotationPrivate 2071@@ -2400,8 +2389,8 @@ class LineAnnotationPrivate : public AnnotationPrivate
2072 { 2072 {
2073 public: 2073 public:
2074 LineAnnotationPrivate(); 2074 LineAnnotationPrivate();
@@ -2079,7 +2079,7 @@ index e15523c..f148671 100644
2079 2079
2080 // data fields (note uses border for rendering style) 2080 // data fields (note uses border for rendering style)
2081 QLinkedList<QPointF> linePoints; 2081 QLinkedList<QPointF> linePoints;
2082@@ -2421,15 +2409,15 @@ LineAnnotationPrivate::LineAnnotationPrivate() 2082@@ -2421,15 +2410,15 @@ LineAnnotationPrivate::LineAnnotationPrivate()
2083 { 2083 {
2084 } 2084 }
2085 2085
@@ -2095,11 +2095,11 @@ index e15523c..f148671 100644
2095 { 2095 {
2096 // Setters are defined in the public class 2096 // Setters are defined in the public class
2097- LineAnnotation *q = static_cast<LineAnnotation *>(makeAlias()); 2097- LineAnnotation *q = static_cast<LineAnnotation *>(makeAlias());
2098+ std::unique_ptr<LineAnnotation> q = static_pointer_cast<LineAnnotation *>(makeAlias()); 2098+ std::unique_ptr<LineAnnotation> q = static_pointer_cast<LineAnnotation>(makeAlias());
2099 2099
2100 // Set page and document 2100 // Set page and document
2101 pdfPage = destPage; 2101 pdfPage = destPage;
2102@@ -2438,9 +2426,9 @@ Annot *LineAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData * 2102@@ -2438,9 +2427,9 @@ Annot *LineAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *
2103 // Set pdfAnnot 2103 // Set pdfAnnot
2104 PDFRectangle rect = boundaryToPdfRectangle(boundary, flags); 2104 PDFRectangle rect = boundaryToPdfRectangle(boundary, flags);
2105 if (lineType == LineAnnotation::StraightLine) { 2105 if (lineType == LineAnnotation::StraightLine) {
@@ -2111,7 +2111,7 @@ index e15523c..f148671 100644
2111 } 2111 }
2112 2112
2113 // Set properties 2113 // Set properties
2114@@ -2454,8 +2442,6 @@ Annot *LineAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData * 2114@@ -2454,8 +2443,6 @@ Annot *LineAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *
2115 q->setLineShowCaption(lineShowCaption); 2115 q->setLineShowCaption(lineShowCaption);
2116 q->setLineIntent(lineIntent); 2116 q->setLineIntent(lineIntent);
2117 2117
@@ -2120,7 +2120,7 @@ index e15523c..f148671 100644
2120 linePoints.clear(); // Free up memory 2120 linePoints.clear(); // Free up memory
2121 2121
2122 return pdfAnnot; 2122 return pdfAnnot;
2123@@ -2621,14 +2607,14 @@ QLinkedList<QPointF> LineAnnotation::linePoints() const 2123@@ -2621,14 +2608,14 @@ QLinkedList<QPointF> LineAnnotation::linePoints() const
2124 2124
2125 QLinkedList<QPointF> res; 2125 QLinkedList<QPointF> res;
2126 if (d->pdfAnnot->getType() == Annot::typeLine) { 2126 if (d->pdfAnnot->getType() == Annot::typeLine) {
@@ -2137,14 +2137,7 @@ index e15523c..f148671 100644
2137 const AnnotPath *vertices = polyann->getVertices(); 2137 const AnnotPath *vertices = polyann->getVertices();
2138 2138
2139 for (int i = 0; i < vertices->getCoordsLength(); ++i) { 2139 for (int i = 0; i < vertices->getCoordsLength(); ++i) {
2140@@ -2645,13 +2631,14 @@ void LineAnnotation::setLinePoints(const QLinkedList<QPointF> &points) 2140@@ -2651,7 +2638,7 @@ void LineAnnotation::setLinePoints(const QLinkedList<QPointF> &points)
2141 {
2142 Q_D(LineAnnotation);
2143
2144+ if (!d->pdfAnnot) {
2145 if (!d->pdfAnnot) {
2146 d->linePoints = points;
2147 return;
2148 } 2141 }
2149 2142
2150 if (d->pdfAnnot->getType() == Annot::typeLine) { 2143 if (d->pdfAnnot->getType() == Annot::typeLine) {
@@ -2336,7 +2329,7 @@ index e15523c..f148671 100644
2336- Annotation *makeAlias() override; 2329- Annotation *makeAlias() override;
2337- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override; 2330- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override;
2338+ std::unique_ptr<Annotation> makeAlias() override; 2331+ std::unique_ptr<Annotation> makeAlias() override;
2339+ std::unique_ptr<Annot> createNativeAnnot(::Page *destPage, DocumentData *doc) override; 2332+ std::shared_ptr<Annot> createNativeAnnot(::Page *destPage, DocumentData *doc) override;
2340 2333
2341 // data fields (note uses border for rendering style) 2334 // data fields (note uses border for rendering style)
2342 GeomAnnotation::GeomType geomType; 2335 GeomAnnotation::GeomType geomType;
@@ -2356,7 +2349,7 @@ index e15523c..f148671 100644
2356 { 2349 {
2357 // Setters are defined in the public class 2350 // Setters are defined in the public class
2358- GeomAnnotation *q = static_cast<GeomAnnotation *>(makeAlias()); 2351- GeomAnnotation *q = static_cast<GeomAnnotation *>(makeAlias());
2359+ std::unique_ptr<GeomAnnotation> q = static_pointer_cast<GeomAnnotation *>(makeAlias()); 2352+ std::unique_ptr<GeomAnnotation> q = static_pointer_cast<GeomAnnotation>(makeAlias());
2360 2353
2361 // Set page and document 2354 // Set page and document
2362 pdfPage = destPage; 2355 pdfPage = destPage;
@@ -2409,7 +2402,7 @@ index e15523c..f148671 100644
2409- Annotation *makeAlias() override; 2402- Annotation *makeAlias() override;
2410- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override; 2403- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override;
2411+ std::unique_ptr<Annotation> makeAlias() override; 2404+ std::unique_ptr<Annotation> makeAlias() override;
2412+ std::shared_ptr<Annot> *createNativeAnnot(::Page *destPage, DocumentData *doc) override; 2405+ std::shared_ptr<Annot> createNativeAnnot(::Page *destPage, DocumentData *doc) override;
2413 2406
2414 // data fields 2407 // data fields
2415 HighlightAnnotation::HighlightType highlightType; 2408 HighlightAnnotation::HighlightType highlightType;
@@ -2434,7 +2427,7 @@ index e15523c..f148671 100644
2434 { 2427 {
2435 // Setters are defined in the public class 2428 // Setters are defined in the public class
2436- HighlightAnnotation *q = static_cast<HighlightAnnotation *>(makeAlias()); 2429- HighlightAnnotation *q = static_cast<HighlightAnnotation *>(makeAlias());
2437+ std::unique_ptr<HighlightAnnotation> q = static_pointer_cast<HighlightAnnotation *>(makeAlias()); 2430+ std::unique_ptr<HighlightAnnotation> q = static_pointer_cast<HighlightAnnotation>(makeAlias());
2438 2431
2439 // Set page and document 2432 // Set page and document
2440 pdfPage = destPage; 2433 pdfPage = destPage;
@@ -2512,7 +2505,7 @@ index e15523c..f148671 100644
2512+std::shared_ptr<Annot> StampAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 2505+std::shared_ptr<Annot> StampAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
2513 { 2506 {
2514- StampAnnotation *q = static_cast<StampAnnotation *>(makeAlias()); 2507- StampAnnotation *q = static_cast<StampAnnotation *>(makeAlias());
2515+ std::unique_ptr<StampAnnotation> q = static_pointer_cast<StampAnnotation *>(makeAlias()); 2508+ std::unique_ptr<StampAnnotation> q = static_pointer_cast<StampAnnotation>(makeAlias());
2516 2509
2517 // Set page and document 2510 // Set page and document
2518 pdfPage = destPage; 2511 pdfPage = destPage;
@@ -2595,7 +2588,7 @@ index e15523c..f148671 100644
2595- Annotation *makeAlias() override; 2588- Annotation *makeAlias() override;
2596- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override; 2589- Annot *createNativeAnnot(::Page *destPage, DocumentData *doc) override;
2597+ std::unique_ptr<Annotation> makeAlias() override; 2590+ std::unique_ptr<Annotation> makeAlias() override;
2598+ std::shared_ptr<Annot> *createNativeAnnot(::Page *destPage, DocumentData *doc) override; 2591+ std::shared_ptr<Annot> createNativeAnnot(::Page *destPage, DocumentData *doc) override;
2599 2592
2600 // data fields 2593 // data fields
2601 QList<QLinkedList<QPointF>> inkPaths; 2594 QList<QLinkedList<QPointF>> inkPaths;
@@ -2604,7 +2597,7 @@ index e15523c..f148671 100644
2604 InkAnnotationPrivate::InkAnnotationPrivate() : AnnotationPrivate() { } 2597 InkAnnotationPrivate::InkAnnotationPrivate() : AnnotationPrivate() { }
2605 2598
2606-Annotation *InkAnnotationPrivate::makeAlias() 2599-Annotation *InkAnnotationPrivate::makeAlias()
2607+std::unique_ptr<Annotation> *InkAnnotationPrivate::makeAlias() 2600+std::unique_ptr<Annotation> InkAnnotationPrivate::makeAlias()
2608 { 2601 {
2609- return new InkAnnotation(*this); 2602- return new InkAnnotation(*this);
2610+ return std::unique_ptr<InkAnnotation>(new InkAnnotation(*this)); 2603+ return std::unique_ptr<InkAnnotation>(new InkAnnotation(*this));
@@ -2616,11 +2609,11 @@ index e15523c..f148671 100644
2616 } 2609 }
2617 2610
2618-Annot *InkAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 2611-Annot *InkAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
2619+std::shared_ptr<Annot> *InkAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 2612+std::shared_ptr<Annot> InkAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
2620 { 2613 {
2621 // Setters are defined in the public class 2614 // Setters are defined in the public class
2622- InkAnnotation *q = static_cast<InkAnnotation *>(makeAlias()); 2615- InkAnnotation *q = static_cast<InkAnnotation *>(makeAlias());
2623+ std::shared_ptr<InkAnnotation> q = static_pointer_cast<InkAnnotation *>(makeAlias()); 2616+ std::unique_ptr<InkAnnotation> q = static_pointer_cast<InkAnnotation>(makeAlias());
2624 2617
2625 // Set page and document 2618 // Set page and document
2626 pdfPage = destPage; 2619 pdfPage = destPage;
@@ -2714,7 +2707,7 @@ index e15523c..f148671 100644
2714 { 2707 {
2715 // Setters are defined in the public class 2708 // Setters are defined in the public class
2716- CaretAnnotation *q = static_cast<CaretAnnotation *>(makeAlias()); 2709- CaretAnnotation *q = static_cast<CaretAnnotation *>(makeAlias());
2717+ std::unique_ptr<CaretAnnotation> q = static_pointer_cast<CaretAnnotation *>(makeAlias()); 2710+ std::unique_ptr<CaretAnnotation> q = static_pointer_cast<CaretAnnotation>(makeAlias());
2718 2711
2719 // Set page and document 2712 // Set page and document
2720 pdfPage = destPage; 2713 pdfPage = destPage;
@@ -2774,7 +2767,7 @@ index e15523c..f148671 100644
2774 } 2767 }
2775 2768
2776-Annot *FileAttachmentAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 2769-Annot *FileAttachmentAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
2777+std::shared_ptr<Annot> *FileAttachmentAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc) 2770+std::shared_ptr<Annot> FileAttachmentAnnotationPrivate::createNativeAnnot(::Page *destPage, DocumentData *doc)
2778 { 2771 {
2779 return nullptr; // Not implemented 2772 return nullptr; // Not implemented
2780 } 2773 }
@@ -2893,6 +2886,7 @@ index e15523c..f148671 100644
2893 { 2886 {
2894 Q_UNUSED(destPage); 2887 Q_UNUSED(destPage);
2895 Q_UNUSED(doc); 2888 Q_UNUSED(doc);
2889
2896diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc 2890diff --git a/qt5/src/poppler-form.cc b/qt5/src/poppler-form.cc
2897index dfdcd39..760a891 100644 2891index dfdcd39..760a891 100644
2898--- a/qt5/src/poppler-form.cc 2892--- a/qt5/src/poppler-form.cc