22#include <com/sun/star/embed/XEmbeddedObject.hpp>
23#include <com/sun/star/lang/XUnoTunnel.hpp>
24#include <com/sun/star/util/XUpdatable2.hpp>
25#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
26#include <com/sun/star/lang/XMultiServiceFactory.hpp>
28#include <com/sun/star/chart2/XChartDocument.hpp>
29#include <com/sun/star/drawing/FillStyle.hpp>
30#include <com/sun/star/drawing/LineStyle.hpp>
42 const uno::Reference< lang::XMultiServiceFactory > xChartFact(rXModel, uno::UNO_QUERY_THROW);
43 const uno::Reference< util::XUpdatable2 > xChartView(xChartFact->createInstance(
"com.sun.star.chart2.ChartView"), uno::UNO_QUERY_THROW);
45 xChartView->updateHard();
47 catch(uno::Exception&)
54 const uno::Reference< ::frame::XModel >& rXModel,
63 rXModel->lockControllers();
65 rXModel->unlockControllers();
69 const uno::Reference< drawing::XDrawPageSupplier > xDrawPageSupplier(rXModel, uno::UNO_QUERY_THROW);
70 const uno::Reference< container::XIndexAccess > xShapeAccess(xDrawPageSupplier->getDrawPage(), uno::UNO_QUERY_THROW);
72 if(xShapeAccess->getCount())
74 const sal_Int32 nShapeCount(xShapeAccess->getCount());
75 const uno::Sequence< beans::PropertyValue > aParams;
76 uno::Reference< drawing::XShape > xShape;
78 for(sal_Int32
a(0);
a < nShapeCount;
a++)
80 xShapeAccess->getByIndex(
a) >>= xShape;
92 catch(uno::Exception&)
108 const uno::Reference < embed::XEmbeddedObject > & xEmbObj)
113 uno::Reference< chart2::XChartDocument > xChartDoc( xEmbObj->getComponent(), uno::UNO_QUERY );
114 OSL_ENSURE( xChartDoc.is(),
"Trying to set chart property to non-chart OLE" );
120 if (uno::Reference< beans::XPropertySet > xPageProp = xChartDoc->getPageBackground())
123 xPageProp->setPropertyValue(
"FillStyle",
uno::Any(drawing::FillStyle_NONE));
125 xPageProp->setPropertyValue(
"LineStyle",
uno::Any(drawing::LineStyle_NONE));
128 catch(
const uno::Exception & )
static drawinglayer::primitive2d::Primitive2DContainer tryToGetChartContentAsPrimitive2DSequence(const css::uno::Reference< css::frame::XModel > &rXModel, basegfx::B2DRange &rRange)
static void updateChart(const css::uno::Reference< css::frame::XModel > &rXModel)
Use chart's XUpdatable::update() to update values.
static void AdaptDefaultsForChart(const css::uno::Reference< css::embed::XEmbeddedObject > &xEmbObj)
virtual css::uno::Sequence< css::uno::Reference< css::graphic::XPrimitive2D > > SAL_CALL createPrimitivesFromXShape(const css::uno::Reference< css::drawing::XShape > &xShape, const css::uno::Sequence< css::beans::PropertyValue > &aParms) override
basegfx::B2DRange getB2DRange(const geometry::ViewInformation2D &aViewInformation) const
#define TOOLS_WARN_EXCEPTION(area, stream)