27#include <com/sun/star/chart2/XAnyDescriptionAccess.hpp>
28#include <com/sun/star/chart2/XInternalDataProvider.hpp>
29#include <com/sun/star/util/XCloneable.hpp>
30#include <com/sun/star/chart2/XChartDocument.hpp>
31#include <com/sun/star/view/XSelectionSupplier.hpp>
32#include <com/sun/star/lang/XComponent.hpp>
33#include <com/sun/star/chart2/XTitled.hpp>
34#include <com/sun/star/util/XModifiable.hpp>
35#include <com/sun/star/chart2/data/XLabeledDataSequence.hpp>
43 using ::com::sun::star::uno::Reference;
44 using ::com::sun::star::uno::UNO_QUERY;
45 using ::com::sun::star::uno::UNO_QUERY_THROW;
46 using ::com::sun::star::uno::Exception;
47 using ::com::sun::star::uno::Sequence;
48 using ::com::sun::star::frame::XModel;
49 using ::com::sun::star::util::XCloneable;
50 using ::com::sun::star::chart2::XChartDocument;
51 using ::com::sun::star::chart2::XInternalDataProvider;
52 using ::com::sun::star::chart2::XAnyDescriptionAccess;
53 using ::com::sun::star::view::XSelectionSupplier;
54 using ::com::sun::star::chart2::data::XLabeledDataSequence;
63 return new ChartModel(*xModel);
65 catch(
const Exception& )
86 m_xDataClone.set( xCloneable->createClone(), UNO_QUERY_THROW );
149 OSL_ASSERT( xDoc.is() && xDoc->hasInternalDataProvider() );
152 if( xDoc.is() && xDoc->hasInternalDataProvider())
156 if ( xCurrentData.is() && xSavedData.is() )
158 xCurrentData->setData( xSavedData->getData() );
159 xCurrentData->setAnyRowDescriptions( xSavedData->getAnyRowDescriptions());
160 xCurrentData->setAnyColumnDescriptions( xSavedData->getAnyColumnDescriptions());
170 ENSURE_OR_RETURN_VOID( i_model.is(),
"ChartModelElement::applyModelContentToModel: invalid source model!" );
171 ENSURE_OR_RETURN_VOID( i_modelToCopyFrom.is(),
"ChartModelElement::applyModelContentToModel: invalid source model!" );
181 i_model->setFirstDiagram( i_modelToCopyFrom->getFirstDiagram() );
184 i_model->setTitleObject( i_modelToCopyFrom->getTitleObject() );
187 ::comphelper::copyProperties(
188 i_modelToCopyFrom->getPageBackground(),
189 i_model->getPageBackground() );
193 ImplApplyDataToModel( i_model, i_data );
197 if ( i_model->hasInternalDataProvider() )
201 if ( xUsedData.is() && xNewDataProvider.is() )
206 xNewDataProvider->registerDataSequenceForChanges( labeledDataSeq->getValues() );
207 xNewDataProvider->registerDataSequenceForChanges( labeledDataSeq->getLabel() );
213 if ( !i_modelToCopyFrom->isModified() )
215 i_model->setModified(
false );
ChartModelClone(const rtl::Reference<::chart::ChartModel > &i_model, const ModelFacet i_facet)
css::uno::Any m_aSelection
css::uno::Reference< css::chart2::XInternalDataProvider > m_xDataClone
void applyToModel(const rtl::Reference<::chart::ChartModel > &i_model) const
static void applyModelContentToModel(const rtl::Reference<::chart::ChartModel > &i_model, const rtl::Reference<::chart::ChartModel > &i_modelToCopyFrom, const css::uno::Reference< css::chart2::XInternalDataProvider > &i_data)
bool impl_isDisposed() const
rtl::Reference<::chart::ChartModel > m_xModelClone
ModelFacet getFacet() const
static bool isIncludeHiddenCells(const rtl::Reference<::chart::ChartModel > &xChartModel)
static bool setIncludeHiddenCells(bool bIncludeHiddenCells, ChartModel &rModel)
This guard calls lockControllers at the given Model in the CTOR and unlockControllers in the DTOR.
static rtl::Reference< ::chart::DataSource > getUsedData(ChartModel &rModel)
#define ENSURE_OR_THROW(c, m)
#define DBG_UNHANDLED_EXCEPTION(...)
#define ENSURE_OR_RETURN_VOID(c, m)
constexpr OUStringLiteral aData