summaryrefslogtreecommitdiff
path: root/include/vcl/filter
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-14 10:45:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-14 09:45:54 +0000
commit67127e9a1340076d0c8f818b41cc6c44ddd575da (patch)
tree09e7f81a95e5923af2ba1b3e332666e79fd744fa /include/vcl/filter
parent4a96f25ac3ef9f2ed940d6e56eca87bba387d451 (diff)
use more string_view in vcl::PDFObjectContainer
which makes the call sites much less verbose Change-Id: I94eef7569e419f134ce574ecd9fb2ce8f50184b2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148839 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/vcl/filter')
-rw-r--r--include/vcl/filter/pdfdocument.hxx2
-rw-r--r--include/vcl/filter/pdfobjectcontainer.hxx9
2 files changed, 9 insertions, 2 deletions
diff --git a/include/vcl/filter/pdfdocument.hxx b/include/vcl/filter/pdfdocument.hxx
index fbe0be89cdc6..7e9d6dd8045a 100644
--- a/include/vcl/filter/pdfdocument.hxx
+++ b/include/vcl/filter/pdfdocument.hxx
@@ -596,7 +596,7 @@ public:
/// See vcl::PDFObjectContainer::updateObject().
bool updateObject(sal_Int32 n) override;
/// See vcl::PDFObjectContainer::writeBuffer().
- bool writeBuffer(const void* pBuffer, sal_uInt64 nBytes) override;
+ bool writeBufferBytes(const void* pBuffer, sal_uInt64 nBytes) override;
void checkAndEnableStreamEncryption(sal_Int32 /*nObject*/) override {}
void disableStreamEncryption() override {}
};
diff --git a/include/vcl/filter/pdfobjectcontainer.hxx b/include/vcl/filter/pdfobjectcontainer.hxx
index f6614f09ea3d..308ec65cae83 100644
--- a/include/vcl/filter/pdfobjectcontainer.hxx
+++ b/include/vcl/filter/pdfobjectcontainer.hxx
@@ -10,6 +10,7 @@
#pragma once
#include <sal/types.h>
+#include <string_view>
namespace vcl
{
@@ -26,7 +27,13 @@ public:
virtual bool updateObject(sal_Int32 n) = 0;
// Write pBuffer to the end of the output.
- virtual bool writeBuffer(const void* pBuffer, sal_uInt64 nBytes) = 0;
+ virtual bool writeBufferBytes(const void* pBuffer, sal_uInt64 nBytes) = 0;
+
+ // Utility method, reduces verbosity at call sites
+ bool writeBuffer(std::string_view aBuffer)
+ {
+ return writeBufferBytes(aBuffer.data(), aBuffer.size());
+ }
virtual void checkAndEnableStreamEncryption(sal_Int32 nObject) = 0;