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 Reference

#include <unochart.hxx>

Inheritance diagram for SwChartDataProvider:
[legend]
Collaboration diagram for SwChartDataProvider:
[legend]

Classes

struct  lt_DataSequenceRef
 

Public Member Functions

 SwChartDataProvider (const SwDoc *pDoc)
 
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 aDataSequences
 
::comphelper::OInterfaceContainerHelper2 aEvtListeners
 
const SwDocpDoc
 
bool bDisposed
 

Detailed Description

Definition at line 103 of file unochart.hxx.

Member Typedef Documentation

Definition at line 121 of file unochart.hxx.

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

Definition at line 118 of file unochart.hxx.

Constructor & Destructor Documentation

SwChartDataProvider::SwChartDataProvider ( const SwChartDataProvider )
privatedelete
SwChartDataProvider::SwChartDataProvider ( const SwDoc pDoc)

Definition at line 516 of file unochart.cxx.

References bDisposed.

SwChartDataProvider::~SwChartDataProvider ( )
overridevirtual

Definition at line 523 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 1433 of file unochart.cxx.

References aDataSequences.

void SAL_CALL SwChartDataProvider::addEventListener ( const css::uno::Reference< css::lang::XEventListener > &  xListener)
overridevirtual
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 1567 of file unochart.cxx.

References aDataSequences, o3tl::sorted_vector< Value, Compare, Find, class >::back(), SwChartDataSequence::ExtendTo(), SwChartDataSequence::FillRangeDesc(), SwXTextTable::GetCellPosition(), SwTableBox::GetName(), SwChartDataSequence::getUnoTunnelId(), SwTable::IsTableComplex(), 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)
overridevirtual

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

Definition at line 1720 of file unochart.cxx.

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

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

Definition at line 1357 of file unochart.cxx.

References Impl_createDataSequenceByRangeRepresentation().

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

Definition at line 1339 of file unochart.cxx.

References Impl_createDataSequenceByRangeRepresentation().

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

Definition at line 1371 of file unochart.cxx.

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

Definition at line 934 of file unochart.cxx.

References Impl_createDataSource().

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

Definition at line 916 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)
overridevirtual
void SAL_CALL SwChartDataProvider::dispose ( void  )
overridevirtual
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 1520 of file unochart.cxx.

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

Referenced by dispose().

OUString SwChartDataProvider::GetBrokenCellRangeForExport ( const OUString &  rCellRangeRepresentation)
staticprivate

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 950 of file unochart.cxx.

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

Referenced by detectArguments().

OUString SAL_CALL SwChartDataProvider::getImplementationName ( )
overridevirtual

Definition at line 1418 of file unochart.cxx.

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

Definition at line 1364 of file unochart.cxx.

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

Definition at line 1428 of file unochart.cxx.

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

Definition at line 1438 of file unochart.cxx.

References aDataSequences.

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

Definition at line 1423 of file unochart.cxx.

References cppu::supportsService().

Member Data Documentation

Map_Set_DataSequenceRef_t SwChartDataProvider::aDataSequences
mutableprivate
::comphelper::OInterfaceContainerHelper2 SwChartDataProvider::aEvtListeners
private

Definition at line 129 of file unochart.hxx.

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

bool SwChartDataProvider::bDisposed
private
const SwDoc* SwChartDataProvider::pDoc
private

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