summaryrefslogtreecommitdiff
path: root/forms
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-12-28 17:56:40 +0100
committerStephan Bergmann <sbergman@redhat.com>2020-12-29 16:42:33 +0100
commit042033f1e6da22616cb76c8d950c20c9efecbad5 (patch)
tree26b3f1f42d067506f44550b410f3fb9640616a5b /forms
parentccfd8e9d09f9ac0a0ea92d0f378391006faaf934 (diff)
loplugin:stringviewparam: operator +
Change-Id: I044dd21b63d7eb03224675584fa143009c6b6008 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108418 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx12
-rw-r--r--forms/source/component/DatabaseForm.hxx6
-rw-r--r--forms/source/xforms/submission.cxx11
3 files changed, 15 insertions, 14 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 11b8bd14d352..0374c9fb956e 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -518,7 +518,7 @@ namespace
}
-void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Reference<XPropertySet>& xComponentSet, const OUString& rNamePrefix,
+void ODatabaseForm::AppendComponent(HtmlSuccessfulObjList& rList, const Reference<XPropertySet>& xComponentSet, std::u16string_view rNamePrefix,
const Reference<XControl>& rxSubmitButton, const css::awt::MouseEvent& MouseEvt)
{
if (!xComponentSet.is())
@@ -857,7 +857,7 @@ void ODatabaseForm::FillSuccessfulList( HtmlSuccessfulObjList& rList,
for( sal_Int32 nIndex=0; nIndex < getCount(); nIndex++ )
{
getByIndex( nIndex ) >>= xComponentSet;
- AppendComponent(rList, xComponentSet, OUString(), rxSubmitButton, MouseEvt);
+ AppendComponent(rList, xComponentSet, std::u16string_view(), rxSubmitButton, MouseEvt);
}
}
@@ -918,7 +918,7 @@ void ODatabaseForm::Encode( OUString& rString )
}
-void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rName,
+void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, std::u16string_view rName,
std::u16string_view rData )
{
// Create part as MessageChild
@@ -927,7 +927,7 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rN
// Header
//TODO: Encode rName into a properly formatted Content-Disposition header
// field as per RFC 2231:
- OUString aContentDisp = "form-data; name=\"" + rName + "\"";
+ OUString aContentDisp = OUString::Concat("form-data; name=\"") + rName + "\"";
pChild->SetContentDisposition(aContentDisp);
rtl_TextEncoding eSystemEncoding = osl_getThreadTextEncoding();
@@ -947,7 +947,7 @@ void ODatabaseForm::InsertTextPart( INetMIMEMessage& rParent, const OUString& rN
}
-void ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rName,
+void ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, std::u16string_view rName,
const OUString& rFileName )
{
OUString aFileName(rFileName);
@@ -989,7 +989,7 @@ void ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString& rN
//TODO: Encode rName and aFileName into a properly formatted
// Content-Disposition header field as per RFC 2231:
OUString aContentDisp =
- "form-data; name=\"" +
+ OUString::Concat("form-data; name=\"") +
rName +
"\""
"; filename=\"" +
diff --git a/forms/source/component/DatabaseForm.hxx b/forms/source/component/DatabaseForm.hxx
index c89a197ba4e9..4e7a670d0d23 100644
--- a/forms/source/component/DatabaseForm.hxx
+++ b/forms/source/component/DatabaseForm.hxx
@@ -501,13 +501,13 @@ private:
css::uno::Sequence<sal_Int8> GetDataMultiPartEncoded(const css::uno::Reference< css::awt::XControl>& SubmitButton, const css::awt::MouseEvent& MouseEvt,
OUString& rContentType);
- void AppendComponent(HtmlSuccessfulObjList& rList, const css::uno::Reference< css::beans::XPropertySet>& xComponentSet, const OUString& rNamePrefix,
+ void AppendComponent(HtmlSuccessfulObjList& rList, const css::uno::Reference< css::beans::XPropertySet>& xComponentSet, std::u16string_view rNamePrefix,
const css::uno::Reference< css::awt::XControl>& rxSubmitButton, const css::awt::MouseEvent& MouseEvt);
void FillSuccessfulList(HtmlSuccessfulObjList& rList, const css::uno::Reference< css::awt::XControl>& rxSubmitButton, const css::awt::MouseEvent& MouseEvt);
- static void InsertTextPart(INetMIMEMessage& rParent, const OUString& rName, std::u16string_view rData);
- static void InsertFilePart(INetMIMEMessage& rParent, const OUString& rName, const OUString& rFileName);
+ static void InsertTextPart(INetMIMEMessage& rParent, std::u16string_view rName, std::u16string_view rData);
+ static void InsertFilePart(INetMIMEMessage& rParent, std::u16string_view rName, const OUString& rFileName);
static void Encode(OUString& rString);
css::uno::Reference< css::sdbc::XConnection > getConnection();
diff --git a/forms/source/xforms/submission.cxx b/forms/source/xforms/submission.cxx
index 6b759e18453e..5f7fdd007315 100644
--- a/forms/source/xforms/submission.cxx
+++ b/forms/source/xforms/submission.cxx
@@ -49,6 +49,7 @@
#include <comphelper/processfactory.hxx>
#include <comphelper/servicehelper.hxx>
#include <memory>
+#include <string_view>
using com::sun::star::util::VetoException;
using com::sun::star::form::submission::XSubmissionVetoListener;
@@ -381,9 +382,9 @@ sal_Int64 SAL_CALL Submission::getSomething(
}
-static OUString lcl_message( const OUString& rID, const OUString& rText )
+static OUString lcl_message( std::u16string_view rID, std::u16string_view rText )
{
- OUString aMessage = "XForms submission '" + rID + "' failed" + rText + ".";
+ OUString aMessage = OUString::Concat("XForms submission '") + rID + "' failed" + rText + ".";
return aMessage;
}
@@ -410,7 +411,7 @@ void SAL_CALL Submission::submitWithInteraction(
if( ! bValid )
{
InvalidDataOnSubmitException aInvalidDataException(
- lcl_message(sID, " due to invalid data" ), *this );
+ lcl_message(sID, u" due to invalid data" ), *this );
if( _rxHandler.is() )
{
@@ -462,7 +463,7 @@ void SAL_CALL Submission::submitWithInteraction(
css::uno::Any anyEx = cppu::getCaughtException();
// exception caught: re-throw as wrapped target exception
throw WrappedTargetException(
- lcl_message( sID, " due to exception being thrown" ),
+ lcl_message( sID, u" due to exception being thrown" ),
*this, anyEx );
}
@@ -470,7 +471,7 @@ void SAL_CALL Submission::submitWithInteraction(
{
// other failure: throw wrapped target exception, too.
throw WrappedTargetException(
- lcl_message( sID, OUString() ), *this, Any() );
+ lcl_message( sID, std::u16string_view() ), *this, Any() );
}
mxModel->rebuild();
}