From 37729618021bb44b9c6ba37dc72a1d3111ce0ffb Mon Sep 17 00:00:00 2001 From: Gökhan Gurbetoğlu Date: Thu, 12 Apr 2018 02:08:51 +0300 Subject: tdf#100726 - Improve readability of OUString concatanations Change-Id: I3ba75dbe6754b8138f61e223387832a6fb53c1c5 Reviewed-on: https://gerrit.libreoffice.org/52752 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sc/source/filter/ftools/ftools.cxx | 10 ++++------ sc/source/ui/docshell/impex.cxx | 40 +++++++++++++++++++------------------- 2 files changed, 24 insertions(+), 26 deletions(-) (limited to 'sc/source') diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx index f7d085a28b6c..196f293aa097 100644 --- a/sc/source/filter/ftools/ftools.cxx +++ b/sc/source/filter/ftools/ftools.cxx @@ -119,12 +119,10 @@ rtl_TextEncoding ScfTools::GetSystemTextEncoding() OUString ScfTools::GetHexStr( sal_uInt16 nValue ) { const sal_Char pHex[] = "0123456789ABCDEF"; - OUString aStr; - - aStr += OUString( pHex[ nValue >> 12 ] ); - aStr += OUString( pHex[ (nValue >> 8) & 0x000F ] ); - aStr += OUString( pHex[ (nValue >> 4) & 0x000F ] ); - aStr += OUString( pHex[ nValue & 0x000F ] ); + OUString aStr = OUString( pHex[ nValue >> 12 ] ) + + OUString( pHex[ (nValue >> 8) & 0x000F ] ) + + OUString( pHex[ (nValue >> 4) & 0x000F ] ) + + OUString( pHex[ nValue & 0x000F ] ); return aStr; } diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 099dae70e5e1..d27a894df309 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -2100,12 +2100,12 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) rtl_math_StringFormat_Automatic, rtl_math_DecimalPlaces_Max, '.', true ); - aBufStr = "C;X"; - aBufStr += OUString::number( c ); - aBufStr += ";Y"; - aBufStr += OUString::number( r ); - aBufStr += ";K"; - aBufStr += aValStr; + aBufStr = "C;X" + + OUString::number( c ) + + ";Y" + + OUString::number( r ) + + ";K" + + aValStr; lcl_WriteSimpleString( rStrm, aBufStr ); goto checkformula; @@ -2115,11 +2115,11 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) aCellStr = pDoc->GetString(nCol, nRow, aRange.aStart.Tab()); aCellStr = aCellStr.replaceAll("\n", SYLK_LF); - aBufStr = "C;X"; - aBufStr += OUString::number( c ); - aBufStr += ";Y"; - aBufStr += OUString::number( r ); - aBufStr += ";K"; + aBufStr = "C;X" + + OUString::number( c ) + + ";Y" + + OUString::number( r ) + + ";K"; lcl_WriteSimpleString( rStrm, aBufStr ); lcl_WriteString( rStrm, aCellStr, '"', ';' ); @@ -2160,21 +2160,21 @@ bool ScImportExport::Doc2Sylk( SvStream& rStrm ) pFCell->GetMatColsRows( nC, nR ); nC += c - 1; nR += r - 1; - aPrefix = ";R"; - aPrefix += OUString::number( nR ); - aPrefix += ";C"; - aPrefix += OUString::number( nC ); - aPrefix += ";M"; + aPrefix = ";R" + + OUString::number( nR ) + + ";C" + + OUString::number( nC ) + + ";M"; } break; case ScMatrixMode::Reference : { // diff expression with 'I' M$-extension ScAddress aPos; (void)pFCell->GetMatrixOrigin( aPos ); - aPrefix = ";I;R"; - aPrefix += OUString::number( aPos.Row() - nStartRow + 1 ); - aPrefix += ";C"; - aPrefix += OUString::number( aPos.Col() - nStartCol + 1 ); + aPrefix = ";I;R" + + OUString::number( aPos.Row() - nStartRow + 1 ) + + ";C" + + OUString::number( aPos.Col() - nStartCol + 1 ); } break; default: -- cgit