sc/inc/scmatrix.hxx | 3 +++ sc/source/core/tool/scmatrix.cxx | 17 +++++++++++++++++ 2 files changed, 20 insertions(+)
New commits: commit 69374b8a48f8165b3f9c084a77326f23d4400dc4 Author: Åukasz Hryniuk <lukasz.hryn...@wp.pl> Date: Sat Aug 8 15:55:56 2015 +0200 Add ScMatrix method to collect multiple values Change-Id: I09b9b1bc62b084824dc0eaffd6ee500de11781fd Reviewed-on: https://gerrit.libreoffice.org/17594 Tested-by: Jenkins <c...@libreoffice.org> Reviewed-by: Markus Mohrhard <markus.mohrh...@googlemail.com> Tested-by: Markus Mohrhard <markus.mohrh...@googlemail.com> diff --git a/sc/inc/scmatrix.hxx b/sc/inc/scmatrix.hxx index db863cc..f54028d 100644 --- a/sc/inc/scmatrix.hxx +++ b/sc/inc/scmatrix.hxx @@ -29,6 +29,7 @@ #include <svl/sharedstring.hxx> #include <functional> +#include <memory> #include <utility> #include <vector> #include <boost/intrusive_ptr.hpp> @@ -398,6 +399,8 @@ public: void DivOp(bool bFlag, double fVal, ScMatrix& rMat); void PowOp(bool bFlag, double fVal, ScMatrix& rMat); + std::vector<ScMatrix::IterateResult> Collect(bool bTextAsZero, const std::vector<std::unique_ptr<sc::op::Op>>& aOp); + ScMatrix& operator+= ( const ScMatrix& r ); #if DEBUG_MATRIX diff --git a/sc/source/core/tool/scmatrix.cxx b/sc/source/core/tool/scmatrix.cxx index 207e451..f178db4 100644 --- a/sc/source/core/tool/scmatrix.cxx +++ b/sc/source/core/tool/scmatrix.cxx @@ -301,6 +301,9 @@ public: template<typename T> void ApplyOperation(T aOp, ScMatrixImpl& rMat); + template<typename T> + std::vector<ScMatrix::IterateResult> ApplyCollectOperation(bool bTextAsZero, const std::vector<std::unique_ptr<T>>& aOp); + #if DEBUG_MATRIX void Dump() const; #endif @@ -2164,7 +2167,16 @@ void ScMatrixImpl::ApplyOperation(T aOp, ScMatrixImpl& rMat) maMat.walk(aFunc); } +template<typename T> +std::vector<ScMatrix::IterateResult> ScMatrixImpl::ApplyCollectOperation(bool bTextAsZero, const std::vector<std::unique_ptr<T>>& aOp) +{ + WalkElementBlocksMultipleValues<T> aFunc(bTextAsZero, aOp); + maMat.walk(aFunc); + return aFunc.getResult(); +} + #if DEBUG_MATRIX + void ScMatrixImpl::Dump() const { cout << "-- matrix content" << endl; @@ -2751,6 +2763,11 @@ void ScMatrix::PowOp( bool bFlag, double fVal, ScMatrix& rMat) } } +std::vector<ScMatrix::IterateResult> ScMatrix::Collect(bool bTextAsZero, const std::vector<std::unique_ptr<sc::op::Op>>& aOp) +{ + return pImpl->ApplyCollectOperation(bTextAsZero, aOp); +} + ScMatrix& ScMatrix::operator+= ( const ScMatrix& r ) { pImpl->AddValues(*r.pImpl);
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits