10 #include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp>
11 #include <com/sun/star/chart2/XChartDocument.hpp>
12 #include <com/sun/star/embed/XEmbeddedObject.hpp>
31 : m_pDocShell(pDocShell)
36 m_pDocShell->GetDocument().AddUnoObject(*
this);
39 TablePivotChart::~TablePivotChart()
44 m_pDocShell->GetDocument().RemoveUnoObject(*
this);
49 if (rHint.
GetId() == SfxHintId::Dying)
50 m_pDocShell =
nullptr;
55 uno::Reference<lang::XComponent> SAL_CALL TablePivotChart::getEmbeddedObject()
60 return uno::Reference<lang::XComponent>(pObject->
GetObjRef()->getComponent(), uno::UNO_QUERY);
66 OUString SAL_CALL TablePivotChart::getName()
71 void SAL_CALL TablePivotChart::setName(OUString
const & )
73 throw uno::RuntimeException();
78 OUString SAL_CALL TablePivotChart::getPivotTableName()
86 uno::Reference<embed::XEmbeddedObject> xObject = pObject->
GetObjRef();
90 uno::Reference<chart2::XChartDocument> xChartDoc(xObject->getComponent(), uno::UNO_QUERY);
94 uno::Reference<chart2::data::XPivotTableDataProvider> xPivotTableDataProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY);
95 if (!xPivotTableDataProvider.is())
98 return xPivotTableDataProvider->getPivotTableName();
css::uno::Reference< css::embed::XEmbeddedObject > const & GetObjRef() const
EmbeddedObjectRef * pObject
void Notify(ScModelObj &rModelObj, const ScRangeList &rChangeRanges, const OUString &rType=OUString("cell-change"), const css::uno::Sequence< css::beans::PropertyValue > &rProperties=css::uno::Sequence< css::beans::PropertyValue >())
CAUTION! The following defines must be in the same namespace as the respective type.
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)