summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel <noelgrandin@gmail.com>2020-10-21 09:29:45 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-10-21 15:34:16 +0200
commit387a88fa252990ded26ee7ea6b89b11be7616986 (patch)
tree870415232202aec0c314b7626b5ad01ddb6083b0
parent4bea7a17056770c83006048f9fd3fa252958718b (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>
-rw-r--r--basegfx/source/tools/zoomtools.cxx16
-rw-r--r--basic/source/comp/exprnode.cxx15
-rw-r--r--basic/source/comp/symtbl.cxx3
-rw-r--r--basic/source/runtime/ddectrl.cxx2
-rw-r--r--basic/source/runtime/inputbox.cxx8
-rw-r--r--basic/source/runtime/methods.cxx20
-rw-r--r--basic/source/runtime/methods1.cxx8
-rw-r--r--basic/source/uno/dlgcont.cxx4
-rw-r--r--canvas/source/cairo/cairo_canvasfont.cxx2
-rw-r--r--canvas/source/cairo/cairo_canvashelper.cxx4
-rw-r--r--canvas/source/cairo/cairo_textlayout.cxx2
-rw-r--r--canvas/source/cairo/cairo_textlayout.hxx2
-rw-r--r--canvas/source/vcl/canvasfont.cxx2
-rw-r--r--canvas/source/vcl/spritehelper.cxx2
-rw-r--r--canvas/source/vcl/textlayout.cxx2
-rw-r--r--canvas/source/vcl/textlayout.hxx2
-rw-r--r--canvas/workben/canvasdemo.cxx2
-rw-r--r--chart2/qa/extras/chart2import.cxx6
-rw-r--r--chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx3
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.cxx22
-rw-r--r--chart2/source/controller/dialogs/DataBrowser.hxx12
-rw-r--r--chart2/source/controller/dialogs/res_DataLabel.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_AxisPositions.cxx6
-rw-r--r--chart2/source/controller/dialogs/tp_PointGeometry.cxx4
-rw-r--r--chart2/source/controller/dialogs/tp_PolarOptions.cxx2
-rw-r--r--chart2/source/controller/dialogs/tp_SeriesToAxis.cxx10
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx2
-rw-r--r--chart2/source/controller/main/ChartController_Position.cxx8
-rw-r--r--chart2/source/controller/main/ChartController_Window.cxx4
-rw-r--r--chart2/source/controller/main/DragMethod_PieSegment.cxx2
-rw-r--r--chart2/source/controller/main/DrawCommandDispatch.cxx8
-rw-r--r--chart2/source/model/main/ChartModel.cxx8
-rw-r--r--chart2/source/view/axes/DateHelper.cxx2
-rw-r--r--chart2/source/view/axes/MinimumAndMaximumSupplier.cxx8
-rw-r--r--chart2/source/view/axes/ScaleAutomatism.cxx15
-rw-r--r--chart2/source/view/charttypes/VSeriesPlotter.cxx6
-rw-r--r--chart2/source/view/inc/DateHelper.hxx3
-rw-r--r--chart2/source/view/inc/MinimumAndMaximumSupplier.hxx9
-rw-r--r--chart2/source/view/inc/PlottingPositionHelper.hxx5
-rw-r--r--chart2/source/view/inc/VSeriesPlotter.hxx6
-rw-r--r--chart2/source/view/main/ChartView.cxx2
-rw-r--r--chart2/source/view/main/PlottingPositionHelper.cxx2
-rw-r--r--chart2/source/view/main/VLegend.cxx4
-rw-r--r--include/basegfx/utils/zoomtools.hxx5
44 files changed, 135 insertions, 127 deletions
diff --git a/basegfx/source/tools/zoomtools.cxx b/basegfx/source/tools/zoomtools.cxx
index 488b19b31264..4fedb8ee848c 100644
--- a/basegfx/source/tools/zoomtools.cxx
+++ b/basegfx/source/tools/zoomtools.cxx
@@ -26,7 +26,7 @@ const double ZOOM_FACTOR = 1.12246205;
* @param nCurrent current value
* @param nMultiple multiple against which the current value is rounded
*/
-static long roundMultiple(long nCurrent, int nMultiple)
+static tools::Long roundMultiple(tools::Long nCurrent, int nMultiple)
{
// round zoom to a multiple of nMultiple
return (( nCurrent + nMultiple / 2 ) - ( nCurrent + nMultiple / 2 ) % nMultiple);
@@ -39,10 +39,10 @@ static long roundMultiple(long nCurrent, int nMultiple)
*
* @param nCurrent current zoom factor
*/
-static long roundZoom(double nCurrent)
+static tools::Long roundZoom(double nCurrent)
{
// convert nCurrent properly to int
- long nNew = nCurrent + 0.5;
+ tools::Long nNew = nCurrent + 0.5;
// round to more common numbers above 50
if (nNew > 1000) {
@@ -66,7 +66,7 @@ static long roundZoom(double nCurrent)
* @param nPrevious previous zoom factor
* @param nStep step which shouldn't be skipped
*/
-static long enforceStep(long nCurrent, long nPrevious, int nStep)
+static tools::Long enforceStep(tools::Long nCurrent, tools::Long nPrevious, int nStep)
{
if ((( nCurrent > nStep ) && ( nPrevious < nStep ))
|| (( nCurrent < nStep ) && ( nPrevious > nStep )))
@@ -80,9 +80,9 @@ static long enforceStep(long nCurrent, long nPrevious, int nStep)
*
* @param nCurrent current zoom factor
*/
-long zoomIn(long nCurrent)
+tools::Long zoomIn(tools::Long nCurrent)
{
- long nNew = roundZoom( nCurrent * ZOOM_FACTOR );
+ tools::Long nNew = roundZoom( nCurrent * ZOOM_FACTOR );
// make sure some values are not skipped
nNew = enforceStep(nNew, nCurrent, 200);
nNew = enforceStep(nNew, nCurrent, 100);
@@ -97,9 +97,9 @@ long zoomIn(long nCurrent)
*
* @param nCurrent current zoom factor
*/
-long zoomOut(long nCurrent)
+tools::Long zoomOut(tools::Long nCurrent)
{
- long nNew = roundZoom( nCurrent / ZOOM_FACTOR );
+ tools::Long nNew = roundZoom( nCurrent / ZOOM_FACTOR );
// make sure some values are not skipped
nNew = enforceStep(nNew, nCurrent, 200);
nNew = enforceStep(nNew, nCurrent, 100);
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 )
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index 6ba15411c9aa..cca052d167e0 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -78,7 +78,7 @@ namespace cairocanvas
if( !::basegfx::fTools::equalZero( fDividend) )
fStretch /= fDividend;
- const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
+ const tools::Long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
maFont->SetAverageFontWidth( nNewWidth );
diff --git a/canvas/source/cairo/cairo_canvashelper.cxx b/canvas/source/cairo/cairo_canvashelper.cxx
index 0ca169ca1fe4..7d4cdba478f4 100644
--- a/canvas/source/cairo/cairo_canvashelper.cxx
+++ b/canvas/source/cairo/cairo_canvashelper.cxx
@@ -360,8 +360,8 @@ namespace cairocanvas
if( !pSurface )
{
- long nWidth;
- long nHeight;
+ tools::Long nWidth;
+ tools::Long nHeight;
vcl::bitmap::CanvasCairoExtractBitmapData(aBmpEx, aBitmap, data, bHasAlpha, nWidth, nHeight);
SurfaceSharedPtr pImageSurface = rSurfaceProvider->getOutputDevice()->CreateSurface(
diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index d81a739b4956..3d4b9ca5a7c3 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -324,7 +324,7 @@ namespace cairocanvas
};
}
- void TextLayout::setupTextOffsets( long* outputOffsets,
+ void TextLayout::setupTextOffsets( tools::Long* outputOffsets,
const uno::Sequence< double >& inputOffsets,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState ) const
diff --git a/canvas/source/cairo/cairo_textlayout.hxx b/canvas/source/cairo/cairo_textlayout.hxx
index a2ca8c93afbb..b2e5c72d0b53 100644
--- a/canvas/source/cairo/cairo_textlayout.hxx
+++ b/canvas/source/cairo/cairo_textlayout.hxx
@@ -86,7 +86,7 @@ namespace cairocanvas
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
- void setupTextOffsets( long* outputOffsets,
+ void setupTextOffsets( tools::Long* outputOffsets,
const css::uno::Sequence< double >& inputOffsets,
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 173203a85bdf..e7fab0492549 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -78,7 +78,7 @@ namespace vclcanvas
if( !::basegfx::fTools::equalZero( fDividend) )
fStretch /= fDividend;
- const long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
+ const ::tools::Long nNewWidth = ::basegfx::fround( aSize.Width() * fStretch );
maFont->SetAverageFontWidth( nNewWidth );
diff --git a/canvas/source/vcl/spritehelper.cxx b/canvas/source/vcl/spritehelper.cxx
index 14be26c2aa6c..96300101b5ae 100644
--- a/canvas/source/vcl/spritehelper.cxx
+++ b/canvas/source/vcl/spritehelper.cxx
@@ -325,7 +325,7 @@ namespace vclcanvas
// paint sprite prio
vcl::Font aVCLFont;
- aVCLFont.SetFontHeight( std::min(long(20),aOutputSize.Height()) );
+ aVCLFont.SetFontHeight( std::min(::tools::Long(20),aOutputSize.Height()) );
aVCLFont.SetColor( COL_RED );
rTargetSurface.SetTextAlign(ALIGN_TOP);
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index ab4a0084dc89..0e64c8f8a255 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -388,7 +388,7 @@ namespace vclcanvas
};
}
- void TextLayout::setupTextOffsets( long* outputOffsets,
+ void TextLayout::setupTextOffsets( ::tools::Long* outputOffsets,
const uno::Sequence< double >& inputOffsets,
const rendering::ViewState& viewState,
const rendering::RenderState& renderState ) const
diff --git a/canvas/source/vcl/textlayout.hxx b/canvas/source/vcl/textlayout.hxx
index b3c9acdb7de6..43853740588b 100644
--- a/canvas/source/vcl/textlayout.hxx
+++ b/canvas/source/vcl/textlayout.hxx
@@ -85,7 +85,7 @@ namespace vclcanvas
const css::rendering::RenderState& renderState ) const;
private:
- void setupTextOffsets( long* outputOffsets,
+ void setupTextOffsets( ::tools::Long* outputOffsets,
const css::uno::Sequence< double >& inputOffsets,
const css::rendering::ViewState& viewState,
const css::rendering::RenderState& renderState ) const;
diff --git a/canvas/workben/canvasdemo.cxx b/canvas/workben/canvasdemo.cxx
index 233f0ff3e7d8..4854a07d1ace 100644
--- a/canvas/workben/canvasdemo.cxx
+++ b/canvas/workben/canvasdemo.cxx
@@ -131,7 +131,7 @@ class DemoRenderer
void drawGrid()
{
- long d, dIncr = maSize.Width() / 3;
+ tools::Long d, dIncr = maSize.Width() / 3;
for ( d = 0; d <= maSize.Width(); d += dIncr )
mxCanvas->drawLine( geometry::RealPoint2D( d, 0 ),
geometry::RealPoint2D( d, maSize.Height() ),
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 1318a1ddebfa..ca454d2ae11f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -968,17 +968,17 @@ void Chart2ImportTest::testTdf105517()
Reference<beans::XPropertySet> xPropSet1(xDSContainer->getDataSeries()[0], uno::UNO_QUERY);
CPPUNIT_ASSERT(xPropSet1.is());
- long lineColor;
+ tools::Long lineColor;
xPropSet1->getPropertyValue("Color") >>= lineColor;
// incorrect line color was 0x4a7ebb due to not handling themeOverride
- CPPUNIT_ASSERT_EQUAL(long(0xeaa700), lineColor);
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0xeaa700), lineColor);
Reference<beans::XPropertySet> xPropSet2(xDSContainer->getDataSeries()[1], uno::UNO_QUERY);
CPPUNIT_ASSERT(xPropSet2.is());
xPropSet2->getPropertyValue("Color") >>= lineColor;
// incorrect line color was 0x98b855
- CPPUNIT_ASSERT_EQUAL(long(0x1e69a8), lineColor);
+ CPPUNIT_ASSERT_EQUAL(tools::Long(0x1e69a8), lineColor);
}
void Chart2ImportTest::testTdf106217()
diff --git a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
index 63abadee1b85..b49c5177dc2e 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty.cxx
@@ -20,6 +20,7 @@
#include "WrappedGapwidthProperty.hxx"
#include "Chart2ModelContact.hxx"
#include <DiagramHelper.hxx>
+#include <tools/long.hxx>
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
@@ -82,7 +83,7 @@ void WrappedBarPositionProperty_Base::setPropertyValue( const Any& rOuterValue,
Sequence< sal_Int32 > aBarPositionSequence;
xProp->getPropertyValue( m_InnerSequencePropertyName ) >>= aBarPositionSequence;
- long nOldLength = aBarPositionSequence.getLength();
+ tools::Long nOldLength = aBarPositionSequence.getLength();
if( nOldLength <= m_nAxisIndex )
{
aBarPositionSequence.realloc( m_nAxisIndex+1 );
diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx
index 89036649c500..9efa33d2d726 100644
--- a/chart2/source/controller/dialogs/DataBrowser.cxx
+++ b/chart2/source/controller/dialogs/DataBrowser.cxx
@@ -70,7 +70,7 @@ const BrowserMode BrowserStdFlags = BrowserMode::COLUMNSELECTION |
BrowserMode::AUTO_HSCROLL | BrowserMode::AUTO_VSCROLL |
BrowserMode::HIDESELECT;
-sal_Int32 lcl_getRowInData( long nRow )
+sal_Int32 lcl_getRowInData( tools::Long nRow )
{
return static_cast< sal_Int32 >( nRow );
}
@@ -607,7 +607,7 @@ void DataBrowser::RenewTable()
if (!m_apDataBrowserModel)
return;
- long nOldRow = GetCurRow();
+ tools::Long nOldRow = GetCurRow();
sal_uInt16 nOldColId = GetCurColumnId();
bool bLastUpdateMode = GetUpdateMode();
@@ -684,7 +684,7 @@ OUString DataBrowser::GetColString( sal_Int32 nColumnId ) const
return OUString();
}
-OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
+OUString DataBrowser::GetCellText( tools::Long nRow, sal_uInt16 nColumnId ) const
{
OUString aResult;
@@ -744,7 +744,7 @@ OUString DataBrowser::GetCellText( long nRow, sal_uInt16 nColumnId ) const
return aResult;
}
-double DataBrowser::GetCellNumber( long nRow, sal_uInt16 nColumnId ) const
+double DataBrowser::GetCellNumber( tools::Long nRow, sal_uInt16 nColumnId ) const
{
double fResult;
::rtl::math::setNan( & fResult );
@@ -1063,7 +1063,7 @@ void DataBrowser::PaintCell(
rDev.SetClipRegion();
}
-bool DataBrowser::SeekRow( long nRow )
+bool DataBrowser::SeekRow( tools::Long nRow )
{
if( ! EditBrowseBox::SeekRow( nRow ))
return false;
@@ -1078,14 +1078,14 @@ bool DataBrowser::SeekRow( long nRow )
bool DataBrowser::IsTabAllowed( bool bForward ) const
{
- long nRow = GetCurRow();
- long nCol = GetCurColumnId();
+ tools::Long nRow = GetCurRow();
+ tools::Long nCol = GetCurColumnId();
// column 0 is header-column
- long nBadCol = bForward
+ tools::Long nBadCol = bForward
? GetColumnCount() - 1
: 1;
- long nBadRow = bForward
+ tools::Long nBadRow = bForward
? GetRowCount() - 1
: 0;
@@ -1099,7 +1099,7 @@ bool DataBrowser::IsTabAllowed( bool bForward ) const
nCol != nBadCol );
}
-::svt::CellController* DataBrowser::GetController( long /*nRow*/, sal_uInt16 nCol )
+::svt::CellController* DataBrowser::GetController( tools::Long /*nRow*/, sal_uInt16 nCol )
{
if( m_bIsReadOnly )
return nullptr;
@@ -1116,7 +1116,7 @@ bool DataBrowser::IsTabAllowed( bool bForward ) const
}
void DataBrowser::InitController(
- ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol )
+ ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol )
{
if( rController == m_rTextEditController )
{
diff --git a/chart2/source/controller/dialogs/DataBrowser.hxx b/chart2/source/controller/dialogs/DataBrowser.hxx
index 4a0888e3821c..e94ff26983ae 100644
--- a/chart2/source/controller/dialogs/DataBrowser.hxx
+++ b/chart2/source/controller/dialogs/DataBrowser.hxx
@@ -55,10 +55,10 @@ class DataBrowser : public ::svt::EditBrowseBox
protected:
// EditBrowseBox overridables
virtual void PaintCell( OutputDevice& rDev, const tools::Rectangle& rRect, sal_uInt16 nColumnId ) const override;
- virtual bool SeekRow( long nRow ) override;
+ virtual bool SeekRow( tools::Long nRow ) override;
virtual bool IsTabAllowed( bool bForward ) const override;
- virtual ::svt::CellController* GetController( long nRow, sal_uInt16 nCol ) override;
- virtual void InitController( ::svt::CellControllerRef& rController, long nRow, sal_uInt16 nCol ) override;
+ virtual ::svt::CellController* GetController( tools::Long nRow, sal_uInt16 nCol ) override;
+ virtual void InitController( ::svt::CellControllerRef& rController, tools::Long nRow, sal_uInt16 nCol ) override;
virtual bool SaveModified() override;
virtual void CursorMoved() override;
// called whenever the control of the current cell has been modified
@@ -82,12 +82,12 @@ public:
@return
the text out of the cell
*/
- virtual OUString GetCellText(long nRow, sal_uInt16 nColId) const override;
+ virtual OUString GetCellText(tools::Long nRow, sal_uInt16 nColId) const override;
/** returns the number in the given cell. If a cell is empty or contains a
string, the result will be Nan
*/
- double GetCellNumber( long nRow, sal_uInt16 nColumnId ) const;
+ double GetCellNumber( tools::Long nRow, sal_uInt16 nColumnId ) const;
bool isDateTimeString( const OUString& aInputString, double& fOutDateTimeValue );
@@ -154,7 +154,7 @@ private:
std::shared_ptr< NumberFormatterWrapper > m_spNumberFormatterWrapper;
/// the row that is currently painted
- long m_nSeekRow;
+ tools::Long m_nSeekRow;
bool m_bIsReadOnly;
bool m_bDataValid;
diff --git a/chart2/source/controller/dialogs/res_DataLabel.cxx b/chart2/source/controller/dialogs/res_DataLabel.cxx
index 281beb86dd6f..8afe2a8b2e68 100644
--- a/chart2/source/controller/dialogs/res_DataLabel.cxx
+++ b/chart2/source/controller/dialogs/res_DataLabel.cxx
@@ -236,7 +236,7 @@ void DataLabelResources::EnableControls()
// Enable or disable separator, placement and direction based on the check
// box states. Note that the check boxes are tri-state.
{
- long nNumberOfCheckedLabelParts = 0;
+ tools::Long nNumberOfCheckedLabelParts = 0;
if (m_xCBNumber->get_state() != TRISTATE_FALSE)
++nNumberOfCheckedLabelParts;
if (m_xCBPercent->get_state() != TRISTATE_FALSE && m_xCBPercent->get_sensitive())
diff --git a/chart2/source/controller/dialogs/tp_AxisPositions.cxx b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
index f94f09b98690..d4e7fa218023 100644
--- a/chart2/source/controller/dialogs/tp_AxisPositions.cxx
+++ b/chart2/source/controller/dialogs/tp_AxisPositions.cxx
@@ -101,8 +101,8 @@ bool AxisPositionsTabPage::FillItemSet(SfxItemSet* rOutAttrs)
rOutAttrs->Put( SfxInt32Item( SCHATTR_AXIS_LABEL_POSITION, nLabelPos ));
// tick marks
- long nTicks=0;
- long nMinorTicks=0;
+ tools::Long nTicks=0;
+ tools::Long nMinorTicks=0;
if(m_xCB_MinorInner->get_active())
nMinorTicks|=CHAXIS_MARK_INNER;
@@ -211,7 +211,7 @@ void AxisPositionsTabPage::Reset(const SfxItemSet* rInAttrs)
PlaceLabelsSelectHdl( *m_xLB_PlaceLabels );
// Tick marks
- long nTicks = 0, nMinorTicks = 0;
+ tools::Long nTicks = 0, nMinorTicks = 0;
if (rInAttrs->GetItemState(SCHATTR_AXIS_TICKS,true, &pPoolItem)== SfxItemState::SET)
nTicks = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if (rInAttrs->GetItemState(SCHATTR_AXIS_HELPTICKS,true, &pPoolItem)== SfxItemState::SET)
diff --git a/chart2/source/controller/dialogs/tp_PointGeometry.cxx b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
index 6d2ac1b45332..88116ee890e1 100644
--- a/chart2/source/controller/dialogs/tp_PointGeometry.cxx
+++ b/chart2/source/controller/dialogs/tp_PointGeometry.cxx
@@ -49,7 +49,7 @@ bool SchLayoutTabPage::FillItemSet(SfxItemSet* rOutAttrs)
int nShape = m_pGeometryResources ? m_pGeometryResources->get_selected_index() : -1;
if (nShape != -1)
{
- long nSegs=32;
+ tools::Long nSegs=32;
if (nShape==CHART_SHAPE3D_PYRAMID)
nSegs=4;
@@ -66,7 +66,7 @@ void SchLayoutTabPage::Reset(const SfxItemSet* rInAttrs)
if (rInAttrs->GetItemState(SCHATTR_STYLE_SHAPE,true, &pPoolItem) == SfxItemState::SET)
{
- long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ tools::Long nVal = static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if(m_pGeometryResources)
{
m_pGeometryResources->select(static_cast<sal_uInt16>(nVal));
diff --git a/chart2/source/controller/dialogs/tp_PolarOptions.cxx b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
index e858813bb39f..f96d9c614450 100644
--- a/chart2/source/controller/dialogs/tp_PolarOptions.cxx
+++ b/chart2/source/controller/dialogs/tp_PolarOptions.cxx
@@ -74,7 +74,7 @@ void PolarOptionsTabPage::Reset(const SfxItemSet* rInAttrs)
if (rInAttrs->GetItemState(SCHATTR_STARTING_ANGLE, true, &pPoolItem) == SfxItemState::SET)
{
- long nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ tools::Long nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
m_xAngleDial->SetRotation( nTmp*100 );
}
else
diff --git a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
index 82bd80ab6542..36d86c4873ef 100644
--- a/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
+++ b/chart2/source/controller/dialogs/tp_SeriesToAxis.cxx
@@ -119,7 +119,7 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xRbtAxis2->set_active(false);
if (rInAttrs->GetItemState(SCHATTR_AXIS,true, &pPoolItem) == SfxItemState::SET)
{
- long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ tools::Long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if(nVal==CHART_AXIS_SECONDARY_Y)
{
m_xRbtAxis2->set_active(true);
@@ -127,16 +127,16 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
}
}
- long nTmp;
+ tools::Long nTmp;
if (rInAttrs->GetItemState(SCHATTR_BAR_GAPWIDTH, true, &pPoolItem) == SfxItemState::SET)
{
- nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
m_xMTGap->set_value(nTmp, FieldUnit::PERCENT);
}
if (rInAttrs->GetItemState(SCHATTR_BAR_OVERLAP, true, &pPoolItem) == SfxItemState::SET)
{
- nTmp = static_cast<long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
+ nTmp = static_cast<tools::Long>(static_cast<const SfxInt32Item*>(pPoolItem)->GetValue());
m_xMTOverlap->set_value(nTmp, FieldUnit::PERCENT);
}
@@ -185,7 +185,7 @@ void SchOptionTabPage::Reset(const SfxItemSet* rInAttrs)
m_xRB_ContinueLine->set_sensitive(true);
}
- long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
+ tools::Long nVal=static_cast<const SfxInt32Item*>(pPoolItem)->GetValue();
if(nVal==css::chart::MissingValueTreatment::LEAVE_GAP)
m_xRB_DontPaint->set_active(true);
else if(nVal==css::chart::MissingValueTreatment::USE_ZERO)
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index 62078d4a877a..04646b69acb6 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -305,7 +305,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI
break;
case SCHATTR_AXIS_TIME_RESOLUTION:
{
- long nTimeResolution=0;
+ tools::Long nTimeResolution=0;
if( rTimeIncrement.TimeResolution >>= nTimeResolution )
rOutItemSet.Put( SfxInt32Item( nWhichId, nTimeResolution ) );
else if( m_pExplicitScale )
diff --git a/chart2/source/controller/main/ChartController_Position.cxx b/chart2/source/controller/main/ChartController_Position.cxx
index 52664c356257..c6af3878bdd7 100644
--- a/chart2/source/controller/main/ChartController_Position.cxx
+++ b/chart2/source/controller/main/ChartController_Position.cxx
@@ -47,10 +47,10 @@ using namespace ::com::sun::star::chart2;
static void lcl_getPositionAndSizeFromItemSet( const SfxItemSet& rItemSet, awt::Rectangle& rPosAndSize, const awt::Size& rOriginalSize )
{
- long nPosX(0);
- long nPosY(0);
- long nSizX(0);
- long nSizY(0);
+ tools::Long nPosX(0);
+ tools::Long nPosY(0);
+ tools::Long nSizX(0);
+ tools::Long nSizY(0);
RectPoint eRP = RectPoint::LT;
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index bd5167766097..51de2bd9ee92 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -1549,8 +1549,8 @@ bool ChartController::execute_KeyInput( const KeyEvent& rKEvt )
awt::Point aPos( xShape->getPosition() );
awt::Size aSize( xShape->getSize() );
awt::Size aPageSize( ChartModelHelper::getPageSize( getModel() ) );
- aPos.X = static_cast< long >( static_cast< double >( aPos.X ) + fShiftAmountX );
- aPos.Y = static_cast< long >( static_cast< double >( aPos.Y ) + fShiftAmountY );
+ aPos.X = static_cast< tools::Long >( static_cast< double >( aPos.X ) + fShiftAmountX );
+ aPos.Y = static_cast< tools::Long >( static_cast< double >( aPos.Y ) + fShiftAmountY );
if( aPos.X + aSize.Width > aPageSize.Width )
aPos.X = aPageSize.Width - aSize.Width;
if( aPos.X < 0 )
diff --git a/chart2/source/controller/main/DragMethod_PieSegment.cxx b/chart2/source/controller/main/DragMethod_PieSegment.cxx
index 9814a5db6595..100846ba9357 100644
--- a/chart2/source/controller/main/DragMethod_PieSegment.cxx
+++ b/chart2/source/controller/main/DragMethod_PieSegment.cxx
@@ -98,7 +98,7 @@ void DragMethod_PieSegment::MoveSdrDrag(const Point& rPnt)
m_fAdditionalOffset = 1.0 - m_fInitialOffset;
B2DVector aNewPosVector = m_aStartVector + (m_aDragDirection * m_fAdditionalOffset);
- Point aNewPos( static_cast<long>(aNewPosVector.getX()), static_cast<long>(aNewPosVector.getY()) );
+ Point aNewPos( static_cast<tools::Long>(aNewPosVector.getX()), static_cast<tools::Long>(aNewPosVector.getY()) );
if( aNewPos != DragStat().GetNow() )
{
Hide();
diff --git a/chart2/source/controller/main/DrawCommandDispatch.cxx b/chart2/source/controller/main/DrawCommandDispatch.cxx
index 24ed7095707f..dd690aa1cf1c 100644
--- a/chart2/source/controller/main/DrawCommandDispatch.cxx
+++ b/chart2/source/controller/main/DrawCommandDispatch.cxx
@@ -81,8 +81,8 @@ static ::basegfx::B2DPolyPolygon getPolygon(const char* pResId, const SdrModel&
if ( pLineEndList.is() )
{
OUString aName(SvxResId(pResId));
- long nCount = pLineEndList->Count();
- for ( long nIndex = 0; nIndex < nCount; ++nIndex )
+ tools::Long nCount = pLineEndList->Count();
+ for ( tools::Long nIndex = 0; nIndex < nCount; ++nIndex )
{
const XLineEndEntry* pEntry = pLineEndList->GetLineEnd(nIndex);
if ( pEntry->GetName() == aName )
@@ -191,10 +191,10 @@ void DrawCommandDispatch::setLineEnds( SfxItemSet& rAttr )
SfxItemSet aSet( pDrawViewWrapper->GetModel()->GetItemPool() );
pDrawViewWrapper->GetAttributes( aSet );
- long nWidth = 300; // (1/100th mm)
+ tools::Long nWidth = 300; // (1/100th mm)
if ( aSet.GetItemState( XATTR_LINEWIDTH ) != SfxItemState::DONTCARE )
{
- long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
+ tools::Long nValue = aSet.Get( XATTR_LINEWIDTH ).GetValue();
if ( nValue > 0 )
{
nWidth = nValue * 3;
diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx
index 0b75c82319d1..0ac958b88a11 100644
--- a/chart2/source/model/main/ChartModel.cxx
+++ b/chart2/source/model/main/ChartModel.cxx
@@ -283,10 +283,10 @@ void ChartModel::impl_adjustAdditionalShapesPositionAndSize( const awt::Size& aV
double fWidth = static_cast< double >( aVisualAreaSize.Width ) / m_aVisualAreaSize.Width;
double fHeight = static_cast< double >( aVisualAreaSize.Height ) / m_aVisualAreaSize.Height;
- aPos.X = static_cast< long >( aPos.X * fWidth );
- aPos.Y = static_cast< long >( aPos.Y * fHeight );
- aSize.Width = static_cast< long >( aSize.Width * fWidth );
- aSize.Height = static_cast< long >( aSize.Height * fHeight );
+ aPos.X = static_cast< tools::Long >( aPos.X * fWidth );
+ aPos.Y = static_cast< tools::Long >( aPos.Y * fHeight );
+ aSize.Width = static_cast< tools::Long >( aSize.Width * fWidth );
+ aSize.Height = static_cast< tools::Long >( aSize.Height * fHeight );
xShape->setPosition( aPos );
xShape->setSize( aSize );
diff --git a/chart2/source/view/axes/DateHelper.cxx b/chart2/source/view/axes/DateHelper.cxx
index f705a7346091..4c4a96dce2f8 100644
--- a/chart2/source/view/axes/DateHelper.cxx
+++ b/chart2/source/view/axes/DateHelper.cxx
@@ -66,7 +66,7 @@ bool DateHelper::IsLessThanOneYearAway( const Date& rD1, const Date& rD2 )
return rD2 > aDMin && rD2 < aDMax;
}
-double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution )
+double DateHelper::RasterizeDateValue( double fValue, const Date& rNullDate, tools::Long TimeResolution )
{
if (std::isnan(fValue))
return fValue;
diff --git a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
index 2bb936567469..2c9264786edf 100644
--- a/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
+++ b/chart2/source/view/axes/MinimumAndMaximumSupplier.cxx
@@ -185,19 +185,19 @@ void MergedMinimumAndMaximumSupplier::clearMinimumAndMaximumSupplierList()
m_aMinimumAndMaximumSupplierList.clear();
}
-long MergedMinimumAndMaximumSupplier::calculateTimeResolutionOnXAxis()
+tools::Long MergedMinimumAndMaximumSupplier::calculateTimeResolutionOnXAxis()
{
- long nRet = css::chart::TimeUnit::YEAR;
+ tools::Long nRet = css::chart::TimeUnit::YEAR;
for (auto const& elem : m_aMinimumAndMaximumSupplierList)
{
- long nCurrent = elem->calculateTimeResolutionOnXAxis();
+ tools::Long nCurrent = elem->calculateTimeResolutionOnXAxis();
if(nRet>nCurrent)
nRet=nCurrent;
}
return nRet;
}
-void MergedMinimumAndMaximumSupplier::setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate )
+void MergedMinimumAndMaximumSupplier::setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate )
{
for (auto const& elem : m_aMinimumAndMaximumSupplierList)
elem->setTimeResolutionOnXAxis( nTimeResolution, rNullDate );
diff --git a/chart2/source/view/axes/ScaleAutomatism.cxx b/chart2/source/view/axes/ScaleAutomatism.cxx
index 10fc3ccd4f56..7557f9b3d95b 100644
--- a/chart2/source/view/axes/ScaleAutomatism.cxx
+++ b/chart2/source/view/axes/ScaleAutomatism.cxx
@@ -26,6 +26,7 @@
#include <com/sun/star/chart2/AxisType.hpp>
#include <rtl/math.hxx>
+#include <tools/long.hxx>
#include <limits>
namespace chart
@@ -612,11 +613,11 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
nMaxMainIncrementCount--;
//choose major time interval:
- long nDayCount = aMaxDate - aMinDate;
- long nMainIncrementCount = 1;
+ tools::Long nDayCount = aMaxDate - aMinDate;
+ tools::Long nMainIncrementCount = 1;
if( !bAutoMajor )
{
- long nIntervalDayCount = rExplicitIncrement.MajorTimeInterval.Number;
+ tools::Long nIntervalDayCount = rExplicitIncrement.MajorTimeInterval.Number;
if( rExplicitIncrement.MajorTimeInterval.TimeUnit < rExplicitScale.TimeResolution )
rExplicitIncrement.MajorTimeInterval.TimeUnit = rExplicitScale.TimeResolution;
switch( rExplicitIncrement.MajorTimeInterval.TimeUnit )
@@ -636,8 +637,8 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
}
if( bAutoMajor )
{
- long nNumer = 1;
- long nIntervalDays = nDayCount / nMaxMainIncrementCount;
+ tools::Long nNumer = 1;
+ tools::Long nIntervalDays = nDayCount / nMaxMainIncrementCount;
double nDaysPerInterval = 1.0;
if( nIntervalDays>365 || rExplicitScale.TimeResolution==YEAR )
{
@@ -672,7 +673,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
}
}
rExplicitIncrement.MajorTimeInterval.Number = nNumer;
- nMainIncrementCount = static_cast<long>(nDayCount/(nNumer*nDaysPerInterval));
+ nMainIncrementCount = static_cast<tools::Long>(nDayCount/(nNumer*nDaysPerInterval));
}
//choose minor time interval:
@@ -680,7 +681,7 @@ void ScaleAutomatism::calculateExplicitIncrementAndScaleForDateTimeAxis(
{
if( rExplicitIncrement.MinorTimeInterval.TimeUnit > rExplicitIncrement.MajorTimeInterval.TimeUnit )
rExplicitIncrement.MinorTimeInterval.TimeUnit = rExplicitIncrement.MajorTimeInterval.TimeUnit;
- long nIntervalDayCount = rExplicitIncrement.MinorTimeInterval.Number;
+ tools::Long nIntervalDayCount = rExplicitIncrement.MinorTimeInterval.Number;
switch( rExplicitIncrement.MinorTimeInterval.TimeUnit )
{
case DAY:
diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx
index 04bd30f3bdcc..bda5509c4e4b 100644
--- a/chart2/source/view/charttypes/VSeriesPlotter.cxx
+++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx
@@ -1620,16 +1620,16 @@ void VSeriesPlotter::setMappedProperties(
PropertyMapper::setMappedProperties(xTargetProp,xSource,rMap,pOverwriteMap);
}
-void VSeriesPlotter::setTimeResolutionOnXAxis( long TimeResolution, const Date& rNullDate )
+void VSeriesPlotter::setTimeResolutionOnXAxis( tools::Long TimeResolution, const Date& rNullDate )
{
m_nTimeResolution = TimeResolution;
m_aNullDate = rNullDate;
}
// MinimumAndMaximumSupplier
-long VSeriesPlotter::calculateTimeResolutionOnXAxis()
+tools::Long VSeriesPlotter::calculateTimeResolutionOnXAxis()
{
- long nRet = css::chart::TimeUnit::YEAR;
+ tools::Long nRet = css::chart::TimeUnit::YEAR;
if (!m_pExplicitCategoriesProvider)
return nRet;
diff --git a/chart2/source/view/inc/DateHelper.hxx b/chart2/source/view/inc/DateHelper.hxx
index 253432eeef4a..8c37851b7de3 100644
--- a/chart2/source/view/inc/DateHelper.hxx
+++ b/chart2/source/view/inc/DateHelper.hxx
@@ -19,6 +19,7 @@
#pragma once
#include <tools/date.hxx>
+#include <tools/long.hxx>
namespace chart
{
@@ -34,7 +35,7 @@ public:
static bool IsLessThanOneMonthAway( const Date& rD1, const Date& rD2 );
static bool IsLessThanOneYearAway( const Date& rD1, const Date& rD2 );
- static double RasterizeDateValue( double fValue, const Date& rNullDate, long TimeResolution );
+ static double RasterizeDateValue( double fValue, const Date& rNullDate, tools::Long TimeResolution );
};
} //namespace chart
diff --git a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
index 2dd8e672d522..b97f5d0d1a26 100644
--- a/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
+++ b/chart2/source/view/inc/MinimumAndMaximumSupplier.hxx
@@ -21,6 +21,7 @@
#include <sal/types.h>
#include <tools/date.hxx>
+#include <tools/long.hxx>
#include <set>
namespace chart
@@ -47,8 +48,8 @@ public:
virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) = 0;
//return a constant out of css::chart::TimeUnit that allows to display the smallest distance between occurring dates
- virtual long calculateTimeResolutionOnXAxis() = 0;
- virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) = 0;
+ virtual tools::Long calculateTimeResolutionOnXAxis() = 0;
+ virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) = 0;
protected:
~MinimumAndMaximumSupplier() {}
@@ -78,8 +79,8 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) override;
virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) override;
- virtual long calculateTimeResolutionOnXAxis() override;
- virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) override;
+ virtual tools::Long calculateTimeResolutionOnXAxis() override;
+ virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) override;
private:
typedef std::set< MinimumAndMaximumSupplier* > MinimumAndMaximumSupplierSet;
diff --git a/chart2/source/view/inc/PlottingPositionHelper.hxx b/chart2/source/view/inc/PlottingPositionHelper.hxx
index f1697abbef5e..763b7205209e 100644
--- a/chart2/source/view/inc/PlottingPositionHelper.hxx
+++ b/chart2/source/view/inc/PlottingPositionHelper.hxx
@@ -22,6 +22,7 @@
#include <basegfx/range/b2drectangle.hxx>
#include <rtl/math.hxx>
+#include <tools/long.hxx>
#include <com/sun/star/drawing/Direction3D.hpp>
#include <com/sun/star/drawing/Position3D.hpp>
#include <basegfx/matrix/b3dhommatrix.hxx>
@@ -106,7 +107,7 @@ public:
inline bool maySkipPointsInRegressionCalculation() const;
- void setTimeResolution( long nTimeResolution, const Date& rNullDate );
+ void setTimeResolution( tools::Long nTimeResolution, const Date& rNullDate );
virtual void setScaledCategoryWidth( double fScaledCategoryWidth );
void AllowShiftXAxisPos( bool bAllowShift );
void AllowShiftZAxisPos( bool bAllowShift );
@@ -127,7 +128,7 @@ protected: //member
bool m_bMaySkipPointsInRegressionCalculation;
bool m_bDateAxis;
- long m_nTimeResolution;
+ tools::Long m_nTimeResolution;
Date m_aNullDate;
double m_fScaledCategoryWidth;
diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 51bc102694b7..7632ff586633 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -171,8 +171,8 @@ public:
virtual bool isExpandNarrowValuesTowardZero( sal_Int32 nDimensionIndex ) override;
virtual bool isSeparateStackingForDifferentSigns( sal_Int32 nDimensionIndex ) override;
- virtual long calculateTimeResolutionOnXAxis() override;
- virtual void setTimeResolutionOnXAxis( long nTimeResolution, const Date& rNullDate ) override;
+ virtual tools::Long calculateTimeResolutionOnXAxis() override;
+ virtual void setTimeResolutionOnXAxis( tools::Long nTimeResolution, const Date& rNullDate ) override;
void getMinimumAndMaximumX( double& rfMinimum, double& rfMaximum ) const;
void getMinimumAndMaximumYInContinuousXRange( double& rfMinY, double& rfMaxY, double fMinX, double fMaxX, sal_Int32 nAxisIndex ) const;
@@ -412,7 +412,7 @@ protected:
std::vector< std::vector< VDataSeriesGroup > > m_aZSlots;
bool m_bCategoryXAxis;//true->xvalues are indices (this would not be necessary if series for category chart wouldn't have x-values)
- long m_nTimeResolution;
+ tools::Long m_nTimeResolution;
Date m_aNullDate;
std::unique_ptr< NumberFormatterWrapper > m_apNumberFormatterWrapper;
diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx
index f713e8b86923..56a64d349e6f 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -2279,7 +2279,7 @@ void lcl_createButtons(const uno::Reference<drawing::XShapes>& xPageShapes,
awt::Size aSize(4000, 700); // size of the button
- long x = 0;
+ tools::Long x = 0;
if (xPivotTableDataProvider->getPageFields().hasElements())
{
diff --git a/chart2/source/view/main/PlottingPositionHelper.cxx b/chart2/source/view/main/PlottingPositionHelper.cxx
index d26e9331ba44..b8e9431ae2ab 100644
--- a/chart2/source/view/main/PlottingPositionHelper.cxx
+++ b/chart2/source/view/main/PlottingPositionHelper.cxx
@@ -652,7 +652,7 @@ double PlottingPositionHelper::getBaseValueY() const
return m_aScales[1].Origin;
}
-void PlottingPositionHelper::setTimeResolution( long nTimeResolution, const Date& rNullDate )
+void PlottingPositionHelper::setTimeResolution( tools::Long nTimeResolution, const Date& rNullDate )
{
m_nTimeResolution = nTimeResolution;
m_aNullDate = rNullDate;
diff --git a/chart2/source/view/main/VLegend.cxx b/chart2/source/view/main/VLegend.cxx
index afd4468ef1bf..0cde4e500330 100644
--- a/chart2/source/view/main/VLegend.cxx
+++ b/chart2/source/view/main/VLegend.cxx
@@ -826,7 +826,7 @@ bool lcl_shouldSymbolsBePlacedOnTheLeftSide( const Reference< beans::XPropertySe
std::vector<std::shared_ptr<VButton>> lcl_createButtons(
uno::Reference<drawing::XShapes> const & xLegendContainer,
uno::Reference<lang::XMultiServiceFactory> const & xShapeFactory,
- ChartModel& rModel, bool bPlaceButtonsVertically, long & nUsedHeight)
+ ChartModel& rModel, bool bPlaceButtonsVertically, tools::Long & nUsedHeight)
{
std::vector<std::shared_ptr<VButton>> aButtons;
@@ -1014,7 +1014,7 @@ void VLegend::createShapes(
if ( !aViewEntries.empty() || bIsPivotChart )
{
// create buttons
- long nUsedButtonHeight = 0;
+ tools::Long nUsedButtonHeight = 0;
bool bPlaceButtonsVertically = (eLegendPosition != LegendPosition_PAGE_START &&
eLegendPosition != LegendPosition_PAGE_END &&
eExpansion != css::chart::ChartLegendExpansion_WIDE);
diff --git a/include/basegfx/utils/zoomtools.hxx b/include/basegfx/utils/zoomtools.hxx
index 4d85e5dec533..4f347c3ba992 100644
--- a/include/basegfx/utils/zoomtools.hxx
+++ b/include/basegfx/utils/zoomtools.hxx
@@ -10,14 +10,15 @@
#pragma once
#include <basegfx/basegfxdllapi.h>
+#include <tools/long.hxx>
namespace basegfx::zoomtools
{
/** This namespace provides functions for optimized geometric zooming
*/
-BASEGFX_DLLPUBLIC long zoomOut(long nCurrent);
-BASEGFX_DLLPUBLIC long zoomIn(long nCurrent);
+BASEGFX_DLLPUBLIC tools::Long zoomOut(tools::Long nCurrent);
+BASEGFX_DLLPUBLIC tools::Long zoomIn(tools::Long nCurrent);
}