[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sc/source

Eike Rathke erack at redhat.com
Tue Jun 14 18:10:35 UTC 2016


 sc/source/core/tool/interpr8.cxx |   48 +++++++--------------------------------
 1 file changed, 9 insertions(+), 39 deletions(-)

New commits:
commit 88cc395e5d8033ec0495de4f3ab05dd8f388f91a
Author: Eike Rathke <erack at redhat.com>
Date:   Tue Jun 14 19:58:31 2016 +0200

    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 at redhat.com>
    Tested-by: Eike Rathke <erack at redhat.com>

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index a94cd03..b62fb59 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


More information about the Libreoffice-commits mailing list