summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsushil_shinde <sushilshinde@libreoffice.org>2014-10-10 11:25:42 +0530
committerKohei Yoshida <libreoffice@kohei.us>2014-10-11 16:57:32 +0000
commit4027bc476a1df9df1924447795ddc2d8b7744e20 (patch)
treea40f9499e26f92c15691b4e55f39342ab41bd146
parent89c98b7d20d05ed0ee0f4d014295b430611b095f (diff)
fdo#84647 : Fixed default value for TickLableSkip value.
1. 'TextCanOverlap' property was stored as false if TickLableSkip is not equal to one. 2. For OOXML charts TickLableSkip can be between 1 to 999999999. 3. We can not apply zero or less than zero value to TickLableSkip. ( As per specification) 4. In axis model default value for TickLableSkip was zero which is incorrect. 5. Added unit test to check 'TextCanOverlap' property for chart. Change-Id: Ib3104b1d932f6e9376c149eabb201c8e9ad23da9 Reviewed-on: https://gerrit.libreoffice.org/11901 Reviewed-by: Kohei Yoshida <libreoffice@kohei.us> Tested-by: Kohei Yoshida <libreoffice@kohei.us>
-rw-r--r--chart2/qa/extras/chart2import.cxx23
-rw-r--r--chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsxbin0 -> 13368 bytes
-rw-r--r--oox/source/drawingml/chart/axismodel.cxx2
3 files changed, 24 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index b853466bfbe3..3b1f1e7fa07f 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -18,9 +18,11 @@
#include <com/sun/star/chart2/XInternalDataProvider.hpp>
#include <com/sun/star/chart/XChartDataArray.hpp>
#include <com/sun/star/drawing/FillStyle.hpp>
+#include <com/sun/star/chart/XTwoAxisXSupplier.hpp>
#include <com/sun/star/util/Color.hpp>
+
class Chart2ImportTest : public ChartTest
{
public:
@@ -53,6 +55,7 @@ public:
void testFdo78080();
void testFdo54361();
void testAutoBackgroundXLSX();
+ void testTextCanOverlapXLSX();
void testNumberFormatsXLSX();
void testTransparentBackground(OUString const & filename);
@@ -88,6 +91,7 @@ public:
CPPUNIT_TEST(testFdo78080);
CPPUNIT_TEST(testFdo54361);
CPPUNIT_TEST(testAutoBackgroundXLSX);
+ CPPUNIT_TEST(testTextCanOverlapXLSX);
CPPUNIT_TEST(testNumberFormatsXLSX);
CPPUNIT_TEST_SUITE_END();
@@ -635,6 +639,25 @@ void Chart2ImportTest::testAutoBackgroundXLSX()
(nColor & 0x00FFFFFF) == 0x00FFFFFF); // highest 2 bytes are transparency which we ignore here.
}
+void Chart2ImportTest::testTextCanOverlapXLSX()
+{
+ // fdo#84647 : To check textoverlap value is imported correclty.
+ load("/chart2/qa/extras/data/xlsx/", "chart-text-can-overlap.xlsx");
+ uno::Reference< chart::XDiagram > mxDiagram;
+ uno::Reference< beans::XPropertySet > xAxisProp;
+ bool textCanOverlap = false;
+ uno::Reference< chart::XChartDocument > xChartDoc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW);
+ CPPUNIT_ASSERT(xChartDoc.is());
+ mxDiagram.set(xChartDoc->getDiagram());
+ CPPUNIT_ASSERT(mxDiagram.is());
+ uno::Reference< chart::XAxisXSupplier > xAxisXSupp( mxDiagram, uno::UNO_QUERY );
+ CPPUNIT_ASSERT(xAxisXSupp.is());
+ xAxisProp = xAxisXSupp->getXAxis();
+ xAxisProp->getPropertyValue("TextCanOverlap") >>= textCanOverlap;
+ // Expected value of 'TextCanOverlap' is true
+ CPPUNIT_ASSERT(textCanOverlap);
+}
+
void Chart2ImportTest::testNumberFormatsXLSX()
{
load("/chart2/qa/extras/data/xlsx/", "number-formats.xlsx");
diff --git a/chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx b/chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx
new file mode 100644
index 000000000000..59f907dffe42
--- /dev/null
+++ b/chart2/qa/extras/data/xlsx/chart-text-can-overlap.xlsx
Binary files differ
diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx
index d4163bca151f..cbd66b789a2a 100644
--- a/oox/source/drawingml/chart/axismodel.cxx
+++ b/oox/source/drawingml/chart/axismodel.cxx
@@ -46,7 +46,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId ) :
mnMinorTimeUnit( XML_days ),
mnOrientation( XML_minMax ),
mnTickLabelPos( XML_nextTo ),
- mnTickLabelSkip( 0 ),
+ mnTickLabelSkip( 1 ),
mnTickMarkSkip( 0 ),
mnTypeId( nTypeId ),
mbAuto( false ),