Coverage Report

Created: 2026-03-31 11:00

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/svx/source/accessibility/AccessibleOLEShape.cxx
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
#include <svx/AccessibleOLEShape.hxx>
21
22
#include <svx/ShapeTypeHandler.hxx>
23
#include <svx/SvxShapeTypes.hxx>
24
#include <svx/svdoole2.hxx>
25
26
#include <comphelper/sequence.hxx>
27
#include <cppuhelper/queryinterface.hxx>
28
29
#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
30
#include <com/sun/star/drawing/XShape.hpp>
31
#include <com/sun/star/drawing/XShapeDescriptor.hpp>
32
33
using namespace ::accessibility;
34
using namespace ::com::sun::star;
35
using namespace ::com::sun::star::uno;
36
using namespace ::com::sun::star::accessibility;
37
38
// internal
39
AccessibleOLEShape::AccessibleOLEShape(const AccessibleShapeInfo& rShapeInfo,
40
                                       const AccessibleShapeTreeInfo& rShapeTreeInfo)
41
0
    : ImplInheritanceHelper(rShapeInfo, rShapeTreeInfo)
42
0
{
43
0
}
44
45
46
AccessibleOLEShape::~AccessibleOLEShape()
47
0
{
48
0
}
49
50
// XAccessibleAction
51
sal_Int32 SAL_CALL AccessibleOLEShape::getAccessibleActionCount()
52
0
{
53
0
    return 0;
54
0
}
55
56
57
sal_Bool SAL_CALL AccessibleOLEShape::doAccessibleAction (sal_Int32 /*nIndex*/)
58
0
{
59
0
    throw lang::IndexOutOfBoundsException();
60
0
}
61
62
63
OUString SAL_CALL AccessibleOLEShape::getAccessibleActionDescription (sal_Int32 /*nIndex*/)
64
0
{
65
0
    throw lang::IndexOutOfBoundsException();
66
0
}
67
68
69
Reference<XAccessibleKeyBinding> SAL_CALL AccessibleOLEShape::getAccessibleActionKeyBinding (sal_Int32 /*nIndex*/)
70
0
{
71
0
    throw lang::IndexOutOfBoundsException();
72
0
}
73
74
std::unordered_map<OUString, OUString> AccessibleOLEShape::implGetExtendedAttributes()
75
0
{
76
0
    if (!m_pShape)
77
0
        return {};
78
79
0
    return { { u"style"_ustr, static_cast<SdrOle2Obj*>(m_pShape)->GetStyleString() } };
80
0
}
81
82
/// Set this object's name if is different to the current name.
83
OUString
84
    AccessibleOLEShape::CreateAccessibleBaseName()
85
0
{
86
0
    OUString sName;
87
88
0
    ShapeTypeId nShapeType = ShapeTypeHandler::Instance().GetTypeId (mxShape);
89
0
    switch (nShapeType)
90
0
    {
91
0
        case DRAWING_APPLET:
92
0
            sName = "AppletOLEShape";
93
0
            break;
94
0
        case DRAWING_FRAME:
95
0
            sName = "FrameOLEShape";
96
0
            break;
97
0
        case DRAWING_OLE:
98
0
            sName = "OLEShape";
99
0
            break;
100
0
        case DRAWING_PLUGIN:
101
0
            sName = "PluginOLEShape";
102
0
            break;
103
104
0
        default:
105
0
            sName = "UnknownAccessibleOLEShape";
106
0
            uno::Reference<drawing::XShapeDescriptor> xDescriptor (mxShape);
107
0
            if (xDescriptor.is())
108
0
                sName += ": " + xDescriptor->getShapeType();
109
0
    }
110
111
0
    return sName;
112
0
}
113
114
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */