diff options
author | Noel <noelgrandin@gmail.com> | 2020-10-21 09:29:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-10-21 15:34:16 +0200 |
commit | 387a88fa252990ded26ee7ea6b89b11be7616986 (patch) | |
tree | 870415232202aec0c314b7626b5ad01ddb6083b0 /basic | |
parent | 4bea7a17056770c83006048f9fd3fa252958718b (diff) |
use tools::Long in basegfx..chart2
Change-Id: Ide4014348d51f0b5f59e1e91b8d41c7748853254
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104608
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/comp/exprnode.cxx | 15 | ||||
-rw-r--r-- | basic/source/comp/symtbl.cxx | 3 | ||||
-rw-r--r-- | basic/source/runtime/ddectrl.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/inputbox.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/methods.cxx | 20 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 8 | ||||
-rw-r--r-- | basic/source/uno/dlgcont.cxx | 4 |
7 files changed, 31 insertions, 29 deletions
diff --git a/basic/source/comp/exprnode.cxx b/basic/source/comp/exprnode.cxx index 8fb38b44eeb6..3b0bbc4ceaec 100644 --- a/basic/source/comp/exprnode.cxx +++ b/basic/source/comp/exprnode.cxx @@ -24,6 +24,7 @@ #include <rtl/math.hxx> #include <parser.hxx> #include <expr.hxx> +#include <tools/long.hxx> #include <basic/sberrors.hxx> @@ -294,8 +295,8 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser) { double nl = pLeft->nVal; double nr = pRight->nVal; - long ll = 0, lr = 0; - long llMod = 0, lrMod = 0; + tools::Long ll = 0, lr = 0; + tools::Long llMod = 0, lrMod = 0; if( ( eTok >= AND && eTok <= IMP ) || eTok == IDIV || eTok == MOD ) { @@ -321,9 +322,9 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser) bErr = true; nr = SbxMINLNG; } - ll = static_cast<long>(nl); lr = static_cast<long>(nr); - llMod = static_cast<long>(nl); - lrMod = static_cast<long>(nr); + ll = static_cast<tools::Long>(nl); lr = static_cast<tools::Long>(nr); + llMod = static_cast<tools::Long>(nl); + lrMod = static_cast<tools::Long>(nr); if( bErr ) { pParser->Error( ERRCODE_BASIC_MATH_OVERFLOW ); @@ -411,7 +412,7 @@ void SbiExprNode::FoldConstantsBinaryNode(SbiParser* pParser) && nVal >= SbxMINLNG && nVal <= SbxMAXLNG ) { // Decimal place away - long n = static_cast<long>(nVal); + tools::Long n = static_cast<tools::Long>(nVal); nVal = n; eType = ( n >= SbxMININT && n <= SbxMAXINT ) ? SbxINTEGER : SbxLONG; @@ -450,7 +451,7 @@ void SbiExprNode::FoldConstantsUnaryNode(SbiParser* pParser) pParser->Error( ERRCODE_BASIC_MATH_OVERFLOW ); bError = true; } - nVal = static_cast<double>(~static_cast<long>(nVal)); + nVal = static_cast<double>(~static_cast<tools::Long>(nVal)); eType = SbxLONG; } break; default: break; diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx index 00a857abad6a..46b3b924798e 100644 --- a/basic/source/comp/symtbl.cxx +++ b/basic/source/comp/symtbl.cxx @@ -26,6 +26,7 @@ #include <stdio.h> #include <rtl/character.hxx> #include <basic/sberrors.hxx> +#include <tools/long.hxx> // All symbol names are laid down int the symbol-pool's stringpool, so that // all symbols are handled in the same case. On saving the code-image, the @@ -69,7 +70,7 @@ short SbiStringPool::Add( double n, SbxDataType t ) // tdf#131296 - store numeric value including its type character // See GetSuffixType in basic/source/comp/scanner.cxx for type characters case SbxINTEGER: snprintf( buf, sizeof(buf), "%d%%", static_cast<short>(n) ); break; - case SbxLONG: snprintf( buf, sizeof(buf), "%ld&", static_cast<long>(n) ); break; + case SbxLONG: snprintf( buf, sizeof(buf), "%ld&", static_cast<tools::Long>(n) ); break; case SbxSINGLE: snprintf( buf, sizeof(buf), "%.6g!", static_cast<float>(n) ); break; case SbxDOUBLE: snprintf( buf, sizeof(buf), "%.16g", n ); break; // default processing in SbiRuntime::StepLOADNC - no type character case SbxCURRENCY: snprintf(buf, sizeof(buf), "%.16g@", n); break; diff --git a/basic/source/runtime/ddectrl.cxx b/basic/source/runtime/ddectrl.cxx index d1154a727f74..95be54507a8a 100644 --- a/basic/source/runtime/ddectrl.cxx +++ b/basic/source/runtime/ddectrl.cxx @@ -53,7 +53,7 @@ ErrCode SbiDdeControl::GetLastErr( const DdeConnection* pConv ) { return ERRCODE_NONE; } - long nErr = pConv->GetError(); + tools::Long nErr = pConv->GetError(); if( !nErr ) { return ERRCODE_NONE; diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index 1d27b25abf46..bf21aea13ce4 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -35,7 +35,7 @@ class SvRTLInputBox : public weld::GenericDialogController std::unique_ptr<weld::Label> m_xPromptText; OUString m_aText; - void PositionDialog( long nXTwips, long nYTwips ); + void PositionDialog( tools::Long nXTwips, tools::Long nYTwips ); void InitButtons(); void SetPrompt(const OUString& rPrompt); DECL_LINK( OkHdl, weld::Button&, void ); @@ -43,7 +43,7 @@ class SvRTLInputBox : public weld::GenericDialogController public: SvRTLInputBox(weld::Window* pParent, const OUString& rPrompt, const OUString& rTitle, - const OUString& rDefault, long nXTwips, long nYTwips ); + const OUString& rDefault, tools::Long nXTwips, tools::Long nYTwips ); OUString const & GetText() const { return m_aText; } }; @@ -51,7 +51,7 @@ public: SvRTLInputBox::SvRTLInputBox(weld::Window* pParent, const OUString& rPrompt, const OUString& rTitle, const OUString& rDefault, - long nXTwips, long nYTwips) + tools::Long nXTwips, tools::Long nYTwips) : GenericDialogController(pParent, "svt/ui/inputbox.ui", "InputBox") , m_xEdit(m_xBuilder->weld_entry("entry")) , m_xOk(m_xBuilder->weld_button("ok")) @@ -72,7 +72,7 @@ void SvRTLInputBox::InitButtons() m_xCancel->connect_clicked(LINK(this,SvRTLInputBox,CancelHdl)); } -void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips) +void SvRTLInputBox::PositionDialog(tools::Long nXTwips, tools::Long nYTwips) { if( nXTwips != -1 && nYTwips != -1 ) { diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx index 3e8f8d23cd42..32c9caddcde8 100644 --- a/basic/source/runtime/methods.cxx +++ b/basic/source/runtime/methods.cxx @@ -124,7 +124,7 @@ static void FilterWhiteSpace( OUString& rStr ) rStr = aRet.makeStringAndClear(); } -static long GetDayDiff( const Date& rDate ); +static tools::Long GetDayDiff( const Date& rDate ); static const CharClass& GetCharClass() { @@ -782,7 +782,7 @@ void SbRtl_FileLen(StarBASIC *, SbxArray & rPar, bool) (void)aItem.getFileStatus( aFileStatus ); nLen = static_cast<sal_Int32>(aFileStatus.getFileSize()); } - rPar.Get32(0)->PutLong( static_cast<long>(nLen) ); + rPar.Get32(0)->PutLong( static_cast<tools::Long>(nLen) ); } } @@ -2218,7 +2218,7 @@ double Now_Impl() { DateTime aDateTime( DateTime::SYSTEM ); double aSerial = static_cast<double>(GetDayDiff( aDateTime )); - long nSeconds = aDateTime.GetHour(); + tools::Long nSeconds = aDateTime.GetHour(); nSeconds *= 3600; nSeconds += aDateTime.GetMin() * 60; nSeconds += aDateTime.GetSec(); @@ -2254,7 +2254,7 @@ void SbRtl_Time(StarBASIC *, SbxArray & rPar, bool bWrite) else { // Time: system dependent - long nSeconds=aTime.GetHour(); + tools::Long nSeconds=aTime.GetHour(); nSeconds *= 3600; nSeconds += aTime.GetMin() * 60; nSeconds += aTime.GetSec(); @@ -2287,7 +2287,7 @@ void SbRtl_Time(StarBASIC *, SbxArray & rPar, bool bWrite) void SbRtl_Timer(StarBASIC *, SbxArray & rPar, bool) { tools::Time aTime( tools::Time::SYSTEM ); - long nSeconds = aTime.GetHour(); + tools::Long nSeconds = aTime.GetHour(); nSeconds *= 3600; nSeconds += aTime.GetMin() * 60; nSeconds += aTime.GetSec(); @@ -3067,7 +3067,7 @@ void SbRtl_FileDateTime(StarBASIC *, SbxArray & rPar, bool) else { double fSerial = static_cast<double>(GetDayDiff( aDate )); - long nSeconds = aTime.GetHour(); + tools::Long nSeconds = aTime.GetHour(); nSeconds *= 3600; nSeconds += aTime.GetMin() * 60; nSeconds += aTime.GetSec(); @@ -4657,10 +4657,10 @@ void SbRtl_Partition(StarBASIC *, SbxArray & rPar, bool) #endif -static long GetDayDiff( const Date& rDate ) +static tools::Long GetDayDiff( const Date& rDate ) { Date aRefDate( 1,1,1900 ); - long nDiffDays; + tools::Long nDiffDays; if ( aRefDate > rDate ) { nDiffDays = aRefDate - rDate; @@ -4677,7 +4677,7 @@ static long GetDayDiff( const Date& rDate ) sal_Int16 implGetDateYear( double aDate ) { Date aRefDate( 1,1,1900 ); - long nDays = static_cast<long>(aDate); + tools::Long nDays = static_cast<tools::Long>(aDate); nDays -= 2; // standardize: 1.1.1900 => 0.0 aRefDate.AddDays( nDays ); sal_Int16 nRet = aRefDate.GetYear(); @@ -4788,7 +4788,7 @@ bool implDateSerial( sal_Int16 nYear, sal_Int16 nMonth, sal_Int16 nDay, } } - long nDiffDays = GetDayDiff( aCurDate ); + tools::Long nDiffDays = GetDayDiff( aCurDate ); rdRet = static_cast<double>(nDiffDays); return true; } diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index 1dee293ef3cf..44f080544408 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -559,13 +559,13 @@ void Wait_Impl( bool bDurationBased, SbxArray& rPar ) StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); return; } - long nWait = 0; + tools::Long nWait = 0; if ( bDurationBased ) { double dWait = rPar.Get32(1)->GetDouble(); double dNow = Now_Impl(); double dSecs = ( dWait - dNow ) * 24.0 * 3600.0; - nWait = static_cast<long>( dSecs * 1000 ); // wait in thousands of sec + nWait = static_cast<tools::Long>( dSecs * 1000 ); // wait in thousands of sec } else { @@ -1124,7 +1124,7 @@ static void PutGet( SbxArray& rPar, bool bPut ) SbxVariable* pVar2 = rPar.Get32(2); SbxDataType eType2 = pVar2->GetType(); bool bHasRecordNo = (eType2 != SbxEMPTY && eType2 != SbxERROR); - long nRecordNo = pVar2->GetLong(); + tools::Long nRecordNo = pVar2->GetLong(); if ( nFileNo < 1 || ( bHasRecordNo && nRecordNo < 1 ) ) { StarBASIC::Error( ERRCODE_BASIC_BAD_ARGUMENT ); @@ -1217,7 +1217,7 @@ void SbRtl_Environ(StarBASIC *, SbxArray & rPar, bool) rPar.Get32(0)->PutString( aResult ); } -static double GetDialogZoomFactor( bool bX, long nValue ) +static double GetDialogZoomFactor( bool bX, tools::Long nValue ) { OutputDevice* pDevice = Application::GetDefaultDevice(); double nResult = 0; diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx index eee4e8300339..b303349fa009 100644 --- a/basic/source/uno/dlgcont.cxx +++ b/basic/source/uno/dlgcont.cxx @@ -190,8 +190,8 @@ void SfxDialogLibraryContainer::storeLibrariesToStorage( const uno::Reference< e { try { - long nSource = SotStorage::GetVersion( mxStorage ); - long nTarget = SotStorage::GetVersion( xStorage ); + tools::Long nSource = SotStorage::GetVersion( mxStorage ); + tools::Long nTarget = SotStorage::GetVersion( xStorage ); if ( nSource == SOFFICE_FILEFORMAT_CURRENT && nTarget != SOFFICE_FILEFORMAT_CURRENT ) |