20#include <com/sun/star/beans/XPropertySet.hpp>
21#include <com/sun/star/document/XEmbeddedObjectSupplier.hpp>
22#include <com/sun/star/container/XNamed.hpp>
23#include <com/sun/star/script/BasicErrorException.hpp>
24#include <com/sun/star/view/XSelectionSupplier.hpp>
35ScVbaChartObject::ScVbaChartObject(
const css::uno::Reference< ov::XHelperInterface >& _xParent,
const css::uno::Reference< css::uno::XComponentContext >& _xContext, css::uno::Reference< css::table::XTableChart > _xTableChart, css::uno::Reference< css::drawing::XDrawPageSupplier > _xDrawPageSupplier ) :
ChartObjectImpl_BASE( _xParent,
_xContext ), xTableChart(
std::move( _xTableChart )), xDrawPageSupplier(
std::move( _xDrawPageSupplier ))
53uno::Reference< drawing::XShape >
59 for (
int i = 0;
i < nItems;
i++)
62 if (
xShape->getShapeType() ==
"com.sun.star.drawing.OLE2Shape")
64 uno::Reference< beans::XPropertySet > xShapePropertySet(
xShape, uno::UNO_QUERY_THROW );
75 catch (uno::Exception& )
77 throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED), OUString() );
98 uno::Reference< excel::XWorksheet > xParent(
getParent(), uno::UNO_QUERY_THROW );
99 uno::Reference< excel::XChartObjects > xColl( xParent->ChartObjects(
uno::Any() ), uno::UNO_QUERY_THROW );
101 if (!pChartObjectsImpl)
102 throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED),
"Parent is not ChartObjects" );
117 uno::Reference< view::XSelectionSupplier > xSelectionSupplier(
getCurrentExcelDoc(
mxContext)->getCurrentController(), uno::UNO_QUERY_THROW );
120 catch (uno::Exception& )
122 throw script::BasicErrorException( OUString(), uno::Reference< uno::XInterface >(), sal_uInt32(
ERRCODE_BASIC_METHOD_FAILED),
"ChartObject Activate internal error" );
126uno::Reference< excel::XChart > SAL_CALL
135 return "ScVbaChartObject";
138uno::Sequence< OUString >
143 "ooo.vba.excel.ChartObject"
css::uno::Reference< css::uno::XComponentContext > mxContext
virtual css::uno::Reference< ov::XHelperInterface > SAL_CALL getParent() override
virtual css::uno::Reference< ov::excel::XChart > SAL_CALL getChart() override
ScVbaChartObject(const css::uno::Reference< ov::XHelperInterface > &_xParent, const css::uno::Reference< css::uno::XComponentContext > &_xContext, css::uno::Reference< css::table::XTableChart > _xTableChart, css::uno::Reference< css::drawing::XDrawPageSupplier > _xDrawPageSupplier)
virtual OUString SAL_CALL getName() override
css::uno::Reference< css::drawing::XDrawPage > xDrawPage
css::uno::Reference< css::container::XNamed > xNamedShape
css::uno::Reference< css::drawing::XDrawPageSupplier > xDrawPageSupplier
virtual css::uno::Sequence< OUString > getServiceNames() override
css::uno::Reference< css::drawing::XShape > xShape
virtual OUString getServiceImplName() override
css::uno::Reference< css::document::XEmbeddedObjectSupplier > xEmbeddedObjectSupplier
virtual void SAL_CALL setName(const OUString &sName) override
std::optional< ov::ShapeHelper > oShapeHelper
css::uno::Reference< css::table::XTableChart > xTableChart
css::uno::Reference< css::drawing::XShape > setShape()
OUString const & getPersistName()
virtual void SAL_CALL Delete() override
css::uno::Reference< css::container::XNamed > xNamed
void removeByName(const OUString &_sChartName)
Sequence< OUString > aServiceNames
VBAHELPER_DLLPUBLIC css::uno::Reference< css::frame::XModel > getCurrentExcelDoc(const css::uno::Reference< css::uno::XComponentContext > &xContext)
#define ERRCODE_BASIC_METHOD_FAILED
Reference< XComponentContext > _xContext
constexpr OUStringLiteral PERSIST_NAME(u"PersistName")