LibreOffice Module sw (master) 1
|
#include <unochart.hxx>
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, rtl::Reference< SwChartDataSequence > const &rxDataSequence) |
void | RemoveDataSequence (const SwTable &rTable, rtl::Reference< SwChartDataSequence > 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::vector< unotools::WeakReference< SwChartDataSequence > > | Vec_DataSequenceRef_t |
typedef std::map< const SwTable *, Vec_DataSequenceRef_t > | Map_Set_DataSequenceRef_t |
Private Member Functions | |
SwChartDataProvider (const SwChartDataProvider &)=delete | |
SwChartDataProvider & | operator= (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 SwDoc * | m_pDoc |
bool | m_bDisposed |
Definition at line 103 of file unochart.hxx.
|
private |
Definition at line 112 of file unochart.hxx.
|
private |
Definition at line 109 of file unochart.hxx.
|
privatedelete |
SwChartDataProvider::SwChartDataProvider | ( | const SwDoc & | rDoc | ) |
Definition at line 510 of file unochart.cxx.
References m_bDisposed.
|
overridevirtual |
Definition at line 516 of file unochart.cxx.
void SwChartDataProvider::AddDataSequence | ( | const SwTable & | rTable, |
rtl::Reference< SwChartDataSequence > const & | rxDataSequence | ||
) |
Definition at line 1413 of file unochart.cxx.
References i, and m_aDataSequences.
|
overridevirtual |
Definition at line 1382 of file unochart.cxx.
References comphelper::OInterfaceContainerHelper4< class ListenerT >::addInterface(), GetChartMutex(), m_aEventListeners, and m_bDisposed.
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 1550 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, and o3tl::sorted_vector< typename Value, typename Compare, template< typename, typename > class Find, bool >::size().
Referenced by SwTable::InsertCol(), and SwTable::InsertRow_().
|
overridevirtual |
! following objects and function are implemented in XMLRangeHelper.?xx ! which is a copy of the respective file from chart2 !!
Definition at line 1691 of file unochart.cxx.
References XMLRangeHelper::CellRange::aLowerRight, XMLRangeHelper::CellRange::aTableName, XMLRangeHelper::CellRange::aUpperLeft, XMLRangeHelper::Cell::bIsEmpty, XMLRangeHelper::getCellRangeFromXMLString(), m_bDisposed, XMLRangeHelper::Cell::nColumn, nPos, XMLRangeHelper::Cell::nRow, and sw_GetCellName().
|
overridevirtual |
! following objects/functions are implemented in XMLRangeHelper.?xx ! which is a copy of the respective file from chart2 !!
Definition at line 1621 of file unochart.cxx.
References XMLRangeHelper::CellRange::aLowerRight, XMLRangeHelper::CellRange::aTableName, XMLRangeHelper::CellRange::aUpperLeft, XMLRangeHelper::Cell::bIsEmpty, SwTable::FindTable(), SwXTextTable::GetCellPosition(), GetFormatAndCreateCursorFromRangeRep(), GetTableAndCellsFromRangeRep(), XMLRangeHelper::getXMLStringFromCellRange(), SwTable::IsTableComplex(), m_bDisposed, m_pDoc, XMLRangeHelper::Cell::nColumn, nPos, and XMLRangeHelper::Cell::nRow.
|
overridevirtual |
Definition at line 1335 of file unochart.cxx.
References Impl_createDataSequenceByRangeRepresentation().
|
overridevirtual |
Definition at line 1317 of file unochart.cxx.
References Impl_createDataSequenceByRangeRepresentation().
|
overridevirtual |
Definition at line 1349 of file unochart.cxx.
|
overridevirtual |
Definition at line 912 of file unochart.cxx.
References Impl_createDataSource().
|
overridevirtual |
Definition at line 894 of file unochart.cxx.
References Impl_createDataSource().
void SwChartDataProvider::DeleteBox | ( | const SwTable * | pTable, |
const SwTableBox & | rBox | ||
) |
Definition at line 1459 of file unochart.cxx.
References IDocumentChartDataProviderAccess::GetChartControllerHelper(), SwFormat::GetDoc(), SwTable::GetFrameFormat(), SwDoc::getIDocumentChartDataProviderAccess(), m_aDataSequences, m_bDisposed, and SwChartLockController_Helper::StartOrContinueLocking().
Referenced by SaveTable::CreateNew(), SwTable::DeleteSel(), SwNodes::SplitTable(), SwUndoTableNdsChg::UndoImpl(), and SwUndoTableMerge::UndoImpl().
|
overridevirtual |
Definition at line 955 of file unochart.cxx.
References aMap, begin, end, SwTableLines::front(), GetBrokenCellRangeForExport(), SwXTextTable::GetCellPosition(), GetSubranges(), SwTableLine::GetTabBoxes(), GetTableAndCellsFromRangeRep(), GetTableByName(), SwTable::GetTabLines(), i, SwTable::IsTableComplex(), m_bDisposed, m_pDoc, SwTableLines::size(), SortSubranges(), and sw_GetCellName().
|
overridevirtual |
Definition at line 1356 of file unochart.cxx.
References DisposeAllDataSequences(), comphelper::OInterfaceContainerHelper4< class ListenerT >::disposeAndClear(), GetChartMutex(), m_aDataSequences, m_aEventListeners, and m_bDisposed.
Referenced by SwDocShell::~SwDocShell().
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 1504 of file unochart.cxx.
References IDocumentChartDataProviderAccess::GetChartControllerHelper(), SwFormat::GetDoc(), SwTable::GetFrameFormat(), SwDoc::getIDocumentChartDataProviderAccess(), m_aDataSequences, m_bDisposed, and SwChartLockController_Helper::StartOrContinueLocking().
Referenced by dispose().
|
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 928 of file unochart.cxx.
References SwXTextTable::GetCellPosition(), GetRangeRepFromTableAndCells(), GetTableAndCellsFromRangeRep(), and sw_GetCellName().
Referenced by detectArguments().
|
overridevirtual |
Definition at line 1398 of file unochart.cxx.
|
overridevirtual |
Definition at line 1342 of file unochart.cxx.
|
overridevirtual |
Definition at line 1408 of file unochart.cxx.
|
private |
css::lang::IllegalArgumentException | |
css::uno::RuntimeException |
Definition at line 1289 of file unochart.cxx.
References FillRangeDescriptor(), GetCellRangeName(), GetFormatAndCreateCursorFromRangeRep(), m_bDisposed, m_pDoc, SwRangeDescriptor::nBottom, SwRangeDescriptor::nLeft, SwRangeDescriptor::nRight, and SwRangeDescriptor::nTop.
Referenced by createDataSequenceByRangeRepresentation(), and createDataSequenceByRangeRepresentationPossible().
|
private |
css::lang::IllegalArgumentException | |
css::uno::RuntimeException |
! by proceeding this way we automatically get rid of ! multiple listed or overlapping cell ranges which should ! just be ignored silently
Definition at line 520 of file unochart.cxx.
References aMap, SwNodes::Count(), FillRangeDescriptor(), SwTable::FindTable(), SwXTextTable::GetCellPosition(), SwOLENode::GetChartTableName(), SwOLEObj::GetCurrentPersistName(), GetFormatAndCreateCursorFromRangeRep(), SwFormat::GetName(), SwDoc::GetNodes(), SwNode::GetOLENode(), SwOLENode::GetOLEObj(), GetRangeRepFromTableAndCells(), GetSubranges(), GetTableAndCellsFromRangeRep(), SwTable::GetTabLines(), i, SwTable::IsTableComplex(), m_bDisposed, m_pDoc, SwRangeDescriptor::nBottom, SwRangeDescriptor::nLeft, SwRangeDescriptor::Normalize(), SwRangeDescriptor::nRight, SwRangeDescriptor::nTop, SwTableLines::size(), SortSubranges(), and sw_GetCellName().
Referenced by createDataSource(), and createDataSourcePossible().
void SwChartDataProvider::InvalidateTable | ( | const SwTable * | pTable, |
bool | bImmediate = false |
||
) |
Definition at line 1434 of file unochart.cxx.
References SwChartLockController_Helper::Disconnect(), IDocumentChartDataProviderAccess::GetChartControllerHelper(), SwFormat::GetDoc(), SwTable::GetFrameFormat(), SwDoc::getIDocumentChartDataProviderAccess(), m_aDataSequences, m_bDisposed, and SwChartLockController_Helper::StartOrContinueLocking().
Referenced by SwDoc::SetTableName(), and SwDoc::UpdateCharts_().
|
privatedelete |
void SwChartDataProvider::RemoveDataSequence | ( | const SwTable & | rTable, |
rtl::Reference< SwChartDataSequence > const & | rxDataSequence | ||
) |
Definition at line 1424 of file unochart.cxx.
References i, and m_aDataSequences.
|
overridevirtual |
Definition at line 1390 of file unochart.cxx.
References GetChartMutex(), m_aEventListeners, m_bDisposed, and comphelper::OInterfaceContainerHelper4< class ListenerT >::removeInterface().
|
overridevirtual |
Definition at line 1403 of file unochart.cxx.
References cppu::supportsService().
|
mutableprivate |
Definition at line 118 of file unochart.hxx.
Referenced by AddDataSequence(), AddRowCols(), DeleteBox(), dispose(), DisposeAllDataSequences(), InvalidateTable(), and RemoveDataSequence().
|
private |
Definition at line 120 of file unochart.hxx.
Referenced by addEventListener(), dispose(), and removeEventListener().
|
private |
Definition at line 122 of file unochart.hxx.
Referenced by addEventListener(), convertRangeFromXML(), convertRangeToXML(), DeleteBox(), detectArguments(), dispose(), DisposeAllDataSequences(), Impl_createDataSequenceByRangeRepresentation(), Impl_createDataSource(), InvalidateTable(), removeEventListener(), and SwChartDataProvider().
|
private |
Definition at line 121 of file unochart.hxx.
Referenced by convertRangeToXML(), detectArguments(), Impl_createDataSequenceByRangeRepresentation(), and Impl_createDataSource().