nss: upgrade to release 3.73
[LibreOffice.git] / sw / source / uibase / dbui / dbui.cxx
blobecec850322b099123f09c612057e36772ff55aa6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
20 #include <dbui.hxx>
22 SaveMonitor::SaveMonitor(weld::Window *pParent)
23 : GenericDialogController(pParent, "modules/swriter/ui/savemonitordialog.ui",
24 "SaveMonitorDialog")
25 , m_xDocName(m_xBuilder->weld_label("docname"))
26 , m_xPrinter(m_xBuilder->weld_label("printer"))
27 , m_xPrintInfo(m_xBuilder->weld_label("printinfo"))
31 SaveMonitor::~SaveMonitor()
35 PrintMonitor::PrintMonitor(weld::Window *pParent)
36 : GenericDialogController(pParent, "modules/swriter/ui/printmonitordialog.ui",
37 "PrintMonitorDialog")
38 , m_xDocName(m_xBuilder->weld_label("docname"))
39 , m_xPrinter(m_xBuilder->weld_label("printer"))
40 , m_xPrintInfo(m_xBuilder->weld_label("printinfo"))
44 PrintMonitor::~PrintMonitor()
48 // Progress Indicator for Creation of personalized Mail Merge documents:
49 CreateMonitor::CreateMonitor(weld::Window *pParent)
50 : GenericDialogController(pParent, "modules/swriter/ui/mmcreatingdialog.ui",
51 "MMCreatingDialog")
52 , m_sCountingPattern()
53 , m_nTotalCount(0)
54 , m_nCurrentPosition(0)
55 , m_xCounting(m_xBuilder->weld_label("progress"))
57 m_sCountingPattern = m_xCounting->get_label();
58 m_xCounting->set_label("...");
61 CreateMonitor::~CreateMonitor()
65 void CreateMonitor::UpdateCountingText()
67 constexpr OUStringLiteral sVariable_Total(u"%Y");
68 constexpr OUStringLiteral sVariable_Position(u"%X");
70 OUString sText(m_sCountingPattern);
71 sText = sText.replaceAll( sVariable_Total, OUString::number( m_nTotalCount ) );
72 sText = sText.replaceAll( sVariable_Position, OUString::number( m_nCurrentPosition ) );
73 m_xCounting->set_label(sText);
76 void CreateMonitor::SetTotalCount( sal_Int32 nTotal )
78 m_nTotalCount = nTotal;
79 UpdateCountingText();
82 void CreateMonitor::SetCurrentPosition( sal_Int32 nCurrent )
84 m_nCurrentPosition = nCurrent;
85 UpdateCountingText();
88 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */