Coverage Report

Created: 2026-06-30 11:14

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/svx/source/sidebar/text/TextUnderlinePopup.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
#include <TextUnderlinePopup.hxx>
20
#include "TextUnderlineControl.hxx"
21
#include <vcl/toolbox.hxx>
22
#include <vcl/weld/Toolbar.hxx>
23
#include <vcl/weld/Window.hxx>
24
25
using namespace svx;
26
27
TextUnderlinePopup::TextUnderlinePopup(
28
    const css::uno::Reference<css::uno::XComponentContext>& rContext)
29
0
    : PopupWindowController(rContext, nullptr, OUString())
30
0
{
31
0
}
Unexecuted instantiation: svx::TextUnderlinePopup::TextUnderlinePopup(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
Unexecuted instantiation: svx::TextUnderlinePopup::TextUnderlinePopup(com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext> const&)
32
33
0
TextUnderlinePopup::~TextUnderlinePopup() {}
34
35
void TextUnderlinePopup::initialize(const css::uno::Sequence<css::uno::Any>& rArguments)
36
0
{
37
0
    PopupWindowController::initialize(rArguments);
38
39
0
    if (m_pToolbar)
40
0
    {
41
0
        mxPopoverContainer.reset(new ToolbarPopupContainer(m_pToolbar));
42
0
        m_pToolbar->set_item_popover(m_aCommandURL, mxPopoverContainer->getTopLevel());
43
0
    }
44
45
0
    ToolBox* pToolBox = nullptr;
46
0
    ToolBoxItemId nId;
47
0
    if (getToolboxId(nId, &pToolBox) && pToolBox->GetItemCommand(nId) == m_aCommandURL)
48
0
        pToolBox->SetItemBits(nId, ToolBoxItemBits::DROPDOWN | pToolBox->GetItemBits(nId));
49
0
}
50
51
std::unique_ptr<WeldToolbarPopup> TextUnderlinePopup::weldPopupWindow()
52
0
{
53
0
    return std::make_unique<TextUnderlineControl>(this, m_pToolbar);
54
0
}
55
56
VclPtr<vcl::Window> TextUnderlinePopup::createVclPopupWindow(vcl::Window* pParent)
57
0
{
58
0
    mxInterimPopover = VclPtr<InterimToolbarPopup>::Create(
59
0
        getFrameInterface(), pParent,
60
0
        std::make_unique<TextUnderlineControl>(this, pParent->GetFrameWeld()));
61
62
0
    mxInterimPopover->Show();
63
64
0
    return mxInterimPopover;
65
0
}
66
67
OUString TextUnderlinePopup::getImplementationName()
68
0
{
69
0
    return u"com.sun.star.comp.svx.UnderlineToolBoxControl"_ustr;
70
0
}
71
72
css::uno::Sequence<OUString> TextUnderlinePopup::getSupportedServiceNames()
73
0
{
74
0
    return { u"com.sun.star.frame.ToolbarController"_ustr };
75
0
}
76
77
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
78
com_sun_star_comp_svx_UnderlineToolBoxControl_get_implementation(
79
    css::uno::XComponentContext* rContext, css::uno::Sequence<css::uno::Any> const&)
80
0
{
81
0
    return cppu::acquire(new TextUnderlinePopup(rContext));
82
0
}
83
84
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */