chart2/source/model/template/ChartTypeTemplate.cxx |    8 +++++++-
 chart2/source/view/charttypes/PieChart.cxx         |    1 +
 2 files changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 800b767f13d4fe9c7e7fc3271427a7193e17dbb6
Author:     Kurt Nordback <kurt.nordb...@protonmail.com>
AuthorDate: Thu Aug 31 18:39:02 2023 -0600
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Feb 9 11:03:22 2024 +0100

    tdf#50934: Ensure BarOfPie has ScaleData::ShiftedCategoryPosition == false
    
    Change-Id: I86c7ba4df89a1350f544345938a29c210903c06d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160722
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx 
b/chart2/source/model/template/ChartTypeTemplate.cxx
index 670391422a85..e91eab13e4e9 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -571,7 +571,13 @@ void ChartTypeTemplate::adaptScales(
                             rtl::Reference< ChartType > xChartType = 
getChartTypeForNewSeries2({});
                             if( aData.AxisType == AxisType::CATEGORY )
                             {
-                                aData.ShiftedCategoryPosition = 
m_aServiceName.indexOf("Column") != -1 || m_aServiceName.indexOf("Bar") != -1 
|| m_aServiceName.endsWith("Close");
+                                // Shift for Column, Hi-Lo-Close, and regular
+                                // Bar types, but not BarOfPie
+                                aData.ShiftedCategoryPosition =
+                                    m_aServiceName.indexOf("Column") != -1 ||
+                                    (m_aServiceName.indexOf("Bar") != -1 &&
+                                     !m_aServiceName.indexOf("BarOfPie")) ||
+                                    m_aServiceName.endsWith("Close");
                             }
                             bool bSupportsDates = 
::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, nDimensionX );
                             if( aData.AxisType != AxisType::CATEGORY && ( 
aData.AxisType != AxisType::DATE || !bSupportsDates) )
diff --git a/chart2/source/view/charttypes/PieChart.cxx 
b/chart2/source/view/charttypes/PieChart.cxx
index 7aeb18d2f6e3..0f924de7c5ab 100644
--- a/chart2/source/view/charttypes/PieChart.cxx
+++ b/chart2/source/view/charttypes/PieChart.cxx
@@ -287,6 +287,7 @@ rtl::Reference<SvxShape> PieChart::createDataPoint(
             aOffset = aNewOrigin - aOrigin;
         }
     } else if (m_eSubType != PieChartSubType_NONE) {
+        // Draw the main pie for bar-of-pie/pie-of-pie smaller and to the left
         drawing::Position3D aOrigin = 
m_aPosHelper.transformUnitCircleToScene(0, 0, rParam.mfLogicZ);
         drawing::Position3D aNewOrigin = 
m_aPosHelper.transformUnitCircleToScene(180, 1.0, rParam.mfLogicZ);
         aOffset = aNewOrigin - aOrigin;

Reply via email to