summaryrefslogtreecommitdiff
path: root/sax/source
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-07-27 17:56:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-07-28 08:47:41 +0200
commit28dc1e713cfc5b5ea38e15f032aba72d05e40b33 (patch)
tree162095cb2e6ea41447f25e22d0f3de6e48bd5f9c /sax/source
parent7ba40c7d62c7c15f9c0e9cbc21b48f105454b885 (diff)
tdf#119840 remove some OUString allocation
Change-Id: I488db37b3a60feb351d1ecd46278f6d5c3cdde5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137535 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sax/source')
-rw-r--r--sax/source/tools/fastattribs.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 81dabf727ebd..3522f38f3ef5 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -263,6 +263,13 @@ const char* FastAttributeList::getAsCharByIndex( sal_Int32 nTokenIndex ) const
return mpChunk + nOffset;
}
+std::string_view FastAttributeList::getAsViewByIndex( sal_Int32 nTokenIndex ) const
+{
+ sal_Int32 nOffset = maAttributeValues[nTokenIndex];
+ size_t nValueLen = maAttributeValues[nTokenIndex + 1] - maAttributeValues[nTokenIndex] - 1;
+ return { mpChunk + nOffset, nValueLen };
+}
+
OUString FastAttributeList::getValue( ::sal_Int32 Token )
{
for (size_t i = 0, n = maAttributeTokens.size(); i < n; ++i)