[Libreoffice-commits] core.git: svx/source

Muhammet Kara muhammet.kara at pardus.org.tr
Fri Jul 1 07:19:58 UTC 2016


 svx/source/accessibility/charmapacc.cxx                   |    7 ++-
 svx/source/accessibility/svxpixelctlaccessiblecontext.cxx |   11 ++--
 svx/source/dialog/_bmpmask.cxx                            |   30 +++++--------
 svx/source/dialog/_contdlg.cxx                            |   12 ++---
 svx/source/dialog/ctredlin.cxx                            |   32 +++++++-------
 5 files changed, 44 insertions(+), 48 deletions(-)

New commits:
commit 35de25aac00f9698c5df338bb6399384a71f6c1c
Author: Muhammet Kara <muhammet.kara at pardus.org.tr>
Date:   Thu Jun 30 11:16:15 2016 +0300

    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 at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/svx/source/accessibility/charmapacc.cxx b/svx/source/accessibility/charmapacc.cxx
index b1bc3b5..e8d6e05 100644
--- a/svx/source/accessibility/charmapacc.cxx
+++ b/svx/source/accessibility/charmapacc.cxx
@@ -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;
 }
diff --git a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
index 0253d24..a8aab19 100644
--- a/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
+++ b/svx/source/accessibility/svxpixelctlaccessiblecontext.cxx
@@ -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;
 }
 
diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx
index c3c711f..e3147f4 100644
--- a/svx/source/dialog/_bmpmask.cxx
+++ b/svx/source/dialog/_bmpmask.cxx
@@ -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);
 }
 
diff --git a/svx/source/dialog/_contdlg.cxx b/svx/source/dialog/_contdlg.cxx
index b27af8a..6e072e6 100644
--- a/svx/source/dialog/_contdlg.cxx
+++ b/svx/source/dialog/_contdlg.cxx
@@ -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 );
 }
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index d7538b1..677cc08 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -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);
 }


More information about the Libreoffice-commits mailing list