[Libreoffice-commits] core.git: 3 commits - chart2/qa oox/source xmloff/source
sushil_shinde
sushil.shinde at synerzip.com
Wed Dec 18 18:21:10 PST 2013
chart2/qa/extras/chart2export.cxx | 10 +++++++++
chart2/qa/extras/data/docx/Bar_horizontal_cone.docx |binary
oox/source/drawingml/chart/axisconverter.cxx | 2 -
oox/source/export/chartexport.cxx | 22 ++++++++++----------
xmloff/source/chart/XMLAxisPositionPropertyHdl.cxx | 8 +++++++
5 files changed, 31 insertions(+), 11 deletions(-)
New commits:
commit a70dfc34a67e9fb240cc70853da0c49fa01c2e4f
Author: sushil_shinde <sushil.shinde at synerzip.com>
Date: Mon Dec 9 12:27:40 2013 +0530
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
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 9830f0a..dbc0a0d 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 0000000..2280d89
Binary files /dev/null and b/chart2/qa/extras/data/docx/Bar_horizontal_cone.docx differ
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx
index da1a732..5efa7d9 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 1243011..de047a7 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 )
commit 02a047365fccce91d5b1feae0addf79fe58ebe31
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Dec 15 23:11:56 2013 +0100
fix an OOXML chart validation error
Change-Id: I0c95aa285509187b6d54f44c41720e2aefab175b
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 53ca88d..7575263 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -1594,7 +1594,7 @@ void ChartExport::exportSeries( Reference< chart2::XChartType > xChartType, sal_
exportErrorBar(xErrorBarXProps, false);
// export categories
- if( mxCategoriesValues.is() )
+ if( eChartType != chart::TYPEID_SCATTER && mxCategoriesValues.is() )
exportSeriesCategory( mxCategoriesValues );
if( (eChartType == chart::TYPEID_SCATTER)
commit b60bb82a0a1d79b0c967fc8cc405ba3d9394eb4a
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Sun Dec 15 23:00:42 2013 +0100
fix an OOXML chart validation error
Change-Id: Ic91f6179b663afb59700f85ea48720dc9b14f372
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 3447f2d..53ca88d 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -2037,15 +2037,6 @@ void ChartExport::_exportAxis(
pFS->startElement( FSNS( XML_c, XML_scaling ),
FSEND );
- // orientation: minMax, maxMin
- sal_Bool bReverseDirection = sal_False;
- if(GetProperty( xAxisProp, "ReverseDirection" ) )
- mAny >>= bReverseDirection;
-
- const char* orientation = bReverseDirection ? "maxMin":"minMax";
- pFS->singleElement( FSNS( XML_c, XML_orientation ),
- XML_val, orientation,
- FSEND );
// logBase, min, max
if(GetProperty( xAxisProp, "Logarithmic" ) )
{
@@ -2060,6 +2051,17 @@ void ChartExport::_exportAxis(
FSEND );
}
}
+
+ // orientation: minMax, maxMin
+ sal_Bool bReverseDirection = sal_False;
+ if(GetProperty( xAxisProp, "ReverseDirection" ) )
+ mAny >>= bReverseDirection;
+
+ const char* orientation = bReverseDirection ? "maxMin":"minMax";
+ pFS->singleElement( FSNS( XML_c, XML_orientation ),
+ XML_val, orientation,
+ FSEND );
+
sal_Bool bAutoMax = sal_False;
if(GetProperty( xAxisProp, "AutoMax" ) )
mAny >>= bAutoMax;
More information about the Libreoffice-commits
mailing list