summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-10-26 10:53:53 +0200
committerStephan Bergmann <sbergman@redhat.com>2021-10-26 22:38:04 +0200
commit3fd9f90cfa620d7148d969a41df86da9e26e43f7 (patch)
treef0bc32a8227ef1921ce8414e70f8e818afa4b5af
parentf1a3218a91d53ca40058598580ed0031336eb21c (diff)
Remove OUStringBuffer member function overloads for OUStringLiteral
...which are already adequately covered by overloads for OUString and the OUStringLiteral-to-OUString implicit conversion that became cheap in e6dfaf9f44f9939abc338c83b3024108431d0f69 "Turn OUStringLiteral into a consteval'ed, static-refcound rtl_uString". The only place where the removal of the ctor overload caused an issue for copy- initialization (in sfx2/source/appl/newhelp.cxx) could easily be rewritten using direct-initialization. Change-Id: I458fb80eebabf981633f3437e7e967caa4c50a5b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124176 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--include/rtl/ustrbuf.hxx48
-rw-r--r--sfx2/source/appl/newhelp.cxx2
2 files changed, 1 insertions, 49 deletions
diff --git a/include/rtl/ustrbuf.hxx b/include/rtl/ustrbuf.hxx
index 2b8288b26b1e..20afe57de7ff 100644
--- a/include/rtl/ustrbuf.hxx
+++ b/include/rtl/ustrbuf.hxx
@@ -188,13 +188,6 @@ public:
libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
libreoffice_internal::ConstCharArrayDetector<T>::length);
}
-
- /** @overload @since LibreOffice 5.4 */
- template<std::size_t N> OUStringBuffer(OUStringLiteral<N> const & literal):
- pData(nullptr), nCapacity(literal.getLength() + 16) //TODO: check for overflow
- {
- rtl_uStringbuffer_newFromStr_WithLength(&pData, literal.getStr(), literal.getLength());
- }
#endif
#if defined LIBO_INTERNAL_ONLY && defined RTL_STRING_UNITTEST
@@ -347,19 +340,6 @@ public:
pData->length = n;
return *this;
}
-
- /** @overload @since LibreOffice 5.4 */
- template<std::size_t N> OUStringBuffer & operator =(OUStringLiteral<N> const & literal) {
- sal_Int32 const n = literal.getLength();
- if (n >= nCapacity) {
- ensureCapacity(n + 16); //TODO: check for overflow
- }
- std::memcpy(
- pData->buffer, literal.getStr(),
- (n + 1) * sizeof (sal_Unicode)); //TODO: check for overflow
- pData->length = n;
- return *this;
- }
#endif
#if defined LIBO_INTERNAL_ONLY
@@ -693,11 +673,6 @@ public:
libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
libreoffice_internal::ConstCharArrayDetector<T>::length);
}
-
- /** @overload @since LibreOffice 5.4 */
- template<std::size_t N> OUStringBuffer & append(OUStringLiteral<N> const & literal) {
- return append(literal.getStr(), literal.getLength());
- }
#endif
#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
@@ -1078,12 +1053,6 @@ public:
libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
libreoffice_internal::ConstCharArrayDetector<T>::length);
}
-
- /** @overload @since LibreOffice 5.4 */
- template<std::size_t N>
- OUStringBuffer & insert(sal_Int32 offset, OUStringLiteral<N> const & literal) {
- return insert(offset, literal.getStr(), literal.getLength());
- }
#endif
/**
@@ -1498,17 +1467,6 @@ public:
libreoffice_internal::ConstCharArrayDetector<T>::length);
return n < 0 ? n : n + fromIndex;
}
-
- /** @overload @since LibreOffice 5.4 */
- template<std::size_t N>
- sal_Int32 indexOf(OUStringLiteral<N> const & literal, sal_Int32 fromIndex = 0)
- const
- {
- sal_Int32 n = rtl_ustr_indexOfStr_WithLength(
- pData->buffer + fromIndex, pData->length - fromIndex, literal.getStr(),
- literal.getLength());
- return n < 0 ? n : n + fromIndex;
- }
#endif
/**
@@ -1604,12 +1562,6 @@ public:
libreoffice_internal::ConstCharArrayDetector<T>::toPointer(literal),
libreoffice_internal::ConstCharArrayDetector<T>::length);
}
-
- /** @overload @since LibreOffice 5.4 */
- template<std::size_t N> sal_Int32 lastIndexOf(OUStringLiteral<N> const & literal) const {
- return rtl_ustr_lastIndexOfStr_WithLength(
- pData->buffer, pData->length, literal.getStr(), literal.getLength());
- }
#endif
/**
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 92007f02afcf..5d0e582b03a6 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -558,7 +558,7 @@ void IndexTabPage_Impl::InitializeIndex()
try
{
- OUStringBuffer aURL = HELP_URL;
+ OUStringBuffer aURL(HELP_URL);
aURL.append(sFactory);
AppendConfigToken(aURL, true);