summaryrefslogtreecommitdiff
path: root/sw/source/uibase
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-08-28 22:47:02 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-08-29 11:44:44 +0000
commitbdd60f1f5e0b995572321fd0865ccb8849d8ed76 (patch)
tree36fd199eded442f12c223a6b9830e5202c85855c /sw/source/uibase
parent2c10714426cc813c36aa82e4870b7b51c5c03050 (diff)
Adapt loplugin:stringconstant to improved OUStringLiteral1
Change-Id: Ibc5128df8bcf8cb5f2f09551c0de6dfdb46bdee0 Reviewed-on: https://gerrit.libreoffice.org/28447 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r--sw/source/uibase/dbui/dbmgr.cxx9
-rw-r--r--sw/source/uibase/dialog/regionsw.cxx4
-rw-r--r--sw/source/uibase/docvw/edtwin2.cxx2
-rw-r--r--sw/source/uibase/fldui/fldmgr.cxx8
-rw-r--r--sw/source/uibase/ribbar/inputwin.cxx12
-rw-r--r--sw/source/uibase/shells/textfld.cxx8
-rw-r--r--sw/source/uibase/shells/textsh2.cxx11
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx8
-rw-r--r--sw/source/uibase/wrtsh/wrtsh2.cxx8
9 files changed, 31 insertions, 39 deletions
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 9642b265ee1e..9fd1ce6653a6 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -527,11 +527,10 @@ bool SwDBManager::Merge( const SwMergeDescriptor& rMergeDesc )
std::vector<OUString> aDBNames;
aDBNames.push_back(OUString());
SwDBData aInsertData = pWorkShell->GetDBData();
- OUString sDBName = aInsertData.sDataSource;
- sDBName += OUString(DB_DELIM);
- sDBName += aInsertData.sCommand;
- sDBName += OUString(DB_DELIM);
- sDBName += OUString::number(aInsertData.nCommandType);
+ OUString sDBName = aInsertData.sDataSource
+ + OUStringLiteral1<DB_DELIM>() + aInsertData.sCommand
+ + OUStringLiteral1<DB_DELIM>()
+ + OUString::number(aInsertData.nCommandType);
pWorkShell->ChangeDBFields( aDBNames, sDBName);
SetInitDBFields(false);
}
diff --git a/sw/source/uibase/dialog/regionsw.cxx b/sw/source/uibase/dialog/regionsw.cxx
index 207fb5192169..8c6ce8279852 100644
--- a/sw/source/uibase/dialog/regionsw.cxx
+++ b/sw/source/uibase/dialog/regionsw.cxx
@@ -154,8 +154,8 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
if(!aFile.isEmpty() || !aSub.isEmpty())
{
- OUString sLinkFileName = OUString(sfx2::cTokenSeparator);
- sLinkFileName += OUString(sfx2::cTokenSeparator);
+ OUString sLinkFileName = OUStringLiteral1<sfx2::cTokenSeparator>()
+ + OUStringLiteral1<sfx2::cTokenSeparator>();
sLinkFileName = comphelper::string::setToken(sLinkFileName, 0, sfx2::cTokenSeparator, aFile);
if(SfxItemState::SET ==
diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx
index 0d2517129de4..edf3aab7ca9b 100644
--- a/sw/source/uibase/docvw/edtwin2.cxx
+++ b/sw/source/uibase/docvw/edtwin2.cxx
@@ -202,7 +202,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt)
if( !sText.isEmpty() )
{
- OUStringBuffer sTmp(sText.replaceAll(OUString(sal_Unicode(0xad)), ""));
+ OUStringBuffer sTmp(sText.replaceAll(OUStringLiteral1<0xad>(), ""));
for (sal_Int32 i = 0; i < sTmp.getLength(); ++i)
{
if (sTmp[i] < 0x20)
diff --git a/sw/source/uibase/fldui/fldmgr.cxx b/sw/source/uibase/fldui/fldmgr.cxx
index 29677576858d..e6c9a174ce0f 100644
--- a/sw/source/uibase/fldui/fldmgr.cxx
+++ b/sw/source/uibase/fldui/fldmgr.cxx
@@ -946,10 +946,10 @@ bool SwFieldMgr::InsertField(
//JP 28.08.95: DDE-Topics/-Items can have blanks in their names!
// That's not yet considered here.
sal_Int32 nIndex = 0;
- OUString sCmd = rData.m_sPar2.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex);
+ OUString sCmd = rData.m_sPar2.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex);
if (nIndex>=0 && ++nIndex<sCmd.getLength())
{
- sCmd = sCmd.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex);
+ sCmd = sCmd.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex);
}
SwDDEFieldType aType( rData.m_sPar1, sCmd, static_cast<SfxLinkUpdateMode>(nFormatId) );
@@ -1397,10 +1397,10 @@ void SwFieldMgr::UpdateCurField(sal_uLong nFormat,
// DDE-Topics/-Items can have blanks in their names!
// That's not yet considered here!
sal_Int32 nIndex = 0;
- sPar2 = sPar2.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex );
+ sPar2 = sPar2.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex );
if (nIndex>=0 && ++nIndex<sPar2.getLength())
{
- sPar2 = sPar2.replaceFirst(" ", OUString(sfx2::cTokenSeparator), &nIndex);
+ sPar2 = sPar2.replaceFirst(" ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nIndex);
}
break;
}
diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx
index 84acdb149e58..357c18e3b74f 100644
--- a/sw/source/uibase/ribbar/inputwin.cxx
+++ b/sw/source/uibase/ribbar/inputwin.cxx
@@ -433,10 +433,8 @@ IMPL_LINK_TYPED( SwInputWindow, SelTableCellsNotify, SwWrtShell&, rCaller, void
aEdit->UpdateRange( sBoxNms, sTableNm );
- OUString sNew;
- sNew += OUString(CH_LRE);
- sNew += aEdit->GetText();
- sNew += OUString(CH_PDF);
+ OUString sNew = OUStringLiteral1<CH_LRE>() + aEdit->GetText()
+ + OUStringLiteral1<CH_PDF>();
if( sNew != sOldFormula )
{
@@ -483,10 +481,8 @@ IMPL_LINK_NOARG_TYPED(SwInputWindow, ModifyHdl, Edit&, void)
{
pWrtShell->StartAllAction();
DelBoxContent();
- OUString sNew;
- sNew += OUString(CH_LRE);
- sNew += aEdit->GetText();
- sNew += OUString(CH_PDF);
+ OUString sNew = OUStringLiteral1<CH_LRE>() + aEdit->GetText()
+ + OUStringLiteral1<CH_PDF>();
pWrtShell->SwEditShell::Insert2( sNew );
pWrtShell->EndAllAction();
sOldFormula = sNew;
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx
index e9db87ffe399..04f3ea1dcd93 100644
--- a/sw/source/uibase/shells/textfld.cxx
+++ b/sw/source/uibase/shells/textfld.cxx
@@ -231,7 +231,7 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if( SfxItemState::SET == pArgs->GetItemState( FN_PARAM_FIELD_TYPE,
false, &pItem ))
nType = static_cast<const SfxUInt16Item *>(pItem)->GetValue();
- aPar1 += OUString(DB_DELIM);
+ aPar1 += OUStringLiteral1<DB_DELIM>();
if( SfxItemState::SET == pArgs->GetItemState(
FN_PARAM_1, false, &pItem ))
{
@@ -240,9 +240,9 @@ void SwTextShell::ExecField(SfxRequest &rReq)
if( SfxItemState::SET == pArgs->GetItemState(
FN_PARAM_3, false, &pItem ))
nCommand = static_cast<const SfxInt32Item*>(pItem)->GetValue();
- aPar1 += OUString(DB_DELIM);
- aPar1 += OUString::number(nCommand);
- aPar1 += OUString(DB_DELIM);
+ aPar1 += OUStringLiteral1<DB_DELIM>()
+ + OUString::number(nCommand)
+ + OUStringLiteral1<DB_DELIM>();
if( SfxItemState::SET == pArgs->GetItemState(
FN_PARAM_2, false, &pItem ))
{
diff --git a/sw/source/uibase/shells/textsh2.cxx b/sw/source/uibase/shells/textsh2.cxx
index 47969fa7b26f..b386e6ac20cc 100644
--- a/sw/source/uibase/shells/textsh2.cxx
+++ b/sw/source/uibase/shells/textsh2.cxx
@@ -196,13 +196,10 @@ void SwTextShell::ExecDB(SfxRequest &rReq)
OUString sColumnName;
if(pColumnNameItem)
static_cast<const SfxUsrAnyItem*>(pColumnNameItem)->GetValue() >>= sColumnName;
- OUString sDBName = sSourceArg;
- sDBName += OUString(DB_DELIM);
- sDBName += sCommandArg;
- sDBName += OUString(DB_DELIM);
- sDBName += OUString::number(nCommandTypeArg);
- sDBName += OUString(DB_DELIM);
- sDBName += sColumnName;
+ OUString sDBName = sSourceArg + OUStringLiteral1<DB_DELIM>()
+ + sCommandArg + OUStringLiteral1<DB_DELIM>()
+ + OUString::number(nCommandTypeArg)
+ + OUStringLiteral1<DB_DELIM>() + sColumnName;
SwFieldMgr aFieldMgr(GetShellPtr());
SwInsertField_Data aData(TYP_DBFLD, 0, sDBName, OUString(), 0);
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 1030003ba4a0..8fc22cb2e39e 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -1369,10 +1369,10 @@ IMPL_LINK_TYPED( SwGlobalTree, DialogClosedHdl, sfx2::FileDialogHelper*, _pFileD
sal_Int32 nPos = 0;
for (SfxMedium* pMed : *pMedList)
{
- OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE );
- sFileName += OUString(sfx2::cTokenSeparator);
- sFileName += pMed->GetFilter()->GetFilterName();
- sFileName += OUString(sfx2::cTokenSeparator);
+ OUString sFileName = pMed->GetURLObject().GetMainURL( INetURLObject::NO_DECODE )
+ + OUStringLiteral1<sfx2::cTokenSeparator>()
+ + pMed->GetFilter()->GetFilterName()
+ + OUStringLiteral1<sfx2::cTokenSeparator>();
pFileNames[nPos++] = sFileName;
}
pMedList.reset();
diff --git a/sw/source/uibase/wrtsh/wrtsh2.cxx b/sw/source/uibase/wrtsh/wrtsh2.cxx
index aba44d2265bc..5b65e86a5ecd 100644
--- a/sw/source/uibase/wrtsh/wrtsh2.cxx
+++ b/sw/source/uibase/wrtsh/wrtsh2.cxx
@@ -553,10 +553,10 @@ void SwWrtShell::NavigatorPaste( const NaviContentBookmark& rBkmk,
else
{
SwSectionData aSection( FILE_LINK_SECTION, GetUniqueSectionName() );
- OUString aLinkFile( rBkmk.GetURL().getToken(0, '#') );
- aLinkFile += OUString(sfx2::cTokenSeparator);
- aLinkFile += OUString(sfx2::cTokenSeparator);
- aLinkFile += rBkmk.GetURL().getToken(1, '#');
+ OUString aLinkFile = rBkmk.GetURL().getToken(0, '#')
+ + OUStringLiteral1<sfx2::cTokenSeparator>()
+ + OUStringLiteral1<sfx2::cTokenSeparator>()
+ + rBkmk.GetURL().getToken(1, '#');
aSection.SetLinkFileName( aLinkFile );
aSection.SetProtectFlag( true );
const SwSection* pIns = InsertSection( aSection );