diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 12:24:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-04-29 18:25:31 +0200 |
commit | 04aafba860f613c20e7078d038cc83eb02de0b54 (patch) | |
tree | 8153152b87089419bde17313d9ac7b9de6fcce32 /stoc | |
parent | 76c793d2acf66f46e9edcda43d2f4327e8374841 (diff) |
loplugin:stringadd simplify some *StringBuffer operations
pulled from a larger patch which I created with a more permissive
variant of this plugin
Change-Id: I7abf1f3f09e84703b6e0e52fe9587dff691b2187
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114875
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx index b6e926bd2e7c..f8717b37b9dd 100644 --- a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx +++ b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx @@ -94,15 +94,14 @@ Factory::createVndSunStarPkgUrlReference( " XVndSunStarPkgUrlReferenceFactory.createVndSunStarPkgUrlReference"); } if (authority->isAbsolute() && !authority->hasFragment()) { - OUStringBuffer buf(128); - buf.append("vnd.sun.star.pkg://"); - buf.append( + OUString buf = + "vnd.sun.star.pkg://" + rtl::Uri::encode( authority->getUriReference(), rtl_UriCharClassRegName, - rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8)); + rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8); css::uno::Reference< css::uri::XUriReference > uriRef( css::uri::UriReferenceFactory::create(m_context)->parse( - buf.makeStringAndClear())); + buf)); return uriRef; } else { return css::uno::Reference< css::uri::XUriReference >(); |