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>
32 : m_pDocShell(pDocShell)
34 , m_aChartName(
std::move(aName))
37 m_pDocShell->GetDocument().AddUnoObject(*
this);
50 if (rHint.
GetId() == SfxHintId::Dying)
61 return uno::Reference<lang::XComponent>(
pObject->GetObjRef()->getComponent(), uno::UNO_QUERY);
74 throw uno::RuntimeException();
87 uno::Reference<embed::XEmbeddedObject> xObject =
pObject->GetObjRef();
91 uno::Reference<chart2::XChartDocument> xChartDoc(xObject->getComponent(), uno::UNO_QUERY);
95 uno::Reference<chart2::data::XPivotTableDataProvider> xPivotTableDataProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY);
96 if (!xPivotTableDataProvider.is())
99 return xPivotTableDataProvider->getPivotTableName();
const ScDocument & GetDocument() const
void RemoveUnoObject(SfxListener &rObject)
virtual void SAL_CALL setName(OUString const &aName) override
virtual OUString SAL_CALL getPivotTableName() override
virtual css::uno::Reference< css::lang::XComponent > SAL_CALL getEmbeddedObject() override
virtual OUString SAL_CALL getName() override
virtual ~TablePivotChart() override
virtual void Notify(SfxBroadcaster &rBC, const SfxHint &rHint) override
static bool TryRunningState(const css::uno::Reference< css::embed::XEmbeddedObject > &)
EmbeddedObjectRef * pObject
#define SC_SIMPLE_SERVICE_INFO(ClassName, ClassNameAscii, ServiceAscii)
CAUTION! The following defines must be in the same namespace as the respective type.