summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2017-12-03 21:46:37 +0200
committerEike Rathke <erack@redhat.com>2017-12-19 22:08:26 +0100
commit00bc5a097313fbd003675267be961ad3a152ba42 (patch)
treede9b9e6981d3c2f262b9391335a067d4898185b6 /basic
parentb74da08e556b7b001943f0288a61da53791d4dcf (diff)
wrap scoped enum around css::util::NumberFormat
Change-Id: Icab5ded8bccdb95f79b3fa35ea164f47919c68fa Reviewed-on: https://gerrit.libreoffice.org/46339 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/comp/scanner.cxx4
-rw-r--r--basic/source/runtime/methods.cxx12
-rw-r--r--basic/source/runtime/runtime.cxx5
-rw-r--r--basic/source/sbx/sbxdate.cxx11
-rw-r--r--basic/source/sbx/sbxscan.cxx2
5 files changed, 18 insertions, 16 deletions
diff --git a/basic/source/comp/scanner.cxx b/basic/source/comp/scanner.cxx
index 67177b7d9f44..2ecb7310d543 100644
--- a/basic/source/comp/scanner.cxx
+++ b/basic/source/comp/scanner.cxx
@@ -575,8 +575,8 @@ bool SbiScanner::NextSym()
bool bSuccess = pFormatter->IsNumberFormat(aSym, nIndex, nVal);
if( bSuccess )
{
- short nType_ = pFormatter->GetType(nIndex);
- if( !(nType_ & css::util::NumberFormat::DATE) )
+ SvNumFormatType nType_ = pFormatter->GetType(nIndex);
+ if( !(nType_ & SvNumFormatType::DATE) )
bSuccess = false;
}
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index 542c8817700c..d1f4206c31c5 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -2048,7 +2048,7 @@ void SbRtl_DateValue(StarBASIC *, SbxArray & rPar, bool)
double fResult;
OUString aStr( rPar.Get(1)->GetOUString() );
bool bSuccess = pFormatter->IsNumberFormat( aStr, nIndex, fResult );
- short nType = pFormatter->GetType( nIndex );
+ SvNumFormatType nType = pFormatter->GetType( nIndex );
// DateValue("February 12, 1969") raises error if the system locale is not en_US
// It seems that both locale number formatter and English number
@@ -2061,9 +2061,9 @@ void SbRtl_DateValue(StarBASIC *, SbxArray & rPar, bool)
nType = pFormatter->GetType( nIndex );
}
- if(bSuccess && (nType==css::util::NumberFormat::DATE || nType==css::util::NumberFormat::DATETIME))
+ if(bSuccess && (nType==SvNumFormatType::DATE || nType==SvNumFormatType::DATETIME))
{
- if ( nType == css::util::NumberFormat::DATETIME )
+ if ( nType == SvNumFormatType::DATETIME )
{
// cut time
if ( fResult > 0.0 )
@@ -2105,10 +2105,10 @@ void SbRtl_TimeValue(StarBASIC *, SbxArray & rPar, bool)
double fResult;
bool bSuccess = pFormatter->IsNumberFormat( rPar.Get(1)->GetOUString(),
nIndex, fResult );
- short nType = pFormatter->GetType(nIndex);
- if(bSuccess && (nType==css::util::NumberFormat::TIME||nType==css::util::NumberFormat::DATETIME))
+ SvNumFormatType nType = pFormatter->GetType(nIndex);
+ if(bSuccess && (nType==SvNumFormatType::TIME||nType==SvNumFormatType::DATETIME))
{
- if ( nType == css::util::NumberFormat::DATETIME )
+ if ( nType == SvNumFormatType::DATETIME )
{
// cut days
fResult = fmod( fResult, 1 );
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 2eaa60f85e5f..2b81778917e0 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -408,8 +408,9 @@ std::shared_ptr<SvNumberFormatter> SbiInstance::PrepareNumberFormatter( sal_uInt
std::shared_ptr<SvNumberFormatter> pNumberFormatter(
new SvNumberFormatter( comphelper::getProcessComponentContext(), eLangType ));
- sal_Int32 nCheckPos = 0; short nType;
- rnStdTimeIdx = pNumberFormatter->GetStandardFormat( css::util::NumberFormat::TIME, eLangType );
+ sal_Int32 nCheckPos = 0;
+ SvNumFormatType nType;
+ rnStdTimeIdx = pNumberFormatter->GetStandardFormat( SvNumFormatType::TIME, eLangType );
// the formatter's standard templates have only got a two-digit date
// -> registering an own format
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index e59c9214a90b..5342d557e1f0 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -116,7 +116,8 @@ double ImpGetDate( const SbxValues* p )
sal_uInt32 nIndex;
sal_Int32 nCheckPos = 0;
- short nType = 127;
+ SvNumFormatType nType = SvNumFormatType::DEFINED | SvNumFormatType::DATE | SvNumFormatType::TIME | SvNumFormatType::CURRENCY
+ | SvNumFormatType::NUMBER | SvNumFormatType::SCIENTIFIC | SvNumFormatType::FRACTION;
// Default templates of the formatter have only two-digit
// date. Therefore register an own format.
@@ -144,9 +145,9 @@ double ImpGetDate( const SbxValues* p )
bool bSuccess = pFormatter->IsNumberFormat( *p->pOUString, nIndex, nRes );
if ( bSuccess )
{
- short nType_ = pFormatter->GetType( nIndex );
- if(!(nType_ & ( css::util::NumberFormat::DATETIME | css::util::NumberFormat::DATE |
- css::util::NumberFormat::TIME | css::util::NumberFormat::DEFINED )))
+ SvNumFormatType nType_ = pFormatter->GetType( nIndex );
+ if(!(nType_ & ( SvNumFormatType::DATETIME | SvNumFormatType::DATE |
+ SvNumFormatType::TIME | SvNumFormatType::DEFINED )))
{
bSuccess = false;
}
@@ -292,7 +293,7 @@ start:
sal_uInt32 nIndex;
sal_Int32 nCheckPos = 0;
- short nType;
+ SvNumFormatType nType;
SvtSysLocale aSysLocale;
DateOrder eDate = aSysLocale.GetLocaleData().getDateOrder();
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 3408c0e9f151..d13cacb3616c 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -703,7 +703,7 @@ void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
if( bSuccess )
{
sal_Int32 nCheckPos = 0;
- short nType;
+ SvNumFormatType nType;
OUString aFmtStr = *pFmt;
const VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
if( pInfo->meType != VbaFormatType::Null )