[Libreoffice-commits] core.git: filter/source framework/source svtools/source

Fakabbir Amin fakabbir at gmail.com
Thu Feb 16 08:51:51 UTC 2017


 filter/source/svg/svgwriter.cxx                         |   20 +++++-----
 filter/source/xsltdialog/xmlfiltersettingsdialog.cxx    |   11 +----
 framework/source/fwe/xml/xmlnamespaces.cxx              |    7 +--
 framework/source/helper/titlebarupdate.cxx              |    7 +--
 framework/source/uielement/generictoolbarcontroller.cxx |    3 -
 framework/source/uielement/menubarmanager.cxx           |    3 -
 svtools/source/brwbox/brwbox3.cxx                       |   30 +++++++--------
 svtools/source/contnr/fileview.cxx                      |   31 ++++++---------
 svtools/source/contnr/treelistbox.cxx                   |    9 +---
 svtools/source/control/calendar.cxx                     |   32 +++++++---------
 10 files changed, 65 insertions(+), 88 deletions(-)

New commits:
commit 9d8c206ee4a5c130e11a4e786b4286f3362f9ca1
Author: Fakabbir Amin <fakabbir at gmail.com>
Date:   Wed Feb 15 15:47:31 2017 +0530

    tdf#100726 Improved readability of OUString concatenations
    
    Cleanup in filter, framework and svtools directory.
    
    Change-Id: Icf4f04cff1207e58ce55ea3dc8c21b0635c3b6ec
    Reviewed-on: https://gerrit.libreoffice.org/34298
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Stephan Bergmann <sbergman at redhat.com>

diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 1fed990..82d5424 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -1817,10 +1817,10 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
 
         if( nSize > 1 )
         {
-            aPathData += "M ";
-            aPathData += OUString::number( ( aPolyPoint = rPoly[ 0 ] ).X() );
-            aPathData += aComma;
-            aPathData += OUString::number( aPolyPoint.Y() );
+            aPathData += "M "
+                        + OUString::number( ( aPolyPoint = rPoly[ 0 ] ).X() )
+                        + aComma
+                        + OUString::number( aPolyPoint.Y() );
 
             sal_Char nCurrentMode = 0;
             const bool bClose(!bLine || rPoly[0] == rPoly[nSize - 1]);
@@ -1839,9 +1839,9 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
                     {
                         if ( j )
                             aPathData += aBlank;
-                        aPathData += OUString::number( ( aPolyPoint = rPoly[ n++ ] ).X() );
-                        aPathData += aComma;
-                        aPathData += OUString::number( aPolyPoint.Y() );
+                        aPathData += OUString::number( ( aPolyPoint = rPoly[ n++ ] ).X() )
+                                    + aComma
+                                    + OUString::number( aPolyPoint.Y() );
                     }
                 }
                 else
@@ -1851,9 +1851,9 @@ OUString SVGActionWriter::GetPathString( const tools::PolyPolygon& rPolyPoly, bo
                         nCurrentMode = 'L';
                         aPathData += "L ";
                     }
-                    aPathData += OUString::number( ( aPolyPoint = rPoly[ n++ ] ).X() );
-                    aPathData += aComma;
-                    aPathData += OUString::number( aPolyPoint.Y() );
+                    aPathData += OUString::number( ( aPolyPoint = rPoly[ n++ ] ).X() )
+                                + aComma
+                                + OUString::number( aPolyPoint.Y() );
                 }
             }
 
