/* -*- 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/. */ #pragma once #include "mtvelements.hxx" #include "mtvfunctions.hxx" class ScFormulaCell; namespace sc { template void ProcessFormula(CellStoreType& rStore, Func& rFunc) { FuncElseNoOp aElse; ProcessElements1 >(rStore, rFunc, aElse); } template typename CellStoreType::iterator ProcessFormula( const CellStoreType::iterator& it, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, FuncElem& rFuncElem) { FuncElseNoOp aElse; return ProcessElements1< CellStoreType, formula_block, FuncElem, FuncElseNoOp >(it, rStore, nRow1, nRow2, rFuncElem, aElse); } /** * Process formula cells found within specified row range. This function * allows modifications of the states of the formula function objects. */ CellStoreType::iterator ProcessFormula( const CellStoreType::iterator& it, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, std::function aFuncElem ); template 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 CellStoreType::iterator ProcessEditText(const CellStoreType::iterator& itPos, CellStoreType& rStore, SCROW nRow1, SCROW nRow2, Func& rFunc) { FuncElseNoOp aElse; return ProcessElements1 >( itPos, rStore, nRow1, nRow2, rFunc, aElse); } template void ParseFormula( const CellStoreType& rStore, Func& rFunc) { FuncElseNoOp aElse; ParseElements1 >(rStore, rFunc, aElse); } template typename CellStoreType::const_iterator ParseFormula( const CellStoreType::const_iterator& itPos, const CellStoreType& rStore, SCROW nStart, SCROW nEnd, Func& rFunc) { FuncElseNoOp aElse; return ParseElements1 >( itPos, rStore, nStart, nEnd, rFunc, aElse); } template typename CellStoreType::const_iterator ParseAll( const typename CellStoreType::const_iterator& itPos, const CellStoreType& rCells, SCROW nRow1, SCROW nRow2, FuncElem& rFuncElem, FuncElse& rFuncElse) { return ParseElements4( itPos, rCells, nRow1, nRow2, rFuncElem, rFuncElse); } template typename CellStoreType::const_iterator ParseAllNonEmpty( const typename CellStoreType::const_iterator& itPos, const CellStoreType& rCells, SCROW nRow1, SCROW nRow2, Func& rFunc) { FuncElseNoOp aElse; return ParseElements4 >( itPos, rCells, nRow1, nRow2, rFunc, aElse); } template typename CellStoreType::const_iterator ParseFormulaNumeric( const CellStoreType::const_iterator& itPos, const CellStoreType& rCells, SCROW nRow1, SCROW nRow2, Func& rFunc) { FuncElseNoOp aElse; return ParseElements2 >( itPos, rCells, nRow1, nRow2, rFunc, aElse); } template void ProcessFormulaEditText(CellStoreType& rStore, Func& rFunc) { // Walk backwards through the data - this helps when the FuncElem will be deleting // stuff, so we don't continually move block data around. FuncElseNoOp aElse; ProcessElements2Reverse >(rStore, rFunc, aElse); } template std::pair FindFormula(const CellStoreType& rStore, SCROW nRow1, SCROW nRow2, Func& rFunc) { typedef std::pair ElseRetType; FuncElseNoOp aElse; return FindElement1 >(rStore, nRow1, nRow2, rFunc, aElse); } template std::pair FindFormulaEditText(const CellStoreType& rStore, SCROW nRow1, SCROW nRow2, Func& rFunc) { return FindElement2(rStore, nRow1, nRow2, rFunc, rFunc); } template void ProcessNote(CellNoteStoreType& rStore, Func& rFunc) { FuncElseNoOp aElse; ProcessElements1 >(rStore, rFunc, aElse); } template typename CellNoteStoreType::const_iterator ParseNote( const CellNoteStoreType::const_iterator& itPos, const CellNoteStoreType& rStore, SCROW nStart, SCROW nEnd, Func& rFunc) { FuncElseNoOp aElse; return ParseElements1 >( itPos, rStore, nStart, nEnd, rFunc, aElse); } template typename CellNoteStoreType::iterator ProcessNote( const CellNoteStoreType::iterator& it, CellNoteStoreType& rStore, SCROW nRow1, SCROW nRow2, FuncElem& rFuncElem) { FuncElseNoOp aElse; return ProcessElements1< CellNoteStoreType, cellnote_block, FuncElem, FuncElseNoOp >(it, rStore, nRow1, nRow2, rFuncElem, aElse); } template typename BroadcasterStoreType::iterator ProcessBroadcaster( const BroadcasterStoreType::iterator& it, BroadcasterStoreType& rStore, SCROW nRow1, SCROW nRow2, FuncElem& rFuncElem) { FuncElseNoOp aElse; return ProcessElements1< BroadcasterStoreType, broadcaster_block, FuncElem, FuncElseNoOp >(it, rStore, nRow1, nRow2, rFuncElem, aElse); } } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */