summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-04-28 14:12:35 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-04-29 08:53:22 +0200
commitd3849255b76e92a42f653c266b88945708984c4f (patch)
treeff1eab21b9e5a1ea00e1573db4b4595ba51b0098 /svl
parentf9b6bd6336b35de060f6f5bdd91517caf5e9a56e (diff)
use more string_view in INetURLObject
Change-Id: I4462f7cf4740fa4d1b129d76a0775f4250f41bbd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133555 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/fsstor/fsstorage.cxx2
-rw-r--r--svl/source/fsstor/fsstorage.hxx2
-rw-r--r--svl/source/misc/documentlockfile.cxx2
-rw-r--r--svl/source/misc/inethist.cxx6
-rw-r--r--svl/source/misc/lockfilecommon.cxx2
-rw-r--r--svl/source/misc/msodocumentlockfile.cxx8
-rw-r--r--svl/source/misc/sharecontrolfile.cxx2
-rw-r--r--svl/source/misc/urihelper.cxx12
8 files changed, 18 insertions, 18 deletions
diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx
index 9056b782d3b3..0ae71ab53389 100644
--- a/svl/source/fsstor/fsstorage.cxx
+++ b/svl/source/fsstor/fsstorage.cxx
@@ -83,7 +83,7 @@ FSStorage::~FSStorage()
{}
}
-bool FSStorage::MakeFolderNoUI( const OUString& rFolder )
+bool FSStorage::MakeFolderNoUI( std::u16string_view rFolder )
{
INetURLObject aURL( rFolder );
OUString aTitle = aURL.getName( INetURLObject::LAST_SEGMENT, true, INetURLObject::DecodeMechanism::WithCharset );
diff --git a/svl/source/fsstor/fsstorage.hxx b/svl/source/fsstor/fsstorage.hxx
index 2b0b7bc78c44..1c4ae7030903 100644
--- a/svl/source/fsstor/fsstorage.hxx
+++ b/svl/source/fsstor/fsstorage.hxx
@@ -62,7 +62,7 @@ public:
void CopyContentToStorage_Impl(ucbhelper::Content& rContent,
const css::uno::Reference<css::embed::XStorage>& xDest);
- static bool MakeFolderNoUI( const OUString& rFolder );
+ static bool MakeFolderNoUI( std::u16string_view rFolder );
// XInterface
diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx
index 096b1e4e8544..fdbbc90ba465 100644
--- a/svl/source/misc/documentlockfile.cxx
+++ b/svl/source/misc/documentlockfile.cxx
@@ -163,7 +163,7 @@ void GenDocumentLockFile::RemoveFileDirectly()
}
-DocumentLockFile::DocumentLockFile( const OUString& aOrigURL )
+DocumentLockFile::DocumentLockFile( std::u16string_view aOrigURL )
: GenDocumentLockFile(GenerateOwnLockFileURL(aOrigURL, u".~lock."))
{
}
diff --git a/svl/source/misc/inethist.cxx b/svl/source/misc/inethist.cxx
index 2fbd981034ec..dc25d6b0b5a9 100644
--- a/svl/source/misc/inethist.cxx
+++ b/svl/source/misc/inethist.cxx
@@ -309,14 +309,14 @@ void INetURLHistory::NormalizeUrl_Impl (INetURLObject &rUrl)
if (!rUrl.HasPort())
rUrl.SetPort (INETHIST_DEF_HTTP_PORT);
if (!rUrl.HasURLPath())
- rUrl.SetURLPath("/");
+ rUrl.SetURLPath(u"/");
break;
case INetProtocol::Https:
if (!rUrl.HasPort())
rUrl.SetPort (INETHIST_DEF_HTTPS_PORT);
if (!rUrl.HasURLPath())
- rUrl.SetURLPath("/");
+ rUrl.SetURLPath(u"/");
break;
default:
@@ -346,7 +346,7 @@ void INetURLHistory::PutUrl_Impl (const INetURLObject &rUrl)
}
}
-bool INetURLHistory::QueryUrl(const OUString &rUrl) const
+bool INetURLHistory::QueryUrl(std::u16string_view rUrl) const
{
INetProtocol eProto = INetURLObject::CompareProtocolScheme (rUrl);
if (!QueryProtocol (eProto))
diff --git a/svl/source/misc/lockfilecommon.cxx b/svl/source/misc/lockfilecommon.cxx
index 844b446397c7..baed8636ecfb 100644
--- a/svl/source/misc/lockfilecommon.cxx
+++ b/svl/source/misc/lockfilecommon.cxx
@@ -70,7 +70,7 @@ void LockFileCommon::SetURL(const OUString& aURL)
OUString LockFileCommon::GenerateOwnLockFileURL(
- const OUString& aOrigURL, std::u16string_view aPrefix)
+ std::u16string_view aOrigURL, std::u16string_view aPrefix)
{
INetURLObject aURL = ResolveLinks(INetURLObject(aOrigURL));
aURL.setName(OUStringConcatenation(aPrefix + aURL.GetLastName() + "%23" /*'#'*/));
diff --git a/svl/source/misc/msodocumentlockfile.cxx b/svl/source/misc/msodocumentlockfile.cxx
index b240e9c9cbd9..ce1bf287a90c 100644
--- a/svl/source/misc/msodocumentlockfile.cxx
+++ b/svl/source/misc/msodocumentlockfile.cxx
@@ -42,7 +42,7 @@ bool isPowerPointFormat(std::u16string_view sExt)
}
// Need to generate different lock file name for MSO.
-OUString GenerateMSOLockFileURL(const OUString& aOrigURL)
+OUString GenerateMSOLockFileURL(std::u16string_view aOrigURL)
{
INetURLObject aURL = LockFileCommon::ResolveLinks(INetURLObject(aOrigURL));
@@ -64,7 +64,7 @@ OUString GenerateMSOLockFileURL(const OUString& aOrigURL)
}
// static
-MSODocumentLockFile::AppType MSODocumentLockFile::getAppType(const OUString& sOrigURL)
+MSODocumentLockFile::AppType MSODocumentLockFile::getAppType(std::u16string_view sOrigURL)
{
AppType eResult = AppType::PowerPoint;
INetURLObject aDocURL = LockFileCommon::ResolveLinks(INetURLObject(sOrigURL));
@@ -77,7 +77,7 @@ MSODocumentLockFile::AppType MSODocumentLockFile::getAppType(const OUString& sOr
return eResult;
}
-MSODocumentLockFile::MSODocumentLockFile(const OUString& aOrigURL)
+MSODocumentLockFile::MSODocumentLockFile(std::u16string_view aOrigURL)
: GenDocumentLockFile(GenerateMSOLockFileURL(aOrigURL))
, m_eAppType(getAppType(aOrigURL))
{
@@ -260,7 +260,7 @@ void MSODocumentLockFile::RemoveFile()
RemoveFileDirectly();
}
-bool MSODocumentLockFile::IsMSOSupportedFileFormat(const OUString& aURL)
+bool MSODocumentLockFile::IsMSOSupportedFileFormat(std::u16string_view aURL)
{
INetURLObject aDocURL = LockFileCommon::ResolveLinks(INetURLObject(aURL));
const OUString sExt = aDocURL.GetFileExtension();
diff --git a/svl/source/misc/sharecontrolfile.cxx b/svl/source/misc/sharecontrolfile.cxx
index cf474fe459af..d0cdda561876 100644
--- a/svl/source/misc/sharecontrolfile.cxx
+++ b/svl/source/misc/sharecontrolfile.cxx
@@ -44,7 +44,7 @@ using namespace ::com::sun::star;
namespace svt {
-ShareControlFile::ShareControlFile( const OUString& aOrigURL )
+ShareControlFile::ShareControlFile( std::u16string_view aOrigURL )
: LockFileCommon(GenerateOwnLockFileURL(aOrigURL, u".~sharing."))
{
if ( !m_xStream.is() && !GetURL().isEmpty() )
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index 30dfdc87f387..1cb5c9f7caee 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -553,7 +553,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
if (nUriEnd != nPrefixEnd
&& isBoundary1(rCharClass, rText, nUriEnd, rEnd))
{
- INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos),
+ INetURLObject aUri(rText.subView(nPos, nUriEnd - nPos),
INetProtocol::File, eMechanism, eCharset,
FSysStyle::Detect);
if (!aUri.HasError())
@@ -584,7 +584,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
&& (isBoundary1(rCharClass, rText, nUriEnd, rEnd)
|| rText[nUriEnd] == '\\'))
{
- INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos),
+ INetURLObject aUri(rText.subView(nPos, nUriEnd - nPos),
INetProtocol::Http, eMechanism,
eCharset);
if (!aUri.HasError())
@@ -633,7 +633,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
if (isBoundary1(rCharClass, rText, nUriEnd, rEnd)
|| rText[nUriEnd] == '\\')
{
- INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos),
+ INetURLObject aUri(rText.subView(nPos, nUriEnd - nPos),
INetProtocol::Http, eMechanism,
eCharset);
if (!aUri.HasError())
@@ -657,7 +657,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
&& checkWChar(rCharClass, rText, &i, &nUriEnd)) ;
if (isBoundary1(rCharClass, rText, nUriEnd, rEnd))
{
- INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos),
+ INetURLObject aUri(rText.subView(nPos, nUriEnd - nPos),
INetProtocol::File,
INetURLObject::EncodeMechanism::All,
RTL_TEXTENCODING_UTF8,
@@ -686,7 +686,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
nullptr, true)) ;
if (isBoundary1(rCharClass, rText, nUriEnd, rEnd))
{
- INetURLObject aUri(rText.copy(nPos, nUriEnd - nPos),
+ INetURLObject aUri(rText.subView(nPos, nUriEnd - nPos),
INetProtocol::File,
INetURLObject::EncodeMechanism::All,
RTL_TEXTENCODING_UTF8,
@@ -723,7 +723,7 @@ OUString URIHelper::FindFirstURLInText(OUString const & rText,
if (nLabels >= 1
&& isBoundary1(rCharClass, rText, i, rEnd))
{
- INetURLObject aUri(rText.copy(nPos, i - nPos),
+ INetURLObject aUri(rText.subView(nPos, i - nPos),
INetProtocol::Mailto,
INetURLObject::EncodeMechanism::All);
if (!aUri.HasError())