diff --git a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
index 1c0bc8f..05bf27c 100644
--- a/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
+++ b/filter/source/xsltdialog/xmlfiltersettingsdialog.cxx
@@ -341,9 +341,7 @@ OUString XMLFilterSettingsDialog::createUniqueFilterName( const OUString& rFilte
 
     while( mxFilterContainer->hasByName( aFilterName ) )
     {
-        aFilterName = rFilterName;
-        aFilterName += aSpace;
-        aFilterName += OUString::number( nId++ );
+        aFilterName = rFilterName + aSpace + OUString::number( nId++ );
     }
 
     return aFilterName;
@@ -360,9 +358,7 @@ OUString XMLFilterSettingsDialog::createUniqueTypeName( const OUString& rTypeNam
 
     while( mxFilterContainer->hasByName( aTypeName ) )
     {
-        aTypeName = rTypeName;
-        aTypeName += aSpace;
-        aTypeName += OUString::number( nId++ );
+        aTypeName = rTypeName + aSpace + OUString::number( nId++ );
     }
 
     return aTypeName;
@@ -595,8 +591,7 @@ bool XMLFilterSettingsDialog::insertOrEdit( filter_info_impl* pNewInfo, const fi
         OUString aDocType;
         if( !pFilterEntry->maDocType.match( m_sDocTypePrefix ) )
         {
-            aDocType = m_sDocTypePrefix;
-            aDocType += pFilterEntry->maDocType;
+            aDocType = m_sDocTypePrefix + pFilterEntry->maDocType;
         }
         else
         {
diff --git a/framework/source/fwe/xml/xmlnamespaces.cxx b/framework/source/fwe/xml/xmlnamespaces.cxx
index 7b103ea..0562d56 100644
--- a/framework/source/fwe/xml/xmlnamespaces.cxx
+++ b/framework/source/fwe/xml/xmlnamespaces.cxx
@@ -102,9 +102,7 @@ OUString XMLNamespaces::applyNSToAttributeName( const OUString& aName ) const
     {
         if ( aName.getLength() > index+1 )
         {
-            OUString aAttributeName = getNamespaceValue( aName.copy( 0, index ) );
-            aAttributeName += "^";
-            aAttributeName += aName.copy( index+1 );
+            OUString aAttributeName = getNamespaceValue( aName.copy( 0, index )) + "^" + aName.copy( index+1);
             return aAttributeName;
         }
         else
@@ -133,8 +131,7 @@ OUString XMLNamespaces::applyNSToElementName( const OUString& aName ) const
 
     if ( !aNamespace.isEmpty() )
     {
-        aElementName = aNamespace;
-        aElementName += "^";
+        aElementName = aNamespace + "^";
     }
     else
         return aName;
diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx
index edacb27..2b10d69 100644
--- a/framework/source/helper/titlebarupdate.cxx
+++ b/framework/source/helper/titlebarupdate.cxx
@@ -149,12 +149,9 @@ void TitleBarUpdate::impl_updateApplicationID(const css::uno::Reference< css::fr
             sDesktopName = "Startcenter";
 #if defined(_WIN32)
         // We use a hardcoded product name matching the registry keys so applications can be associated with file types
-        sApplicationID = "TheDocumentFoundation.LibreOffice.";
-        sApplicationID += sDesktopName;
+        sApplicationID = "TheDocumentFoundation.LibreOffice." + sDesktopName;
 #else
-        sApplicationID = utl::ConfigManager::getProductName().toAsciiLowerCase();
-        sApplicationID += "-";
-        sApplicationID += sDesktopName.toAsciiLowerCase();
+        sApplicationID = utl::ConfigManager::getProductName().toAsciiLowerCase() + "-" + sDesktopName.toAsciiLowerCase();
 #endif
     }
     catch(const css::uno::Exception&)
diff --git a/framework/source/uielement/generictoolbarcontroller.cxx b/framework/source/uielement/generictoolbarcontroller.cxx
index 2d8205f..9460afb 100644
--- a/framework/source/uielement/generictoolbarcontroller.cxx
+++ b/framework/source/uielement/generictoolbarcontroller.cxx
@@ -219,8 +219,7 @@ void GenericToolbarController::statusChanged( const FeatureStateEvent& Event )
                 if ( aStrValue.startsWith("($1)") )
                 {
                     OUString aTmp(FwkResId(STR_UPDATEDOC));
-                    aTmp += " ";
-                    aTmp += aStrValue.copy( 4 );
+                    aTmp += " " + aStrValue.copy( 4 );
                     aStrValue = aTmp;
                 }
                 else if ( aStrValue.startsWith("($2)") )
diff --git a/framework/source/uielement/menubarmanager.cxx b/framework/source/uielement/menubarmanager.cxx
index ef32903..e1a1653 100644
--- a/framework/source/uielement/menubarmanager.cxx
+++ b/framework/source/uielement/menubarmanager.cxx
@@ -445,8 +445,7 @@ void SAL_CALL MenuBarManager::statusChanged( const FeatureStateEvent& Event )
                         if ( aItemText.startsWith("($1)") )
                         {
                             OUString aTmp(FWK_RESSTR(STR_UPDATEDOC));
-                            aTmp += " ";
-                            aTmp += aItemText.copy( 4 );
+                            aTmp += " " + aItemText.copy( 4 );
                             aItemText = aTmp;
                         }
                         else if ( aItemText.startsWith("($2)") )
diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx
index faaf3a3..b0f5d51 100644
--- a/svtools/source/brwbox/brwbox3.cxx
+++ b/svtools/source/brwbox/brwbox3.cxx
@@ -235,11 +235,11 @@ OUString BrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType e
             else
                 aRetText = "TableCell";
 #if OSL_DEBUG_LEVEL > 0
-            aRetText += " [";
-            aRetText += OUString::number(sal_Int32(GetCurRow()));
-            aRetText += ",";
-            aRetText += OUString::number(sal_Int32(GetCurColumnId()));
-            aRetText += "]";
+            aRetText += " ["
+                        + OUString::number(sal_Int32(GetCurRow()))
+                        + ","
+                        + OUString::number(sal_Int32(GetCurColumnId()))
+                        + "]";
 #endif
             break;
         case ::svt::BBTYPE_ROWHEADERCELL:
@@ -248,21 +248,21 @@ OUString BrowseBox::GetAccessibleObjectName( ::svt::AccessibleBrowseBoxObjType e
                 aRetText = OUString::number( rowId );
             }
 #if OSL_DEBUG_LEVEL > 0
-            aRetText += " [";
-            aRetText += OUString::number(sal_Int32(GetCurRow()));
-            aRetText += ",";
-            aRetText += OUString::number(sal_Int32(GetCurColumnId()));
-            aRetText += "]";
+            aRetText += " ["
+                        + OUString::number(sal_Int32(GetCurRow()))
+                        + ","
+                        + OUString::number(sal_Int32(GetCurColumnId()))
+                        + "]";
 #endif
             break;
         case ::svt::BBTYPE_COLUMNHEADERCELL:
             aRetText = GetColumnDescription( sal_Int16( _nPosition ) );
 #if OSL_DEBUG_LEVEL > 0
-            aRetText += " [";
-            aRetText += OUString::number(sal_Int32(GetCurRow()));
-            aRetText += ",";
-            aRetText += OUString::number(sal_Int32(GetCurColumnId()));
-            aRetText += "]";
+            aRetText += " ["
+                        + OUString::number(sal_Int32(GetCurRow()))
+                        + ","
+                        + OUString::number(sal_Int32(GetCurColumnId()))
+                        + "]";
 #endif
             break;
         default:
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index f18e73f..bcbf2c7 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1320,8 +1320,7 @@ OUString SvtFileView::GetConfigString() const
     DBG_ASSERT( pBar, "invalid headerbar" );
 
     // sort order
-    sRet += OUString::number( mpImpl->mnSortColumn );
-    sRet += ";";
+    sRet += OUString::number( mpImpl->mnSortColumn ) + ";";
     HeaderBarItemBits nBits = pBar->GetItemBits( mpImpl->mnSortColumn );
     bool bUp = ( ( nBits & HeaderBarItemBits::UPARROW ) == HeaderBarItemBits::UPARROW );
     sRet += bUp ? OUString("1") : OUString("0");
@@ -1331,10 +1330,10 @@ OUString SvtFileView::GetConfigString() const
     for ( sal_uInt16 i = 0; i < nCount; ++i )
     {
         sal_uInt16 nId = pBar->GetItemId(i);
-        sRet += OUString::number( nId );
-        sRet += ";";
-        sRet += OUString::number( pBar->GetItemSize( nId ) );
-        sRet += ";";
+        sRet += OUString::number( nId )
+                + ";"
+                + OUString::number( pBar->GetItemSize( nId ) )
+                + ";";
     }
 
     sRet = comphelper::string::stripEnd(sRet, ';');
@@ -1893,9 +1892,7 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
         // title, type, size, date
         aValue = (*aIt)->GetTitle();
         ReplaceTabWithString( aValue );
-        aValue += aTab;
-        aValue += (*aIt)->maType;
-        aValue += aTab;
+        aValue += aTab + (*aIt)->maType + aTab;
         // folders don't have a size
         if ( ! (*aIt)->mbIsFolder )
             aValue += CreateExactSizeText( (*aIt)->maSize );
@@ -1905,9 +1902,9 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
         {
             SvtSysLocale aSysLocale;
             const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
-            aValue += rLocaleData.getDate( (*aIt)->maModDate );
-            aValue += aDateSep;
-            aValue += rLocaleData.getTime( (*aIt)->maModDate, false );
+            aValue += rLocaleData.getDate( (*aIt)->maModDate )
+                    + aDateSep
+                    + rLocaleData.getTime( (*aIt)->maModDate, false );
         }
         (*aIt)->maDisplayText = aValue;
 
@@ -2135,17 +2132,15 @@ OUString SvtFileView_Impl::FolderInserted( const OUString& rURL, const OUString&
     // title, type, size, date
     aValue = pData->GetTitle();
     ReplaceTabWithString( aValue );
-    aValue += aTab;
-    aValue += pData->maType;
-    aValue += aTab;
+    aValue += aTab + pData->maType + aTab;
     // folders don't have a size
     aValue += aTab;
     // set the date
     SvtSysLocale aSysLocale;
     const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
-    aValue += rLocaleData.getDate( pData->maModDate );
-    aValue += aDateSep;
-    aValue += rLocaleData.getTime( pData->maModDate );
+    aValue += rLocaleData.getDate( pData->maModDate )
+            + aDateSep
+            + rLocaleData.getTime( pData->maModDate );
 
     pData->maDisplayText = aValue;
     maContent.push_back( pData );
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index fcbdc00..964158c 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -1354,8 +1354,7 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
                     }
                     if (!headString.isEmpty())
                     {
-                        sRet += headString ;
-                        sRet += ":" ;
+                        sRet += headString + ":";
                     }
                 }
                 else
@@ -1367,8 +1366,7 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
                     }
                     if (!aString.isEmpty())
                     {
-                        sRet += aString ;
-                        sRet += ":" ;
+                        sRet += aString + ":";
                     }
                     nHeaderCur++;
                 }
@@ -1376,8 +1374,7 @@ OUString SvTreeListBox::SearchEntryTextWithHeadTitle( SvTreeListEntry* pEntry )
             }
             else
             {
-                sRet += static_cast<SvLBoxString&>( rItem ).GetText();
-                sRet += ",";
+                sRet += static_cast<SvLBoxString&>( rItem ).GetText() + ",";
             }
             //end want to the column header
         }
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index a6d1fe0..edb5663 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -823,9 +823,9 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
             // display month in title bar
             nDeltaX = nX;
             nDeltaY = nY + TITLE_BORDERY;
