From 3404aab7825d47357c7358a8da4f3795648a14e1 Mon Sep 17 00:00:00 2001 From: Svetlana Kulikova Date: Thu, 28 Aug 2025 12:10:22 +0300 Subject: [PATCH] Fix bug 76484 --- PdfFile/SrcWriter/Annotation.cpp | 4 +--- PdfFile/SrcWriter/Document.cpp | 1 + 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/PdfFile/SrcWriter/Annotation.cpp b/PdfFile/SrcWriter/Annotation.cpp index 9feaa36849..0d2dbb440c 100644 --- a/PdfFile/SrcWriter/Annotation.cpp +++ b/PdfFile/SrcWriter/Annotation.cpp @@ -1405,10 +1405,8 @@ namespace PdfWriter std::string sValue = U_TO_UTF8(wsT); CDictObject* pOwner = GetObjOwnValue("T"); if (!pOwner) - { pOwner = this; - pOwner->Add("T", new CStringObject(sValue.c_str(), true)); - } + pOwner->Add("T", new CStringObject(sValue.c_str(), true)); } void CWidgetAnnotation::SetBC(const std::vector& arrBC) { diff --git a/PdfFile/SrcWriter/Document.cpp b/PdfFile/SrcWriter/Document.cpp index 43c89ecfce..ecd6d67dea 100644 --- a/PdfFile/SrcWriter/Document.cpp +++ b/PdfFile/SrcWriter/Document.cpp @@ -741,6 +741,7 @@ namespace PdfWriter } void CDocument::AddAnnotation(const int& nID, CAnnotation* pAnnot) { + pAnnot->SetXref(m_pXref); m_mAnnotations[nID] = pAnnot; } CImageDict* CDocument::CreateImage()