diff options
Diffstat (limited to 'sax/source/tools/fastattribs.cxx')
-rw-r--r-- | sax/source/tools/fastattribs.cxx | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx index 3522f38f3ef5..d020e18de18c 100644 --- a/sax/source/tools/fastattribs.cxx +++ b/sax/source/tools/fastattribs.cxx @@ -242,7 +242,7 @@ bool FastAttributeList::getAsDouble( sal_Int32 nToken, double &rDouble) const return false; } -bool FastAttributeList::getAsChar( sal_Int32 nToken, const char*& rPos ) const +bool FastAttributeList::getAsView( sal_Int32 nToken, std::string_view& rPos ) const { for (size_t i = 0, n = maAttributeTokens.size(); i < n; ++i) { @@ -250,19 +250,14 @@ bool FastAttributeList::getAsChar( sal_Int32 nToken, const char*& rPos ) const continue; sal_Int32 nOffset = maAttributeValues[i]; - rPos = mpChunk + nOffset; + size_t nValueLen = maAttributeValues[i + 1] - maAttributeValues[i] - 1; + rPos = { mpChunk + nOffset, nValueLen }; return true; } return false; } -const char* FastAttributeList::getAsCharByIndex( sal_Int32 nTokenIndex ) const -{ - sal_Int32 nOffset = maAttributeValues[nTokenIndex]; - return mpChunk + nOffset; -} - std::string_view FastAttributeList::getAsViewByIndex( sal_Int32 nTokenIndex ) const { sal_Int32 nOffset = maAttributeValues[nTokenIndex]; |