summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/pdfobjectcopier.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-23 15:39:24 +0100
committerCaolán McNamara <caolan.mcnamara@collabora.com>2024-07-23 21:58:15 +0200
commitea2c60501a600d1f53bfc130e123c0996837b2fa (patch)
tree545d66f7f4129a791e43d53d5a05f299bca539e7 /vcl/source/gdi/pdfobjectcopier.cxx
parent8a83a62410bc3f9bbcd6d0dabb260814c6172bf8 (diff)
Resolves: tdf#162161 reexport of specific pdf appears blank
the contents of the referenced colorspace obj disappears so it gets rendered blank Change-Id: Iaa76d355b5903c695e74edadc329043156bad3b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/170904 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'vcl/source/gdi/pdfobjectcopier.cxx')
-rw-r--r--vcl/source/gdi/pdfobjectcopier.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/vcl/source/gdi/pdfobjectcopier.cxx b/vcl/source/gdi/pdfobjectcopier.cxx
index 0d07c0df7f67..56c3ba6e8138 100644
--- a/vcl/source/gdi/pdfobjectcopier.cxx
+++ b/vcl/source/gdi/pdfobjectcopier.cxx
@@ -139,6 +139,21 @@ sal_Int32 PDFObjectCopier::copyExternalResource(SvMemoryStream& rDocBuffer,
pNumber->writeString(aLine);
aLine.append("\n");
}
+ // If the object has a name element outside a dictionary or array, copy that.
+ else if (filter::PDFNameElement* pName = rObject.GetNameElement())
+ {
+ // currently just handle the exact case seen in the real world
+ if (pName->GetValue() == "DeviceRGB")
+ {
+ pName->writeString(aLine);
+ aLine.append("\n");
+ }
+ else
+ {
+ SAL_INFO("vcl.pdfwriter",
+ "PDFObjectCopier::copyExternalResource: skipping: " << pName->GetValue());
+ }
+ }
// We have the whole object, now write it to the output.
if (!m_rContainer.updateObject(nObject))