Coverage Report

Created: 2025-11-16 09:57

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/chart2/source/controller/main/ToolbarController.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
10
#include <ChartToolbarController.hxx>
11
12
#include <com/sun/star/frame/XFrame.hpp>
13
#include <com/sun/star/frame/XDispatch.hpp>
14
#include <com/sun/star/frame/XFramesSupplier.hpp>
15
#include <cppuhelper/supportsservice.hxx>
16
#include <sal/log.hxx>
17
18
namespace com::sun::star::uno { class XComponentContext; }
19
20
namespace chart {
21
22
ChartToolbarController::ChartToolbarController(const css::uno::Sequence<css::uno::Any>& rProperties)
23
0
{
24
0
    for (const auto& rProperty : rProperties)
25
0
    {
26
0
        css::beans::PropertyValue aPropValue;
27
0
        rProperty >>= aPropValue;
28
0
        if (aPropValue.Name == "Frame")
29
0
        {
30
0
            mxFramesSupplier.set(aPropValue.Value, css::uno::UNO_QUERY);
31
0
            break;
32
0
        }
33
0
    }
34
0
}
Unexecuted instantiation: chart::ChartToolbarController::ChartToolbarController(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)
Unexecuted instantiation: chart::ChartToolbarController::ChartToolbarController(com::sun::star::uno::Sequence<com::sun::star::uno::Any> const&)
35
36
ChartToolbarController::~ChartToolbarController()
37
0
{
38
0
}
39
40
void ChartToolbarController::execute(sal_Int16 /*nKeyModifier*/)
41
0
{
42
0
}
43
44
void ChartToolbarController::click()
45
0
{
46
0
    css::uno::Reference<css::frame::XFrame> xActiveFrame = mxFramesSupplier->getActiveFrame();
47
0
    if (!xActiveFrame.is())
48
0
        return;
49
50
0
    css::uno::Reference<css::frame::XController> xActiveController = xActiveFrame->getController();
51
0
    if (!xActiveController.is())
52
0
        return;
53
54
0
    css::uno::Reference<css::frame::XDispatch> xDispatch(xActiveController, css::uno::UNO_QUERY);
55
0
    if (!xDispatch.is())
56
0
        return;
57
58
0
    css::util::URL aURL;
59
0
    aURL.Path = "FormatSelection";
60
0
    xDispatch->dispatch(aURL, css::uno::Sequence<css::beans::PropertyValue>());
61
0
}
62
63
void ChartToolbarController::doubleClick()
64
0
{
65
0
    SAL_INFO("chart2", "double clicked");
66
0
}
67
68
69
css::uno::Reference<css::awt::XWindow> ChartToolbarController::createPopupWindow()
70
0
{
71
0
    return css::uno::Reference<css::awt::XWindow>();
72
0
}
73
74
css::uno::Reference<css::awt::XWindow> ChartToolbarController::createItemWindow(
75
        const css::uno::Reference<css::awt::XWindow>& /*rParent*/)
76
0
{
77
0
    return css::uno::Reference<css::awt::XWindow>();
78
0
}
79
80
void ChartToolbarController::statusChanged(const css::frame::FeatureStateEvent& /*rEvent*/)
81
0
{
82
83
0
}
84
85
void ChartToolbarController::disposing(const css::lang::EventObject& /*rSource*/)
86
0
{
87
0
}
88
89
void ChartToolbarController::initialize(const css::uno::Sequence<css::uno::Any>& /*rAny*/)
90
0
{
91
0
}
92
93
void ChartToolbarController::update()
94
0
{
95
0
}
96
97
98
OUString ChartToolbarController::getImplementationName()
99
0
{
100
0
    return u"org.libreoffice.chart2.Chart2ToolboxController"_ustr;
101
0
}
102
103
sal_Bool ChartToolbarController::supportsService(OUString const & ServiceName)
104
0
{
105
0
    return cppu::supportsService(this, ServiceName);
106
0
}
107
108
css::uno::Sequence<OUString> ChartToolbarController::getSupportedServiceNames()
109
0
{
110
0
    return { u"com.sun.star.frame.ToolbarController"_ustr };
111
0
}
112
113
}
114
115
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
116
org_libreoffice_chart2_Chart2ToolboxController(css::uno::XComponentContext*, css::uno::Sequence<css::uno::Any> const & rProperties)
117
0
{
118
0
    return cppu::acquire(new ::chart::ChartToolbarController(rProperties));
119
0
}
120
121
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */