[Libreoffice-commits] .: 2 commits - basic/source
Takeshi Abe
tabe at kemper.freedesktop.org
Thu Apr 12 10:24:08 PDT 2012
basic/source/basmgr/basmgr.cxx | 12 +++++++-----
basic/source/sbx/sbxconv.hxx | 2 ++
basic/source/sbx/sbxcurr.cxx | 11 +++--------
basic/source/sbx/sbxdec.cxx | 3 ---
4 files changed, 12 insertions(+), 16 deletions(-)
New commits:
commit a9bad6b8f99dfb1640fbbff3f29036182f0103f6
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Fri Apr 13 02:16:31 2012 +0900
made the search straightforward
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 5e909b2..3de240f 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -533,12 +533,14 @@ void BasicLibs::Insert( BasicLibInfo* LibInfo )
BasicLibInfo* BasicLibs::Remove( BasicLibInfo* LibInfo )
{
- size_t i = GetPos( LibInfo );
- if ( i < aList.size() )
+ vector< BasicLibInfo* >::iterator it, eit = aList.end();
+ for (it = aList.begin(); it != eit; ++it)
{
- vector< BasicLibInfo* >::iterator it = aList.begin();
- advance( it , i );
- it = aList.erase( it );
+ if (*it == LibInfo)
+ {
+ aList.erase(it);
+ break;
+ }
}
return LibInfo;
}
commit 7465f5e604ee449006a243f1d55cb0882bb58ac1
Author: Takeshi Abe <tabe at fixedpoint.jp>
Date: Fri Apr 13 02:15:12 2012 +0900
extract ImpGetIntntlSep() into sbxconv.hxx and reuse it
diff --git a/basic/source/sbx/sbxconv.hxx b/basic/source/sbx/sbxconv.hxx
index 2a11f15..8c0a4b1 100644
--- a/basic/source/sbx/sbxconv.hxx
+++ b/basic/source/sbx/sbxconv.hxx
@@ -42,6 +42,8 @@ extern SbxError ImpScan
// with advanced evaluation (International, "TRUE"/"FALSE")
extern sal_Bool ImpConvStringExt( ::rtl::OUString& rSrc, SbxDataType eTargetType );
+void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep );
+
// SBXINT.CXX
double ImpRound( double );
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 20a3968..a418346 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -40,13 +40,10 @@ static rtl::OUString ImpCurrencyToString( const sal_Int64 &rVal )
bool isNeg = ( rVal < 0 );
sal_Int64 absVal = isNeg ? -rVal : rVal;
- SvtSysLocale aSysLocale;
sal_Unicode cDecimalSep = '.';
#if MAYBEFUTURE
sal_Unicode cThousandSep = ',';
- const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
- cDecimalSep = rData.getNumDecimalSep().GetBuffer()[0];
- cThousandSep = rData.getNumThousandSep().GetBuffer()[0];
+ ImpGetIntntlSep( cDecimalSep, cThousandSep );
#endif
rtl::OUString aAbsStr = rtl::OUString::valueOf( absVal );
@@ -119,14 +116,12 @@ static sal_Int64 ImpStringToCurrency( const rtl::OUString &rStr )
sal_Int32 nFractDigit = 4;
- SvtSysLocale aSysLocale;
sal_Unicode cDeciPnt = sal_Unicode('.');
sal_Unicode c1000Sep = sal_Unicode(',');
#if MAYBEFUTURE
- const LocaleDataWrapper& rData = aSysLocale.GetLocaleData();
- sal_Unicode cLocaleDeciPnt = rData.getNumDecimalSep().GetBuffer()[0];
- sal_Unicode cLocale1000Sep = rData.getNumThousandSep().GetBuffer()[0];
+ 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
diff --git a/basic/source/sbx/sbxdec.cxx b/basic/source/sbx/sbxdec.cxx
index 320c444..50d1759 100644
--- a/basic/source/sbx/sbxdec.cxx
+++ b/basic/source/sbx/sbxdec.cxx
@@ -201,9 +201,6 @@ void SbxDecimal::setUInt( unsigned int val )
setULong( (sal_uInt32)val );
}
-// sbxscan.cxx
-void ImpGetIntntlSep( sal_Unicode& rcDecimalSep, sal_Unicode& rcThousandSep );
-
bool SbxDecimal::setString( ::rtl::OUString* pOUString )
{
static LCID nLANGID = MAKELANGID( LANG_ENGLISH, SUBLANG_ENGLISH_US );
More information about the Libreoffice-commits
mailing list