Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / inc / macromgr.hxx
blobd7930eaa308aef20bba1bfa2b659778f45d5a9d2
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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 */
10 #pragma once
12 #include <com/sun/star/container/XContainerListener.hpp>
14 #include <rtl/ustring.hxx>
15 #include "scdllapi.h"
17 #include <memory>
18 #include <unordered_map>
20 class ScDocument;
21 class ScFormulaCell;
22 class ScUserMacroDepTracker;
24 class ScMacroManager
26 public:
27 explicit ScMacroManager(ScDocument& rDoc);
28 ~ScMacroManager();
30 SC_DLLPUBLIC void InitUserFuncData();
31 SC_DLLPUBLIC void SetUserFuncVolatile(const OUString& sName, bool isVolatile);
32 SC_DLLPUBLIC bool GetUserFuncVolatile(const OUString& sName);
34 void AddDependentCell(const OUString& aModuleName, ScFormulaCell* pCell);
35 void RemoveDependentCell(const ScFormulaCell* pCell);
36 void BroadcastModuleUpdate(const OUString& aModuleName);
38 private:
39 typedef std::unordered_map<OUString, bool> NameBoolMap;
40 NameBoolMap mhFuncToVolatile;
41 css::uno::Reference<css::container::XContainerListener> mxContainerListener;
43 ::std::unique_ptr<ScUserMacroDepTracker> mpDepTracker;
44 ScDocument& mrDoc;
47 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */