summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-08-01 18:58:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-08-01 20:53:28 +0200
commit75a862b887fb0b7ff633a396ee7f7f34c2c82964 (patch)
tree50361f282bfcd20ff04f97b59806b95029a9a405 /include
parentf8d764b138fddde719a04683f9bd3720c21e0656 (diff)
use more string_view when dealing with attributes
which means we don't need to call strlen on them, since we already know how long they are. Change-Id: Iefc76f38a23250e87a65c27df3634d562464a760 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/137679 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/oox/helper/attributelist.hxx2
-rw-r--r--include/sax/fastattribs.hxx3
2 files changed, 2 insertions, 3 deletions
diff --git a/include/oox/helper/attributelist.hxx b/include/oox/helper/attributelist.hxx
index d58305bffa54..65e7f4ee2cf3 100644
--- a/include/oox/helper/attributelist.hxx
+++ b/include/oox/helper/attributelist.hxx
@@ -145,7 +145,7 @@ public:
passed default string if the attribute is missing. */
OUString getXString( sal_Int32 nAttrToken, const OUString& rDefault ) const;
- const char* getChar( sal_Int32 nAttrToken ) const;
+ std::string_view getView( sal_Int32 nAttrToken ) const;
/** Returns the double value of the specified attribute, or the passed
diff --git a/include/sax/fastattribs.hxx b/include/sax/fastattribs.hxx
index 24133a4f82ca..ef7e97884735 100644
--- a/include/sax/fastattribs.hxx
+++ b/include/sax/fastattribs.hxx
@@ -103,9 +103,8 @@ public:
// performance sensitive shortcuts to avoid allocation ...
bool getAsInteger( sal_Int32 nToken, sal_Int32 &rInt) const;
bool getAsDouble( sal_Int32 nToken, double &rDouble) const;
- bool getAsChar( sal_Int32 nToken, const char*& rPos ) const;
+ bool getAsView( sal_Int32 nToken, std::string_view& rPos ) const;
sal_Int32 getAsIntegerByIndex( sal_Int32 nTokenIndex ) const;
- const char* getAsCharByIndex( sal_Int32 nTokenIndex ) const;
std::string_view getAsViewByIndex( sal_Int32 nTokenIndex ) const;
OUString getValueByIndex( sal_Int32 nTokenIndex ) const;