Coverage Report

Created: 2026-09-28 10:59

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libreoffice/sw/source/uibase/dbui/dbui.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 <dbui.hxx>
21
#include <vcl/weld/Builder.hxx>
22
23
SaveMonitor::SaveMonitor(weld::Window *pParent)
24
0
    : GenericDialogController(pParent, u"modules/swriter/ui/savemonitordialog.ui"_ustr,
25
0
        u"SaveMonitorDialog"_ustr)
26
0
    , m_xDocName(m_xBuilder->weld_label(u"docname"_ustr))
27
0
    , m_xPrinter(m_xBuilder->weld_label(u"printer"_ustr))
28
0
    , m_xPrintInfo(m_xBuilder->weld_label(u"printinfo"_ustr))
29
0
{
30
0
}
31
32
SaveMonitor::~SaveMonitor()
33
0
{
34
0
}
35
36
PrintMonitor::PrintMonitor(weld::Window *pParent)
37
0
    : GenericDialogController(pParent, u"modules/swriter/ui/printmonitordialog.ui"_ustr,
38
0
        u"PrintMonitorDialog"_ustr)
39
0
    , m_xPrinter(m_xBuilder->weld_label(u"printer"_ustr))
40
0
    , m_xPrintInfo(m_xBuilder->weld_label(u"printinfo"_ustr))
41
0
{
42
0
}
43
44
PrintMonitor::~PrintMonitor()
45
0
{
46
0
}
47
48
// Progress Indicator for Creation of personalized Mail Merge documents:
49
CreateMonitor::CreateMonitor(weld::Window *pParent)
50
0
    : GenericDialogController(pParent, u"modules/swriter/ui/mmcreatingdialog.ui"_ustr,
51
0
        u"MMCreatingDialog"_ustr)
52
0
    , m_nTotalCount(0)
53
0
    , m_nCurrentPosition(0)
54
0
    , m_xCounting(m_xBuilder->weld_label(u"progress"_ustr))
55
0
{
56
0
    m_sCountingPattern = m_xCounting->get_label();
57
0
    m_xCounting->set_label(u"..."_ustr);
58
0
}
59
60
CreateMonitor::~CreateMonitor()
61
0
{
62
0
}
63
64
void CreateMonitor::UpdateCountingText()
65
0
{
66
0
    static constexpr OUStringLiteral sVariable_Total(u"%Y");
67
0
    static constexpr OUStringLiteral sVariable_Position(u"%X");
68
69
0
    OUString sText(m_sCountingPattern);
70
0
    sText = sText.replaceAll( sVariable_Total, OUString::number( m_nTotalCount ) );
71
0
    sText = sText.replaceAll( sVariable_Position, OUString::number( m_nCurrentPosition ) );
72
0
    m_xCounting->set_label(sText);
73
0
}
74
75
void CreateMonitor::SetTotalCount( sal_Int32 nTotal )
76
0
{
77
0
    m_nTotalCount = nTotal;
78
0
    UpdateCountingText();
79
0
}
80
81
void CreateMonitor::SetCurrentPosition( sal_Int32 nCurrent )
82
0
{
83
0
    m_nCurrentPosition = nCurrent;
84
0
    UpdateCountingText();
85
0
}
86
87
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */