LibreOffice Module sc (master) 1
poolhelp.hxx
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 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#pragma once
21
22#include <rtl/ref.hxx>
24#include <docoptio.hxx>
25#include <svl/itempool.hxx>
26#include <mutex>
27
28class ScDocument;
29class ScDocumentPool;
32class SfxItemPool;
33
35{
36private:
37 mutable std::mutex maMtxCreateNumFormatter;
41 mutable std::unique_ptr<SvNumberFormatter> pFormTable;
42 mutable rtl::Reference<SfxItemPool> pEditPool; // EditTextObjectPool
43 mutable rtl::Reference<SfxItemPool> pEnginePool; // EditEnginePool
44
45public:
46 ScPoolHelper( ScDocument& rSourceDoc );
47 virtual ~ScPoolHelper() override;
48
49 // called in dtor of main document
50 void SourceDocumentGone();
51
52 // access to pointers (are never 0):
53 ScDocumentPool* GetDocPool() const { return pDocPool.get(); }
54 ScStyleSheetPool* GetStylePool() const { return mxStylePool.get(); }
56 SfxItemPool* GetEditPool() const;
58
59 void SetFormTableOpt(const ScDocOptions& rOpt);
60
61 std::unique_ptr<SvNumberFormatter> CreateNumberFormatter() const;
62};
63
64/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
rtl::Reference< ScDocumentPool > pDocPool
Definition: poolhelp.hxx:39
SfxItemPool * GetEnginePool() const
Definition: poolhelp.cxx:58
rtl::Reference< SfxItemPool > pEditPool
Definition: poolhelp.hxx:42
void SourceDocumentGone()
Definition: poolhelp.cxx:110
rtl::Reference< SfxItemPool > pEnginePool
Definition: poolhelp.hxx:43
SfxItemPool * GetEditPool() const
Definition: poolhelp.cxx:47
ScDocumentPool * GetDocPool() const
Definition: poolhelp.hxx:53
std::unique_ptr< SvNumberFormatter > pFormTable
Definition: poolhelp.hxx:41
void SetFormTableOpt(const ScDocOptions &rOpt)
Definition: poolhelp.cxx:75
rtl::Reference< ScStyleSheetPool > mxStylePool
Definition: poolhelp.hxx:40
std::mutex maMtxCreateNumFormatter
Definition: poolhelp.hxx:37
virtual ~ScPoolHelper() override
Definition: poolhelp.cxx:38
ScPoolHelper(ScDocument &rSourceDoc)
Definition: poolhelp.cxx:30
ScDocOptions aOpt
Definition: poolhelp.hxx:38
ScStyleSheetPool * GetStylePool() const
Definition: poolhelp.hxx:54
SvNumberFormatter * GetFormTable() const
Definition: poolhelp.cxx:68
std::unique_ptr< SvNumberFormatter > CreateNumberFormatter() const
Definition: poolhelp.cxx:90