summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorGülşah Köse <gulsah.kose@collabora.com>2020-08-25 13:06:27 +0300
committerAndras Timar <andras.timar@collabora.com>2020-08-25 16:05:23 +0200
commitafac39ff8a614f3efbc0c3e2d75ad81e1da8792d (patch)
treebfe9f7f068099a8c04a0970df795e7740baf92b7 /chart2
parentc056a7ddd80988c54a1216058ef65eca78818fe9 (diff)
Revert tdf#132355 fix due to reggression.
This reverts commit 06a8f5d17061a8fd59fa37c0cdd1a89c72223337. Change-Id: Iee296e423e3e76d82db9556137459249b5d87508 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101326 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'chart2')
-rw-r--r--chart2/qa/extras/chart2import.cxx17
-rw-r--r--chart2/qa/extras/data/odt/stock_chart_LO_6_2.odtbin16810 -> 0 bytes
-rw-r--r--chart2/source/inc/ChartTypeHelper.hxx1
-rw-r--r--chart2/source/model/template/ChartTypeTemplate.cxx5
-rw-r--r--chart2/source/tools/ChartTypeHelper.cxx13
5 files changed, 18 insertions, 18 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index a2b77a851002..103016fe7fc8 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -154,7 +154,6 @@ public:
void testTdf121991();
void testTdf125444PercentageCustomLabel();
void testTdf123206CustomLabelField();
- void testStockChartShiftedCategoryPosition();
CPPUNIT_TEST_SUITE(Chart2ImportTest);
CPPUNIT_TEST(Fdo60083);
@@ -258,7 +257,6 @@ public:
CPPUNIT_TEST(testTdf121991);
CPPUNIT_TEST(testTdf125444PercentageCustomLabel);
CPPUNIT_TEST(testTdf123206CustomLabelField);
- CPPUNIT_TEST(testStockChartShiftedCategoryPosition);
CPPUNIT_TEST_SUITE_END();
@@ -2407,21 +2405,6 @@ void Chart2ImportTest::testTdf123206CustomLabelField()
}
-void Chart2ImportTest::testStockChartShiftedCategoryPosition()
-{
- load("/chart2/qa/extras/data/odt/", "stock_chart_LO_6_2.odt");
-
- uno::Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), uno::UNO_QUERY);
- CPPUNIT_ASSERT(xChartDoc.is());
-
- Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 0);
- CPPUNIT_ASSERT(xAxis.is());
-
- chart2::ScaleData aScaleData = xAxis->getScaleData();
- CPPUNIT_ASSERT(aScaleData.Categories.is());
- CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
-}
-
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt b/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt
deleted file mode 100644
index 06e15a6b0ddc..000000000000
--- a/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt
+++ /dev/null
Binary files differ
diff --git a/chart2/source/inc/ChartTypeHelper.hxx b/chart2/source/inc/ChartTypeHelper.hxx
index f9ba155b397e..b4af58240460 100644
--- a/chart2/source/inc/ChartTypeHelper.hxx
+++ b/chart2/source/inc/ChartTypeHelper.hxx
@@ -46,6 +46,7 @@ public:
static bool isSupportingStartingAngle( const css::uno::Reference< css::chart2::XChartType >& xChartType );
//starting value for bars or baseline for areas for example
static bool isSupportingBaseValue( const css::uno::Reference< css::chart2::XChartType >& xChartType );
+ static bool shiftCategoryPosAtXAxisPerDefault( const css::uno::Reference< css::chart2::XChartType >& xChartType );
static bool isSupportingAxisPositioning( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionCount, sal_Int32 nDimensionIndex );
static bool isSupportingDateAxis( const css::uno::Reference< css::chart2::XChartType >& xChartType, sal_Int32 nDimensionIndex );
static bool isSupportingComplexCategory( const css::uno::Reference< css::chart2::XChartType >& xChartType );
diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx
index cb7a0d387500..afd9eb0f048a 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -626,7 +626,10 @@ void ChartTypeTemplate::adaptScales(
Reference< XChartType > xChartType(getChartTypeForNewSeries(Sequence< Reference< XChartType > >()));
if( aData.AxisType == AxisType::CATEGORY )
{
- aData.ShiftedCategoryPosition = m_aServiceName.indexOf("Column") != -1 || m_aServiceName.indexOf("Bar") != -1 || m_aServiceName.endsWith("Close");
+ if( !m_aServiceName.endsWith("ColumnWithLine") )
+ aData.ShiftedCategoryPosition = ::chart::ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault(xChartType);
+ else
+ aData.ShiftedCategoryPosition = true;
}
bool bSupportsDates = ::chart::ChartTypeHelper::isSupportingDateAxis( xChartType, nDimensionX );
if( aData.AxisType != AxisType::CATEGORY && ( aData.AxisType != AxisType::DATE || !bSupportsDates) )
diff --git a/chart2/source/tools/ChartTypeHelper.cxx b/chart2/source/tools/ChartTypeHelper.cxx
index be46b0f19ac5..ebd2af04ab45 100644
--- a/chart2/source/tools/ChartTypeHelper.cxx
+++ b/chart2/source/tools/ChartTypeHelper.cxx
@@ -430,6 +430,19 @@ bool ChartTypeHelper::isSupportingComplexCategory( const uno::Reference< chart2:
return true;
}
+bool ChartTypeHelper::shiftCategoryPosAtXAxisPerDefault( const uno::Reference< chart2::XChartType >& xChartType )
+{
+ if(xChartType.is())
+ {
+ OUString aChartTypeName = xChartType->getChartType();
+ if( aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_COLUMN)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_BAR)
+ || aChartTypeName.match(CHART2_SERVICE_NAME_CHARTTYPE_CANDLESTICK) )
+ return true;
+ }
+ return false;
+}
+
bool ChartTypeHelper::noBordersForSimpleScheme( const uno::Reference< chart2::XChartType >& xChartType )
{
if(xChartType.is())