Improve readability of OUString concatanation in SvxPixelCtlAccessible

, SvxShowCharSetVirtualAcc
, SvxBmpMask
, SvxSuperContourDlg
, and SvxTPView

It is more readable and more efficient as a bonus.
See: https://goo.gl/jsVAwy:

Change-Id: Id0641673e1e6fb04b3193c2b8e9a2ab3156b4552
Reviewed-on: https://gerrit.libreoffice.org/26794
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
This commit is contained in:
Muhammet Kara
2016-06-30 11:16:15 +03:00
committed by Noel Grandin
parent 1a13a9a46a
commit 35de25aac0
5 changed files with 44 additions and 48 deletions

View File

@@ -644,7 +644,7 @@ OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleDescription()
{
OExternalLockGuard aGuard( this );
ensureAlive();
OUString sDescription = SVX_RESSTR( RID_SVXSTR_CHARACTER_CODE );
OUString sDescription;
const OUString aCharStr( mpParent->maText);
sal_Int32 nStrIndex = 0;
@@ -660,7 +660,10 @@ OUString SAL_CALL SvxShowCharSetItemAcc::getAccessibleDescription()
}
if( c < 256 )
snprintf( buf+6, 10, " (%" SAL_PRIuUINT32 ")", c );
sDescription += " " + OUString(buf, strlen(buf), RTL_TEXTENCODING_ASCII_US);
sDescription = SVX_RESSTR( RID_SVXSTR_CHARACTER_CODE )
+ " "
+ OUString(buf, strlen(buf), RTL_TEXTENCODING_ASCII_US);
return sDescription;
}

View File

@@ -843,12 +843,11 @@ OUString SvxPixelCtlAccessibleChild::GetName()
sal_Int32 nXIndex = mnIndexInParent % mrParentWindow.GetLineCount();
sal_Int32 nYIndex = mnIndexInParent / mrParentWindow.GetLineCount();
OUString str;
str += "(";
str += OUString::number(nXIndex);
str += ",";
str += OUString::number(nYIndex);
str += ")";
OUString str = "("
+ OUString::number(nXIndex)
+ ","
+ OUString::number(nYIndex)
+ ")";
return str;
}

View File

@@ -420,37 +420,34 @@ SvxBmpMask::SvxBmpMask(SfxBindings *pBindinx, SfxChildWindow *pCW, vcl::Window*
m_pLbColor4->SetGetFocusHdl( LINK( pData, MaskData, FocusLbHdl ) );
m_pLbColorTrans->Disable();
OUString sColorPalette (BMP_RESID( RID_SVXDLG_BMPMASK_STR_PALETTE));
OUString sColorPaletteN;
m_pQSet1->SetStyle( m_pQSet1->GetStyle() | WB_DOUBLEBORDER | WB_ITEMBORDER );
m_pQSet1->SetColCount();
m_pQSet1->SetLineCount( 1 );
OUString sColorPalette (BMP_RESID( RID_SVXDLG_BMPMASK_STR_PALETTE));
OUString sColorPaletteN;
sColorPaletteN = sColorPalette;
sColorPaletteN += " 1";
sColorPaletteN = sColorPalette + " 1";
m_pQSet1->InsertItem( 1, aPipetteColor, sColorPaletteN);
m_pQSet1->SelectItem( 1 );
m_pQSet2->SetStyle( m_pQSet2->GetStyle() | WB_DOUBLEBORDER | WB_ITEMBORDER );
m_pQSet2->SetColCount();
m_pQSet2->SetLineCount( 1 );
sColorPaletteN = sColorPalette;
sColorPaletteN += " 2";
sColorPaletteN = sColorPalette + " 2";
m_pQSet2->InsertItem( 1, aPipetteColor, sColorPaletteN);
m_pQSet2->SelectItem( 0 );
m_pQSet3->SetStyle( m_pQSet3->GetStyle() | WB_DOUBLEBORDER | WB_ITEMBORDER );
m_pQSet3->SetColCount();
m_pQSet3->SetLineCount( 1 );
sColorPaletteN = sColorPalette;
sColorPaletteN += " 3";
sColorPaletteN = sColorPalette + " 3";
m_pQSet3->InsertItem( 1, aPipetteColor, sColorPaletteN);
m_pQSet3->SelectItem( 0 );
m_pQSet4->SetStyle( m_pQSet4->GetStyle() | WB_DOUBLEBORDER | WB_ITEMBORDER );
m_pQSet4->SetColCount();
m_pQSet4->SetLineCount( 1 );
sColorPaletteN = sColorPalette;
sColorPaletteN += " 4";
sColorPaletteN = sColorPalette + " 4";
m_pQSet4->InsertItem( 1, aPipetteColor, sColorPaletteN);
m_pQSet4->SelectItem( 0 );
@@ -1130,17 +1127,14 @@ void SvxBmpMask::SetAccessibleNames()
// set the accessible name for valueset
OUString sColorPalette (BMP_RESID( RID_SVXDLG_BMPMASK_STR_PALETTE));
OUString sColorPaletteN;
sColorPaletteN = sColorPalette;
sColorPaletteN += " 1";
sColorPaletteN = sColorPalette + " 1";
m_pQSet1->SetText (sColorPaletteN);
sColorPaletteN = sColorPalette;
sColorPaletteN += " 2";
sColorPaletteN = sColorPalette + " 2";
m_pQSet2->SetText (sColorPaletteN);
sColorPaletteN = sColorPalette;
sColorPaletteN += " 3";
sColorPaletteN = sColorPalette + " 3";
m_pQSet3->SetText (sColorPaletteN);
sColorPaletteN = sColorPalette;
sColorPaletteN += " 4";
sColorPaletteN = sColorPalette + " 4";
m_pQSet4->SetText (sColorPaletteN);
}

