summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 10:35:49 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-10-28 12:07:54 +0100
commitbc539bd3c04964471af6b5ca54264215c8995696 (patch)
treec37af5b9fb3dc0b8677fc8dd535fb8e93ad6039d /sot
parent9f78a4174e5099ad3af65a23e158a51c1afca54d (diff)
loplugin:stringadd improve detection
if one side of the expression is a compile-time-constant, we don't need to worry about side-effects on the other side Change-Id: Iee71ea51b327ef244bf39f128f921ac325d74e2b Reviewed-on: https://gerrit.libreoffice.org/81589 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/sdstor/ucbstorage.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index 5340f841454c..7ca803627124 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -1480,9 +1480,8 @@ UCBStorage_Impl::UCBStorage_Impl( const OUString& rName, StreamMode nMode, UCBSt
if ( m_bIsRoot )
{
// create the special package URL for the package content
- OUString aTemp = "vnd.sun.star.pkg://";
- aTemp += INetURLObject::encode( aName, INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All );
- m_aURL = aTemp;
+ m_aURL = "vnd.sun.star.pkg://" +
+ INetURLObject::encode( aName, INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All );
if ( m_nMode & StreamMode::WRITE )
{
@@ -1521,9 +1520,8 @@ UCBStorage_Impl::UCBStorage_Impl( SvStream& rStream, UCBStorage* pStorage, bool
// UCBStorages work on a content, so a temporary file for a content must be created, even if the stream is only
// accessed readonly
// the root storage opens the package; create the special package URL for the package content
- OUString aTemp = "vnd.sun.star.pkg://";
- aTemp += INetURLObject::encode( m_pTempFile->GetURL(), INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All );
- m_aURL = aTemp;
+ m_aURL = "vnd.sun.star.pkg://" +
+ INetURLObject::encode( m_pTempFile->GetURL(), INetURLObject::PART_AUTHORITY, INetURLObject::EncodeMechanism::All );
// copy data into the temporary file
std::unique_ptr<SvStream> pStream(::utl::UcbStreamHelper::CreateStream( m_pTempFile->GetURL(), StreamMode::STD_READWRITE, true /* bFileExists */ ));