include/xmloff/xmltoken.hxx | 12 ++++++- xmloff/source/chart/PropertyMap.hxx | 11 ++++++ xmloff/source/chart/SchXMLExport.cxx | 43 +++++++++------------------ xmloff/source/chart/SchXMLSeries2Context.cxx | 9 +++-- xmloff/source/core/xmltoken.cxx | 13 +++++++- 5 files changed, 54 insertions(+), 34 deletions(-)
New commits: commit bda2f4d39aef63eeaaa0ba032f06c51296d39dd8 Author: Tomaž Vajngerl <qui...@gmail.com> Date: Sun Jun 9 12:07:16 2013 +0200 Added new regression curve properties as ODT 1.2 extended. Added: - regression-extrapolate-forward - regression-extrapolate-backward - regression-max-degree - regression-min-degree - regression-moving-type - regression-period - regression-force-intercept - regression-intercept-value Not all of these are yet filled as they are not yet implemented. Change-Id: I7ac39c0df5b8b7fb7be6b32d301e33a7f49f2960 diff --git a/include/xmloff/xmltoken.hxx b/include/xmloff/xmltoken.hxx index 9b01d0a..d7ac351 100644 --- a/include/xmloff/xmltoken.hxx +++ b/include/xmloff/xmltoken.hxx @@ -1474,7 +1474,6 @@ namespace xmloff { namespace token { XML_REGION_RIGHT, XML_REGISTER_TRUE, XML_REGISTER_TRUTH_REF_STYLE_NAME, - XML_REGRESSION_TYPE, XML_REJECTED, XML_REJECTING_CHANGE_ID, XML_REJECTION, @@ -2143,6 +2142,16 @@ namespace xmloff { namespace token { XML_MARKED_INVALID, XML_REGRESSION_CURVE, + XML_REGRESSION_TYPE, + XML_REGRESSION_EXTRAPOLATE_FORWARD, + XML_REGRESSION_EXTRAPOLATE_BACKWARD, + XML_REGRESSION_MAX_DEGREE, + XML_REGRESSION_MIN_DEGREE, + XML_REGRESSION_MOVING_TYPE, + XML_REGRESSION_PERIOD, + XML_REGRESSION_FORCE_INTERCEPT, + XML_REGRESSION_INTERCEPT_VALUE, + XML_ERROR_INDICATOR, XML_TABLE_TYPE, @@ -3185,6 +3194,7 @@ namespace xmloff { namespace token { XML_VERTICAL_BAR, XML_ERROR_STANDARD_WEIGHT, // errorbar standard deviation error weight + XML_TOKEN_END }; diff --git a/xmloff/source/chart/PropertyMap.hxx b/xmloff/source/chart/PropertyMap.hxx index 0f48024..fb2a522 100644 --- a/xmloff/source/chart/PropertyMap.hxx +++ b/xmloff/source/chart/PropertyMap.hxx @@ -183,7 +183,18 @@ const XMLPropertyMapEntry aXMLChartPropMap[] = MAP_ENTRY( "ShowNegativeError", CHART, XML_ERROR_LOWER_INDICATOR, XML_TYPE_BOOL), MAP_ENTRY( "ErrorBarStyle", CHART, XML_ERROR_CATEGORY, XML_SCH_TYPE_ERROR_BAR_STYLE ), MAP_ENTRY( "PercentageError", CHART, XML_ERROR_PERCENTAGE, XML_TYPE_DOUBLE ), + + // regression curve properties MAP_SPECIAL( "RegressionType", CHART, XML_REGRESSION_TYPE, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_REGRESSION_TYPE ), + + MAP_ENTRY_ODF_EXT( "PolynomialDegree", CHART, XML_REGRESSION_MAX_DEGREE, XML_TYPE_NUMBER ), + MAP_ENTRY_ODF_EXT( "MovingAveragePeriod", CHART, XML_REGRESSION_PERIOD, XML_TYPE_NUMBER ), + MAP_ENTRY_ODF_EXT( "MovingAverageType", CHART, XML_REGRESSION_MOVING_TYPE, XML_TYPE_STRING ), + MAP_ENTRY_ODF_EXT( "ExtrapolateForward", CHART, XML_REGRESSION_EXTRAPOLATE_FORWARD, XML_TYPE_DOUBLE ), + MAP_ENTRY_ODF_EXT( "ExtrapolateBackward", CHART, XML_REGRESSION_EXTRAPOLATE_BACKWARD, XML_TYPE_DOUBLE ), + MAP_ENTRY_ODF_EXT( "ForceIntercept", CHART, XML_REGRESSION_FORCE_INTERCEPT, XML_TYPE_BOOL ), + MAP_ENTRY_ODF_EXT( "InterceptValue", CHART, XML_REGRESSION_INTERCEPT_VALUE, XML_TYPE_DOUBLE ), + MAP_SPECIAL_ODF12( "ErrorBarRangePositive", CHART, XML_ERROR_UPPER_RANGE, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ), // export only MAP_SPECIAL_ODF12( "ErrorBarRangeNegative", CHART, XML_ERROR_LOWER_RANGE, XML_TYPE_STRING, XML_SCH_CONTEXT_SPECIAL_ERRORBAR_RANGE ), // export only diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index e682ed5..6c697a1 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -227,12 +227,10 @@ public: const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > & xDiagram, sal_Bool bExportContent ); + void exportRegressionCurve( - const ::com::sun::star::uno::Reference< - ::com::sun::star::chart2::XDataSeries > & xSeries, - const ::com::sun::star::uno::Reference< - ::com::sun::star::beans::XPropertySet > & xSeriesProp, - const ::com::sun::star::awt::Size & rPageSize, + const com::sun::star::uno::Reference<com::sun::star::chart2::XDataSeries>& xSeries, + const com::sun::star::awt::Size& rPageSize, sal_Bool bExportContent ); void exportErrorBar ( @@ -2887,7 +2885,7 @@ void SchXMLExportHelper_Impl::exportSeries( if( xPropSet.is() && mxExpPropMapper.is() ) { - exportRegressionCurve( aSeriesSeq[nSeriesIdx], xPropSet, rPageSize, bExportContent ); + exportRegressionCurve( aSeriesSeq[nSeriesIdx], rPageSize, bExportContent ); } exportErrorBar( xPropSet,false, bExportContent ); // X ErrorBar @@ -2909,7 +2907,6 @@ void SchXMLExportHelper_Impl::exportSeries( void SchXMLExportHelper_Impl::exportRegressionCurve( const Reference< chart2::XDataSeries >& xSeries, - const Reference< beans::XPropertySet >& xSeriesProp, const awt::Size& rPageSize, sal_Bool bExportContent ) { diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index 164f346..98deab5 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -905,6 +905,8 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( { Reference< lang::XMultiServiceFactory > xMSF( comphelper::getProcessServiceFactory(), uno::UNO_QUERY ); Reference< chart2::XRegressionCurve > xRegCurve( xMSF->createInstance( aServiceName ), uno::UNO_QUERY_THROW ); + Reference< chart2::XRegressionCurveContainer > xRegCurveCont( iStyle->m_xSeries, uno::UNO_QUERY_THROW ); + if( xRegCurve.is()) { Reference< beans::XPropertySet > xCurveProperties( xRegCurve, uno::UNO_QUERY ); @@ -913,7 +915,6 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( xRegCurve->setEquationProperties( iStyle->m_xEquationProperties ); } - Reference< chart2::XRegressionCurveContainer > xRegCurveCont( iStyle->m_xSeries, uno::UNO_QUERY_THROW ); xRegCurveCont->addRegressionCurve( xRegCurve ); } } diff --git a/xmloff/source/core/xmltoken.cxx b/xmloff/source/core/xmltoken.cxx index 85e153e..44c611f 100644 --- a/xmloff/source/core/xmltoken.cxx +++ b/xmloff/source/core/xmltoken.cxx @@ -1480,7 +1480,6 @@ namespace xmloff { namespace token { TOKEN( "region-right", XML_REGION_RIGHT ), TOKEN( "register-true", XML_REGISTER_TRUE ), TOKEN( "register-truth-ref-style-name", XML_REGISTER_TRUTH_REF_STYLE_NAME ), - TOKEN( "regression-type", XML_REGRESSION_TYPE ), TOKEN( "rejected", XML_REJECTED ), TOKEN( "rejecting-change-id", XML_REJECTING_CHANGE_ID ), TOKEN( "rejection", XML_REJECTION ), @@ -2151,7 +2150,19 @@ namespace xmloff { namespace token { TOKEN( "marked-invalid", XML_MARKED_INVALID ), + // Regression curve & properties TOKEN( "regression-curve", XML_REGRESSION_CURVE ), + TOKEN( "regression-type", XML_REGRESSION_TYPE ), + // Extended regression curve properties - ODF 1.2 extended + TOKEN( "regression-extrapolate-forward", XML_REGRESSION_EXTRAPOLATE_FORWARD ), + TOKEN( "regression-extrapolate-backward", XML_REGRESSION_EXTRAPOLATE_BACKWARD ), + TOKEN( "regression-max-degree", XML_REGRESSION_MAX_DEGREE ), + TOKEN( "regression-min-degree", XML_REGRESSION_MIN_DEGREE ), + TOKEN( "regression-moving-type", XML_REGRESSION_MOVING_TYPE ), + TOKEN( "regression-period", XML_REGRESSION_PERIOD ), + TOKEN( "regression-force-intercept", XML_REGRESSION_FORCE_INTERCEPT ), + TOKEN( "regression-intercept-value", XML_REGRESSION_INTERCEPT_VALUE ), + TOKEN( "error-indicator", XML_ERROR_INDICATOR ), TOKEN( "table-type", XML_TABLE_TYPE ), commit 0c40cab6fbcbd3660b44dc68fcd45e1114e7a4e6 Author: Tomaž Vajngerl <qui...@gmail.com> Date: Sat Jun 8 16:38:22 2013 +0200 Little cleanup in ODT regression lines import/export Change-Id: Ie6cdfec1295e08cd5141056eeac39f248ee97766 diff --git a/xmloff/source/chart/SchXMLExport.cxx b/xmloff/source/chart/SchXMLExport.cxx index a42c302..e682ed5 100644 --- a/xmloff/source/chart/SchXMLExport.cxx +++ b/xmloff/source/chart/SchXMLExport.cxx @@ -2933,17 +2933,19 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( if (!xRegCurve.is()) continue; - bool bShowEquation = false; - bool bShowRSquared = false; - bool bExportEquation = false; - Reference< beans::XPropertySet > xProperties( xRegCurve , uno::UNO_QUERY ); - - OUString aService; + if( !xProperties.is() ) + continue; Reference< lang::XServiceName > xServiceName( xProperties, uno::UNO_QUERY ); if( !xServiceName.is() ) continue; + + bool bShowEquation = false; + bool bShowRSquared = false; + bool bExportEquation = false; + + OUString aService; aService = xServiceName->getServiceName(); aPropertyStates = mxExpPropMapper->Filter( xProperties ); @@ -2954,11 +2956,7 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( aPropertyStates.push_back(property); Reference< beans::XPropertySet > xEquationProperties; - if( xRegCurve.is()) - { - xEquationProperties.set( xRegCurve->getEquationProperties() ); - } - + xEquationProperties.set( xRegCurve->getEquationProperties() ); if( xEquationProperties.is()) { xEquationProperties->getPropertyValue( OUString("ShowEquation")) >>= bShowEquation; @@ -2997,16 +2995,8 @@ void SchXMLExportHelper_Impl::exportRegressionCurve( SvXMLElementExport aRegressionExport( mrExport, XML_NAMESPACE_CHART, XML_REGRESSION_CURVE, sal_True, sal_True ); if( bExportEquation ) { - // default is true - if( !bShowEquation ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_EQUATION, XML_FALSE ); - } - // default is false - if( bShowRSquared ) - { - mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_R_SQUARE, XML_TRUE ); - } + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_EQUATION, (bShowEquation ? XML_TRUE : XML_FALSE) ); + mrExport.AddAttribute( XML_NAMESPACE_CHART, XML_DISPLAY_R_SQUARE, (bShowRSquared ? XML_TRUE : XML_FALSE) ); // export position chart2::RelativePosition aRelativePosition; diff --git a/xmloff/source/chart/SchXMLSeries2Context.cxx b/xmloff/source/chart/SchXMLSeries2Context.cxx index c13b5dd..164f346 100644 --- a/xmloff/source/chart/SchXMLSeries2Context.cxx +++ b/xmloff/source/chart/SchXMLSeries2Context.cxx @@ -241,7 +241,7 @@ Reference< chart2::data::XLabeledDataSequence2 > lcl_createAndAddSequenceToSerie return xLabeledSeq; } -XMLPropStyleContext* lcl_GetStyleContext( +XMLPropStyleContext* lcl_GetStylePropContext( const SvXMLStylesContext* pStylesCtxt, const SvXMLStyleContext*& rpStyle, OUString& rStyleName ) @@ -875,7 +875,7 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( if (!rCurrentStyleName.isEmpty()) { - XMLPropStyleContext* pCurrent = lcl_GetStyleContext(pStylesCtxt, rpStyle, rCurrentStyleName); + XMLPropStyleContext* pCurrent = lcl_GetStylePropContext(pStylesCtxt, rpStyle, rCurrentStyleName); if( pCurrent ) { pPropStyleContext = pCurrent; @@ -889,7 +889,7 @@ void SchXMLSeries2Context::setStylesToRegressionCurves( if (!iStyle->msStyleName.isEmpty()) { - XMLPropStyleContext* pCurrent = lcl_GetStyleContext(pStylesCtxt, rpStyle, iStyle->msStyleName); + XMLPropStyleContext* pCurrent = lcl_GetStylePropContext(pStylesCtxt, rpStyle, iStyle->msStyleName); if( pCurrent ) { pPropStyleContext = pCurrent;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits