summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsushil_shinde <sushil.shinde@synerzip.com>2013-12-09 12:27:40 +0530
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2013-12-19 03:20:40 +0100
commita70dfc34a67e9fb240cc70853da0c49fa01c2e4f (patch)
tree97964cf2cc86a868a538db4fa71a112e010a6dec
parent02a047365fccce91d5b1feae0addf79fe58ebe31 (diff)
fdo#72306 Axis names were lost after saving file on LO.
While exporting chart "crosses" position values were not handled properly in chartexport. Fixed this issue by handling "autozero" value for c:crosses. Added unit test. Change-Id: I3489908d4c3d4b41a04debfecf95e65f373649ce
-rw-r--r--chart2/qa/extras/chart2export.cxx10
-rw-r--r--chart2/qa/extras/data/docx/Bar_horizontal_cone.docxbin0 -> 18237 bytes
-rw-r--r--oox/source/drawingml/chart/axisconverter.cxx2
-rw-r--r--xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx8
4 files changed, 19 insertions, 1 deletions
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 9830f0a91646..dbc0a0d2c9fc 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -34,6 +34,7 @@ public:
void testTrendline();
void testStockChart();
void testBarChart();
+ void testCrosses();
CPPUNIT_TEST_SUITE(Chart2ExportTest);
CPPUNIT_TEST(test);
@@ -41,6 +42,7 @@ public:
CPPUNIT_TEST(testTrendline);
CPPUNIT_TEST(testStockChart);
CPPUNIT_TEST(testBarChart);
+ CPPUNIT_TEST(testCrosses);
CPPUNIT_TEST_SUITE_END();
@@ -425,6 +427,14 @@ void Chart2ExportTest::testBarChart()
assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:barChart/c:barDir", "val", "col");
}
+void Chart2ExportTest::testCrosses()
+{
+ load("/chart2/qa/extras/data/docx/", "Bar_horizontal_cone.docx");
+ xmlDocPtr pXmlDoc = parseExport("word/charts/chart", "Office Open XML Text");
+
+ assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotArea/c:catAx/c:crosses", "val", "autoZero");
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest);
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx b/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx
new file mode 100644
index 000000000000..2280d89fc11a
--- /dev/null
+++ b/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx
Binary files differ
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index da1a732f192c..5efa7d9183cc 100644
--- a/oox/source/drawingml/chart/axisconverter.cxx
+++ b/oox/source/drawingml/chart/axisconverter.cxx
@@ -323,7 +323,7 @@ void AxisConverter::convertFromModel( const Reference< XCoordinateSystem >& rxCo
{
case XML_min: eAxisPos = cssc::ChartAxisPosition_START; break;
case XML_max: eAxisPos = cssc::ChartAxisPosition_END; break;
- case XML_autoZero: eAxisPos = cssc::ChartAxisPosition_VALUE; break;
+ case XML_autoZero: eAxisPos = cssc::ChartAxisPosition_ZERO; break;
}
if( !mrModel.mbAuto )
aAxisProp.setProperty( PROP_CrossoverPosition, eAxisPos );
diff --git a/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx b/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx
index 1243011bfd8f..de047a7444de 100644
--- a/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx
+++ b/xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx
@@ -62,6 +62,14 @@ bool XMLAxisPositionPropertyHdl::importXML( const OUString& rStrImpValue,
bResult = true;
}
}
+ else if( rStrImpValue.equals( GetXMLToken(XML_0) ) )
+ {
+ if( !m_bCrossingValue )
+ {
+ rValue <<= ::com::sun::star::chart::ChartAxisPosition_ZERO;
+ bResult = true;
+ }
+ }
else
{
if( !m_bCrossingValue )