chart2/qa/extras/chart2import.cxx                  |   34 ---------------------
 chart2/source/inc/ChartTypeHelper.hxx              |    1 
 chart2/source/model/template/ChartTypeTemplate.cxx |    5 ++-
 chart2/source/tools/AxisHelper.cxx                 |    1 
 chart2/source/tools/ChartTypeHelper.cxx            |   13 ++++++++
 dev/null                                           |binary
 6 files changed, 18 insertions(+), 36 deletions(-)

New commits:
commit 445836c853b07723a1bca6eb0d9876313fc30609
Author:     Gülşah Köse <gulsah.k...@collabora.com>
AuthorDate: Tue Aug 25 16:01:22 2020 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Aug 25 16:05:39 2020 +0200

    Revert tdf#128733 fix due to reggression
    
    This reverts commit 71f9961488232697bcdb37db349569a20f15bb2d.
    
    Change-Id: I6a930fecbf2e82f9c9765b9ed0aa983a6b45ddbd
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101327
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

diff --git a/chart2/qa/extras/chart2import.cxx 
b/chart2/qa/extras/chart2import.cxx
index 103016fe7fc8..383196d774d4 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -137,7 +137,6 @@ public:
     void testTdf114179();
     void testTdf124243();
     void testTdf127393();
-    void testTdf128733();
     void testTdf128432();
     void testTdf128627();
     void testTdf128634();
@@ -240,7 +239,6 @@ public:
     CPPUNIT_TEST(testTdf114179);
     CPPUNIT_TEST(testTdf124243);
     CPPUNIT_TEST(testTdf127393);
-    CPPUNIT_TEST(testTdf128733);
     CPPUNIT_TEST(testTdf128432);
     CPPUNIT_TEST(testTdf128627);
     CPPUNIT_TEST(testTdf128634);
@@ -2088,21 +2086,6 @@ void Chart2ImportTest::testTdf127393()
     CPPUNIT_ASSERT(!aScaleData2.ShiftedCategoryPosition);
 }
 
-void Chart2ImportTest::testTdf128733()
-{
-    load("/chart2/qa/extras/data/odt/", "tdf128733.odt");
-
-    Reference<chart2::XChartDocument> xChartDoc(getChartDocFromWriter(0), 
uno::UNO_QUERY);
-    CPPUNIT_ASSERT(xChartDoc.is());
-    // test secondary X axis ShiftedCategoryPosition value
-    Reference<chart2::XAxis> xAxis = getAxisFromDoc(xChartDoc, 0, 0, 1);
-    CPPUNIT_ASSERT(xAxis.is());
-
-    chart2::ScaleData aScaleData = xAxis->getScaleData();
-    CPPUNIT_ASSERT(aScaleData.Categories.is());
-    CPPUNIT_ASSERT(aScaleData.ShiftedCategoryPosition);
-}
-
 void Chart2ImportTest::testTdf128432()
 {
     load("/chart2/qa/extras/data/ods/", "tdf128432.ods");
diff --git a/chart2/qa/extras/data/odt/tdf128733.odt 
b/chart2/qa/extras/data/odt/tdf128733.odt
deleted file mode 100644
index 18aace26c02d..000000000000
Binary files a/chart2/qa/extras/data/odt/tdf128733.odt and /dev/null differ
diff --git a/chart2/source/tools/AxisHelper.cxx 
b/chart2/source/tools/AxisHelper.cxx
index 75d51c610e11..6ec3d44f48d4 100644
--- a/chart2/source/tools/AxisHelper.cxx
+++ b/chart2/source/tools/AxisHelper.cxx
@@ -364,7 +364,6 @@ Reference< XAxis > AxisHelper::createAxis(
                 aScale.AutoDateAxis = aMainScale.AutoDateAxis;
                 aScale.Categories = aMainScale.Categories;
                 aScale.Orientation = aMainScale.Orientation;
-                aScale.ShiftedCategoryPosition = 
aMainScale.ShiftedCategoryPosition;
 
                 xAxis->setScaleData( aScale );
 
commit afac39ff8a614f3efbc0c3e2d75ad81e1da8792d
Author:     Gülşah Köse <gulsah.k...@collabora.com>
AuthorDate: Tue Aug 25 13:06:27 2020 +0300
Commit:     Andras Timar <andras.ti...@collabora.com>
CommitDate: Tue Aug 25 16:05:23 2020 +0200

    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 <jenkinscollaboraoff...@gmail.com>
    Reviewed-by: Andras Timar <andras.ti...@collabora.com>

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
Binary files a/chart2/qa/extras/data/odt/stock_chart_LO_6_2.odt and /dev/null 
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())
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to