33#include <com/sun/star/chart/ChartDataRowSource.hpp>
34#include <com/sun/star/chart/XChartDocument.hpp>
35#include <com/sun/star/embed/Aspects.hpp>
36#include <com/sun/star/view/XSelectionChangeListener.hpp>
47 bool bDefaultDataInColumns(
true);
54 css::uno::Reference< css::chart::XChartDocument > xDoc(
static_cast<cppu::OWeakObject*
>(xChartDoc.get()), uno::UNO_QUERY);
58 css::uno::Reference< css::chart::XDiagram > aDiagram = xDoc->getDiagram();
62 css::uno::Reference< css::beans::XPropertySet > xProp(aDiagram, uno::UNO_QUERY);
66 css::chart::ChartDataRowSource aDataRowSource(css::chart::ChartDataRowSource_COLUMNS);
68 xProp->getPropertyValue(
"DataRowSource" ) >>= aDataRowSource;
70 bDefaultDataInColumns = (aDataRowSource == css::chart::ChartDataRowSource_COLUMNS);
84 auto aCooSysSeq( xDiagram->getBaseCoordinateSystems() );
85 if( !aCooSysSeq.empty() )
94 std::vector< rtl::Reference< DataSeries > > aResult;
98 aResult = xDiagram->getDataSeries();
108 return xDiagram ? xDiagram->getChartTypeOfSeries( xGivenDataSeries ) :
nullptr;
113 return awt::Size( 16000, 9000 );
119 OSL_ENSURE(
xModel.is(),
"need xVisualObject for page size");
121 aPageSize =
xModel->getVisualAreaSize( embed::Aspects::MSOLE_CONTENT );
131 if( xSelectionChangeListener.is() )
133 lang::EventObject
aEvent( xSelectionChangeListener );
134 xSelectionChangeListener->selectionChanged(
aEvent );
141 bool bIncluded =
true;
149 xDiagram->getPropertyValue(
"IncludeHiddenCells") >>= bIncluded;
151 catch(
const beans::UnknownPropertyException& )
160 bool bChanged =
false;
166 if (xDiagramProperties.is())
168 bool bOldValue = bIncludeHiddenCells;
169 xDiagramProperties->getPropertyValue(
"IncludeHiddenCells" ) >>= bOldValue;
170 if( bOldValue == bIncludeHiddenCells )
175 uno::Any aNewValue(bIncludeHiddenCells);
180 if( xDataProviderProperties.is() )
181 xDataProviderProperties->setPropertyValue(
"IncludeHiddenCells", aNewValue );
183 catch(
const beans::UnknownPropertyException& )
199 xProp->setPropertyValue(
"IncludeHiddenCells", aNewValue );
202 xProp->setPropertyValue(
"IncludeHiddenCells", aNewValue );
206 catch(
const beans::UnknownPropertyException& )
211 xDiagramProperties->setPropertyValue(
"IncludeHiddenCells", aNewValue);
214 catch (
const uno::Exception&)
static bool isIncludeHiddenCells(const rtl::Reference<::chart::ChartModel > &xChartModel)
static rtl::Reference< InternalDataProvider > createInternalDataProvider(const rtl::Reference<::chart::ChartModel > &xChartDoc, bool bConnectToModel)
static bool setIncludeHiddenCells(bool bIncludeHiddenCells, ChartModel &rModel)
static css::awt::Size getPageSize(const rtl::Reference<::chart::ChartModel > &xModel)
static void triggerRangeHighlighting(const rtl::Reference<::chart::ChartModel > &xModel)
static rtl::Reference< ChartType > getChartTypeOfSeries(const rtl::Reference<::chart::ChartModel > &xModel, const rtl::Reference< ::chart::DataSeries > &xGivenDataSeries)
static std::vector< rtl::Reference< ::chart::DataSeries > > getDataSeries(const rtl::Reference< ::chart::ChartModel > &xModel)
static css::awt::Size getDefaultPageSize()
static rtl::Reference< ::chart::BaseCoordinateSystem > getFirstCoordinateSystem(const rtl::Reference<::chart::ChartModel > &xModel)
static rtl::Reference< ::chart::DataSource > getUsedData(ChartModel &rModel)
Data provider that handles data internally.
#define TOOLS_WARN_EXCEPTION(area, stream)
constexpr OUStringLiteral aData
Reference< XModel > xModel