vcl/source/gdi/pdfwriter_impl.cxx |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit bc02f7e0f5a169536b1d9b7ecf3b5138fb52043e
Author:     Xisco Fauli <[email protected]>
AuthorDate: Wed Feb 25 17:57:39 2026 +0100
Commit:     Tomaž Vajngerl <[email protected]>
CommitDate: Sun Mar 1 16:26:20 2026 +0100

    tdf#168057: use RoleMapNS in PDF/UA-2
    
    This commit reverts my previous attempt at fixing the same issue
    commit 5dbf35a932bfa00e17f17b1f2337de7403754b8d
    Author: Xisco Fauli <[email protected]>
    Date:   Wed Feb 25 12:54:41 2026 +0100
    
        tdf#168057: Don't use aliases in StructElem when exporting to PDF/UA-2
    
    The unittest has been removed in the backport because
    the verapdf validator is only available in master
    
    Change-Id: I20ef86c780224909a7fa9414fea628415289af60
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200350
    Tested-by: Jenkins
    Reviewed-by: Xisco Fauli <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200352
    Reviewed-by: Tomaž Vajngerl <[email protected]>
    Signed-off-by: Xisco Fauli <[email protected]>
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/200390

diff --git a/vcl/source/gdi/pdfwriter_impl.cxx 
b/vcl/source/gdi/pdfwriter_impl.cxx
index 5481804143fc..91b050f4cef7 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -1954,11 +1954,21 @@ void PDFWriterImpl::emitNamespaces()
         if (!updateObject(nObject))
             return;
 
-        COSWriter aWriter(m_aContext.Encryption.getParams(), m_pPDFEncryptor);
+        OStringBuffer aLine;
+        COSWriter aWriter(aLine, m_aContext.Encryption.getParams(), 
m_pPDFEncryptor);
         aWriter.startObject(nObject);
         aWriter.startDict();
         aWriter.write("/Type", "/Namespace");
         aWriter.writeKeyAndLiteral("/NS", sNamespace);
+        if( ! m_aRoleMap.empty() )
+        {
+            aLine.append( "/RoleMapNS<<" );
+            for (auto const& role : m_aRoleMap)
+            {
+                aLine.append( "/" + role.first + "/" + role.second + "
" );
+            }
+            aLine.append( ">>
" );
+        }
         aWriter.endDict();
         aWriter.endObject();
 

Reply via email to