LibreOffice Module sw (master)  1
Classes | Public Member Functions | Private Types | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
SwChartDataProvider Class Referencefinal

#include <unochart.hxx>

Inheritance diagram for SwChartDataProvider:
Collaboration diagram for SwChartDataProvider:


struct  lt_DataSequenceRef

Public Member Functions

 SwChartDataProvider (const SwDoc &rDoc)
virtual ~SwChartDataProvider () override
virtual sal_Bool SAL_CALL createDataSourcePossible (const css::uno::Sequence< css::beans::PropertyValue > &aArguments) override
virtual css::uno::Reference< css::chart2::data::XDataSource > SAL_CALL createDataSource (const css::uno::Sequence< css::beans::PropertyValue > &aArguments) override
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL detectArguments (const css::uno::Reference< css::chart2::data::XDataSource > &xDataSource) override
virtual sal_Bool SAL_CALL createDataSequenceByRangeRepresentationPossible (const OUString &aRangeRepresentation) override
virtual css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL createDataSequenceByRangeRepresentation (const OUString &aRangeRepresentation) override
virtual css::uno::Reference< css::sheet::XRangeSelection > SAL_CALL getRangeSelection () override
virtual css::uno::Reference< css::chart2::data::XDataSequence > SAL_CALL createDataSequenceByValueArray (const OUString &aRole, const OUString &aRangeRepresentation) override
virtual OUString SAL_CALL convertRangeToXML (const OUString &aRangeRepresentation) override
virtual OUString SAL_CALL convertRangeFromXML (const OUString &aXMLRange) override
virtual void SAL_CALL dispose () override
virtual void SAL_CALL addEventListener (const css::uno::Reference< css::lang::XEventListener > &xListener) override
virtual void SAL_CALL removeEventListener (const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual OUString SAL_CALL getImplementationName () override
virtual sal_Bool SAL_CALL supportsService (const OUString &ServiceName) override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames () override
void AddDataSequence (const SwTable &rTable, css::uno::Reference< css::chart2::data::XDataSequence > const &rxDataSequence)
void RemoveDataSequence (const SwTable &rTable, css::uno::Reference< css::chart2::data::XDataSequence > const &rxDataSequence)
void InvalidateTable (const SwTable *pTable)
void DeleteBox (const SwTable *pTable, const SwTableBox &rBox)
void DisposeAllDataSequences (const SwTable *pTable)
void AddRowCols (const SwTable &rTable, const SwSelBoxes &rBoxes, sal_uInt16 nLines, bool bBehind)
 SwChartDataProvider::AddRowCols tries to notify charts of added columns or rows and extends the value sequence respectively (if possible). More...

Private Types

typedef std::set< css::uno::WeakReference< css::chart2::data::XDataSequence >, lt_DataSequenceRefSet_DataSequenceRef_t
typedef std::map< const SwTable *, Set_DataSequenceRef_tMap_Set_DataSequenceRef_t

Private Member Functions

 SwChartDataProvider (const SwChartDataProvider &)=delete
SwChartDataProvideroperator= (const SwChartDataProvider &)=delete
css::uno::Reference< css::chart2::data::XDataSource > Impl_createDataSource (const css::uno::Sequence< css::beans::PropertyValue > &aArguments, bool bTestOnly=false)
css::uno::Reference< css::chart2::data::XDataSequence > Impl_createDataSequenceByRangeRepresentation (const OUString &aRangeRepresentation, bool bTestOnly=false)

Static Private Member Functions

static OUString GetBrokenCellRangeForExport (const OUString &rCellRangeRepresentation)
 Fix for #i79009 we need to return a property that has the same value as the property 'CellRangeRepresentation' but for all rows which are increased by one. More...

Private Attributes

Map_Set_DataSequenceRef_t m_aDataSequences
::comphelper::OInterfaceContainerHelper2 m_aEventListeners
const SwDocm_pDoc
bool m_bDisposed

Detailed Description

Definition at line 102 of file unochart.hxx.

Member Typedef Documentation

Definition at line 120 of file unochart.hxx.

typedef std::set< css::uno::WeakReference < css::chart2::data::XDataSequence >, lt_DataSequenceRef > SwChartDataProvider::Set_DataSequenceRef_t

Definition at line 117 of file unochart.hxx.

Constructor & Destructor Documentation

SwChartDataProvider::SwChartDataProvider ( const SwChartDataProvider )
SwChartDataProvider::SwChartDataProvider ( const SwDoc rDoc)

Definition at line 505 of file unochart.cxx.

References m_bDisposed.

SwChartDataProvider::~SwChartDataProvider ( )

Definition at line 512 of file unochart.cxx.

Member Function Documentation

void SwChartDataProvider::AddDataSequence ( const SwTable rTable,
css::uno::Reference< css::chart2::data::XDataSequence > const &  rxDataSequence 

Definition at line 1414 of file unochart.cxx.

References m_aDataSequences.

void SAL_CALL SwChartDataProvider::addEventListener ( const css::uno::Reference< css::lang::XEventListener > &  xListener)
void SwChartDataProvider::AddRowCols ( const SwTable rTable,
const SwSelBoxes rBoxes,
sal_uInt16  nLines,
bool  bBehind 

SwChartDataProvider::AddRowCols tries to notify charts of added columns or rows and extends the value sequence respectively (if possible).

If those can be added to the end of existing value data-sequences those sequences get modified accordingly and will send a modification notification (calling 'setModified

Since this function is a work-around for non existent Writer core functionality (no arbitrary multi-selection in tables that can be used to define a data-sequence) this function will be somewhat unreliable. For example we will only try to adapt value sequences. For this we assume that a sequence of length 1 is a label sequence and those with length >= 2 we presume to be value sequences. Also new cells can only be added in the direction the value sequence is already pointing (rows / cols) and at the start or end of the values data-sequence. Nothing needs to be done if the new cells are in between the table cursors point and mark since data-sequence are considered to consist of all cells between those. New rows/cols need to be added already to the table before calling this function.

Definition at line 1547 of file unochart.cxx.

References o3tl::sorted_vector< Value, Compare, Find, class >::back(), SwXTextTable::GetCellPosition(), SwTableBox::GetName(), SwTable::IsTableComplex(), m_aDataSequences, SwRangeDescriptor::nBottom, SwRangeDescriptor::nLeft, SwRangeDescriptor::nRight, SwRangeDescriptor::nTop, and o3tl::sorted_vector< Value, Compare, Find, class >::size().

Referenced by SwTable::InsertCol(), and SwTable::InsertRow_().

OUString SAL_CALL SwChartDataProvider::convertRangeFromXML ( const OUString &  aXMLRange)

! following objects and function are implemented in XMLRangeHelper.?xx ! which is a copy of the respective file from chart2 !!

Definition at line 1693 of file unochart.cxx.

References XMLRangeHelper::getCellRangeFromXMLString(), if(), m_bDisposed, nPos, and sw_GetCellName().

OUString SAL_CALL SwChartDataProvider::convertRangeToXML ( const OUString &  aRangeRepresentation)
uno::Reference< chart2::data::XDataSequence > SAL_CALL SwChartDataProvider::createDataSequenceByRangeRepresentation ( const OUString &  aRangeRepresentation)

Definition at line 1338 of file unochart.cxx.

References Impl_createDataSequenceByRangeRepresentation().

sal_Bool SAL_CALL SwChartDataProvider::createDataSequenceByRangeRepresentationPossible ( const OUString &  aRangeRepresentation)

Definition at line 1320 of file unochart.cxx.

References Impl_createDataSequenceByRangeRepresentation().

uno::Reference< css::chart2::data::XDataSequence > SAL_CALL SwChartDataProvider::createDataSequenceByValueArray ( const OUString &  aRole,
const OUString &  aRangeRepresentation 

Definition at line 1352 of file unochart.cxx.

uno::Reference< chart2::data::XDataSource > SAL_CALL SwChartDataProvider::createDataSource ( const css::uno::Sequence< css::beans::PropertyValue > &  aArguments)

Definition at line 917 of file unochart.cxx.

References Impl_createDataSource().

sal_Bool SAL_CALL SwChartDataProvider::createDataSourcePossible ( const css::uno::Sequence< css::beans::PropertyValue > &  aArguments)

Definition at line 899 of file unochart.cxx.

References Impl_createDataSource().

void SwChartDataProvider::DeleteBox ( const SwTable pTable,
const SwTableBox rBox 
uno::Sequence< beans::PropertyValue > SAL_CALL SwChartDataProvider::detectArguments ( const css::uno::Reference< css::chart2::data::XDataSource > &  xDataSource)
void SAL_CALL SwChartDataProvider::dispose ( void  )
void SwChartDataProvider::DisposeAllDataSequences ( const SwTable pTable)

make a copy of the STL container! This is necessary since calling 'dispose' will implicitly remove an element of the original container, and thus any iterator in the original container would become invalid.

Definition at line 1500 of file unochart.cxx.

References IDocumentChartDataProviderAccess::GetChartControllerHelper(), SwFormat::GetDoc(), SwTable::GetFrameFormat(), SwDoc::getIDocumentChartDataProviderAccess(), m_aDataSequences, m_bDisposed, and SwChartLockController_Helper::StartOrContinueLocking().

Referenced by dispose().

OUString SwChartDataProvider::GetBrokenCellRangeForExport ( const OUString &  rCellRangeRepresentation)

Fix for #i79009 we need to return a property that has the same value as the property 'CellRangeRepresentation' but for all rows which are increased by one.

E.g. Table1.A1:D5 -> Table1,A2:D6 Since the problem is only for old charts which did not support multiple we do not need to provide that property/string if the 'CellRangeRepresentation' contains multiple ranges.

Definition at line 933 of file unochart.cxx.

References SwXTextTable::GetCellPosition(), GetRangeRepFromTableAndCells(), GetTableAndCellsFromRangeRep(), and sw_GetCellName().

Referenced by detectArguments().

OUString SAL_CALL SwChartDataProvider::getImplementationName ( )

Definition at line 1399 of file unochart.cxx.

uno::Reference< sheet::XRangeSelection > SAL_CALL SwChartDataProvider::getRangeSelection ( )

Definition at line 1345 of file unochart.cxx.

uno::Sequence< OUString > SAL_CALL SwChartDataProvider::getSupportedServiceNames ( )

Definition at line 1409 of file unochart.cxx.

uno::Reference< chart2::data::XDataSequence > SwChartDataProvider::Impl_createDataSequenceByRangeRepresentation ( const OUString &  aRangeRepresentation,
bool  bTestOnly = false 
uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createDataSource ( const css::uno::Sequence< css::beans::PropertyValue > &  aArguments,
bool  bTestOnly = false 
void SwChartDataProvider::InvalidateTable ( const SwTable pTable)
SwChartDataProvider& SwChartDataProvider::operator= ( const SwChartDataProvider )
void SwChartDataProvider::RemoveDataSequence ( const SwTable rTable,
css::uno::Reference< css::chart2::data::XDataSequence > const &  rxDataSequence 

Definition at line 1419 of file unochart.cxx.

References m_aDataSequences.

void SAL_CALL SwChartDataProvider::removeEventListener ( const css::uno::Reference< css::lang::XEventListener > &  aListener)
sal_Bool SAL_CALL SwChartDataProvider::supportsService ( const OUString &  ServiceName)

Definition at line 1404 of file unochart.cxx.

References cppu::supportsService().

Member Data Documentation

Map_Set_DataSequenceRef_t SwChartDataProvider::m_aDataSequences
::comphelper::OInterfaceContainerHelper2 SwChartDataProvider::m_aEventListeners

Definition at line 128 of file unochart.hxx.

Referenced by addEventListener(), dispose(), and removeEventListener().

bool SwChartDataProvider::m_bDisposed
const SwDoc* SwChartDataProvider::m_pDoc

The documentation for this class was generated from the following files: