diff options
author | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-05-24 11:52:18 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@gmail.com> | 2013-06-24 16:51:25 -0400 |
commit | c008dc483f8c6840803983e7e351cec6fdd32070 (patch) | |
tree | 7c88eeabde57ea4a3c1a760d1c02ea2fd37bd721 /sc/inc/mtvcellfunc.hxx | |
parent | 75dec25730c88bdb8eb5e2a3f92689460fa89d29 (diff) |
Switch to using multi_type_vector for cell storage.
The old style cell storage is no more. Currently the code is buildable,
but crashes during unit test.
Change-Id: Ie688e22e95c7fb02b9e97b23df0fc1883a97945f
Diffstat (limited to 'sc/inc/mtvcellfunc.hxx')
-rw-r--r-- | sc/inc/mtvcellfunc.hxx | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/sc/inc/mtvcellfunc.hxx b/sc/inc/mtvcellfunc.hxx new file mode 100644 index 000000000000..9ce3c12ea8cc --- /dev/null +++ b/sc/inc/mtvcellfunc.hxx @@ -0,0 +1,154 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef SC_MTVCELLFUNC_HXX +#define SC_MTVCELLFUNC_HXX + +#include "mtvelements.hxx" +#include "mtvfunctions.hxx" + +namespace sc { + +template<typename _Func> +void ProcessFormula(CellStoreType& rStore, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + ProcessElements1<CellStoreType, formula_block, _Func, FuncElseNoOp<size_t> >(rStore, rFunc, aElse); +} + +template<typename _FuncElem> +typename CellStoreType::iterator +ProcessFormula( + const CellStoreType::iterator& it, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, _FuncElem& rFuncElem) +{ + FuncElseNoOp<size_t> aElse; + return ProcessElements1< + CellStoreType, formula_block, _FuncElem, FuncElseNoOp<size_t> >(it, rStore, nRow1, nRow2, rFuncElem, aElse); +} + +template<typename _FuncElem, typename _FuncElse> +typename CellStoreType::iterator +ProcessFormula( + const CellStoreType::iterator& it, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, _FuncElem& rFuncElem, _FuncElse& rFuncElse) +{ + return ProcessElements1< + CellStoreType, formula_block, _FuncElem, _FuncElse>(it, rStore, nRow1, nRow2, rFuncElem, rFuncElse); +} + +template<typename _Func> +typename CellStoreType::iterator +ProcessFormulaNumeric( + const CellStoreType::iterator& itPos, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + return ProcessElements2< + CellStoreType, numeric_block, formula_block, _Func, FuncElseNoOp<size_t> >( + itPos, rStore, nRow1, nRow2, rFunc, aElse); +} + +template<typename _Func> +void ProcessEditText(CellStoreType& rStore, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + ProcessElements1<CellStoreType, edittext_block, _Func, FuncElseNoOp<size_t> >(rStore, rFunc, aElse); +} + +template<typename _Func> +CellStoreType::iterator +ProcessEditText(const CellStoreType::iterator& itPos, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + return ProcessElements1<CellStoreType, edittext_block, _Func, FuncElseNoOp<size_t> >( + itPos, rStore, nRow1, nRow2, rFunc, aElse); +} + +template<typename _Func> +void ParseFormula( + const CellStoreType& rStore, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + ParseElements1<CellStoreType, formula_block, _Func, FuncElseNoOp<size_t> >(rStore, rFunc, aElse); +} + +template<typename _Func> +typename CellStoreType::const_iterator +ParseFormula( + const CellStoreType::const_iterator& itPos, const CellStoreType& rStore, + SCROW nStart, SCROW nEnd, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + return ParseElements1<CellStoreType, formula_block, _Func, FuncElseNoOp<size_t> >( + itPos, rStore, nStart, nEnd, rFunc, aElse); +} + +template<typename _FuncElem, typename _FuncElse> +typename CellStoreType::const_iterator +ParseAll( + const typename CellStoreType::const_iterator& itPos, const CellStoreType& rCells, + SCROW nRow1, SCROW nRow2, _FuncElem& rFuncElem, _FuncElse& rFuncElse) +{ + return ParseElements4<CellStoreType, + numeric_block, string_block, edittext_block, formula_block, + _FuncElem, _FuncElse>( + itPos, rCells, nRow1, nRow2, rFuncElem, rFuncElse); +} + +template<typename _Func> +typename CellStoreType::const_iterator +ParseAllNonEmpty( + const typename CellStoreType::const_iterator& itPos, const CellStoreType& rCells, + SCROW nRow1, SCROW nRow2, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + return ParseElements4<CellStoreType, + numeric_block, string_block, edittext_block, formula_block, + _Func, FuncElseNoOp<size_t> >( + itPos, rCells, nRow1, nRow2, rFunc, aElse); +} + +template<typename _Func> +typename CellStoreType::const_iterator +ParseFormulaNumeric( + const CellStoreType::const_iterator& itPos, const CellStoreType& rCells, + SCROW nRow1, SCROW nRow2, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + return ParseElements2<CellStoreType, + numeric_block, formula_block, _Func, FuncElseNoOp<size_t> >( + itPos, rCells, nRow1, nRow2, rFunc, aElse); +} + +template<typename _Func> +void ProcessFormulaEditText(CellStoreType& rStore, _Func& rFunc) +{ + FuncElseNoOp<size_t> aElse; + ProcessElements2<CellStoreType, edittext_block, formula_block, _Func, FuncElseNoOp<size_t> >(rStore, rFunc, aElse); +} + +template<typename _Func> +std::pair<CellStoreType::const_iterator, size_t> +FindFormula(const CellStoreType& rStore, SCROW nRow1, SCROW nRow2, _Func& rFunc) +{ + typedef std::pair<size_t,bool> ElseRetType; + FuncElseNoOp<size_t, ElseRetType> aElse; + return FindElement1<CellStoreType, formula_block, _Func, FuncElseNoOp<size_t, ElseRetType> >(rStore, nRow1, nRow2, rFunc, aElse); +} + +template<typename _Func> +std::pair<CellStoreType::const_iterator, size_t> +FindFormulaEditText(const CellStoreType& rStore, SCROW nRow1, SCROW nRow2, _Func& rFunc) +{ + return FindElement2<CellStoreType, edittext_block, formula_block, _Func, _Func>(rStore, nRow1, nRow2, rFunc, rFunc); +} + +} + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |