Kaydet (Commit) a70dfc34 authored tarafından sushil_shinde's avatar sushil_shinde Kaydeden (comit) Markus Mohrhard

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
üst 02a04736
......@@ -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();
......
......@@ -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 );
......
......@@ -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 )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment