Kaydet (Commit) 3351ebde authored tarafından Matteo Casalin's avatar Matteo Casalin

OUString: remove temporaries and repeated expressions

Change-Id: I1d86be40c4bde4e8fb51c430c6416165655c055c
üst b50155ae
...@@ -193,9 +193,8 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh) ...@@ -193,9 +193,8 @@ SwColumnDlg::SwColumnDlg(Window* pParent, SwWrtShell& rSh)
const sal_Int32 nPagePos = m_pApplyToLB->GetEntryPos( (void*) LISTBOX_PAGE ); const sal_Int32 nPagePos = m_pApplyToLB->GetEntryPos( (void*) LISTBOX_PAGE );
if (pPageSet && pPageDesc) if (pPageSet && pPageDesc)
{ {
OUString sPageStr = m_pApplyToLB->GetEntry(nPagePos); const OUString sPageStr = m_pApplyToLB->GetEntry(nPagePos) + pPageDesc->GetName();
m_pApplyToLB->RemoveEntry(nPagePos); m_pApplyToLB->RemoveEntry(nPagePos);
sPageStr += pPageDesc->GetName();
m_pApplyToLB->InsertEntry( sPageStr, nPagePos ); m_pApplyToLB->InsertEntry( sPageStr, nPagePos );
m_pApplyToLB->SetEntryData( nPagePos, (void*) LISTBOX_PAGE); m_pApplyToLB->SetEntryData( nPagePos, (void*) LISTBOX_PAGE);
} }
...@@ -915,41 +914,28 @@ void SwColumnPage::UpdateCols() ...@@ -915,41 +914,28 @@ void SwColumnPage::UpdateCols()
void SwColumnPage::SetLabels( sal_uInt16 nVis ) void SwColumnPage::SetLabels( sal_uInt16 nVis )
{ {
OUString sLbl( '~' ); const OUString sLbl( '~' );
OUString sLbl2( OUString::number( nVis + 1 )); const OUString sLbl1(OUString::number( nVis + 1 ));
OUString tmp1(sLbl2); m_pLbl1->SetText(sLbl1 + sLbl);
sLbl2 = sLbl2.replaceAt(sLbl2.getLength() - 1, 0, sLbl);
m_pLbl1->SetText(sLbl2); const OUString sLbl2(OUString::number( nVis + 2 ));
m_pLbl2->SetText(sLbl2 + sLbl);
sLbl2 = OUString::number( nVis + 2 );
OUString tmp2(sLbl2); const OUString sLbl3(OUString::number( nVis + 3 ));
sLbl2 = sLbl2.replaceAt(sLbl2.getLength() - 1, 0, sLbl); m_pLbl3->SetText(sLbl3 + sLbl);
m_pLbl2->SetText(sLbl2);
const OUString sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
sLbl2 = OUString::number( nVis + 3 ); aEd1.SetAccessibleName(sColumnWidth.replaceFirst("%1", sLbl1));
OUString tmp3(sLbl2); aEd2.SetAccessibleName(sColumnWidth.replaceFirst("%1", sLbl2));
sLbl2 = sLbl2.replaceAt(sLbl2.getLength() - 1, 0, sLbl); aEd3.SetAccessibleName(sColumnWidth.replaceFirst("%1", sLbl3));
m_pLbl3->SetText(sLbl2);
OUString sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ; const OUString sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
aEd1.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp1)); aDistEd1.SetAccessibleName(
sDist.replaceFirst("%1", sLbl1).replaceFirst("%2", sLbl2));
sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
aEd2.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp2)); aDistEd2.SetAccessibleName(
sDist.replaceFirst("%1", sLbl2).replaceFirst("%2", sLbl3));
sColumnWidth = SW_RESSTR( STR_ACCESS_COLUMN_WIDTH ) ;
aEd3.SetAccessibleName(sColumnWidth.replaceFirst("%1", tmp3));
OUString sDist = SW_RESSTR( STR_ACCESS_PAGESETUP_SPACING ) ;
OUString sDist1 = sDist;
sDist1 = sDist1.replaceFirst("%1", tmp1);
sDist1 = sDist1.replaceFirst("%2", tmp2);
aDistEd1.SetAccessibleName(sDist1);
OUString sDist2 = sDist;
sDist2 = sDist2.replaceFirst("%1", tmp2);
sDist2 = sDist2.replaceFirst("%2", tmp3);
aDistEd2.SetAccessibleName(sDist2);
} }
/*------------------------------------------------------------------------ /*------------------------------------------------------------------------
......
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