View File

@@ -545,9 +545,9 @@ IMPL_LINK_TYPED( SvxSuperContourDlg, MousePosHdl, GraphCtrl*, pWnd, void )
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0];
aStr = GetUnitString( rMousePos.X(), eFieldUnit, cSep );
aStr += " / ";
aStr += GetUnitString( rMousePos.Y(), eFieldUnit, cSep );
aStr = GetUnitString( rMousePos.X(), eFieldUnit, cSep )
+ " / "
+ GetUnitString( rMousePos.Y(), eFieldUnit, cSep );
m_pStbStatus->SetItemText( 2, aStr );
}
@@ -560,9 +560,9 @@ IMPL_LINK_TYPED( SvxSuperContourDlg, GraphSizeHdl, GraphCtrl*, pWnd, void )
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
const sal_Unicode cSep = rLocaleWrapper.getNumDecimalSep()[0];
aStr = GetUnitString( rSize.Width(), eFieldUnit, cSep );
aStr += " x ";
aStr += GetUnitString( rSize.Height(), eFieldUnit, cSep );
aStr = GetUnitString( rSize.Width(), eFieldUnit, cSep )
+ " x "
+ GetUnitString( rSize.Height(), eFieldUnit, cSep );
m_pStbStatus->SetItemText( 3, aStr );
}

View File

@@ -436,13 +436,13 @@ void SvxTPView::InsertWriterHeader()
m_pViewData->SetTabs(pTabs);
OUString aStrTab('\t');
OUString aString(get<FixedText>("action")->GetText());
aString += aStrTab;
aString += get<FixedText>("author")->GetText();
aString += aStrTab;
aString += get<FixedText>("date")->GetText();
aString += aStrTab;
aString += get<FixedText>("comment")->GetText();
OUString aString = get<FixedText>("action")->GetText()
+ aStrTab
+ get<FixedText>("author")->GetText()
+ aStrTab
+ get<FixedText>("date")->GetText()
+ aStrTab
+ get<FixedText>("comment")->GetText();
m_pViewData->ClearHeader();
m_pViewData->InsertHeaderEntry(aString);
}
@@ -453,15 +453,15 @@ void SvxTPView::InsertCalcHeader()
m_pViewData->SetTabs(pTabs);
OUString aStrTab('\t');
OUString aString(get<FixedText>("action")->GetText());
aString += aStrTab;
aString += get<FixedText>("position")->GetText();
aString += aStrTab;
aString += get<FixedText>("author")->GetText();
aString += aStrTab;
aString += get<FixedText>("date")->GetText();
aString += aStrTab;
aString += get<FixedText>("comment")->GetText();
OUString aString = get<FixedText>("action")->GetText()
+ aStrTab
+ get<FixedText>("position")->GetText()
+ aStrTab
+ get<FixedText>("author")->GetText()
+ aStrTab
+ get<FixedText>("date")->GetText()
+ aStrTab
+ get<FixedText>("comment")->GetText();
m_pViewData->ClearHeader();
m_pViewData->InsertHeaderEntry(aString);
}