chart2/qa/extras/chart2export.cxx | 11 ++ chart2/qa/extras/chart2import.cxx | 65 ++++++++++++ chart2/qa/extras/data/xlsx/hidden_cells.xlsx |binary chart2/qa/extras/data/xlsx/majorTickMark.xlsx |binary chart2/qa/extras/data/xlsx/minorTickMark.xlsx |binary chart2/qa/extras/data/xlsx/plotVisOnly.xlsx |binary chart2/qa/extras/data/xlsx/rAngAx.xlsx |binary chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx | 13 ++ oox/inc/drawingml/chart/plotareamodel.hxx | 12 -- oox/source/drawingml/chart/axiscontext.cxx | 6 - oox/source/drawingml/chart/axismodel.cxx | 4 oox/source/drawingml/chart/chartspaceconverter.cxx | 3 oox/source/drawingml/chart/chartspacefragment.cxx | 9 - oox/source/drawingml/chart/chartspacemodel.cxx | 4 oox/source/drawingml/chart/plotareacontext.cxx | 4 oox/source/drawingml/chart/plotareamodel.cxx | 4 oox/source/drawingml/chart/titlecontext.cxx | 1 oox/source/drawingml/chart/typegroupcontext.cxx | 7 - oox/source/drawingml/chart/typegroupmodel.cxx | 2 oox/source/export/chartexport.cxx | 36 +++--- 20 files changed, 128 insertions(+), 53 deletions(-)
New commits: commit 629ed90f7146d5a6b0de6211a916d615dea642aa Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 08:08:27 2015 +0200 add test for minorTickMark OOXML default value Change-Id: Id1a4dcbc25b78afe123d529413ac8873b6452d2e diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 2784aad..445edf3 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -82,6 +82,7 @@ public: void testPlotVisOnlyDefaultValue2013XLSX(); void testRAngAxDefaultValue2013XLSX(); void testMajorTickMarksDefaultValue2013XLSX(); + void testMinorTickMarksDefaultValue2013XLSX(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -126,6 +127,7 @@ public: CPPUNIT_TEST(testPlotVisOnlyDefaultValue2013XLSX); CPPUNIT_TEST(testRAngAxDefaultValue2013XLSX); CPPUNIT_TEST(testMajorTickMarksDefaultValue2013XLSX); + CPPUNIT_TEST(testMinorTickMarksDefaultValue2013XLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -992,6 +994,21 @@ void Chart2ImportTest::testMajorTickMarksDefaultValue2013XLSX() CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks); } +void Chart2ImportTest::testMinorTickMarksDefaultValue2013XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "minorTickMark.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference<chart2::XAxis> xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xXAxis.is()); + Reference<beans::XPropertySet> xPropSet(xXAxis, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("MinorTickmarks"); + sal_Int32 nMajorTickmarks = chart2::TickmarkStyle::NONE; + CPPUNIT_ASSERT(aAny.hasValue()); + CPPUNIT_ASSERT(aAny >>= nMajorTickmarks); + CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/minorTickMark.xlsx b/chart2/qa/extras/data/xlsx/minorTickMark.xlsx new file mode 100644 index 0000000..2d68792 Binary files /dev/null and b/chart2/qa/extras/data/xlsx/minorTickMark.xlsx differ commit 1c8fb9a5a0d57c9a8a97fa3c33b8753fa034ad7b Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 07:59:50 2015 +0200 add test for majorTickMark OOXML default value Change-Id: Ib8af3f17db019dcddca58173806ee6499b50b416 diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index c69e0d3..2784aad 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -21,6 +21,7 @@ #include <com/sun/star/drawing/FillStyle.hpp> #include <com/sun/star/chart/XTwoAxisXSupplier.hpp> #include <com/sun/star/chart/MissingValueTreatment.hpp> +#include <com/sun/star/chart2/TickmarkStyle.hpp> #include <com/sun/star/util/Color.hpp> @@ -80,6 +81,7 @@ public: void testVaryColorDefaultValues2013XLSX(); void testPlotVisOnlyDefaultValue2013XLSX(); void testRAngAxDefaultValue2013XLSX(); + void testMajorTickMarksDefaultValue2013XLSX(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -123,6 +125,7 @@ public: CPPUNIT_TEST(testVaryColorDefaultValues2013XLSX); CPPUNIT_TEST(testPlotVisOnlyDefaultValue2013XLSX); CPPUNIT_TEST(testRAngAxDefaultValue2013XLSX); + CPPUNIT_TEST(testMajorTickMarksDefaultValue2013XLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -974,6 +977,21 @@ void Chart2ImportTest::testRAngAxDefaultValue2013XLSX() CPPUNIT_ASSERT(bRightAngleAxes); } +void Chart2ImportTest::testMajorTickMarksDefaultValue2013XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "majorTickMark.xlsx"); + Reference<chart2::XChartDocument> xChartDoc = getChartDocFromSheet(0, mxComponent); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChartDoc.is()); + Reference<chart2::XAxis> xXAxis = getAxisFromDoc(xChartDoc, 0, 0, 0); + CPPUNIT_ASSERT(xXAxis.is()); + Reference<beans::XPropertySet> xPropSet(xXAxis, uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("MajorTickmarks"); + sal_Int32 nMajorTickmarks = chart2::TickmarkStyle::NONE; + CPPUNIT_ASSERT(aAny.hasValue()); + CPPUNIT_ASSERT(aAny >>= nMajorTickmarks); + CPPUNIT_ASSERT_EQUAL(chart2::TickmarkStyle::INNER | chart2::TickmarkStyle::OUTER, nMajorTickmarks); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/majorTickMark.xlsx b/chart2/qa/extras/data/xlsx/majorTickMark.xlsx new file mode 100644 index 0000000..2b6cdcf Binary files /dev/null and b/chart2/qa/extras/data/xlsx/majorTickMark.xlsx differ commit 08dc203cecc225b8e191ec894160516fede91a90 Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 06:50:36 2015 +0200 add test for rAngAx OOXML default value Change-Id: Iaad4aa553564e31726b31ebf890ef0376c8f1690 diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index c559dda..c69e0d3 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -79,6 +79,7 @@ public: void testVaryColorDefaultValues2007XLSX(); void testVaryColorDefaultValues2013XLSX(); void testPlotVisOnlyDefaultValue2013XLSX(); + void testRAngAxDefaultValue2013XLSX(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -121,6 +122,7 @@ public: CPPUNIT_TEST(testVaryColorDefaultValues2007XLSX); CPPUNIT_TEST(testVaryColorDefaultValues2013XLSX); CPPUNIT_TEST(testPlotVisOnlyDefaultValue2013XLSX); + CPPUNIT_TEST(testRAngAxDefaultValue2013XLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -959,6 +961,19 @@ void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX() CPPUNIT_ASSERT(!bShowHiddenValues); } +void Chart2ImportTest::testRAngAxDefaultValue2013XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "rAngAx.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChart1Doc.is()); + Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("RightAngledAxes"); + CPPUNIT_ASSERT(aAny.hasValue()); + bool bRightAngleAxes = false; + CPPUNIT_ASSERT(aAny >>= bRightAngleAxes); + CPPUNIT_ASSERT(bRightAngleAxes); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/rAngAx.xlsx b/chart2/qa/extras/data/xlsx/rAngAx.xlsx new file mode 100644 index 0000000..f6d521a Binary files /dev/null and b/chart2/qa/extras/data/xlsx/rAngAx.xlsx differ commit 368e8b83e13106905d021b4c12983ba28e4a9110 Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 06:04:55 2015 +0200 don't use r prefix for uno::Reference passed by value Change-Id: I9b6478c75af5c959b52e501aff9c01d68860a295 diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 1ea20cd..9dfe8ea 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -732,7 +732,7 @@ void ChartExport::_ExportContent() } } -void ChartExport::exportChartSpace( Reference< css::chart::XChartDocument > rChartDoc, +void ChartExport::exportChartSpace( Reference< css::chart::XChartDocument > xChartDoc, bool bIncludeTable ) { FSHelperPtr pFS = GetFS(); @@ -755,23 +755,23 @@ void ChartExport::exportChartSpace( Reference< css::chart::XChartDocument > rCha // TODO:external data } //XML_chart - exportChart(rChartDoc); + exportChart(xChartDoc); // TODO: printSettings // TODO: style // TODO: text properties // TODO: shape properties - Reference< XPropertySet > xPropSet( rChartDoc->getArea(), uno::UNO_QUERY ); + Reference< XPropertySet > xPropSet( xChartDoc->getArea(), uno::UNO_QUERY ); if( xPropSet.is() ) exportShapeProps( xPropSet ); //XML_externalData - exportExternalData(rChartDoc); + exportExternalData(xChartDoc); pFS->endElement( FSNS( XML_c, XML_chartSpace ) ); } -void ChartExport::exportExternalData( Reference< css::chart::XChartDocument > rChartDoc ) +void ChartExport::exportExternalData( Reference< css::chart::XChartDocument > xChartDoc ) { // Embedded external data is grab bagged for docx file hence adding export part of // external data for docx files only. @@ -779,7 +779,7 @@ void ChartExport::exportExternalData( Reference< css::chart::XChartDocument > rC return; OUString externalDataPath; - Reference< beans::XPropertySet > xDocPropSet( rChartDoc->getDiagram(), uno::UNO_QUERY ); + Reference< beans::XPropertySet > xDocPropSet( xChartDoc->getDiagram(), uno::UNO_QUERY ); if( xDocPropSet.is()) { try @@ -822,10 +822,10 @@ void ChartExport::exportExternalData( Reference< css::chart::XChartDocument > rC } } -void ChartExport::exportChart( Reference< css::chart::XChartDocument > rChartDoc ) +void ChartExport::exportChart( Reference< css::chart::XChartDocument > xChartDoc ) { - Reference< chart2::XChartDocument > xNewDoc( rChartDoc, uno::UNO_QUERY ); - mxDiagram.set( rChartDoc->getDiagram() ); + Reference< chart2::XChartDocument > xNewDoc( xChartDoc, uno::UNO_QUERY ); + mxDiagram.set( xChartDoc->getDiagram() ); if( xNewDoc.is()) mxNewDiagram.set( xNewDoc->getFirstDiagram()); @@ -833,7 +833,7 @@ void ChartExport::exportChart( Reference< css::chart::XChartDocument > rChartDoc bool bHasMainTitle = false; bool bHasSubTitle = false; bool bHasLegend = false; - Reference< beans::XPropertySet > xDocPropSet( rChartDoc, uno::UNO_QUERY ); + Reference< beans::XPropertySet > xDocPropSet( xChartDoc, uno::UNO_QUERY ); if( xDocPropSet.is()) { try @@ -863,7 +863,7 @@ void ChartExport::exportChart( Reference< css::chart::XChartDocument > rChartDoc // title if( bHasMainTitle ) { - Reference< drawing::XShape > xShape = rChartDoc->getTitle(); + Reference< drawing::XShape > xShape = xChartDoc->getTitle(); if( xShape.is() ) { exportTitle( xShape ); @@ -904,9 +904,9 @@ void ChartExport::exportChart( Reference< css::chart::XChartDocument > rChartDoc exportPlotArea( ); // legend if( bHasLegend ) - exportLegend( rChartDoc ); + exportLegend( xChartDoc ); - uno::Reference<beans::XPropertySet> xDiagramPropSet(rChartDoc->getDiagram(), uno::UNO_QUERY); + uno::Reference<beans::XPropertySet> xDiagramPropSet(xChartDoc->getDiagram(), uno::UNO_QUERY); uno::Any aPlotVisOnly = xDiagramPropSet->getPropertyValue("IncludeHiddenCells"); bool bIncludeHiddenCells = false; aPlotVisOnly >>= bIncludeHiddenCells; @@ -952,13 +952,13 @@ void ChartExport::exportMissingValueTreatment(uno::Reference<beans::XPropertySet FSEND); } -void ChartExport::exportLegend( Reference< css::chart::XChartDocument > rChartDoc ) +void ChartExport::exportLegend( Reference< css::chart::XChartDocument > xChartDoc ) { FSHelperPtr pFS = GetFS(); pFS->startElement( FSNS( XML_c, XML_legend ), FSEND ); - Reference< beans::XPropertySet > xProp( rChartDoc->getLegend(), uno::UNO_QUERY ); + Reference< beans::XPropertySet > xProp( xChartDoc->getLegend(), uno::UNO_QUERY ); if( xProp.is() ) { // position commit 163c28b117183e00aefb564fa21e4af8be6b291e Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 05:45:56 2015 +0200 add test for plotVisOnly export to OOXML Change-Id: I2dc49ec1c10da97f9b57ebff804cf403d2802beb diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx index 7c14b73..abc7f87 100644 --- a/chart2/qa/extras/chart2export.cxx +++ b/chart2/qa/extras/chart2export.cxx @@ -95,6 +95,7 @@ public: void testLegendManualLayoutXLSX(); void testAxisCharacterPropertiesXLSX(); void testTitleCharacterPropertiesXLSX(); + void testPlotVisOnlyXLSX(); CPPUNIT_TEST_SUITE(Chart2ExportTest); CPPUNIT_TEST(testErrorBarXLSX); @@ -154,6 +155,7 @@ public: CPPUNIT_TEST(testLegendManualLayoutXLSX); CPPUNIT_TEST(testAxisCharacterPropertiesXLSX); CPPUNIT_TEST(testTitleCharacterPropertiesXLSX); + CPPUNIT_TEST(testPlotVisOnlyXLSX); CPPUNIT_TEST_SUITE_END(); protected: @@ -1423,6 +1425,15 @@ void Chart2ExportTest::testTitleCharacterPropertiesXLSX() assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:title/c:tx/c:rich/a:p/a:r/a:rPr", "b", "1"); } +void Chart2ExportTest::testPlotVisOnlyXLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "hidden_cells.xlsx"); + xmlDocPtr pXmlDoc = parseExport("xl/charts/chart", "Calc Office Open XML"); + CPPUNIT_ASSERT(pXmlDoc); + + assertXPath(pXmlDoc, "/c:chartSpace/c:chart/c:plotVisOnly", "val", "0"); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ExportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/hidden_cells.xlsx b/chart2/qa/extras/data/xlsx/hidden_cells.xlsx new file mode 100644 index 0000000..da3e2da Binary files /dev/null and b/chart2/qa/extras/data/xlsx/hidden_cells.xlsx differ commit d38b6043040f778ab36522dd8697dce388c437d9 Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 05:24:55 2015 +0200 add test for plotVisOnly default value Change-Id: I0b0a5df307bc5478283fbbe48a0016256b9cf7cd diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index 9150b30..c559dda 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -78,6 +78,7 @@ public: void testTrendlineDefaultValue2013XLSX(); void testVaryColorDefaultValues2007XLSX(); void testVaryColorDefaultValues2013XLSX(); + void testPlotVisOnlyDefaultValue2013XLSX(); CPPUNIT_TEST_SUITE(Chart2ImportTest); CPPUNIT_TEST(Fdo60083); @@ -119,6 +120,7 @@ public: CPPUNIT_TEST(testTrendlineDefaultValue2013XLSX); CPPUNIT_TEST(testVaryColorDefaultValues2007XLSX); CPPUNIT_TEST(testVaryColorDefaultValues2013XLSX); + CPPUNIT_TEST(testPlotVisOnlyDefaultValue2013XLSX); CPPUNIT_TEST_SUITE_END(); private: @@ -944,6 +946,19 @@ void Chart2ImportTest::testVaryColorDefaultValues2013XLSX() CPPUNIT_ASSERT(bVaryColor); } +void Chart2ImportTest::testPlotVisOnlyDefaultValue2013XLSX() +{ + load("/chart2/qa/extras/data/xlsx/", "plotVisOnly.xlsx"); + uno::Reference< chart::XChartDocument > xChart1Doc ( getChartCompFromSheet( 0, mxComponent ), UNO_QUERY_THROW); + CPPUNIT_ASSERT_MESSAGE("failed to load chart", xChart1Doc.is()); + Reference<beans::XPropertySet> xPropSet(xChart1Doc->getDiagram(), uno::UNO_QUERY_THROW); + uno::Any aAny = xPropSet->getPropertyValue("IncludeHiddenCells"); + CPPUNIT_ASSERT(aAny.hasValue()); + bool bShowHiddenValues = true; + CPPUNIT_ASSERT(aAny >>= bShowHiddenValues); + CPPUNIT_ASSERT(!bShowHiddenValues); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Chart2ImportTest); CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/chart2/qa/extras/data/xlsx/plotVisOnly.xlsx b/chart2/qa/extras/data/xlsx/plotVisOnly.xlsx new file mode 100644 index 0000000..8e4fcbd Binary files /dev/null and b/chart2/qa/extras/data/xlsx/plotVisOnly.xlsx differ commit 1e033254927750affcd1dcc0e10c48f076ebec13 Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 05:23:48 2015 +0200 export plotVisOnly correctly to OOXML Change-Id: Icf37ac292b49246e879331ba72cc8aa831c7edba diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index 1635af1..1ea20cd 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -905,9 +905,13 @@ void ChartExport::exportChart( Reference< css::chart::XChartDocument > rChartDoc // legend if( bHasLegend ) exportLegend( rChartDoc ); - // only visible cells should be plotted on the chart + + uno::Reference<beans::XPropertySet> xDiagramPropSet(rChartDoc->getDiagram(), uno::UNO_QUERY); + uno::Any aPlotVisOnly = xDiagramPropSet->getPropertyValue("IncludeHiddenCells"); + bool bIncludeHiddenCells = false; + aPlotVisOnly >>= bIncludeHiddenCells; pFS->singleElement( FSNS( XML_c, XML_plotVisOnly ), - XML_val, "1", + XML_val, BS(!bIncludeHiddenCells), FSEND ); exportMissingValueTreatment(Reference<beans::XPropertySet>(mxDiagram, uno::UNO_QUERY)); commit 1be9365d7f7c33e23d4599931616fdf56bb26fbf Author: Markus Mohrhard <[email protected]> Date: Thu Apr 30 05:21:18 2015 +0200 support querying about hidden cells in chart data sequences Change-Id: I8886c022d709acfd0f65453e36f29c1c953b4b1c diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx index 1c0d37b..41442fd 100644 --- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx @@ -1982,6 +1982,8 @@ public: virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException) SAL_OVERRIDE; + virtual Any getPropertyValue(const Reference<beans::XPropertySet>& xInnerPropertySet) const + throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException); private: //member ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; @@ -2002,11 +2004,20 @@ void WrappedIncludeHiddenCellsProperty::setPropertyValue( const Any& rOuterValue { bool bNewValue = false; if( ! (rOuterValue >>= bNewValue) ) - throw lang::IllegalArgumentException( "Property Dim3D requires boolean value", 0, 0 ); + throw lang::IllegalArgumentException( "Property IncludeHiddenCells requires boolean value", 0, 0 ); ChartModelHelper::setIncludeHiddenCells( bNewValue, *m_spChart2ModelContact->getModel() ); } +Any WrappedIncludeHiddenCellsProperty::getPropertyValue( const Reference< beans::XPropertySet >& /*xInnerPropertySet*/ ) const + throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException) +{ + bool bValue = ChartModelHelper::isIncludeHiddenCells( m_spChart2ModelContact->getChartModel() ); + uno::Any aAny; + aAny <<= bValue; + return aAny; +} + // ____ XDiagramProvider ____ Reference< chart2::XDiagram > SAL_CALL DiagramWrapper::getDiagram() throw (uno::RuntimeException, std::exception) commit fbe09a2a02fba03eaa6c649d0ca08cd0df73c7e2 Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 12:22:07 2015 +0200 fix minorTickMark MSO 2007 vs OOXML default value Change-Id: Idedf9155605df529f496ceb1ac6b740bc4b2101c diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx index f04c0ad..618e3e8 100644 --- a/oox/source/drawingml/chart/axiscontext.cxx +++ b/oox/source/drawingml/chart/axiscontext.cxx @@ -118,8 +118,7 @@ ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const At case C_TOKEN( minorGridlines ): return new ShapePrWrapperContext( *this, mrModel.mxMinorGridLines.create() ); case C_TOKEN( minorTickMark ): - // default is 'none', not 'cross' as specified - mrModel.mnMinorTickMark = rAttribs.getToken( XML_val, XML_none ); + mrModel.mnMinorTickMark = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_none : XML_cross ); return 0; case C_TOKEN( numFmt ): mrModel.maNumberFormat.setAttributes( rAttribs ); diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx index 45c1a46..2ff6bf7 100644 --- a/oox/source/drawingml/chart/axismodel.cxx +++ b/oox/source/drawingml/chart/axismodel.cxx @@ -42,7 +42,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mnLabelOffset( 100 ), mnMajorTickMark( bMSO2007Doc ? XML_out : XML_cross ), mnMajorTimeUnit( XML_days ), - mnMinorTickMark( XML_none ), + mnMinorTickMark( bMSO2007Doc ? XML_none : XML_cross ), mnMinorTimeUnit( XML_days ), mnOrientation( XML_minMax ), mnTickLabelPos( XML_nextTo ), commit e5cdc76a7e28a886ab44d1c315a6661d1d88da0f Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 12:19:26 2015 +0200 fix majorTickMark MSO 2007 vs OOXML default value Change-Id: I7357ad7e01270653f67ec2140643f5542e7da7ad diff --git a/oox/source/drawingml/chart/axiscontext.cxx b/oox/source/drawingml/chart/axiscontext.cxx index fec2785..f04c0ad 100644 --- a/oox/source/drawingml/chart/axiscontext.cxx +++ b/oox/source/drawingml/chart/axiscontext.cxx @@ -113,8 +113,7 @@ ContextHandlerRef AxisContextBase::onCreateContext( sal_Int32 nElement, const At case C_TOKEN( majorGridlines ): return new ShapePrWrapperContext( *this, mrModel.mxMajorGridLines.create() ); case C_TOKEN( majorTickMark ): - // default is 'out', not 'cross' as specified - mrModel.mnMajorTickMark = rAttribs.getToken( XML_val, XML_out ); + mrModel.mnMajorTickMark = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_out : XML_cross ); return 0; case C_TOKEN( minorGridlines ): return new ShapePrWrapperContext( *this, mrModel.mxMinorGridLines.create() ); diff --git a/oox/source/drawingml/chart/axismodel.cxx b/oox/source/drawingml/chart/axismodel.cxx index 7541a4e..45c1a46 100644 --- a/oox/source/drawingml/chart/axismodel.cxx +++ b/oox/source/drawingml/chart/axismodel.cxx @@ -40,7 +40,7 @@ AxisModel::AxisModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mnCrossMode( XML_autoZero ), mnLabelAlign( XML_ctr ), mnLabelOffset( 100 ), - mnMajorTickMark( XML_out ), + mnMajorTickMark( bMSO2007Doc ? XML_out : XML_cross ), mnMajorTimeUnit( XML_days ), mnMinorTickMark( XML_none ), mnMinorTimeUnit( XML_days ), commit 7a8ef88e177618a75cb51e31b31d6295aad3f7b1 Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 12:16:30 2015 +0200 fix grouping MSO 2007 vs OOXML default value Change-Id: Idee9ce707d852efb56657eff7d565893f99e4da3 diff --git a/oox/source/drawingml/chart/typegroupcontext.cxx b/oox/source/drawingml/chart/typegroupcontext.cxx index b55ad96..2dc3d35 100644 --- a/oox/source/drawingml/chart/typegroupcontext.cxx +++ b/oox/source/drawingml/chart/typegroupcontext.cxx @@ -83,7 +83,7 @@ ContextHandlerRef AreaTypeGroupContext::onCreateContext( sal_Int32 nElement, con mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 ); return 0; case C_TOKEN( grouping ): - mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard ); + mrModel.mnGrouping = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_standard : XML_clustered ); return 0; case C_TOKEN( ser ): return new AreaSeriesContext( *this, mrModel.maSeries.create(bMSO2007Doc) ); @@ -123,8 +123,7 @@ ContextHandlerRef BarTypeGroupContext::onCreateContext( sal_Int32 nElement, cons mrModel.mnGapWidth = rAttribs.getInteger( XML_val, 150 ); return 0; case C_TOKEN( grouping ): - // default is 'standard', not 'clustered' as specified - mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard ); + mrModel.mnGrouping = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_standard : XML_clustered ); return 0; case C_TOKEN( overlap ): mrModel.mnOverlap = rAttribs.getInteger( XML_val, 0 ); @@ -208,7 +207,7 @@ ContextHandlerRef LineTypeGroupContext::onCreateContext( sal_Int32 nElement, con mrModel.mnGapDepth = rAttribs.getInteger( XML_val, 150 ); return 0; case C_TOKEN( grouping ): - mrModel.mnGrouping = rAttribs.getToken( XML_val, XML_standard ); + mrModel.mnGrouping = rAttribs.getToken( XML_val, bMSO2007Doc ? XML_standard : XML_clustered ); return 0; case C_TOKEN( hiLowLines ): return new ShapePrWrapperContext( *this, mrModel.mxHiLowLines.create() ); diff --git a/oox/source/drawingml/chart/typegroupmodel.cxx b/oox/source/drawingml/chart/typegroupmodel.cxx index e8b3d11..9d5e960 100644 --- a/oox/source/drawingml/chart/typegroupmodel.cxx +++ b/oox/source/drawingml/chart/typegroupmodel.cxx @@ -40,7 +40,7 @@ TypeGroupModel::TypeGroupModel( sal_Int32 nTypeId, bool bMSO2007Doc ) : mnFirstAngle( 0 ), mnGapDepth( 150 ), mnGapWidth( 150 ), - mnGrouping( XML_standard ), + mnGrouping( bMSO2007Doc ? XML_standard : XML_clustered ), mnHoleSize( 10 ), mnOfPieType( XML_pie ), mnOverlap( 0 ), commit e31805548f78e26c6d98317554449b891193155a Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 12:12:38 2015 +0200 fix showDLblsOverMax MSO2007 vs OOXML default value Change-Id: Iee541f180d9c569246e7ca8271b65f0717877e4f diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 8c98ad6..b358751 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -105,8 +105,7 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, !bMSO2007Document ); return 0; case C_TOKEN( showDLblsOverMax ): - // default is 'false', not 'true' as specified - mrModel.mbShowLabelsOverMax = rAttribs.getBool( XML_val, false ); + mrModel.mbShowLabelsOverMax = rAttribs.getBool( XML_val, !bMSO2007Document ); return 0; case C_TOKEN( sideWall ): return new WallFloorContext( *this, mrModel.mxSideWall.create() ); diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index 1e05dff..85ebc8e 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -29,7 +29,7 @@ ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : mnStyle( 2 ), mbAutoTitleDel( !bMSO2007Doc ), // difference between OOXML spec and MSO 2007 mbPlotVisOnly( !bMSO2007Doc ), - mbShowLabelsOverMax( false ), + mbShowLabelsOverMax( !bMSO2007Doc ), mbPivotChart( false ) { } commit 58ba2e1942044307742d5be275ea4c38f3fdfbdd Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 12:02:42 2015 +0200 fix plotVisOnly MSO 2007 vs OOXML default value Change-Id: I729b4dd0527ad5b0823532a115416bfff8c2db15 diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index ae7947e..8c98ad6 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -102,8 +102,7 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const case C_TOKEN( plotArea ): return new PlotAreaContext( *this, mrModel.mxPlotArea.create() ); case C_TOKEN( plotVisOnly ): - // default is 'false', not 'true' as specified - mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, false ); + mrModel.mbPlotVisOnly = rAttribs.getBool( XML_val, !bMSO2007Document ); return 0; case C_TOKEN( showDLblsOverMax ): // default is 'false', not 'true' as specified diff --git a/oox/source/drawingml/chart/chartspacemodel.cxx b/oox/source/drawingml/chart/chartspacemodel.cxx index 8a14bb0..1e05dff 100644 --- a/oox/source/drawingml/chart/chartspacemodel.cxx +++ b/oox/source/drawingml/chart/chartspacemodel.cxx @@ -28,7 +28,7 @@ ChartSpaceModel::ChartSpaceModel(bool bMSO2007Doc) : mnDispBlanksAs( bMSO2007Doc ? XML_gap : XML_zero ), // difference between OOXML spec and MSO 2007 mnStyle( 2 ), mbAutoTitleDel( !bMSO2007Doc ), // difference between OOXML spec and MSO 2007 - mbPlotVisOnly( false ), + mbPlotVisOnly( !bMSO2007Doc ), mbShowLabelsOverMax( false ), mbPivotChart( false ) { commit 3e1c05afbd353a7eb608764d6c2c7282b4592e13 Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 12:00:12 2015 +0200 remove more old misleading comments Change-Id: I4e604be8e40b4e47f4036d7fe66e50d5f0823525 diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 30ba8cc..ae7947e 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -84,7 +84,6 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const case C_TOKEN( autoTitleDeleted ): { - // default value is false for MSO 2007 and true in OOXML mrModel.mbAutoTitleDel = rAttribs.getBool( XML_val, !bMSO2007Document ); return 0; } commit fc9e298371e264281e90eee68923710d732fd07b Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 11:51:23 2015 +0200 remove whitespace Change-Id: Id3f398e52f7f6b93626f6a067aceb5fb25048658 diff --git a/oox/inc/drawingml/chart/plotareamodel.hxx b/oox/inc/drawingml/chart/plotareamodel.hxx index 340fa8d..b90b90b 100644 --- a/oox/inc/drawingml/chart/plotareamodel.hxx +++ b/oox/inc/drawingml/chart/plotareamodel.hxx @@ -29,8 +29,6 @@ namespace oox { namespace drawingml { namespace chart { - - struct View3DModel { OptValue< sal_Int32 > monHeightPercent; /// Height of the 3D view, relative to chart width. @@ -44,8 +42,6 @@ struct View3DModel ~View3DModel(); }; - - struct WallFloorModel { typedef ModelRef< Shape > ShapeRef; @@ -58,8 +54,6 @@ struct WallFloorModel ~WallFloorModel(); }; - - struct DataTableModel { bool mbShowHBorder; /// Show Horizontal Border @@ -69,8 +63,6 @@ struct DataTableModel ~DataTableModel(); }; - - struct PlotAreaModel { typedef ModelVector< TypeGroupModel > TypeGroupVector; @@ -89,8 +81,6 @@ struct PlotAreaModel ~PlotAreaModel(); }; - - } // namespace chart } // namespace drawingml } // namespace oox commit cff6ed154b3daf88c9972b1d8f6b00499e641338 Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 11:45:14 2015 +0200 fix rAngAx MSO 2007 vs OOXML default value Change-Id: I7381e9987257325c7aad387ee0a2781a883be829 diff --git a/oox/inc/drawingml/chart/plotareamodel.hxx b/oox/inc/drawingml/chart/plotareamodel.hxx index 3d8c6a0..340fa8d 100644 --- a/oox/inc/drawingml/chart/plotareamodel.hxx +++ b/oox/inc/drawingml/chart/plotareamodel.hxx @@ -40,7 +40,7 @@ struct View3DModel sal_Int32 mnPerspective; /// Eye distance to the 3D objects. bool mbRightAngled; /// True = right-angled axes in 3D view. - explicit View3DModel(); + explicit View3DModel(bool bMSO2007Doc); ~View3DModel(); }; diff --git a/oox/source/drawingml/chart/chartspaceconverter.cxx b/oox/source/drawingml/chart/chartspaceconverter.cxx index 56a10ae..b841954 100644 --- a/oox/source/drawingml/chart/chartspaceconverter.cxx +++ b/oox/source/drawingml/chart/chartspaceconverter.cxx @@ -78,9 +78,10 @@ void ChartSpaceConverter::convertFromModel( const Reference< XShapes >& rxExtern PropertySet aBackPropSet( getChartDocument()->getPageBackground() ); getFormatter().convertFrameFormatting( aBackPropSet, mrModel.mxShapeProp, OBJECTTYPE_CHARTSPACE ); + bool bMSO2007Doc = getFilter().isMSO2007Document(); // convert plot area (container of all chart type groups) PlotAreaConverter aPlotAreaConv( *this, mrModel.mxPlotArea.getOrCreate() ); - aPlotAreaConv.convertFromModel( mrModel.mxView3D.getOrCreate() ); + aPlotAreaConv.convertFromModel( mrModel.mxView3D.getOrCreate(bMSO2007Doc) ); // plot area converter has created the diagram object Reference< XDiagram > xDiagram = getChartDocument()->getFirstDiagram(); diff --git a/oox/source/drawingml/chart/chartspacefragment.cxx b/oox/source/drawingml/chart/chartspacefragment.cxx index 2c02642..30ba8cc 100644 --- a/oox/source/drawingml/chart/chartspacefragment.cxx +++ b/oox/source/drawingml/chart/chartspacefragment.cxx @@ -115,7 +115,7 @@ ContextHandlerRef ChartSpaceFragment::onCreateContext( sal_Int32 nElement, const case C_TOKEN( title ): return new TitleContext( *this, mrModel.mxTitle.create() ); case C_TOKEN( view3D ): - return new View3DContext( *this, mrModel.mxView3D.create() ); + return new View3DContext( *this, mrModel.mxView3D.create(bMSO2007Document) ); } break; } diff --git a/oox/source/drawingml/chart/plotareacontext.cxx b/oox/source/drawingml/chart/plotareacontext.cxx index 2c9fb12..f19adbd 100644 --- a/oox/source/drawingml/chart/plotareacontext.cxx +++ b/oox/source/drawingml/chart/plotareacontext.cxx @@ -44,6 +44,7 @@ View3DContext::~View3DContext() ContextHandlerRef View3DContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) { + bool bMSO2007Doc = getFilter().isMSO2007Document(); switch( getCurrentElement() ) { case C_TOKEN( view3D ): @@ -59,8 +60,7 @@ ContextHandlerRef View3DContext::onCreateContext( sal_Int32 nElement, const Attr mrModel.mnPerspective = rAttribs.getInteger( XML_val, 30 ); return 0; case C_TOKEN( rAngAx ): - // default is 'false', not 'true' as specified - mrModel.mbRightAngled = rAttribs.getBool( XML_val, false ); + mrModel.mbRightAngled = rAttribs.getBool( XML_val, !bMSO2007Doc ); return 0; case C_TOKEN( rotX ): // default value dependent on chart type diff --git a/oox/source/drawingml/chart/plotareamodel.cxx b/oox/source/drawingml/chart/plotareamodel.cxx index 7c6ea59..9220d49 100644 --- a/oox/source/drawingml/chart/plotareamodel.cxx +++ b/oox/source/drawingml/chart/plotareamodel.cxx @@ -23,10 +23,10 @@ namespace oox { namespace drawingml { namespace chart { -View3DModel::View3DModel() : +View3DModel::View3DModel(bool bMSO2007Doc) : mnDepthPercent( 100 ), mnPerspective( 30 ), - mbRightAngled( false ) + mbRightAngled( !bMSO2007Doc ) { } commit 508280b0844c4775e55954c2803428287de93edb Author: Markus Mohrhard <[email protected]> Date: Tue Apr 28 11:43:32 2015 +0200 remove old misleading comment Change-Id: I0aeb1bb012a9f4c6916da65d5ec6849e621aee07 diff --git a/oox/source/drawingml/chart/titlecontext.cxx b/oox/source/drawingml/chart/titlecontext.cxx index b8accab..4e9f4a3 100644 --- a/oox/source/drawingml/chart/titlecontext.cxx +++ b/oox/source/drawingml/chart/titlecontext.cxx @@ -134,7 +134,6 @@ ContextHandlerRef LegendContext::onCreateContext( sal_Int32 nElement, const Attr return 0; case C_TOKEN( overlay ): - // default is 'false', not 'true' as specified mrModel.mbOverlay = rAttribs.getBool( XML_val, !bMSO2007Doc ); return 0; _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
