summaryrefslogtreecommitdiff
path: root/sw/source/ui
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/ui
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/ui')
-rw-r--r--sw/source/ui/dbui/mmlayoutpage.cxx12
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx30
-rw-r--r--sw/source/ui/envelp/envlop1.cxx4
-rw-r--r--sw/source/ui/fldui/changedb.cxx6
-rw-r--r--sw/source/ui/fldui/flddb.cxx8
-rw-r--r--sw/source/ui/fldui/fldfunc.cxx2
-rw-r--r--sw/source/ui/fldui/fldvar.cxx12
7 files changed, 37 insertions, 37 deletions
diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx
index a8a652d6e2ec..79af0846c5a5 100644
--- a/sw/source/ui/dbui/mmlayoutpage.cxx
+++ b/sw/source/ui/dbui/mmlayoutpage.cxx
@@ -318,10 +318,10 @@ SwFrameFormat* SwMailMergeLayoutPage::InsertAddressFrame(
SwFieldMgr aFieldMgr(&rShell);
//create a database string source.command.commandtype.column
const SwDBData& rData = rConfigItem.GetCurrentDBData();
- OUString sDBName(rData.sDataSource + OUString(DB_DELIM)
- + rData.sCommand + OUString(DB_DELIM));
+ OUString sDBName(rData.sDataSource + OUStringLiteral1<DB_DELIM>()
+ + rData.sCommand + OUStringLiteral1<DB_DELIM>());
const OUString sDatabaseConditionPrefix(sDBName.replace(DB_DELIM, '.'));
- sDBName += OUString::number(rData.nCommandType) + OUString(DB_DELIM);
+ sDBName += OUString::number(rData.nCommandType) + OUStringLiteral1<DB_DELIM>();
// if only the country is in an address line the
// paragraph has to be hidden depending on the
@@ -510,9 +510,9 @@ void SwMailMergeLayoutPage::InsertGreeting(SwWrtShell& rShell, SwMailMergeConfig
const OUString sConditionBase("[" + sCommonBase + sGenderColumn + "]");
const OUString sNameColumnBase("[" + sCommonBase + sNameColumn + "]");
- const OUString sDBName(rData.sDataSource + OUString(DB_DELIM)
- + rData.sCommand + OUString(DB_DELIM)
- + OUString::number(rData.nCommandType) + OUString(DB_DELIM));
+ const OUString sDBName(rData.sDataSource + OUStringLiteral1<DB_DELIM>()
+ + rData.sCommand + OUStringLiteral1<DB_DELIM>()
+ + OUString::number(rData.nCommandType) + OUStringLiteral1<DB_DELIM>());
// Female: [database.sGenderColumn] != "rFemaleGenderValue" && [database.NameColumn]
// Male: [database.sGenderColumn] == "rFemaleGenderValue" && [database.rGenderColumn]
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index ccdf15ef7f95..e5332fa0fbbb 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -210,11 +210,11 @@ void SectRepr::SetFile( const OUString& rFile )
if( !rFile.isEmpty() || !sSub.isEmpty() )
{
- sNewFile += OUString(sfx2::cTokenSeparator);
+ sNewFile += OUStringLiteral1<sfx2::cTokenSeparator>();
if( !rFile.isEmpty() ) // Filter only with FileName
sNewFile += sOldFileName.getToken( 1, sfx2::cTokenSeparator );
- sNewFile += OUString(sfx2::cTokenSeparator) + sSub;
+ sNewFile += OUStringLiteral1<sfx2::cTokenSeparator>() + sSub;
}
m_SectionData.SetLinkFileName( sNewFile );
@@ -237,10 +237,10 @@ void SectRepr::SetFilter( const OUString& rFilter )
const OUString sSub( sOldFileName.getToken( 2, sfx2::cTokenSeparator ) );
if( !sFile.isEmpty() )
- sNewFile = sFile + OUString(sfx2::cTokenSeparator) +
- rFilter + OUString(sfx2::cTokenSeparator) + sSub;
+ sNewFile = sFile + OUStringLiteral1<sfx2::cTokenSeparator>() +
+ rFilter + OUStringLiteral1<sfx2::cTokenSeparator>() + sSub;
else if( !sSub.isEmpty() )
- sNewFile = OUString(sfx2::cTokenSeparator) + OUString(sfx2::cTokenSeparator) + sSub;
+ sNewFile = OUStringLiteral1<sfx2::cTokenSeparator>() + OUStringLiteral1<sfx2::cTokenSeparator>() + sSub;
m_SectionData.SetLinkFileName( sNewFile );
@@ -259,8 +259,8 @@ void SectRepr::SetSubRegion(const OUString& rSubRegion)
const OUString sFilter( sLinkFileName.getToken( 0, sfx2::cTokenSeparator, n ) );
if( !rSubRegion.isEmpty() || !sOldFileName.isEmpty() )
- sNewFile = sOldFileName + OUString(sfx2::cTokenSeparator) +
- sFilter + OUString(sfx2::cTokenSeparator) + rSubRegion;
+ sNewFile = sOldFileName + OUStringLiteral1<sfx2::cTokenSeparator>() +
+ sFilter + OUStringLiteral1<sfx2::cTokenSeparator>() + rSubRegion;
m_SectionData.SetLinkFileName( sNewFile );
@@ -285,8 +285,8 @@ OUString SectRepr::GetFile() const
if (DDE_LINK_SECTION == m_SectionData.GetType())
{
sal_Int32 n = 0;
- return sLinkFile.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &n )
- .replaceFirst( OUString(sfx2::cTokenSeparator), " ", &n );
+ return sLinkFile.replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &n )
+ .replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &n );
}
return INetURLObject::decode( sLinkFile.getToken( 0, sfx2::cTokenSeparator ),
INetURLObject::DECODE_UNAMBIGUOUS );
@@ -1144,10 +1144,10 @@ IMPL_LINK_TYPED( SwEditRegionDlg, FileNameHdl, Edit&, rEdit, void )
{
OUString sLink( SwSectionData::CollapseWhiteSpaces(rEdit.GetText()) );
sal_Int32 nPos = 0;
- sLink = sLink.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos );
+ sLink = sLink.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos );
if (nPos>=0)
{
- sLink = sLink.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos );
+ sLink = sLink.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos );
}
pSectRepr->GetSectionData().SetLinkFileName( sLink );
@@ -1619,10 +1619,10 @@ bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* )
{
aLinkFile = SwSectionData::CollapseWhiteSpaces(sFileName);
sal_Int32 nPos = 0;
- aLinkFile = aLinkFile.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos );
+ aLinkFile = aLinkFile.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos );
if (nPos>=0)
{
- aLinkFile = aLinkFile.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nPos );
+ aLinkFile = aLinkFile.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nPos );
}
}
else
@@ -1638,8 +1638,8 @@ bool SwInsertSectionTabPage::FillItemSet( SfxItemSet* )
aSection.SetLinkFilePassword( m_sFilePasswd );
}
- aLinkFile += OUString(sfx2::cTokenSeparator) + m_sFilterName
- + OUString(sfx2::cTokenSeparator) + sSubRegion;
+ aLinkFile += OUStringLiteral1<sfx2::cTokenSeparator>() + m_sFilterName
+ + OUStringLiteral1<sfx2::cTokenSeparator>() + sSubRegion;
}
aSection.SetLinkFileName(aLinkFile);
diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx
index 398de3dab700..1c9d34d38007 100644
--- a/sw/source/ui/envelp/envlop1.cxx
+++ b/sw/source/ui/envelp/envlop1.cxx
@@ -226,7 +226,7 @@ SwEnvPage::SwEnvPage(vcl::Window* pParent, const SfxItemSet& rSet)
m_pPreview->SetBorderStyle( WindowBorderStyle::MONO );
SwDBData aData = pSh->GetDBData();
- sActDBName = aData.sDataSource + OUString(DB_DELIM) + aData.sCommand;
+ sActDBName = aData.sDataSource + OUStringLiteral1<DB_DELIM>() + aData.sCommand;
InitDatabaseBox();
}
@@ -256,7 +256,7 @@ IMPL_LINK_TYPED( SwEnvPage, DatabaseHdl, ListBox&, rListBox, void )
{
sActDBName = rListBox.GetSelectEntry();
pSh->GetDBManager()->GetTableNames(m_pTableLB, sActDBName);
- sActDBName += OUString(DB_DELIM);
+ sActDBName += OUStringLiteral1<DB_DELIM>();
}
else
{
diff --git a/sw/source/ui/fldui/changedb.cxx b/sw/source/ui/fldui/changedb.cxx
index ab3fd3565a5b..32a69db38ebd 100644
--- a/sw/source/ui/fldui/changedb.cxx
+++ b/sw/source/ui/fldui/changedb.cxx
@@ -192,7 +192,7 @@ void SwChangeDBDlg::UpdateFields()
if( m_pUsedDBTLB->GetParent( pEntry ))
{
OUString sTmp(m_pUsedDBTLB->GetEntryText( m_pUsedDBTLB->GetParent( pEntry )) +
- OUString(DB_DELIM) + m_pUsedDBTLB->GetEntryText( pEntry ) + OUString(DB_DELIM) +
+ OUStringLiteral1<DB_DELIM>() + m_pUsedDBTLB->GetEntryText( pEntry ) + OUStringLiteral1<DB_DELIM>() +
OUString::number((int)reinterpret_cast<sal_uLong>(pEntry->GetUserData())));
aDBNames.push_back(sTmp);
}
@@ -205,9 +205,9 @@ void SwChangeDBDlg::UpdateFields()
sal_Bool bIsTable = false;
const OUString DBName(m_pAvailDBTLB->GetDBName(sTableName, sColumnName, &bIsTable));
const OUString sTemp = DBName
- + OUString(DB_DELIM)
+ + OUStringLiteral1<DB_DELIM>()
+ sTableName
- + OUString(DB_DELIM)
+ + OUStringLiteral1<DB_DELIM>()
+ OUString::number(bIsTable
? CommandType::TABLE
: CommandType::QUERY);
diff --git a/sw/source/ui/fldui/flddb.cxx b/sw/source/ui/fldui/flddb.cxx
index bd2f636e6b67..cdd2cd71f839 100644
--- a/sw/source/ui/fldui/flddb.cxx
+++ b/sw/source/ui/fldui/flddb.cxx
@@ -219,14 +219,14 @@ bool SwFieldDBPage::FillItemSet(SfxItemSet* )
sal_uInt16 nSubType = 0;
OUString sDBName = aData.sDataSource
- + OUString(DB_DELIM)
+ + OUStringLiteral1<DB_DELIM>()
+ aData.sCommand
- + OUString(DB_DELIM)
+ + OUStringLiteral1<DB_DELIM>()
+ OUString::number(aData.nCommandType)
- + OUString(DB_DELIM);
+ + OUStringLiteral1<DB_DELIM>();
if (!sColumnName.isEmpty())
{
- sDBName += sColumnName + OUString(DB_DELIM);
+ sDBName += sColumnName + OUStringLiteral1<DB_DELIM>();
}
OUString aName = sDBName + m_pConditionED->GetText();
diff --git a/sw/source/ui/fldui/fldfunc.cxx b/sw/source/ui/fldui/fldfunc.cxx
index 5f3a1701f771..5e9713324f39 100644
--- a/sw/source/ui/fldui/fldfunc.cxx
+++ b/sw/source/ui/fldui/fldfunc.cxx
@@ -575,7 +575,7 @@ bool SwFieldFuncPage::FillItemSet(SfxItemSet* )
for(sal_Int32 i = 0; i < m_pListItemsLB->GetEntryCount(); i++)
{
if(i)
- aVal += OUString(DB_DELIM);
+ aVal += OUStringLiteral1<DB_DELIM>();
aVal += m_pListItemsLB->GetEntry(i);
}
}
diff --git a/sw/source/ui/fldui/fldvar.cxx b/sw/source/ui/fldui/fldvar.cxx
index 3d162721e960..2fa1dad31833 100644
--- a/sw/source/ui/fldui/fldvar.cxx
+++ b/sw/source/ui/fldui/fldvar.cxx
@@ -473,8 +473,8 @@ void SwFieldVarPage::SubTypeHdl(ListBox* pBox)
// That's not considered here yet
OUString sCmd( pType->GetCmd() );
sal_Int32 nTmpPos = 0;
- sCmd = sCmd.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &nTmpPos );
- sCmd = sCmd.replaceFirst( OUString(sfx2::cTokenSeparator), " ", &nTmpPos );
+ sCmd = sCmd.replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &nTmpPos );
+ sCmd = sCmd.replaceFirst( OUStringLiteral1<sfx2::cTokenSeparator>(), " ", &nTmpPos );
m_pValueED->SetText( sCmd );
m_pFormatLB->SelectEntryPos(static_cast<int>(pType->GetType()));
@@ -1040,8 +1040,8 @@ IMPL_LINK_TYPED( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void )
// DDE-Topics/-Items can have blanks in their names!
// That's not being considered here yet.
sal_Int32 nTmpPos = 0;
- sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
- sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
+ sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos );
+ sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos );
static_cast<SwDDEFieldType*>(pType)->SetCmd(sValue);
static_cast<SwDDEFieldType*>(pType)->SetType(static_cast<SfxLinkUpdateMode>(nFormat));
}
@@ -1079,8 +1079,8 @@ IMPL_LINK_TYPED( SwFieldVarPage, TBClickHdl, ToolBox *, pBox, void )
// DDE-Topics/-Items can have blanks in their names!
// That's not being considered here yet.
sal_Int32 nTmpPos = 0;
- sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
- sValue = sValue.replaceFirst( " ", OUString(sfx2::cTokenSeparator), &nTmpPos );
+ sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos );
+ sValue = sValue.replaceFirst( " ", OUStringLiteral1<sfx2::cTokenSeparator>(), &nTmpPos );
SwDDEFieldType aType(sName, sValue, static_cast<SfxLinkUpdateMode>(nFormat));
m_pSelectionLB->InsertEntry(sName);