LibreOffice Module sw (master)
1
|
#include <unochart.hxx>
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_DataSequenceRef > | Set_DataSequenceRef_t |
typedef std::map< const SwTable *, Set_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 102 of file unochart.hxx.
|
private |
Definition at line 120 of file unochart.hxx.
|
private |
Definition at line 117 of file unochart.hxx.
|
privatedelete |
SwChartDataProvider::SwChartDataProvider | ( | const SwDoc & | rDoc | ) |
Definition at line 503 of file unochart.cxx.
References m_bDisposed.
|
overridevirtual |
Definition at line 509 of file unochart.cxx.
void SwChartDataProvider::AddDataSequence | ( | const SwTable & | rTable, |
css::uno::Reference< css::chart2::data::XDataSequence > const & | rxDataSequence | ||
) |
Definition at line 1415 of file unochart.cxx.
References m_aDataSequences.
|
overridevirtual |
Definition at line 1384 of file unochart.cxx.
References comphelper::OInterfaceContainerHelper4< 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 1552 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_().
|
overridevirtual |
! following objects and function are implemented in XMLRangeHelper.?xx ! which is a copy of the respective file from chart2 !!
Definition at line 1698 of file unochart.cxx.
References XMLRangeHelper::getCellRangeFromXMLString(), if(), m_bDisposed, nPos, 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 1628 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 1337 of file unochart.cxx.
References Impl_createDataSequenceByRangeRepresentation().
|
overridevirtual |
Definition at line 1319 of file unochart.cxx.
References Impl_createDataSequenceByRangeRepresentation().
|
overridevirtual |
Definition at line 1351 of file unochart.cxx.
|
overridevirtual |
Definition at line 914 of file unochart.cxx.
References Impl_createDataSource().
|
overridevirtual |
Definition at line 896 of file unochart.cxx.
References Impl_createDataSource().
void SwChartDataProvider::DeleteBox | ( | const SwTable * | pTable, |
const SwTableBox & | rBox | ||
) |
Definition at line 1451 of file unochart.cxx.
References SwChartDataSequence::DeleteBox(), SwChartDataSequence::dispose(), 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 957 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().
Definition at line 1358 of file unochart.cxx.
References DisposeAllDataSequences(), comphelper::OInterfaceContainerHelper4< ListenerT >::disposeAndClear(), GetChartMutex(), m_aDataSequences, m_aEventListeners, and m_bDisposed.
Referenced by SwDocShell::~SwDocShell().
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 1505 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 930 of file unochart.cxx.
References SwXTextTable::GetCellPosition(), GetRangeRepFromTableAndCells(), GetTableAndCellsFromRangeRep(), and sw_GetCellName().
Referenced by detectArguments().
|
overridevirtual |
Definition at line 1400 of file unochart.cxx.
|
overridevirtual |
Definition at line 1344 of file unochart.cxx.
|
overridevirtual |
Definition at line 1410 of file unochart.cxx.
|
private |
css::lang::IllegalArgumentException | |
css::uno::RuntimeException |
Definition at line 1291 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 513 of file unochart.cxx.
References aMap, SwNodes::Count(), FillRangeDescriptor(), SwTable::FindTable(), SwTableLines::front(), SwXTextTable::GetCellPosition(), SwOLENode::GetChartTableName(), SwOLEObj::GetCurrentPersistName(), GetFormatAndCreateCursorFromRangeRep(), SwFormat::GetName(), SwDoc::GetNodes(), SwNode::GetOLENode(), SwOLENode::GetOLEObj(), GetRangeRepFromTableAndCells(), GetSubranges(), SwTableLine::GetTabBoxes(), 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().
Definition at line 1425 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, |
css::uno::Reference< css::chart2::data::XDataSequence > const & | rxDataSequence | ||
) |
Definition at line 1420 of file unochart.cxx.
References m_aDataSequences.
|
overridevirtual |
Definition at line 1392 of file unochart.cxx.
References GetChartMutex(), m_aEventListeners, m_bDisposed, and comphelper::OInterfaceContainerHelper4< ListenerT >::removeInterface().
|
overridevirtual |
Definition at line 1405 of file unochart.cxx.
References cppu::supportsService().
|
mutableprivate |
Definition at line 126 of file unochart.hxx.
Referenced by AddDataSequence(), AddRowCols(), DeleteBox(), dispose(), DisposeAllDataSequences(), InvalidateTable(), and RemoveDataSequence().
|
private |
Definition at line 128 of file unochart.hxx.
Referenced by addEventListener(), dispose(), and removeEventListener().
|
private |
Definition at line 130 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 129 of file unochart.hxx.
Referenced by convertRangeToXML(), detectArguments(), Impl_createDataSequenceByRangeRepresentation(), and Impl_createDataSource().