LibreOffice Module sc (master) 1
sharedformulagroups.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <memory>
12#include <tokenarray.hxx>
13
14namespace sc {
15
16void SharedFormulaGroups::set( size_t nSharedId, std::unique_ptr<ScTokenArray> pArray )
17{
18 m_Store.try_emplace(nSharedId, std::move(pArray), ScAddress(ScAddress::INITIALIZE_INVALID));
19}
20
21void SharedFormulaGroups::set( size_t nSharedId, std::unique_ptr<ScTokenArray> pArray, const ScAddress& rOrigin )
22{
23 m_Store.try_emplace(nSharedId, std::move(pArray), rOrigin);
24}
25
26const ScTokenArray* SharedFormulaGroups::get( size_t nSharedId ) const
27{
28 StoreType::const_iterator const it = m_Store.find(nSharedId);
29 return it == m_Store.end() ? nullptr : it->second.getTokenArray();
30}
31
33{
34 StoreType::const_iterator const it = m_Store.find(nSharedId);
35 return it == m_Store.end() ? nullptr : &(it->second);
36}
37
38}
39
40/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ INITIALIZE_INVALID
Definition: address.hxx:221
void set(size_t nSharedId, std::unique_ptr< ScTokenArray > pArray)
const ScTokenArray * get(size_t nSharedId) const
const SharedFormulaGroupEntry * getEntry(size_t nSharedId) const
CAUTION! The following defines must be in the same namespace as the respective type.
Definition: broadcast.cxx:15