summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-26 13:52:46 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-26 13:55:31 +0200
commit35c81431a6f76d2e7dbbb450f5ef4ca39efe1684 (patch)
treeec6970293a8d72ac54fdce70bbfb03fd42d3c90c /cui
parenta212bd0e36c24f44d84c0ef4a9837386fbd73369 (diff)
loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: I89536204943c0bb86ad9a7cf11050d040650078d
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/hldocntp.cxx2
-rw-r--r--cui/source/options/optgenrl.cxx2
-rw-r--r--cui/source/options/optjava.cxx2
-rw-r--r--cui/source/options/optpath.cxx44
-rw-r--r--cui/source/options/webconninfo.cxx13
5 files changed, 27 insertions, 36 deletions
diff --git a/cui/source/dialogs/hldocntp.cxx b/cui/source/dialogs/hldocntp.cxx
index 234ea38d7428..1ae6e037fd47 100644
--- a/cui/source/dialogs/hldocntp.cxx
+++ b/cui/source/dialogs/hldocntp.cxx
@@ -347,7 +347,7 @@ void SvxHyperlinkNewDocTp::DoApply ()
OUString aStrFlags('S');
if ( m_pRbtEditLater->IsChecked() )
{
- aStrFlags += OUString('H');
+ aStrFlags += "H";
}
SfxStringItem aFlags (SID_OPTIONS, aStrFlags);
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 788ce72921e1..824447bb59d4 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -378,7 +378,7 @@ IMPL_LINK( SvxGeneralTabPage, ModifyHdl_Impl, Edit *, pEdit )
rShortName.pEdit->SetText(OUString());
}
while ((unsigned)sShortName.getLength() < nInits)
- sShortName += OUString(' ');
+ sShortName += " ";
OUString sName = pEdit->GetText();
OUString sLetter = sName.isEmpty()
? OUString(sal_Unicode(' ')) : sName.copy(0, 1);
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 31c94c6eb1bd..14c2a22563d3 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -1110,7 +1110,7 @@ OUString SvxJavaClassPathDlg::GetClassPath() const
for ( sal_Int32 i = 0; i < nCount; ++i )
{
if ( !sPath.isEmpty() )
- sPath += OUString(CLASSPATH_DELIMITER);
+ sPath += OUStringLiteral1<CLASSPATH_DELIMITER>();
OUString* pFullPath = static_cast< OUString* >( m_pPathList->GetEntryData(i) );
if ( pFullPath )
sPath += *pFullPath;
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index 06f6feef2a48..45c8bbb4aa54 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -63,9 +63,9 @@ using namespace svx;
#define ITEMID_TYPE 1
#define ITEMID_PATH 2
-#define POSTFIX_INTERNAL OUString("_internal")
-#define POSTFIX_USER OUString("_user")
-#define POSTFIX_WRITABLE OUString("_writable")
+#define POSTFIX_INTERNAL "_internal"
+#define POSTFIX_USER "_user"
+#define POSTFIX_WRITABLE "_writable"
#define VAR_ONE "%1"
#define IODLG_CONFIGNAME OUString("FilePicker_Save")
@@ -155,7 +155,7 @@ OUString Convert_Impl( const OUString& rValue )
else if ( ::utl::LocalFileHelper::IsFileContent( aValue ) )
aReturn += aObj.GetURLPath( INetURLObject::DECODE_WITH_CHARSET );
if ( i+1 < nCount)
- aReturn += OUString(MULTIPATH_DELIMITER);
+ aReturn += OUStringLiteral1<MULTIPATH_DELIMITER>();
}
return aReturn;
@@ -313,7 +313,7 @@ void SvxPathTabPage::Reset( const SfxItemSet* )
GetPathList( i, sInternal, sUser, sWritable, bReadOnly );
OUString sTmpPath = sUser;
if ( !sTmpPath.isEmpty() && !sWritable.isEmpty() )
- sTmpPath += OUString(MULTIPATH_DELIMITER);
+ sTmpPath += OUStringLiteral1<MULTIPATH_DELIMITER>();
sTmpPath += sWritable;
OUString aValue( sTmpPath );
aValue = Convert_Impl( aValue );
@@ -434,7 +434,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl)
if ( !bFound )
{
if ( !sTemp.isEmpty() )
- sTemp += OUString(MULTIPATH_DELIMITER);
+ sTemp += OUStringLiteral1<MULTIPATH_DELIMITER>();
sTemp += sOnePath;
}
}
@@ -444,7 +444,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, StandardHdl_Impl)
for ( i = 0; nOldCount > 0 && i < nOldCount - 1; ++i )
{
if ( !sUserPath.isEmpty() )
- sUserPath += OUString(MULTIPATH_DELIMITER);
+ sUserPath += OUStringLiteral1<MULTIPATH_DELIMITER>();
sUserPath += sTemp.getToken( i, MULTIPATH_DELIMITER );
}
sWritablePath = sTemp.getToken( nOldCount - 1, MULTIPATH_DELIMITER );
@@ -554,7 +554,7 @@ IMPL_LINK_NOARG(SvxPathTabPage, PathHdl_Impl)
OUString sPath( sUser );
if ( !sPath.isEmpty() )
- sPath += OUString(MULTIPATH_DELIMITER);
+ sPath += OUStringLiteral1<MULTIPATH_DELIMITER>();
sPath += sWritable;
pMultiDlg->SetPath( sPath );
@@ -721,9 +721,8 @@ void SvxPathTabPage::GetPathList(
}
// load internal paths
- OUString sProp( sCfgName );
- sProp += POSTFIX_INTERNAL;
- Any aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
+ Any aAny = pImpl->m_xPathSettings->getPropertyValue(
+ sCfgName + POSTFIX_INTERNAL);
Sequence< OUString > aPathSeq;
if ( aAny >>= aPathSeq )
{
@@ -738,9 +737,8 @@ void SvxPathTabPage::GetPathList(
}
}
// load user paths
- sProp = sCfgName;
- sProp += POSTFIX_USER;
- aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
+ aAny = pImpl->m_xPathSettings->getPropertyValue(
+ sCfgName + POSTFIX_USER);
if ( aAny >>= aPathSeq )
{
long i, nCount = aPathSeq.getLength();
@@ -754,17 +752,15 @@ void SvxPathTabPage::GetPathList(
}
}
// then the writable path
- sProp = sCfgName;
- sProp += POSTFIX_WRITABLE;
- aAny = pImpl->m_xPathSettings->getPropertyValue( sProp );
+ aAny = pImpl->m_xPathSettings->getPropertyValue(
+ sCfgName + POSTFIX_WRITABLE);
OUString sWritablePath;
if ( aAny >>= sWritablePath )
_rWritablePath = sWritablePath;
// and the readonly flag
- sProp = sCfgName;
Reference< XPropertySetInfo > xInfo = pImpl->m_xPathSettings->getPropertySetInfo();
- Property aProp = xInfo->getPropertyByName( sProp );
+ Property aProp = xInfo->getPropertyByName(sCfgName);
_rReadOnly = ( ( aProp.Attributes & PropertyAttribute::READONLY ) == PropertyAttribute::READONLY );
}
catch( const Exception& )
@@ -796,16 +792,14 @@ void SvxPathTabPage::SetPathList(
OUString* pArray = aPathSeq.getArray();
for ( sal_uInt16 i = 0; i < nCount; ++i )
pArray[i] = _rUserPath.getToken( i, cDelim );
- OUString sProp( sCfgName );
- sProp += POSTFIX_USER;
Any aValue = makeAny( aPathSeq );
- pImpl->m_xPathSettings->setPropertyValue( sProp, aValue );
+ pImpl->m_xPathSettings->setPropertyValue(
+ sCfgName + POSTFIX_USER, aValue);
// then the writable path
aValue = makeAny( OUString( _rWritablePath ) );
- sProp = sCfgName;
- sProp += POSTFIX_WRITABLE;
- pImpl->m_xPathSettings->setPropertyValue( sProp, aValue );
+ pImpl->m_xPathSettings->setPropertyValue(
+ sCfgName + POSTFIX_WRITABLE, aValue);
}
catch( const Exception& e )
{
diff --git a/cui/source/options/webconninfo.cxx b/cui/source/options/webconninfo.cxx
index ffa1ef28c524..98e0b875d904 100644
--- a/cui/source/options/webconninfo.cxx
+++ b/cui/source/options/webconninfo.cxx
@@ -180,10 +180,9 @@ void WebConnectionInfoDialog::FillPasswordList()
{
for ( sal_Int32 nUserInd = 0; nUserInd < aURLEntries[nURLInd].UserList.getLength(); nUserInd++ )
{
- OUString aUIEntry( aURLEntries[nURLInd].Url );
- aUIEntry += OUString( (sal_Unicode)'\t' );
- aUIEntry += aURLEntries[nURLInd].UserList[nUserInd].UserName;
- SvTreeListEntry* pEntry = m_pPasswordsLB->InsertEntry( aUIEntry );
+ SvTreeListEntry* pEntry = m_pPasswordsLB->InsertEntry(
+ aURLEntries[nURLInd].Url + "\t" +
+ aURLEntries[nURLInd].UserList[nUserInd].UserName);
pEntry->SetUserData( reinterpret_cast<void*>(nCount++) );
}
}
@@ -196,10 +195,8 @@ void WebConnectionInfoDialog::FillPasswordList()
for ( sal_Int32 nURLIdx = 0; nURLIdx < aUrls.getLength(); nURLIdx++ )
{
- OUString aUIEntry( aUrls[ nURLIdx ] );
- aUIEntry += OUString( (sal_Unicode)'\t' );
- aUIEntry += OUString( "*" );
- SvTreeListEntry* pEntry = m_pPasswordsLB->InsertEntry( aUIEntry );
+ SvTreeListEntry* pEntry = m_pPasswordsLB->InsertEntry(
+ aUrls[nURLIdx] + "\t*");
pEntry->SetUserData( reinterpret_cast<void*>(nCount++) );
}
}