fix(ooxmlexport): Prevent unknown media type crash
[LibreOffice.git] / sc / source / core / inc / poolhelp.hxx
blob860e1b3a8b2f149e012bad092fa932d34fd14ede
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #pragma once
22 #include <rtl/ref.hxx>
23 #include <salhelper/simplereferenceobject.hxx>
24 #include <docoptio.hxx>
25 #include <svl/itempool.hxx>
26 #include <mutex>
28 class ScDocument;
29 class ScDocumentPool;
30 class ScStyleSheetPool;
31 class SvNumberFormatter;
32 class SfxItemPool;
34 class ScPoolHelper final : public salhelper::SimpleReferenceObject
36 private:
37 mutable std::mutex maMtxCreateNumFormatter;
38 ScDocOptions aOpt;
39 rtl::Reference<ScDocumentPool> pDocPool;
40 rtl::Reference< ScStyleSheetPool > mxStylePool;
41 mutable std::unique_ptr<SvNumberFormatter> pFormTable;
42 mutable rtl::Reference<SfxItemPool> pEditPool; // EditTextObjectPool
43 mutable rtl::Reference<SfxItemPool> pEnginePool; // EditEnginePool
45 public:
46 ScPoolHelper( ScDocument& rSourceDoc );
47 virtual ~ScPoolHelper() override;
49 // called in dtor of main document
50 void SourceDocumentGone();
52 // access to pointers (are never 0):
53 ScDocumentPool* GetDocPool() const { return pDocPool.get(); }
54 ScStyleSheetPool* GetStylePool() const { return mxStylePool.get(); }
55 SvNumberFormatter* GetFormTable() const;
56 SfxItemPool* GetEditPool() const;
57 SfxItemPool* GetEnginePool() const;
59 void SetFormTableOpt(const ScDocOptions& rOpt);
61 std::unique_ptr<SvNumberFormatter> CreateNumberFormatter() const;
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */