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:
[legend]
Collaboration diagram for SwChartDataProvider:
[legend]

Classes

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, const OUString &aRoleQualifier) 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, bool bImmediate=false)
 
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 (std::u16string_view aRangeRepresentation, bool bTestOnly=false)
 

Static Private Member Functions

static OUString GetBrokenCellRangeForExport (std::u16string_view 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::OInterfaceContainerHelper4< css::lang::XEventListener > m_aEventListeners
 
const SwDocm_pDoc
 
bool m_bDisposed
 

Detailed Description

Definition at line 102 of file unochart.hxx.

Member Typedef Documentation

◆ Map_Set_DataSequenceRef_t

Definition at line 120 of file unochart.hxx.

◆ Set_DataSequenceRef_t

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

Definition at line 117 of file unochart.hxx.

Constructor & Destructor Documentation

◆ SwChartDataProvider() [1/2]

SwChartDataProvider::SwChartDataProvider ( const SwChartDataProvider )
privatedelete

◆ SwChartDataProvider() [2/2]

SwChartDataProvider::SwChartDataProvider ( const SwDoc rDoc)

Definition at line 503 of file unochart.cxx.

References m_bDisposed.

◆ ~SwChartDataProvider()

SwChartDataProvider::~SwChartDataProvider ( )
overridevirtual

Definition at line 509 of file unochart.cxx.

Member Function Documentation

◆ AddDataSequence()

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

Definition at line 1421 of file unochart.cxx.

References m_aDataSequences.

◆ addEventListener()

void SAL_CALL SwChartDataProvider::addEventListener ( const css::uno::Reference< css::lang::XEventListener > &  xListener)
overridevirtual

◆ AddRowCols()

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

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

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

◆ convertRangeFromXML()

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

◆ convertRangeToXML()

OUString SAL_CALL SwChartDataProvider::convertRangeToXML ( const OUString &  aRangeRepresentation)
overridevirtual

◆ createDataSequenceByRangeRepresentation()

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

Definition at line 1343 of file unochart.cxx.

References Impl_createDataSequenceByRangeRepresentation().

◆ createDataSequenceByRangeRepresentationPossible()

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

Definition at line 1325 of file unochart.cxx.

References Impl_createDataSequenceByRangeRepresentation().

◆ createDataSequenceByValueArray()

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

Definition at line 1357 of file unochart.cxx.

◆ createDataSource()

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

Definition at line 920 of file unochart.cxx.

References Impl_createDataSource().

◆ createDataSourcePossible()

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

Definition at line 902 of file unochart.cxx.

References Impl_createDataSource().

◆ DeleteBox()

void SwChartDataProvider::DeleteBox ( const SwTable pTable,
const SwTableBox rBox 
)

◆ detectArguments()

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

◆ dispose()

void SAL_CALL SwChartDataProvider::dispose ( void  )
overridevirtual

◆ DisposeAllDataSequences()

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

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

Referenced by dispose().

◆ GetBrokenCellRangeForExport()

OUString SwChartDataProvider::GetBrokenCellRangeForExport ( std::u16string_view  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 936 of file unochart.cxx.

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

Referenced by detectArguments().

◆ getImplementationName()

OUString SAL_CALL SwChartDataProvider::getImplementationName ( )
overridevirtual

Definition at line 1406 of file unochart.cxx.

◆ getRangeSelection()

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

Definition at line 1350 of file unochart.cxx.

◆ getSupportedServiceNames()

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

Definition at line 1416 of file unochart.cxx.

◆ Impl_createDataSequenceByRangeRepresentation()

uno::Reference< chart2::data::XDataSequence > SwChartDataProvider::Impl_createDataSequenceByRangeRepresentation ( std::u16string_view  aRangeRepresentation,
bool  bTestOnly = false 
)
private

◆ Impl_createDataSource()

uno::Reference< chart2::data::XDataSource > SwChartDataProvider::Impl_createDataSource ( const css::uno::Sequence< css::beans::PropertyValue > &  aArguments,
bool  bTestOnly = false 
)
private

◆ InvalidateTable()

void SwChartDataProvider::InvalidateTable ( const SwTable pTable,
bool  bImmediate = false 
)

◆ operator=()

SwChartDataProvider & SwChartDataProvider::operator= ( const SwChartDataProvider )
privatedelete

◆ RemoveDataSequence()

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

Definition at line 1426 of file unochart.cxx.

References m_aDataSequences.

◆ removeEventListener()

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

◆ supportsService()

sal_Bool SAL_CALL SwChartDataProvider::supportsService ( const OUString &  ServiceName)
overridevirtual

Definition at line 1411 of file unochart.cxx.

References cppu::supportsService().

Member Data Documentation

◆ m_aDataSequences

Map_Set_DataSequenceRef_t SwChartDataProvider::m_aDataSequences
mutableprivate

◆ m_aEventListeners

::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> SwChartDataProvider::m_aEventListeners
private

Definition at line 128 of file unochart.hxx.

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

◆ m_bDisposed

bool SwChartDataProvider::m_bDisposed
private

◆ m_pDoc

const SwDoc* SwChartDataProvider::m_pDoc
private

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