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@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
Fakabbir Amin
2017-02-15 15:47:31 +05:30
committed by Stephan Bergmann
parent 5986bafea9
commit 9d8c206ee4
10 changed files with 65 additions and 88 deletions

View File

@@ -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() );
}
}

View File

@@ -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
{

View File

@@ -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;

View File

@@ -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&)

View File

@@ -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)") )

View File

@@ -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)") )

View File

@@ -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:

View File

@@ -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 );

View File

@@ -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
}

View File

@@ -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;