diff --git a/sc/source/core/tool/chartarr.cxx b/sc/source/core/tool/chartarr.cxx index 08abde87d850..2bac86df6850 100644 --- a/sc/source/core/tool/chartarr.cxx +++ b/sc/source/core/tool/chartarr.cxx @@ -49,6 +49,7 @@ using ::std::vector; using ::rtl::OUString; +using ::rtl::OUStringBuffer; // ----------------------------------------------------------------------- @@ -300,16 +301,20 @@ ScMemChart* ScChartArray::CreateMemChartSingle() for (nCol=0; nColGetString( aCols[nCol], nStrRow, nTab1, aString ); - if ( !aString.Len() ) + if (aString.isEmpty()) { - aString = ScGlobal::GetRscString(STR_COLUMN); - aString += ' '; + OUStringBuffer aBuf; + aBuf.append(ScGlobal::GetRscString(STR_COLUMN)); + aBuf.append(sal_Unicode(' ')); + ScAddress aPos( aCols[ nCol ], 0, 0 ); aPos.Format( aColStr, SCA_VALID_COL, NULL ); - aString += aColStr; + aBuf.append(aColStr); + + aString = aBuf.makeStringAndClear(); } pMemChart->SetColText( static_cast(nCol), aString); } @@ -320,17 +325,19 @@ ScMemChart* ScChartArray::CreateMemChartSingle() for (nRow=0; nRowGetString( nStrCol, aRows[nRow], nTab1, aString ); } - if ( !aString.Len() ) + if (aString.isEmpty()) { - aString = ScGlobal::GetRscString(STR_ROW); - aString += ' '; - aString += String::CreateFromInt32( aRows[nRow]+1 ); + OUStringBuffer aBuf; + aBuf.append(ScGlobal::GetRscString(STR_ROW)); + aBuf.append(sal_Unicode(' ')); + aBuf.append(static_cast(aRows[nRow]+1)); + aString = aBuf.makeStringAndClear(); } pMemChart->SetRowText( static_cast(nRow), aString); } @@ -452,22 +459,24 @@ ScMemChart* ScChartArray::CreateMemChartMulti() SCCOL nPosCol = 0; for ( nCol = 0; nCol < nColCount; nCol++ ) { - String aString, aColStr; + OUString aString, aColStr; const ScAddress* pPos = GetPositionMap()->GetColHeaderPosition( static_cast(nCol) ); if ( HasColHeaders() && pPos ) pDocument->GetString( pPos->Col(), pPos->Row(), pPos->Tab(), aString ); - if ( !aString.Len() ) + + if (aString.isEmpty()) { - aString = ScGlobal::GetRscString(STR_COLUMN); - aString += ' '; + OUStringBuffer aBuf(ScGlobal::GetRscString(STR_COLUMN)); + aBuf.append(sal_Unicode(' ')); if ( pPos ) nPosCol = pPos->Col() + 1; else nPosCol++; ScAddress aPos( nPosCol - 1, 0, 0 ); aPos.Format( aColStr, SCA_VALID_COL, NULL ); - aString += aColStr; + aBuf.append(aColStr); + aString = aBuf.makeStringAndClear(); } pMemChart->SetColText( static_cast(nCol), aString); } @@ -479,22 +488,23 @@ ScMemChart* ScChartArray::CreateMemChartMulti() SCROW nPosRow = 0; for ( nRow = 0; nRow < nRowCount; nRow++ ) { - String aString; + OUString aString; const ScAddress* pPos = GetPositionMap()->GetRowHeaderPosition( nRow ); if ( HasRowHeaders() && pPos ) { pDocument->GetString( pPos->Col(), pPos->Row(), pPos->Tab(), aString ); } - if ( !aString.Len() ) + if (aString.isEmpty()) { - aString = ScGlobal::GetRscString(STR_ROW); - aString += ' '; + OUStringBuffer aBuf(ScGlobal::GetRscString(STR_ROW)); + aBuf.append(sal_Unicode(' ')); if ( pPos ) nPosRow = pPos->Row() + 1; else nPosRow++; - aString += String::CreateFromInt32( nPosRow ); + aBuf.append(static_cast(nPosRow)); + aString = aBuf.makeStringAndClear(); } pMemChart->SetRowText( static_cast(nRow), aString); }