summaryrefslogtreecommitdiff
path: root/vcl/source/gdi
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2023-04-01 12:40:58 +0100
committerMichael Meeks <michael.meeks@collabora.com>2023-04-03 10:30:10 +0200
commit0bd949f4412249e5ecd63716efcc55d92d120da9 (patch)
tree1c4600acf34ddbc9f68fd47fcb8df0eefe2b15cc /vcl/source/gdi
parent56ae7d01505fdae421109cfc78449230ba589d79 (diff)
BinaryDataContainer: pure re-factor to encapsulate stream copying.
Change-Id: Iab24e8d18bf7badbca672fbdbf455f78d08f41a0 Signed-off-by: Michael Meeks <michael.meeks@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/149905 Tested-by: Jenkins
Diffstat (limited to 'vcl/source/gdi')
-rw-r--r--vcl/source/gdi/TypeSerializer.cxx4
-rw-r--r--vcl/source/gdi/impgraph.cxx5
2 files changed, 3 insertions, 6 deletions
diff --git a/vcl/source/gdi/TypeSerializer.cxx b/vcl/source/gdi/TypeSerializer.cxx
index 83f77bed1379..0882f97243ad 100644
--- a/vcl/source/gdi/TypeSerializer.cxx
+++ b/vcl/source/gdi/TypeSerializer.cxx
@@ -387,8 +387,8 @@ void TypeSerializer::writeGraphic(const Graphic& rGraphic)
sal_uInt32 nSize = pVectorGraphicData->getBinaryDataContainer().getSize();
mrStream.WriteUInt32(nSize);
- mrStream.WriteBytes(pVectorGraphicData->getBinaryDataContainer().getData(),
- nSize);
+ pVectorGraphicData->getBinaryDataContainer().writeToStream(mrStream);
+
// For backwards compatibility, used to serialize path
mrStream.WriteUniOrByteString(u"", mrStream.GetStreamCharSet());
}
diff --git a/vcl/source/gdi/impgraph.cxx b/vcl/source/gdi/impgraph.cxx
index 8e0dfdd5ad43..84df1765569c 100644
--- a/vcl/source/gdi/impgraph.cxx
+++ b/vcl/source/gdi/impgraph.cxx
@@ -1230,10 +1230,7 @@ bool ImpGraphic::swapOutGraphic(SvStream& rStream)
}
rStream.WriteUInt32(maVectorGraphicData->getBinaryDataContainer().getSize());
-
- rStream.WriteBytes(
- maVectorGraphicData->getBinaryDataContainer().getData(),
- maVectorGraphicData->getBinaryDataContainer().getSize());
+ maVectorGraphicData->getBinaryDataContainer().writeToStream(rStream);
}
else if (mpAnimation)
{