summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-06-14 19:58:31 +0200
committerEike Rathke <erack@redhat.com>2016-06-14 18:10:10 +0000
commit88cc395e5d8033ec0495de4f3ab05dd8f388f91a (patch)
tree298de5730d0ba17b683a9776c65139b834631f87 /sc
parent2c9f14bd4bb764d61ca672bd1d64af2f28fb5dd6 (diff)
do not use OUString::number() to "format" numeric values
Change-Id: Ie35a34152556e19eff1f196ddd0ddd51a6da1a23 (cherry picked from commit be2cf3d28b91cff4127c95cfe4481f36bdeb24fb) Reviewed-on: https://gerrit.libreoffice.org/26274 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/tool/interpr8.cxx48
1 files changed, 9 insertions, 39 deletions
diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index a94cd032ed02..b62fb59cde30 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1416,17 +1416,12 @@ void ScInterpreter::ScConcat_MS()
ScRefCellValue aCell( *pDok, aAdr );
if ( !aCell.isEmpty() )
{
- if ( aCell.hasString() )
+ if ( !aCell.hasEmptyValue() )
{
svl::SharedString aSS;
GetCellString( aSS, aCell);
aResBuf.append( aSS.getString());
}
- else
- {
- if ( !aCell.hasEmptyValue() )
- aResBuf.append( OUString::number( GetCellValue( aAdr, aCell)));
- }
}
}
break;
@@ -1462,17 +1457,12 @@ void ScInterpreter::ScConcat_MS()
ScRefCellValue aCell( *pDok, aAdr );
if ( !aCell.isEmpty() )
{
- if ( aCell.hasString() )
+ if ( !aCell.hasEmptyValue() )
{
svl::SharedString aSS;
GetCellString( aSS, aCell);
aResBuf.append( aSS.getString());
}
- else
- {
- if ( !aCell.hasEmptyValue() )
- aResBuf.append( OUString::number( GetCellValue( aAdr, aCell)));
- }
}
}
}
@@ -1500,7 +1490,7 @@ void ScInterpreter::ScConcat_MS()
else
{
if ( pMat->IsValue( j, k ) )
- aResBuf.append( OUString::number( pMat->GetDouble( j, k ) ) );
+ aResBuf.append( pMat->GetString( *pFormatter, j, k ).getString() );
}
}
}
@@ -1544,17 +1534,12 @@ void ScInterpreter::ScTextJoin_MS()
ScRefCellValue aCell( *pDok, aAdr );
if ( !aCell.isEmpty() )
{
- if ( aCell.hasString() )
+ if ( !aCell.hasEmptyValue() )
{
svl::SharedString aSS;
GetCellString( aSS, aCell);
aDelimiters.push_back( aSS.getString());
}
- else
- {
- if ( !aCell.hasEmptyValue() )
- aDelimiters.push_back( OUString::number( GetCellValue( aAdr, aCell)));
- }
}
}
break;
@@ -1590,17 +1575,12 @@ void ScInterpreter::ScTextJoin_MS()
ScRefCellValue aCell( *pDok, aAdr );
if ( !aCell.isEmpty() )
{
- if ( aCell.hasString() )
+ if ( !aCell.hasEmptyValue() )
{
svl::SharedString aSS;
GetCellString( aSS, aCell);
aDelimiters.push_back( aSS.getString());
}
- else
- {
- if ( !aCell.hasEmptyValue() )
- aDelimiters.push_back( OUString::number( GetCellValue( aAdr, aCell)));
- }
}
else
aDelimiters.push_back( "" );
@@ -1632,7 +1612,7 @@ void ScInterpreter::ScTextJoin_MS()
else
{
if ( pMat->IsValue( j, k ) )
- aDelimiters.push_back( OUString::number( pMat->GetDouble( j, k ) ) );
+ aDelimiters.push_back( pMat->GetString( *pFormatter, j, k ).getString() );
}
}
else
@@ -1697,17 +1677,12 @@ void ScInterpreter::ScTextJoin_MS()
OUString aStr;
if ( !aCell.isEmpty() )
{
- if ( aCell.hasString() )
+ if ( !aCell.hasEmptyValue() )
{
svl::SharedString aSS;
GetCellString( aSS, aCell);
aStr = aSS.getString();
}
- else
- {
- if ( !aCell.hasEmptyValue() )
- aStr = OUString::number( GetCellValue( aAdr, aCell));
- }
}
else
aStr.clear();
@@ -1761,17 +1736,12 @@ void ScInterpreter::ScTextJoin_MS()
ScRefCellValue aCell( *pDok, aAdr );
if ( !aCell.isEmpty() )
{
- if ( aCell.hasString() )
+ if ( !aCell.hasEmptyValue() )
{
svl::SharedString aSS;
GetCellString( aSS, aCell);
aStr = aSS.getString();
}
- else
- {
- if ( !aCell.hasEmptyValue() )
- aStr = OUString::number( GetCellValue( aAdr, aCell));
- }
}
else
aStr.clear();
@@ -1819,7 +1789,7 @@ void ScInterpreter::ScTextJoin_MS()
else
{
if ( pMat->IsValue( j, k ) )
- aStr = OUString::number( pMat->GetDouble( j, k ) );
+ aStr = pMat->GetString( *pFormatter, j, k ).getString();
}
}
else