[Libreoffice-commits] core.git: 2 commits - sc/source

Eike Rathke erack at redhat.com
Mon Apr 20 09:43:09 PDT 2015


 sc/source/core/tool/interpr3.cxx |   36 ++++++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 8 deletions(-)

New commits:
commit b756a907eadb803c8014c7a875bb0b0ee32c50b3
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Apr 20 18:37:49 2015 +0200

    error handling per element and propagate, tdf#88547 follow-up
    
    Change-Id: Ic7171f3b0c0931e476d8419257b33c760c6283a6

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index b97dad5..1dd07f5 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3736,9 +3736,24 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
                             OUString aStr = pMat->GetString( i ).getString();
                             if ( aStr.getLength() > 0 )
                             {
+                                sal_uInt16 nErr = nGlobalError;
+                                nGlobalError = 0;
                                 double fVal = ConvertStringToValue( aStr );
                                 if ( !nGlobalError )
+                                {
                                     rArray.push_back( fVal );
+                                    nGlobalError = nErr;
+                                }
+                                else
+                                {
+                                    rArray.push_back( CreateDoubleError( errNoValue));
+                                    // Propagate previous error if any, else
+                                    // the current #VALUE! error.
+                                    if (nErr)
+                                        nGlobalError = nErr;
+                                    else
+                                        nGlobalError = errNoValue;
+                                }
                             }
                         }
                     }
commit 2fcd8c2c40481a95bf0cf59b1dd314d84226226c
Author: Eike Rathke <erack at redhat.com>
Date:   Mon Apr 20 18:11:15 2015 +0200

    take different paths for performance if bAllowText, tdf#88547 follow-up
    
    Change-Id: I93cd943f9b26e6e4bdc7c616e9fc7a46d07a9d91

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 7b21392..b97dad5 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3724,7 +3724,7 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
                     for (SCSIZE i = 0; i < nCount; ++i)
                         rArray.push_back( pMat->GetDouble(i));
                 }
-                else
+                else if (bAllowText)
                 {
                     for (SCSIZE i = 0; i < nCount; ++i)
                     {
@@ -3732,20 +3732,25 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector<double
                             rArray.push_back( pMat->GetDouble(i));
                         else
                         {
-                            if ( bAllowText )
+                            // tdf#88547 try to convert string to (date)value
+                            OUString aStr = pMat->GetString( i ).getString();
+                            if ( aStr.getLength() > 0 )
                             {
-                                // tdf 88547 try to convert string to (date)value
-                                OUString aStr = pMat->GetString( i ).getString();
-                                if ( aStr.getLength() > 0 )
-                                {
-                                    double fVal = ConvertStringToValue( aStr );
-                                    if ( !nGlobalError )
-                                        rArray.push_back( fVal );
-                                }
+                                double fVal = ConvertStringToValue( aStr );
+                                if ( !nGlobalError )
+                                    rArray.push_back( fVal );
                             }
                         }
                     }
                 }
+                else
+                {
+                    for (SCSIZE i = 0; i < nCount; ++i)
+                    {
+                        if ( pMat->IsValue( i ) )
+                            rArray.push_back( pMat->GetDouble(i));
+                    }
+                }
             }
             break;
             default :


More information about the Libreoffice-commits mailing list