diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-26 14:03:48 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-27 20:31:14 +0200 |
commit | 48e279c6748bf023fba12fdc3f4cee402f611c6e (patch) | |
tree | 2e1b3a20ccd71f47a66938f882c1fe9d5e947bb4 /include | |
parent | f3665d2a42b39814764f3eb9e20498b8a4be1d00 (diff) |
use string_view in INetURLObject::decode
Change-Id: I10e04970ceac33c9c3fbfd0182dd2140e06cb80b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114658
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/oox/core/xmlfilterbase.hxx | 4 | ||||
-rw-r--r-- | include/oox/export/drawingml.hxx | 2 | ||||
-rw-r--r-- | include/tools/urlobj.hxx | 19 |
3 files changed, 6 insertions, 19 deletions
diff --git a/include/oox/core/xmlfilterbase.hxx b/include/oox/core/xmlfilterbase.hxx index ce8ab9e3ae47..7c1cada284d2 100644 --- a/include/oox/core/xmlfilterbase.hxx +++ b/include/oox/core/xmlfilterbase.hxx @@ -163,7 +163,7 @@ public: @return Added relation Id. */ - OUString addRelation( const OUString& rType, const OUString& rTarget ); + OUString addRelation( const OUString& rType, std::u16string_view rTarget ); /** Adds new relation to part's relations. @@ -178,7 +178,7 @@ public: @return Added relation Id. */ - OUString addRelation( const css::uno::Reference< css::io::XOutputStream >& rOutputStream, const OUString& rType, const OUString& rTarget, bool bExternal = false ); + OUString addRelation( const css::uno::Reference< css::io::XOutputStream >& rOutputStream, const OUString& rType, std::u16string_view rTarget, bool bExternal = false ); /** Returns a stack of used textfields, used by the pptx importer to replace links to slidepages with the real page name */ TextFieldStack& getTextFieldStack() const; diff --git a/include/oox/export/drawingml.hxx b/include/oox/export/drawingml.hxx index bc9c8bc9dd69..2876d59c5367 100644 --- a/include/oox/export/drawingml.hxx +++ b/include/oox/export/drawingml.hxx @@ -323,7 +323,7 @@ public: sax_fastparser::FSHelperPtr CreateOutputStream ( const OUString& sFullStream, - const OUString& sRelativeStream, + std::u16string_view sRelativeStream, const css::uno::Reference< css::io::XOutputStream >& xParentRelation, const char* sContentType, const char* sRelationshipType, diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx index 1fb5f4e86aea..e323e5049987 100644 --- a/include/tools/urlobj.hxx +++ b/include/tools/urlobj.hxx @@ -839,12 +839,7 @@ public: @return The text, decoded according to the given mechanism and charset (escape sequences replaced by 'raw' characters). */ - static inline OUString decode(OUString const & rText, - DecodeMechanism eMechanism, - rtl_TextEncoding eCharset - = RTL_TEXTENCODING_UTF8); - - static inline OUString decode(OUStringBuffer const & rText, + static inline OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset = RTL_TEXTENCODING_UTF8); @@ -1298,19 +1293,11 @@ inline OUString INetURLObject::encode(OUString const & rText, Part ePart, } // static -inline OUString INetURLObject::decode(OUString const & rText, - DecodeMechanism eMechanism, - rtl_TextEncoding eCharset) -{ - return decode(rText.getStr(), rText.getStr() + rText.getLength(), - eMechanism, eCharset); -} - -inline OUString INetURLObject::decode(OUStringBuffer const & rText, +inline OUString INetURLObject::decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset) { - return decode(rText.getStr(), rText.getStr() + rText.getLength(), + return decode(rText.data(), rText.data() + rText.size(), eMechanism, eCharset); } |