36#include <com/sun/star/awt/Point.hpp>
37#include <com/sun/star/chart2/RegressionEquation.hpp>
38#include <com/sun/star/chart2/RelativePosition.hpp>
39#include <com/sun/star/xml/sax/XAttributeList.hpp>
47 std::vector< RegressionStyle >& rRegressionStyleVector,
49 css::chart2::XDataSeries > xSeries,
50 const awt::Size & rChartSize) :
52 mrImportHelper( rImpHelper ),
53 mxSeries(
std::move( xSeries )),
54 maChartSize( rChartSize ),
55 mrRegressionStyleVector( rRegressionStyleVector )
64 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
66 OUString sAutoStyleName;
70 sAutoStyleName = aIter.toString();
81 const css::uno::Reference< css::xml::sax::XFastAttributeList >& )
96 const awt::Size& rChartSize,
99 mrImportHelper( rImpHelper ),
100 mrRegressionStyle( rRegressionStyle ),
101 maChartSize( rChartSize )
108 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList)
112 OUString sAutoStyleName;
113 bool bShowEquation =
true;
114 bool bShowRSquare =
false;
115 awt::Point aPosition;
116 bool bHasXPos =
false;
117 bool bHasYPos =
false;
121 switch(aIter.getToken())
125 rImport.GetMM100UnitConverter().convertMeasureToCore(
126 aPosition.X, aIter.toView() );
131 rImport.GetMM100UnitConverter().convertMeasureToCore(
132 aPosition.Y, aIter.toView() );
142 sAutoStyleName = aIter.toString();
149 if( sAutoStyleName.isEmpty() && !bShowEquation && !bShowRSquare )
154 if( !sAutoStyleName.isEmpty() )
165 if( pPropStyleContext )
169 xEquationProperties->setPropertyValue(
"ShowEquation",
uno::Any( bShowEquation ));
170 xEquationProperties->setPropertyValue(
"ShowCorrelationCoefficient",
uno::Any( bShowRSquare ));
172 if( bHasXPos && bHasYPos )
174 chart2::RelativePosition aRelPos;
175 aRelPos.Primary =
static_cast< double >( aPosition.X ) /
static_cast< double >(
maChartSize.Width );
176 aRelPos.Secondary =
static_cast< double >( aPosition.Y ) /
static_cast< double >(
maChartSize.Height );
177 xEquationProperties->setPropertyValue(
"RelativePosition",
uno::Any( aRelPos ));
SchXMLImportHelper & mrImportHelper
css::awt::Size maChartSize
virtual ~SchXMLEquationContext() override
SchXMLEquationContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, const css::awt::Size &rChartSize, RegressionStyle &rRegressionStyle)
RegressionStyle & mrRegressionStyle
virtual void SAL_CALL startFastElement(sal_Int32 Element, const css::uno::Reference< css::xml::sax::XFastAttributeList > &Attribs) override
With this class you can import a <chart:chart> element containing its data as <table:table> element o...
SvXMLStylesContext * GetAutoStylesContext() const
static XmlStyleFamily GetChartFamilyID()
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
SchXMLRegressionCurveObjectContext(SchXMLImportHelper &rImportHelper, SvXMLImport &rImport, std::vector< RegressionStyle > &rRegressionStyleVector, css::uno::Reference< css::chart2::XDataSeries > xSeries, const css::awt::Size &rChartSize)
css::awt::Size maChartSize
css::uno::Reference< css::chart2::XDataSeries > mxSeries
virtual void SAL_CALL startFastElement(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList) override
virtual ~SchXMLRegressionCurveObjectContext() override
std::vector< RegressionStyle > & mrRegressionStyleVector
SchXMLImportHelper & mrImportHelper
This class deliberately does not support XWeak, to improve performance when loading large documents.
SvXMLImport & GetImport()
const SvXMLStyleContext * FindStyleChildContext(XmlStyleFamily nFamily, const OUString &rName, bool bCreateIndex=false) const
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
static bool convertBool(bool &rBool, std::u16string_view rString)
Reference< XComponentContext > getProcessComponentContext()
FastAttributeList & castToFastAttributeList(const css::uno::Reference< css::xml::sax::XFastAttributeList > &xAttrList)
Handling of tokens in XML:
css::uno::Reference< css::beans::XPropertySet > m_xEquationProperties
#define XMLOFF_WARN_UNKNOWN_ELEMENT(area, token)
#define XMLOFF_WARN_UNKNOWN(area, rIter)
#define XML_ELEMENT(prefix, name)