-            OUString aMonthText(maCalendarWrapper.getDisplayName(i18n::CalendarDisplayIndex::MONTH, nMonth - 1, 1));
-            aMonthText += " ";
-            aMonthText += OUString::number(nYear);
+            OUString aMonthText = maCalendarWrapper.getDisplayName(i18n::CalendarDisplayIndex::MONTH, nMonth - 1, 1)
+                    + " "
+                    + OUString::number(nYear);
             long nMonthTextWidth = rRenderContext.GetTextWidth(aMonthText);
             long nMonthOffX1 = 0;
             long nMonthOffX2 = 0;
@@ -840,9 +840,9 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
             if (nMonthTextWidth > nMaxMonthWidth)
             {
                 // Abbreviated month name.
-                aMonthText  = maCalendarWrapper.getDisplayName(i18n::CalendarDisplayIndex::MONTH, nMonth - 1, 0);
-                aMonthText += " ";
-                aMonthText += OUString::number(nYear);
+                aMonthText  = maCalendarWrapper.getDisplayName(i18n::CalendarDisplayIndex::MONTH, nMonth - 1, 0)
+                            + " "
+                            + OUString::number(nYear);
                 nMonthTextWidth = rRenderContext.GetTextWidth(aMonthText);
             }
             long nTempOff = (mnMonthWidth - nMonthTextWidth + 1) / 2;
