dbaccess/source/ui/misc/DExport.cxx |   17 ++++-------------
 1 file changed, 4 insertions(+), 13 deletions(-)

New commits:
commit 91a75920166e1cb64d6b7e6be1980a93bd163c9a
Author:     Bogdan Buzea <[email protected]>
AuthorDate: Tue Oct 22 05:57:37 2024 +0200
Commit:     David Gilbert <[email protected]>
CommitDate: Sun Oct 27 19:04:27 2024 +0100

    tdf#163486: PVS: Identical branches
    
    V1037 Two or more case-branches perform the same actions. Check lines: 425, 
499
    V1037 Two or more case-branches perform the same actions. Check lines: 463, 
469
    V1037 Two or more case-branches perform the same actions. Check lines: 552, 
576
    V1037 Two or more case-branches perform the same actions. Check lines: 555, 
582
    
    Change-Id: I1a41401569ee9893bf853bd3f56c2559aeb36a87
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175386
    Reviewed-by: David Gilbert <[email protected]>
    Tested-by: Jenkins

diff --git a/dbaccess/source/ui/misc/DExport.cxx 
b/dbaccess/source/ui/misc/DExport.cxx
index f8bdea3050f2..1cba0dee6943 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -421,9 +421,6 @@ sal_Int16 ODatabaseExport::CheckString(const OUString& 
aCheckToken, sal_Int16 _n
                 case NumberFormat::ALL:
                     nNumberFormat = NumberFormat::ALL;
                     break;
-                case NumberFormat::DEFINED:
-                    nNumberFormat = NumberFormat::TEXT;
-                    break;
                 case NumberFormat::DATE:
                     switch(_nOldNumberFormat)
                     {
@@ -459,12 +456,10 @@ sal_Int16 ODatabaseExport::CheckString(const OUString& 
aCheckToken, sal_Int16 _n
                 case NumberFormat::CURRENCY:
                     switch(_nOldNumberFormat)
                     {
-                        case NumberFormat::NUMBER:
-                            nNumberFormat = NumberFormat::CURRENCY;
-                            break;
                         case NumberFormat::CURRENCY:
                             nNumberFormat = _nOldNumberFormat;
                             break;
+                        case NumberFormat::NUMBER:
                         case NumberFormat::ALL:
                             nNumberFormat = NumberFormat::CURRENCY;
                             break;
@@ -496,6 +491,7 @@ sal_Int16 ODatabaseExport::CheckString(const OUString& 
aCheckToken, sal_Int16 _n
                 case NumberFormat::TEXT:
                 case NumberFormat::UNDEFINED:
                 case NumberFormat::LOGICAL:
+                case NumberFormat::DEFINED:
                     nNumberFormat = NumberFormat::TEXT; // Text overwrites 
everything
                     break;
                 case NumberFormat::DATETIME:
@@ -548,13 +544,6 @@ void ODatabaseExport::SetColumnTypes(const TColumnVector* 
_pList,const OTypeInfo
 
         switch ( nType )
         {
-            case NumberFormat::ALL:
-                nDataType  = DataType::DOUBLE;
-                break;
-            case NumberFormat::DEFINED:
-                nDataType   = DataType::VARCHAR;
-                nLength     = ((m_vColumnSize[i] % 10 ) ? m_vColumnSize[i]/ 10 
+ 1: m_vColumnSize[i]/ 10) * 10;
-                break;
             case NumberFormat::DATE:
                 nDataType  = DataType::DATE;
                 break;
@@ -569,12 +558,14 @@ void ODatabaseExport::SetColumnTypes(const TColumnVector* 
_pList,const OTypeInfo
                 nScale      = 4;
                 nLength     = 19;
                 break;
+            case NumberFormat::ALL:
             case NumberFormat::NUMBER:
             case NumberFormat::SCIENTIFIC:
             case NumberFormat::FRACTION:
             case NumberFormat::PERCENT:
                 nDataType  = DataType::DOUBLE;
                 break;
+            case NumberFormat::DEFINED:
             case NumberFormat::TEXT:
             case NumberFormat::UNDEFINED:
             case NumberFormat::LOGICAL:

Reply via email to