Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/include/comphelper/servicehelper.hxx
Line
Count
Source
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
#ifndef INCLUDED_COMPHELPER_SERVICEHELPER_HXX
21
#define INCLUDED_COMPHELPER_SERVICEHELPER_HXX
22
23
#include <rtl/uuid.h>
24
#include <com/sun/star/lang/XUnoTunnel.hpp>
25
#include <com/sun/star/uno/Sequence.hxx>
26
27
namespace comphelper {
28
29
    // Class encapsulating UIDs used as e.g. tunnel IDs for css::lang::XUnoTunnel,
30
    // or implementation IDs for css::lang::XTypeProvider
31
    class UnoIdInit
32
    {
33
    private:
34
        css::uno::Sequence< sal_Int8 > m_aSeq;
35
    public:
36
80
        UnoIdInit() : m_aSeq(16)
37
80
        {
38
80
            rtl_createUuid(reinterpret_cast<sal_uInt8*>(m_aSeq.getArray()), nullptr, true);
39
80
        }
40
7.18M
        const css::uno::Sequence< sal_Int8 >& getSeq() const { return m_aSeq; }
41
    };
42
43
    inline sal_Int64 getSomething_cast(void* p)
44
2.72M
    {
45
2.72M
        return sal::static_int_cast<sal_Int64>(reinterpret_cast<sal_IntPtr>(p));
46
2.72M
    }
47
48
    template<class T> inline T* getSomething_cast(sal_Int64 n)
49
2.73M
    {
50
2.73M
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
2.73M
    }
SvNumberFormatsSupplierObj* comphelper::getSomething_cast<SvNumberFormatsSupplierObj>(long)
Line
Count
Source
49
75.0k
    {
50
75.0k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
75.0k
    }
Unexecuted instantiation: ScModelObj* comphelper::getSomething_cast<ScModelObj>(long)
SvxUnoTextRangeBase* comphelper::getSomething_cast<SvxUnoTextRangeBase>(long)
Line
Count
Source
49
167k
    {
50
167k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
167k
    }
SvxDrawPage* comphelper::getSomething_cast<SvxDrawPage>(long)
Line
Count
Source
49
271k
    {
50
271k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
271k
    }
SvxUnoTextBase* comphelper::getSomething_cast<SvxUnoTextBase>(long)
Line
Count
Source
49
200k
    {
50
200k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
200k
    }
ScHeaderFooterTextCursor* comphelper::getSomething_cast<ScHeaderFooterTextCursor>(long)
Line
Count
Source
49
1.98k
    {
50
1.98k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
1.98k
    }
SvxShape* comphelper::getSomething_cast<SvxShape>(long)
Line
Count
Source
49
1.71M
    {
50
1.71M
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
1.71M
    }
Unexecuted instantiation: ScDrawTextCursor* comphelper::getSomething_cast<ScDrawTextCursor>(long)
Unexecuted instantiation: ScCellTextCursor* comphelper::getSomething_cast<ScCellTextCursor>(long)
SfxObjectShell* comphelper::getSomething_cast<SfxObjectShell>(long)
Line
Count
Source
49
1.05k
    {
50
1.05k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
1.05k
    }
SvxUnoTextRange* comphelper::getSomething_cast<SvxUnoTextRange>(long)
Line
Count
Source
49
189k
    {
50
189k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
189k
    }
Unexecuted instantiation: SdrModel* comphelper::getSomething_cast<SdrModel>(long)
Unexecuted instantiation: connectivity::file::OConnection* comphelper::getSomething_cast<connectivity::file::OConnection>(long)
Unexecuted instantiation: SmModel* comphelper::getSomething_cast<SmModel>(long)
SwXShape* comphelper::getSomething_cast<SwXShape>(long)
Line
Count
Source
49
35.1k
    {
50
35.1k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
35.1k
    }
SwXStyle* comphelper::getSomething_cast<SwXStyle>(long)
Line
Count
Source
49
17.4k
    {
50
17.4k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
17.4k
    }
SwXTextDocument* comphelper::getSomething_cast<SwXTextDocument>(long)
Line
Count
Source
49
17.5k
    {
50
17.5k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
17.5k
    }
Unexecuted instantiation: SdDrawPage* comphelper::getSomething_cast<SdDrawPage>(long)
SdMasterPage* comphelper::getSomething_cast<SdMasterPage>(long)
Line
Count
Source
49
2.48k
    {
50
2.48k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
2.48k
    }
SdXImpressDocument* comphelper::getSomething_cast<SdXImpressDocument>(long)
Line
Count
Source
49
37.9k
    {
50
37.9k
        return reinterpret_cast<T*>(sal::static_int_cast<sal_IntPtr>(n));
51
37.9k
    }
Unexecuted instantiation: accessibility::AccessibleShape* comphelper::getSomething_cast<accessibility::AccessibleShape>(long)
52
53
    template <class T> T* getFromUnoTunnel(const css::uno::Reference<css::lang::XUnoTunnel>& xUT)
54
2.88M
    {
55
2.88M
        if (!xUT.is())
56
158k
            return nullptr;
57
58
2.72M
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
2.88M
    }
SvNumberFormatsSupplierObj* comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
75.0k
    {
55
75.0k
        if (!xUT.is())
56
0
            return nullptr;
57
58
75.0k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
75.0k
    }
Unexecuted instantiation: ScModelObj* comphelper::getFromUnoTunnel<ScModelObj>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
SvxUnoTextRangeBase* comphelper::getFromUnoTunnel<SvxUnoTextRangeBase>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
167k
    {
55
167k
        if (!xUT.is())
56
0
            return nullptr;
57
58
167k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
167k
    }
SvxDrawPage* comphelper::getFromUnoTunnel<SvxDrawPage>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
271k
    {
55
271k
        if (!xUT.is())
56
0
            return nullptr;
57
58
271k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
271k
    }
SvxUnoTextBase* comphelper::getFromUnoTunnel<SvxUnoTextBase>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
200k
    {
55
200k
        if (!xUT.is())
56
0
            return nullptr;
57
58
200k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
200k
    }
ScHeaderFooterTextCursor* comphelper::getFromUnoTunnel<ScHeaderFooterTextCursor>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
1.98k
    {
55
1.98k
        if (!xUT.is())
56
0
            return nullptr;
57
58
1.98k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
1.98k
    }
SvxShape* comphelper::getFromUnoTunnel<SvxShape>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
1.71M
    {
55
1.71M
        if (!xUT.is())
56
3.60k
            return nullptr;
57
58
1.71M
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
1.71M
    }
Unexecuted instantiation: ScDrawTextCursor* comphelper::getFromUnoTunnel<ScDrawTextCursor>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Unexecuted instantiation: ScCellTextCursor* comphelper::getFromUnoTunnel<ScCellTextCursor>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Unexecuted instantiation: SfxObjectShell* comphelper::getFromUnoTunnel<SfxObjectShell>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
SvxUnoTextRange* comphelper::getFromUnoTunnel<SvxUnoTextRange>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
189k
    {
55
189k
        if (!xUT.is())
56
77
            return nullptr;
57
58
189k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
189k
    }
Unexecuted instantiation: SdrModel* comphelper::getFromUnoTunnel<SdrModel>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Unexecuted instantiation: connectivity::file::OConnection* comphelper::getFromUnoTunnel<connectivity::file::OConnection>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Unexecuted instantiation: SmModel* comphelper::getFromUnoTunnel<SmModel>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
SwXShape* comphelper::getFromUnoTunnel<SwXShape>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
189k
    {
55
189k
        if (!xUT.is())
56
154k
            return nullptr;
57
58
35.1k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
189k
    }
SwXStyle* comphelper::getFromUnoTunnel<SwXStyle>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
17.4k
    {
55
17.4k
        if (!xUT.is())
56
0
            return nullptr;
57
58
17.4k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
17.4k
    }
SwXTextDocument* comphelper::getFromUnoTunnel<SwXTextDocument>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
17.5k
    {
55
17.5k
        if (!xUT.is())
56
0
            return nullptr;
57
58
17.5k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
17.5k
    }
Unexecuted instantiation: SdDrawPage* comphelper::getFromUnoTunnel<SdDrawPage>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
SdMasterPage* comphelper::getFromUnoTunnel<SdMasterPage>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
2.48k
    {
55
2.48k
        if (!xUT.is())
56
0
            return nullptr;
57
58
2.48k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
2.48k
    }
SdXImpressDocument* comphelper::getFromUnoTunnel<SdXImpressDocument>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
Line
Count
Source
54
37.9k
    {
55
37.9k
        if (!xUT.is())
56
0
            return nullptr;
57
58
37.9k
        return getSomething_cast<T>(xUT->getSomething(T::getUnoTunnelId()));
59
37.9k
    }
Unexecuted instantiation: accessibility::AccessibleShape* comphelper::getFromUnoTunnel<accessibility::AccessibleShape>(com::sun::star::uno::Reference<com::sun::star::lang::XUnoTunnel> const&)
60
61
    // Takes an interface
62
    template <class T> T* getFromUnoTunnel(const css::uno::Reference<css::uno::XInterface>& xIface)
63
2.78M
    {
64
2.78M
        return getFromUnoTunnel<T>(
65
2.78M
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
2.78M
    }
SvNumberFormatsSupplierObj* comphelper::getFromUnoTunnel<SvNumberFormatsSupplierObj>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
28.8k
    {
64
28.8k
        return getFromUnoTunnel<T>(
65
28.8k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
28.8k
    }
Unexecuted instantiation: ScModelObj* comphelper::getFromUnoTunnel<ScModelObj>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
SvxUnoTextRangeBase* comphelper::getFromUnoTunnel<SvxUnoTextRangeBase>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
167k
    {
64
167k
        return getFromUnoTunnel<T>(
65
167k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
167k
    }
SvxDrawPage* comphelper::getFromUnoTunnel<SvxDrawPage>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
271k
    {
64
271k
        return getFromUnoTunnel<T>(
65
271k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
271k
    }
SvxUnoTextBase* comphelper::getFromUnoTunnel<SvxUnoTextBase>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
200k
    {
64
200k
        return getFromUnoTunnel<T>(
65
200k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
200k
    }
ScHeaderFooterTextCursor* comphelper::getFromUnoTunnel<ScHeaderFooterTextCursor>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
1.98k
    {
64
1.98k
        return getFromUnoTunnel<T>(
65
1.98k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
1.98k
    }
SvxShape* comphelper::getFromUnoTunnel<SvxShape>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
1.70M
    {
64
1.70M
        return getFromUnoTunnel<T>(
65
1.70M
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
1.70M
    }
Unexecuted instantiation: ScDrawTextCursor* comphelper::getFromUnoTunnel<ScDrawTextCursor>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Unexecuted instantiation: ScCellTextCursor* comphelper::getFromUnoTunnel<ScCellTextCursor>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Unexecuted instantiation: SfxObjectShell* comphelper::getFromUnoTunnel<SfxObjectShell>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
SvxUnoTextRange* comphelper::getFromUnoTunnel<SvxUnoTextRange>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
189k
    {
64
189k
        return getFromUnoTunnel<T>(
65
189k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
189k
    }
Unexecuted instantiation: SdrModel* comphelper::getFromUnoTunnel<SdrModel>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Unexecuted instantiation: connectivity::file::OConnection* comphelper::getFromUnoTunnel<connectivity::file::OConnection>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Unexecuted instantiation: SmModel* comphelper::getFromUnoTunnel<SmModel>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
SwXShape* comphelper::getFromUnoTunnel<SwXShape>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
167k
    {
64
167k
        return getFromUnoTunnel<T>(
65
167k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
167k
    }
Unexecuted instantiation: SwXStyle* comphelper::getFromUnoTunnel<SwXStyle>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
SwXTextDocument* comphelper::getFromUnoTunnel<SwXTextDocument>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
17.5k
    {
64
17.5k
        return getFromUnoTunnel<T>(
65
17.5k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
17.5k
    }
Unexecuted instantiation: SdDrawPage* comphelper::getFromUnoTunnel<SdDrawPage>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
SdMasterPage* comphelper::getFromUnoTunnel<SdMasterPage>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
2.48k
    {
64
2.48k
        return getFromUnoTunnel<T>(
65
2.48k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
2.48k
    }
SdXImpressDocument* comphelper::getFromUnoTunnel<SdXImpressDocument>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
Line
Count
Source
63
37.9k
    {
64
37.9k
        return getFromUnoTunnel<T>(
65
37.9k
            css::uno::Reference<css::lang::XUnoTunnel>{ xIface, css::uno::UNO_QUERY });
66
37.9k
    }
Unexecuted instantiation: accessibility::AccessibleShape* comphelper::getFromUnoTunnel<accessibility::AccessibleShape>(com::sun::star::uno::Reference<com::sun::star::uno::XInterface> const&)
67
68
    template <typename T>
69
    inline bool isUnoTunnelId(const css::uno::Sequence< sal_Int8 >& rId)
70
4.45M
    {
71
4.45M
        return rId.getLength() == 16
72
4.45M
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
4.45M
    }
bool comphelper::isUnoTunnelId<SvNumberFormatsSupplierObj>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
75.0k
    {
71
75.0k
        return rId.getLength() == 16
72
75.0k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
75.0k
    }
bool comphelper::isUnoTunnelId<ScModelObj>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
20.2k
    {
71
20.2k
        return rId.getLength() == 16
72
20.2k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
20.2k
    }
bool comphelper::isUnoTunnelId<SfxObjectShell>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
67.8k
    {
71
67.8k
        return rId.getLength() == 16
72
67.8k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
67.8k
    }
Unexecuted instantiation: bool comphelper::isUnoTunnelId<ScCellTextCursor>(com::sun::star::uno::Sequence<signed char> const&)
bool comphelper::isUnoTunnelId<ScHeaderFooterTextCursor>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
5.91k
    {
71
5.91k
        return rId.getLength() == 16
72
5.91k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
5.91k
    }
bool comphelper::isUnoTunnelId<ScDrawTextCursor>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
1.90k
    {
71
1.90k
        return rId.getLength() == 16
72
1.90k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
1.90k
    }
bool comphelper::isUnoTunnelId<SvxUnoTextRangeBase>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
365k
    {
71
365k
        return rId.getLength() == 16
72
365k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
365k
    }
bool comphelper::isUnoTunnelId<SvxUnoTextBase>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
208k
    {
71
208k
        return rId.getLength() == 16
72
208k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
208k
    }
bool comphelper::isUnoTunnelId<SvxUnoText>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
895
    {
71
895
        return rId.getLength() == 16
72
895
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
895
    }
Unexecuted instantiation: bool comphelper::isUnoTunnelId<accessibility::AccessibleShape>(com::sun::star::uno::Sequence<signed char> const&)
bool comphelper::isUnoTunnelId<SvxDrawPage>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
271k
    {
71
271k
        return rId.getLength() == 16
72
271k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
271k
    }
bool comphelper::isUnoTunnelId<SvxShape>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
1.92M
    {
71
1.92M
        return rId.getLength() == 16
72
1.92M
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
1.92M
    }
Unexecuted instantiation: bool comphelper::isUnoTunnelId<dbaccess::ODBTableDecorator>(com::sun::star::uno::Sequence<signed char> const&)
Unexecuted instantiation: bool comphelper::isUnoTunnelId<connectivity::OConnectionWrapper>(com::sun::star::uno::Sequence<signed char> const&)
Unexecuted instantiation: bool comphelper::isUnoTunnelId<connectivity::OMetaConnection>(com::sun::star::uno::Sequence<signed char> const&)
Unexecuted instantiation: bool comphelper::isUnoTunnelId<connectivity::file::OConnection>(com::sun::star::uno::Sequence<signed char> const&)
Unexecuted instantiation: bool comphelper::isUnoTunnelId<SmModel>(com::sun::star::uno::Sequence<signed char> const&)
bool comphelper::isUnoTunnelId<SwXShape>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
904k
    {
71
904k
        return rId.getLength() == 16
72
904k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
904k
    }
bool comphelper::isUnoTunnelId<SwXStyle>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
17.4k
    {
71
17.4k
        return rId.getLength() == 16
72
17.4k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
17.4k
    }
bool comphelper::isUnoTunnelId<SwXTextDocument>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
27.2k
    {
71
27.2k
        return rId.getLength() == 16
72
27.2k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
27.2k
    }
bool comphelper::isUnoTunnelId<SdrModel>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
37.9k
    {
71
37.9k
        return rId.getLength() == 16
72
37.9k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
37.9k
    }
bool comphelper::isUnoTunnelId<SdXImpressDocument>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
37.9k
    {
71
37.9k
        return rId.getLength() == 16
72
37.9k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
37.9k
    }
bool comphelper::isUnoTunnelId<SdGenericDrawPage>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
242k
    {
71
242k
        return rId.getLength() == 16
72
242k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
242k
    }
bool comphelper::isUnoTunnelId<SdDrawPage>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
194k
    {
71
194k
        return rId.getLength() == 16
72
194k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
194k
    }
bool comphelper::isUnoTunnelId<SdMasterPage>(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
70
50.8k
    {
71
50.8k
        return rId.getLength() == 16
72
50.8k
            && memcmp(T::getUnoTunnelId().getConstArray(), rId.getConstArray(), 16) == 0;
73
50.8k
    }
74
75
    template <class Base> struct FallbackToGetSomethingOf
76
    {
77
        static sal_Int64 get(const css::uno::Sequence<sal_Int8>& rId, Base* p)
78
500k
        {
79
500k
            return p->Base::getSomething(rId);
80
500k
        }
comphelper::FallbackToGetSomethingOf<SvxUnoTextCursor>::get(com::sun::star::uno::Sequence<signed char> const&, SvxUnoTextCursor*)
Line
Count
Source
78
5.83k
        {
79
5.83k
            return p->Base::getSomething(rId);
80
5.83k
        }
comphelper::FallbackToGetSomethingOf<SvxUnoTextRangeBase>::get(com::sun::star::uno::Sequence<signed char> const&, SvxUnoTextRangeBase*)
Line
Count
Source
78
8.42k
        {
79
8.42k
            return p->Base::getSomething(rId);
80
8.42k
        }
comphelper::FallbackToGetSomethingOf<SvxUnoTextBase>::get(com::sun::star::uno::Sequence<signed char> const&, SvxUnoTextBase*)
Line
Count
Source
78
895
        {
79
895
            return p->Base::getSomething(rId);
80
895
        }
Unexecuted instantiation: comphelper::FallbackToGetSomethingOf<SfxBaseModel>::get(com::sun::star::uno::Sequence<signed char> const&, SfxBaseModel*)
comphelper::FallbackToGetSomethingOf<SvxDrawPage>::get(com::sun::star::uno::Sequence<signed char> const&, SvxDrawPage*)
Line
Count
Source
78
242k
        {
79
242k
            return p->Base::getSomething(rId);
80
242k
        }
comphelper::FallbackToGetSomethingOf<SdGenericDrawPage>::get(com::sun::star::uno::Sequence<signed char> const&, SdGenericDrawPage*)
Line
Count
Source
78
242k
        {
79
242k
            return p->Base::getSomething(rId);
80
242k
        }
81
    };
82
83
    template <> struct FallbackToGetSomethingOf<void>
84
    {
85
216k
        static sal_Int64 get(const css::uno::Sequence<sal_Int8>&, void*) { return 0; }
86
    };
87
88
    template <class T, class Base = void>
89
    sal_Int64 getSomethingImpl(const css::uno::Sequence<sal_Int8>& rId, T* pThis,
90
        FallbackToGetSomethingOf<Base> = {})
91
3.39M
    {
92
3.39M
        if (isUnoTunnelId<T>(rId))
93
2.67M
            return getSomething_cast(pThis);
94
95
716k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
3.39M
    }
long comphelper::getSomethingImpl<SvNumberFormatsSupplierObj, void>(com::sun::star::uno::Sequence<signed char> const&, SvNumberFormatsSupplierObj*, comphelper::FallbackToGetSomethingOf<void>)
Line
Count
Source
91
75.0k
    {
92
75.0k
        if (isUnoTunnelId<T>(rId))
93
75.0k
            return getSomething_cast(pThis);
94
95
0
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
75.0k
    }
Unexecuted instantiation: long comphelper::getSomethingImpl<ScCellTextCursor, SvxUnoTextCursor>(com::sun::star::uno::Sequence<signed char> const&, ScCellTextCursor*, comphelper::FallbackToGetSomethingOf<SvxUnoTextCursor>)
long comphelper::getSomethingImpl<ScHeaderFooterTextCursor, SvxUnoTextCursor>(com::sun::star::uno::Sequence<signed char> const&, ScHeaderFooterTextCursor*, comphelper::FallbackToGetSomethingOf<SvxUnoTextCursor>)
Line
Count
Source
91
5.91k
    {
92
5.91k
        if (isUnoTunnelId<T>(rId))
93
1.98k
            return getSomething_cast(pThis);
94
95
3.92k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
5.91k
    }
long comphelper::getSomethingImpl<ScDrawTextCursor, SvxUnoTextCursor>(com::sun::star::uno::Sequence<signed char> const&, ScDrawTextCursor*, comphelper::FallbackToGetSomethingOf<SvxUnoTextCursor>)
Line
Count
Source
91
1.90k
    {
92
1.90k
        if (isUnoTunnelId<T>(rId))
93
0
            return getSomething_cast(pThis);
94
95
1.90k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
1.90k
    }
long comphelper::getSomethingImpl<SvxUnoTextRangeBase, void>(com::sun::star::uno::Sequence<signed char> const&, SvxUnoTextRangeBase*, comphelper::FallbackToGetSomethingOf<void>)
Line
Count
Source
91
365k
    {
92
365k
        if (isUnoTunnelId<T>(rId))
93
356k
            return getSomething_cast(pThis);
94
95
8.42k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
365k
    }
long comphelper::getSomethingImpl<SvxUnoTextBase, SvxUnoTextRangeBase>(com::sun::star::uno::Sequence<signed char> const&, SvxUnoTextBase*, comphelper::FallbackToGetSomethingOf<SvxUnoTextRangeBase>)
Line
Count
Source
91
208k
    {
92
208k
        if (isUnoTunnelId<T>(rId))
93
200k
            return getSomething_cast(pThis);
94
95
8.42k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
208k
    }
long comphelper::getSomethingImpl<SvxUnoText, SvxUnoTextBase>(com::sun::star::uno::Sequence<signed char> const&, SvxUnoText*, comphelper::FallbackToGetSomethingOf<SvxUnoTextBase>)
Line
Count
Source
91
895
    {
92
895
        if (isUnoTunnelId<T>(rId))
93
0
            return getSomething_cast(pThis);
94
95
895
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
895
    }
Unexecuted instantiation: long comphelper::getSomethingImpl<accessibility::AccessibleShape, void>(com::sun::star::uno::Sequence<signed char> const&, accessibility::AccessibleShape*, comphelper::FallbackToGetSomethingOf<void>)
long comphelper::getSomethingImpl<SvxDrawPage, void>(com::sun::star::uno::Sequence<signed char> const&, SvxDrawPage*, comphelper::FallbackToGetSomethingOf<void>)
Line
Count
Source
91
271k
    {
92
271k
        if (isUnoTunnelId<T>(rId))
93
271k
            return getSomething_cast(pThis);
94
95
0
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
271k
    }
long comphelper::getSomethingImpl<SvxShape, void>(com::sun::star::uno::Sequence<signed char> const&, SvxShape*, comphelper::FallbackToGetSomethingOf<void>)
Line
Count
Source
91
1.92M
    {
92
1.92M
        if (isUnoTunnelId<T>(rId))
93
1.71M
            return getSomething_cast(pThis);
94
95
208k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
1.92M
    }
Unexecuted instantiation: long comphelper::getSomethingImpl<connectivity::OMetaConnection, void>(com::sun::star::uno::Sequence<signed char> const&, connectivity::OMetaConnection*, comphelper::FallbackToGetSomethingOf<void>)
Unexecuted instantiation: long comphelper::getSomethingImpl<connectivity::file::OConnection, void>(com::sun::star::uno::Sequence<signed char> const&, connectivity::file::OConnection*, comphelper::FallbackToGetSomethingOf<void>)
Unexecuted instantiation: long comphelper::getSomethingImpl<SmModel, SfxBaseModel>(com::sun::star::uno::Sequence<signed char> const&, SmModel*, comphelper::FallbackToGetSomethingOf<SfxBaseModel>)
long comphelper::getSomethingImpl<SwXStyle, void>(com::sun::star::uno::Sequence<signed char> const&, SwXStyle*, comphelper::FallbackToGetSomethingOf<void>)
Line
Count
Source
91
17.4k
    {
92
17.4k
        if (isUnoTunnelId<T>(rId))
93
17.4k
            return getSomething_cast(pThis);
94
95
0
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
17.4k
    }
long comphelper::getSomethingImpl<SdXImpressDocument, SfxBaseModel>(com::sun::star::uno::Sequence<signed char> const&, SdXImpressDocument*, comphelper::FallbackToGetSomethingOf<SfxBaseModel>)
Line
Count
Source
91
37.9k
    {
92
37.9k
        if (isUnoTunnelId<T>(rId))
93
37.9k
            return getSomething_cast(pThis);
94
95
0
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
37.9k
    }
long comphelper::getSomethingImpl<SdGenericDrawPage, SvxDrawPage>(com::sun::star::uno::Sequence<signed char> const&, SdGenericDrawPage*, comphelper::FallbackToGetSomethingOf<SvxDrawPage>)
Line
Count
Source
91
242k
    {
92
242k
        if (isUnoTunnelId<T>(rId))
93
0
            return getSomething_cast(pThis);
94
95
242k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
242k
    }
long comphelper::getSomethingImpl<SdDrawPage, SdGenericDrawPage>(com::sun::star::uno::Sequence<signed char> const&, SdDrawPage*, comphelper::FallbackToGetSomethingOf<SdGenericDrawPage>)
Line
Count
Source
91
194k
    {
92
194k
        if (isUnoTunnelId<T>(rId))
93
0
            return getSomething_cast(pThis);
94
95
194k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
194k
    }
long comphelper::getSomethingImpl<SdMasterPage, SdGenericDrawPage>(com::sun::star::uno::Sequence<signed char> const&, SdMasterPage*, comphelper::FallbackToGetSomethingOf<SdGenericDrawPage>)
Line
Count
Source
91
50.8k
    {
92
50.8k
        if (isUnoTunnelId<T>(rId))
93
2.48k
            return getSomething_cast(pThis);
94
95
48.3k
        return FallbackToGetSomethingOf<Base>::get(rId, pThis);
96
50.8k
    }
97
98
}
99
100
/** the UNO3_GETIMPLEMENTATION_* macros implement a static helper function
101
    that gives access to your implementation for a given interface reference,
102
    if possible.
103
104
    Example:
105
        MyClass* pClass = comphelper::getFromUnoTunnel<MyClass>( xRef );
106
107
    Usage:
108
        Put a UNO3_GETIMPLEMENTATION_DECL( classname ) inside your class
109
        definition and UNO3_GETIMPLEMENTATION_IMPL( classname ) inside
110
        your cxx file. Your class must inherit css::lang::XUnoTunnel
111
        and export it with queryInterface. Implementation of XUnoTunnel is
112
        done by this macro.
113
*/
114
#define UNO3_GETIMPLEMENTATION_DECL( classname ) \
115
    static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept; \
116
    virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& aIdentifier ) override;
117
118
#define UNO3_GETIMPLEMENTATION_BASE_IMPL( classname ) \
119
1.67M
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
1.67M
{ \
121
1.67M
    static const comphelper::UnoIdInit aId; \
122
1.67M
    return aId.getSeq(); \
123
1.67M
}
SvNumberFormatsSupplierObj::getUnoTunnelId()
Line
Count
Source
119
150k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
150k
{ \
121
150k
    static const comphelper::UnoIdInit aId; \
122
150k
    return aId.getSeq(); \
123
150k
}
Unexecuted instantiation: ScCellTextCursor::getUnoTunnelId()
ScHeaderFooterTextCursor::getUnoTunnelId()
Line
Count
Source
119
7.90k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
7.90k
{ \
121
7.90k
    static const comphelper::UnoIdInit aId; \
122
7.90k
    return aId.getSeq(); \
123
7.90k
}
ScDrawTextCursor::getUnoTunnelId()
Line
Count
Source
119
1.90k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
1.90k
{ \
121
1.90k
    static const comphelper::UnoIdInit aId; \
122
1.90k
    return aId.getSeq(); \
123
1.90k
}
SvxUnoTextRangeBase::getUnoTunnelId()
Line
Count
Source
119
721k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
721k
{ \
121
721k
    static const comphelper::UnoIdInit aId; \
122
721k
    return aId.getSeq(); \
123
721k
}
Unexecuted instantiation: accessibility::AccessibleShape::getUnoTunnelId()
SvxDrawPage::getUnoTunnelId()
Line
Count
Source
119
543k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
543k
{ \
121
543k
    static const comphelper::UnoIdInit aId; \
122
543k
    return aId.getSeq(); \
123
543k
}
SdDrawPage::getUnoTunnelId()
Line
Count
Source
119
194k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
194k
{ \
121
194k
    static const comphelper::UnoIdInit aId; \
122
194k
    return aId.getSeq(); \
123
194k
}
SdMasterPage::getUnoTunnelId()
Line
Count
Source
119
53.3k
const css::uno::Sequence< sal_Int8 > & classname::getUnoTunnelId() noexcept \
120
53.3k
{ \
121
53.3k
    static const comphelper::UnoIdInit aId; \
122
53.3k
    return aId.getSeq(); \
123
53.3k
}
124
125
#define UNO3_GETIMPLEMENTATION_IMPL( classname )\
126
UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)\
127
711k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
128
711k
{ \
129
711k
    return comphelper::getSomethingImpl(rId, this); \
130
711k
}
SvNumberFormatsSupplierObj::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
127
75.0k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
128
75.0k
{ \
129
75.0k
    return comphelper::getSomethingImpl(rId, this); \
130
75.0k
}
SvxUnoTextRangeBase::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
127
365k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
128
365k
{ \
129
365k
    return comphelper::getSomethingImpl(rId, this); \
130
365k
}
Unexecuted instantiation: accessibility::AccessibleShape::getSomething(com::sun::star::uno::Sequence<signed char> const&)
SvxDrawPage::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
127
271k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
128
271k
{ \
129
271k
    return comphelper::getSomethingImpl(rId, this); \
130
271k
}
131
132
#define UNO3_GETIMPLEMENTATION2_IMPL( classname, baseclass )\
133
UNO3_GETIMPLEMENTATION_BASE_IMPL(classname)\
134
252k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
135
252k
{ \
136
252k
    return comphelper::getSomethingImpl(rId, this, comphelper::FallbackToGetSomethingOf<baseclass>{}); \
137
252k
}
Unexecuted instantiation: ScCellTextCursor::getSomething(com::sun::star::uno::Sequence<signed char> const&)
ScHeaderFooterTextCursor::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
134
5.91k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
135
5.91k
{ \
136
5.91k
    return comphelper::getSomethingImpl(rId, this, comphelper::FallbackToGetSomethingOf<baseclass>{}); \
137
5.91k
}
ScDrawTextCursor::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
134
1.90k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
135
1.90k
{ \
136
1.90k
    return comphelper::getSomethingImpl(rId, this, comphelper::FallbackToGetSomethingOf<baseclass>{}); \
137
1.90k
}
SdDrawPage::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
134
194k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
135
194k
{ \
136
194k
    return comphelper::getSomethingImpl(rId, this, comphelper::FallbackToGetSomethingOf<baseclass>{}); \
137
194k
}
SdMasterPage::getSomething(com::sun::star::uno::Sequence<signed char> const&)
Line
Count
Source
134
50.8k
sal_Int64 SAL_CALL classname::getSomething( const css::uno::Sequence< sal_Int8 >& rId ) \
135
50.8k
{ \
136
50.8k
    return comphelper::getSomethingImpl(rId, this, comphelper::FallbackToGetSomethingOf<baseclass>{}); \
137
50.8k
}
138
139
140
#endif // INCLUDED_COMPHELPER_SERVICEHELPER_HXX
141
142
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */