summaryrefslogtreecommitdiff
path: root/chart2
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 /chart2
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>
Diffstat (limited to 'chart2')
-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
26 files changed, 83 insertions, 78 deletions
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);