[Libreoffice-commits] core.git: basic/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jun 13 07:13:20 UTC 2017


 basic/source/sbx/sbxcurr.cxx |   54 -------------------------------------------
 1 file changed, 54 deletions(-)

New commits:
commit e272761e8fca9eccbf6fd5737df2b1aee1730947
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 12 13:01:18 2017 +0200

    remove MAYBEFUTURE dead code
    
    Seems to date from:
       commit c631cf94e468d6f5ced5cacda3600c683c44dca2
       Author: John LeMoyne Castle <jlc at mail2lee.com>
       Date:   Tue Dec 21 15:47:53 2010 +0000
       68bit currency enhancement
    
    Change-Id: I81863991ec3717ea213dffb535283e6fc8abceb7
    Reviewed-on: https://gerrit.libreoffice.org/38693
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 130f51e6de27..9f013ea64f8c 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -32,10 +32,6 @@ static OUString ImpCurrencyToString( sal_Int64 rVal )
     sal_Int64 absVal = isNeg ? -rVal : rVal;
 
     sal_Unicode cDecimalSep = '.';
-#ifdef MAYBEFUTURE
-    sal_Unicode cThousandSep = ',';
-    ImpGetIntntlSep( cDecimalSep, cThousandSep );
-#endif
 
     OUString aAbsStr = OUString::number( absVal );
     OUStringBuffer aBuf;
@@ -51,13 +47,6 @@ static OUString ImpCurrencyToString( sal_Int64 rVal )
     if ( !bLessThanOne )
     {
         nCapacity = initialLen + 1;
-#ifdef MAYBEFUTURE
-        if ( initialLen > 5 )
-        {
-            sal_Int32 nThouSeparators = ( initialLen - 5 ) / 3;
-            nCapacity += nThouSeparators;
-        }
-#endif
     }
 
     if ( isNeg )
@@ -74,10 +63,6 @@ static OUString ImpCurrencyToString( sal_Int64 rVal )
     {
         if ( nDigitCount == 4 )
             aBuf[nInsertIndex--] = cDecimalSep;
-#ifdef MAYBEFUTURE
-        if ( nDigitCount > 4 && ! ( ( nDigitCount - 4  ) % 3) )
-            aBuf[nInsertIndex--] = cThousandSep;
-#endif
         if ( nDigitCount < initialLen )
             aBuf[nInsertIndex--] = aAbsStr[ charCpyIndex-- ];
         else
@@ -110,45 +95,6 @@ static sal_Int64 ImpStringToCurrency( const OUString &rStr )
     sal_Unicode cDeciPnt = '.';
     sal_Unicode c1000Sep = ',';
 
-#ifdef MAYBEFUTURE
-    sal_Unicode cLocaleDeciPnt, cLocale1000Sep;
-    ImpGetIntntlSep( cLocaleDeciPnt, cLocale1000Sep );
-
-        // score each set of separators (Locale and Basic) on total number of matches
-        // if one set has more matches use that set
-        // if tied use the set with the only or rightmost decimal separator match
-        // currency is fixed pt system: usually expect the decimal pt, 1000sep may occur
-    sal_Int32 LocaleScore = 0;
-    sal_Int32 LocaleLastDeci = -1;
-    sal_Int32 LOBasicScore = 0;
-    sal_Int32 LOBasicLastDeci = -1;
-
-    for( int idx=0; idx<rStr.getLength(); idx++ )
-    {
-        if ( *(p+idx) == cLocaleDeciPnt )
-        {
-            LocaleScore++;
-            LocaleLastDeci = idx;
-        }
-        if ( *(p+idx) == cLocale1000Sep )
-            LocaleScore++;
-
-        if ( *(p+idx) == cDeciPnt )
-        {
-            LOBasicScore++;
-            LOBasicLastDeci = idx;
-        }
-        if ( *(p+idx) == c1000Sep )
-            LOBasicScore++;
-    }
-    if ( ( LocaleScore > LOBasicScore )
-       ||( LocaleScore = LOBasicScore && LocaleLastDeci > LOBasicLastDeci ) )
-    {
-        cDeciPnt = cLocaleDeciPnt;
-        c1000Sep = cLocale1000Sep;
-    }
-#endif
-
     // lets use the existing string number conversions
     // there is a performance impact here ( multiple string copies )
     // but better I think than a home brewed string parser, if we need a parser


More information about the Libreoffice-commits mailing list