@@ -1539,23 +1539,21 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt )
                 maCalendarWrapper.setGregorianDateTime( aDate);
                 sal_uInt16      nWeek = (sal_uInt16) maCalendarWrapper.getValue( i18n::CalendarFieldIndex::WEEK_OF_YEAR);
                 sal_uInt16      nMonth = aDate.GetMonth();
-                OUString   aStr( maDayText );
-                aStr += ": ";
-                aStr += OUString::number(aDate.GetDayOfYear());
-                aStr += " / ";
-                aStr += maWeekText;
-                aStr += ": ";
-                aStr += OUString::number(nWeek);
+                OUString   aStr = maDayText
+                                + ": "
+                                + OUString::number(aDate.GetDayOfYear())
+                                + " / "
+                                + maWeekText
+                                + ": "
+                                + OUString::number(nWeek);
         // if year is not the same, add it
                 if ( (nMonth == 12) && (nWeek == 1) )
                 {
-                    aStr += ",  ";
-                    aStr += OUString::number(aDate.GetNextYear());
+                    aStr += ",  " + OUString::number(aDate.GetNextYear());
                 }
                 else if ( (nMonth == 1) && (nWeek > 50) )
                 {
-                    aStr += ", ";
-                    aStr += OUString::number(aDate.GetYear()-1);
+                    aStr += ", " + OUString::number(aDate.GetYear()-1);
                 }
                 Help::ShowQuickHelp( this, aDateRect, aStr );
                 return;


More information about the Libreoffice-commits mailing list