diff options
author | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-28 12:55:31 +0200 |
---|---|---|
committer | Bjoern Michaelsen <bjoern.michaelsen@canonical.com> | 2015-06-30 10:40:02 +0200 |
commit | 1ad4751b7b687a8e6127c1ae99af47a7bc763e84 (patch) | |
tree | 63b790812c847635d2db11f624e4504d99c00f97 | |
parent | f7d603a7af180a47721c95db5631d08ab9738769 (diff) |
now use GetAny() here
Change-Id: I23b6f2c53841a4f105d911d72c4d7fe1c077ed82
-rw-r--r-- | sw/source/core/unocore/unochart.cxx | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/sw/source/core/unocore/unochart.cxx b/sw/source/core/unocore/unochart.cxx index 11c32ac41026..ceb9602d7b6b 100644 --- a/sw/source/core/unocore/unochart.cxx +++ b/sw/source/core/unocore/unochart.cxx @@ -2009,34 +2009,6 @@ sal_Int64 SAL_CALL SwChartDataSequence::getSomething( const uno::Sequence< sal_I return 0; } -uno::Sequence< uno::Any > SAL_CALL SwChartDataSequence::getData() - throw (uno::RuntimeException, std::exception) -{ - SolarMutexGuard aGuard; - if (bDisposed) - throw lang::DisposedException(); - - SwFrameFormat* pTableFormat = GetFrameFormat(); - if(!pTableFormat) - return {}; - SwTable* pTable = SwTable::FindTable(pTableFormat); - if(pTable->IsTableComplex()) - return {}; - SwRangeDescriptor aDesc; - if(!FillRangeDescriptor(aDesc, GetCellRangeName(*pTableFormat,*pTableCrsr))) - return {}; - auto vData(SwXCellRange(pTableCrsr, *pTableFormat, aDesc).getDataArray()); - if(!vData.getLength()) - return {}; - std::vector< uno::Any > vResult; - vResult.reserve(vData.getLength()*vData[0].getLength()); - for(auto& rRow : vData) - std::copy( - rRow.begin(), - rRow.end(), - std::back_inserter(vResult)); - return comphelper::containerToSequence(vResult); -} OUString SAL_CALL SwChartDataSequence::getSourceRangeRepresentation( ) throw (uno::RuntimeException, std::exception) @@ -2199,6 +2171,20 @@ uno::Sequence< OUString > SAL_CALL SwChartDataSequence::getTextualData() return vTextData; } +uno::Sequence< uno::Any > SAL_CALL SwChartDataSequence::getData() + throw (uno::RuntimeException, std::exception) +{ + SolarMutexGuard aGuard; + auto vCells(getCells()); + uno::Sequence< uno::Any > vAnyData(vCells.size()); + std::transform(vCells.begin(), + vCells.end(), + vAnyData.begin(), + [] (decltype(vCells)::value_type& xCell) + { return static_cast<SwXCell*>(xCell.get())->GetAny(); }); + return vAnyData; +} + uno::Sequence< double > SAL_CALL SwChartDataSequence::getNumericalData() throw (uno::RuntimeException, std::exception) { |