Kaydet (Commit) 90370f6c authored tarafından Matteo Casalin's avatar Matteo Casalin

OUString: constify, avoid temporaries and concatenated appends

Change-Id: I3d96fd410d84536006306a2fdae5cc796801ebaf
üst 636813a0
...@@ -148,7 +148,7 @@ bool SwCondCollPage::FillItemSet(SfxItemSet &rSet) ...@@ -148,7 +148,7 @@ bool SwCondCollPage::FillItemSet(SfxItemSet &rSet)
SwCondCollItem aCondItem; SwCondCollItem aCondItem;
for (size_t i = 0; i < m_aStrArr.size(); ++i) for (size_t i = 0; i < m_aStrArr.size(); ++i)
{ {
OUString sEntry = m_pTbLinks->GetEntryText(i, 1); const OUString sEntry = m_pTbLinks->GetEntryText(i, 1);
aCondItem.SetStyle( &sEntry, i); aCondItem.SetStyle( &sEntry, i);
} }
rSet.Put(aCondItem); rSet.Put(aCondItem);
...@@ -229,8 +229,7 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn) ...@@ -229,8 +229,7 @@ IMPL_LINK( SwCondCollPage, AssignRemoveHdl, PushButton*, pBtn)
return 0; return 0;
} }
OUString sSel = m_aStrArr[nPos]; OUString sSel = m_aStrArr[nPos] + "\t";
sSel += "\t";
const sal_Bool bAssEnabled = pBtn != m_pRemovePB && m_pAssignPB->IsEnabled(); const sal_Bool bAssEnabled = pBtn != m_pRemovePB && m_pAssignPB->IsEnabled();
m_pAssignPB->Enable( !bAssEnabled ); m_pAssignPB->Enable( !bAssEnabled );
...@@ -270,12 +269,11 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox) ...@@ -270,12 +269,11 @@ IMPL_LINK( SwCondCollPage, SelectHdl, ListBox*, pBox)
} }
else else
{ {
OUString sTbEntry;
SvTreeListEntry* pE = m_pTbLinks->FirstSelected(); SvTreeListEntry* pE = m_pTbLinks->FirstSelected();
if(pE) const OUString sTbEntry = pE
sTbEntry = m_pTbLinks->GetEntryText(pE); ? m_pTbLinks->GetEntryText(pE).getToken(1, '\t')
sTbEntry = sTbEntry.getToken(1, '\t'); : OUString();
OUString sStyle = m_pStyleLB->GetSelectEntry(); const OUString sStyle = m_pStyleLB->GetSelectEntry();
m_pAssignPB->Enable( sStyle != sTbEntry && m_pConditionCB->IsChecked() ); m_pAssignPB->Enable( sStyle != sTbEntry && m_pConditionCB->IsChecked() );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment