summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-03-15 09:10:55 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-03-16 06:27:18 +0000
commit61ed494b4acd7664c03a19577c67c9b2c2dec59a (patch)
tree8f569cd23291d2babc4b36cd97a85a286f6f01b8
parent1aeacf54bf6c961d89678e961c747ff76d867c5f (diff)
convert DiagramPositioningMode to scoped enum
Change-Id: I235a9e8bc4fa5406ff71f70c65038127716d58e8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148907 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx4
-rw-r--r--chart2/source/inc/Diagram.hxx6
-rw-r--r--chart2/source/model/main/Diagram.cxx6
-rw-r--r--chart2/source/view/main/SeriesPlotterContainer.cxx2
4 files changed, 8 insertions, 10 deletions
diff --git a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
index 50bedc860974..b9ba429433e2 100644
--- a/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
+++ b/chart2/source/controller/chartapiwrapper/Chart2ModelContact.cxx
@@ -196,7 +196,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleIncludingAxes() const
awt::Rectangle aRect(0,0,0,0);
rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( m_xChartModel );
- if( xDiagram && xDiagram->getDiagramPositioningMode() == DiagramPositioningMode_INCLUDING )
+ if( xDiagram && xDiagram->getDiagramPositioningMode() == DiagramPositioningMode::Including )
aRect = DiagramHelper::getDiagramRectangleFromModel(m_xChartModel.get());
else
{
@@ -212,7 +212,7 @@ awt::Rectangle Chart2ModelContact::GetDiagramRectangleExcludingAxes() const
awt::Rectangle aRect(0,0,0,0);
rtl::Reference< Diagram > xDiagram = ChartModelHelper::findDiagram( m_xChartModel );
- if( xDiagram && xDiagram->getDiagramPositioningMode() == DiagramPositioningMode_EXCLUDING )
+ if( xDiagram && xDiagram->getDiagramPositioningMode() == DiagramPositioningMode::Excluding )
aRect = DiagramHelper::getDiagramRectangleFromModel(m_xChartModel.get());
else
{
diff --git a/chart2/source/inc/Diagram.hxx b/chart2/source/inc/Diagram.hxx
index 3844b34d7638..d9c4b17aa283 100644
--- a/chart2/source/inc/Diagram.hxx
+++ b/chart2/source/inc/Diagram.hxx
@@ -43,11 +43,9 @@ class Legend;
class DataTable;
class Wall;
-enum DiagramPositioningMode
+enum class DiagramPositioningMode
{
- DiagramPositioningMode_AUTO,
- DiagramPositioningMode_EXCLUDING,
- DiagramPositioningMode_INCLUDING
+ Auto, Excluding, Including
};
diff --git a/chart2/source/model/main/Diagram.cxx b/chart2/source/model/main/Diagram.cxx
index 7fbc3459fc49..cda52d52a5bc 100644
--- a/chart2/source/model/main/Diagram.cxx
+++ b/chart2/source/model/main/Diagram.cxx
@@ -704,7 +704,7 @@ css::uno::Sequence< OUString > SAL_CALL Diagram::getSupportedServiceNames()
DiagramPositioningMode Diagram::getDiagramPositioningMode()
{
- DiagramPositioningMode eMode = DiagramPositioningMode_AUTO;
+ DiagramPositioningMode eMode = DiagramPositioningMode::Auto;
chart2::RelativePosition aRelPos;
chart2::RelativeSize aRelSize;
if( (getFastPropertyValue(PROP_DIAGRAM_REL_POS) >>= aRelPos ) &&
@@ -713,9 +713,9 @@ DiagramPositioningMode Diagram::getDiagramPositioningMode()
bool bPosSizeExcludeAxes=false;
getFastPropertyValue(PROP_DIAGRAM_POSSIZE_EXCLUDE_LABELS) >>= bPosSizeExcludeAxes;
if( bPosSizeExcludeAxes )
- eMode = DiagramPositioningMode_EXCLUDING;
+ eMode = DiagramPositioningMode::Excluding;
else
- eMode = DiagramPositioningMode_INCLUDING;
+ eMode = DiagramPositioningMode::Including;
}
return eMode;
}
diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx
index 9f409d0b43b7..bb699e3378c1 100644
--- a/chart2/source/view/main/SeriesPlotterContainer.cxx
+++ b/chart2/source/view/main/SeriesPlotterContainer.cxx
@@ -228,7 +228,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
= ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(xChartType);
bool bExcludingPositioning
- = xDiagram->getDiagramPositioningMode() == DiagramPositioningMode_EXCLUDING;
+ = xDiagram->getDiagramPositioningMode() == DiagramPositioningMode::Excluding;
VSeriesPlotter* pPlotter = VSeriesPlotter::createSeriesPlotter(
xChartType, nDimensionCount, bExcludingPositioning);
if (!pPlotter)