LibreOffice Module svl (master) 1
numuno.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 * 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
21#include <svl/numuno.hxx>
22#include "numfmuno.hxx"
23
24using namespace com::sun::star;
25
26
28{
29public:
31 mutable ::comphelper::SharedMutex aMutex;
32
34 pFormatter(p) {}
35};
36
37
38// Default ctor for getReflection
40 : pImpl( new SvNumFmtSuppl_Impl(nullptr) )
41{
42}
43
45 : pImpl( new SvNumFmtSuppl_Impl(pForm) )
46{
47}
48
50{
51}
52
53::comphelper::SharedMutex& SvNumberFormatsSupplierObj::getSharedMutex() const
54{
55 return pImpl->aMutex;
56}
57
59{
60 return pImpl->pFormatter;
61}
62
64{
65 // The old Numberformatter has been retired, do not access it anymore!
66 pImpl->pFormatter = pNew;
67}
68
69// XNumberFormatsSupplier
70
71uno::Reference<beans::XPropertySet> SAL_CALL SvNumberFormatsSupplierObj::getNumberFormatSettings()
72{
73 ::osl::MutexGuard aGuard( pImpl->aMutex );
74
75 return new SvNumberFormatSettingsObj( *this, pImpl->aMutex );
76}
77
78uno::Reference<util::XNumberFormats> SAL_CALL SvNumberFormatsSupplierObj::getNumberFormats()
79{
80 ::osl::MutexGuard aGuard( pImpl->aMutex );
81
82 return new SvNumberFormatsObj( *this, pImpl->aMutex );
83}
84
85// XUnoTunnel
86
88
89/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SvNumFmtSuppl_Impl(SvNumberFormatter *p)
Definition: numuno.cxx:33
SvNumberFormatter * pFormatter
Definition: numuno.cxx:30
mutable::comphelper::SharedMutex aMutex
Definition: numuno.cxx:31
virtual ~SvNumberFormatsSupplierObj() override
Definition: numuno.cxx:49
SvNumberFormatter * GetNumberFormatter() const
Definition: numuno.cxx:58
void SetNumberFormatter(SvNumberFormatter *pNew)
Definition: numuno.cxx:63
std::unique_ptr< SvNumFmtSuppl_Impl > pImpl
Definition: numuno.hxx:46
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL getNumberFormatSettings() override
Definition: numuno.cxx:71
virtual css::uno::Reference< css::util::XNumberFormats > SAL_CALL getNumberFormats() override
Definition: numuno.cxx:78
void * p
UNO3_GETIMPLEMENTATION_IMPL(SvNumberFormatsSupplierObj)