summaryrefslogtreecommitdiff
path: root/chart2/source/view
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2024-03-07 14:32:44 +0100
committerBalazs Varga <balazs.varga.extern@allotropia.de>2024-03-08 09:42:42 +0100
commit40a19e61efff859d83e0689c0ed7d40c8e9ae8fe (patch)
treed1f2d958086018e6889ff3b664aa4bc3e9bbcfd3 /chart2/source/view
parentf4ba83e82aafc206d17d2fa66a27573ebc5a3624 (diff)
tdf#159456 - chart view: fix wrongly shifted value Y axis
We only have to shift the category axis only, and not the value axis, if we have a chart data table. Change-Id: Ie77ea829e8f8987702dce7d17cb3e20054f3d8cc Reviewed-on: https://gerrit.libreoffice.org/c/core/+/164539 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'chart2/source/view')
-rw-r--r--chart2/source/view/main/SeriesPlotterContainer.cxx7
-rw-r--r--chart2/source/view/main/SeriesPlotterContainer.hxx2
2 files changed, 3 insertions, 6 deletions
diff --git a/chart2/source/view/main/SeriesPlotterContainer.cxx b/chart2/source/view/main/SeriesPlotterContainer.cxx
index b70e51510b7d..06a22207634d 100644
--- a/chart2/source/view/main/SeriesPlotterContainer.cxx
+++ b/chart2/source/view/main/SeriesPlotterContainer.cxx
@@ -174,7 +174,7 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
}
if (xDiagram->getDataTable().is())
- m_bForceShiftPosition = true;
+ m_bTableShiftPosition = true;
//prepare for autoscaling and shape creation
// - create plotter for charttypes (for each first scale group at each plotter, as they are independent)
@@ -357,12 +357,9 @@ void SeriesPlotterContainer::initializeCooSysAndSeriesPlotter(ChartModel& rChart
bool SeriesPlotterContainer::isCategoryPositionShifted(const chart2::ScaleData& rSourceScale,
bool bHasComplexCategories)
{
- if (m_bForceShiftPosition)
- return true;
-
if (rSourceScale.AxisType == AxisType::CATEGORY)
return bHasComplexCategories || rSourceScale.ShiftedCategoryPosition
- || m_bChartTypeUsesShiftedCategoryPositionPerDefault;
+ || m_bTableShiftPosition || m_bChartTypeUsesShiftedCategoryPositionPerDefault;
if (rSourceScale.AxisType == AxisType::DATE)
return rSourceScale.ShiftedCategoryPosition;
diff --git a/chart2/source/view/main/SeriesPlotterContainer.hxx b/chart2/source/view/main/SeriesPlotterContainer.hxx
index 578f2ba2760c..38f3c8b909c8 100644
--- a/chart2/source/view/main/SeriesPlotterContainer.hxx
+++ b/chart2/source/view/main/SeriesPlotterContainer.hxx
@@ -151,7 +151,7 @@ private:
sal_Int32 m_nMaxAxisIndex;
bool m_bChartTypeUsesShiftedCategoryPositionPerDefault;
- bool m_bForceShiftPosition = false;
+ bool m_bTableShiftPosition = false;
sal_Int32 m_nDefaultDateNumberFormat;
};