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 
28 class ScDocument;
29 class ScDocumentPool;
30 class ScStyleSheetPool;
31 class SvNumberFormatter;
32 class SfxItemPool;
33 
35 {
36 private:
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
45 
46 public:
47  ScPoolHelper( ScDocument& rSourceDoc );
48  virtual ~ScPoolHelper() override;
49 
50  // called in dtor of main document
51  void SourceDocumentGone();
52 
53  // access to pointers (are never 0):
54  ScDocumentPool* GetDocPool() const { return pDocPool.get(); }
55  ScStyleSheetPool* GetStylePool() const { return mxStylePool.get(); }
57  SfxItemPool* GetEditPool() const;
58  SfxItemPool* GetEnginePool() const;
59 
60  void SetFormTableOpt(const ScDocOptions& rOpt);
61 
62  std::unique_ptr<SvNumberFormatter> CreateNumberFormatter() const;
63 };
64 
65 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxItemPool * GetEditPool() const
Definition: poolhelp.cxx:48
ScDocOptions aOpt
Definition: poolhelp.hxx:38
virtual ~ScPoolHelper() override
Definition: poolhelp.cxx:39
std::unique_ptr< SvNumberFormatter > CreateNumberFormatter() const
Definition: poolhelp.cxx:91
ScDocument & m_rSourceDoc
Definition: poolhelp.hxx:44
SvNumberFormatter * GetFormTable() const
Definition: poolhelp.cxx:69
rtl::Reference< ScStyleSheetPool > mxStylePool
Definition: poolhelp.hxx:40
ScPoolHelper(ScDocument &rSourceDoc)
Definition: poolhelp.cxx:30
ScDocumentPool * GetDocPool() const
Definition: poolhelp.hxx:54
void SourceDocumentGone()
Definition: poolhelp.cxx:110
rtl::Reference< SfxItemPool > pEditPool
Definition: poolhelp.hxx:42
SfxItemPool * GetEnginePool() const
Definition: poolhelp.cxx:59
ScStyleSheetPool * GetStylePool() const
Definition: poolhelp.hxx:55
rtl::Reference< ScDocumentPool > pDocPool
Definition: poolhelp.hxx:39
std::mutex maMtxCreateNumFormatter
Definition: poolhelp.hxx:37
std::unique_ptr< SvNumberFormatter > pFormTable
Definition: poolhelp.hxx:41
void SetFormTableOpt(const ScDocOptions &rOpt)
Definition: poolhelp.cxx:76
rtl::Reference< SfxItemPool > pEnginePool
Definition: poolhelp.hxx:43