LibreOffice Module sw (master) 1
contentcontrollistitemdlg.cxx
Go to the documentation of this file.
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
21
23
24using namespace com::sun::star;
25
28 : GenericDialogController(pParent, "modules/swriter/ui/contentcontrollistitemdlg.ui",
29 "ContentControlListItemDialog")
30 , m_rItem(rItem)
31 , m_xDisplayNameED(m_xBuilder->weld_entry("displayname"))
32 , m_xValueED(m_xBuilder->weld_entry("value"))
33 , m_xOk(m_xBuilder->weld_button("ok"))
34{
35 m_xOk->connect_clicked(LINK(this, SwContentControlListItemDlg, OkHdl));
36 m_xDisplayNameED->set_text(rItem.m_aDisplayText);
37 m_xValueED->set_text(rItem.m_aValue);
38}
39
41{
42 m_rItem.m_aDisplayText = m_xDisplayNameED->get_text();
43 m_rItem.m_aValue = m_xValueED->get_text();
44
45 m_xDialog->response(RET_OK);
46}
47
48/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
Reference< XExecutableDialog > m_xDialog
Edits the properties of a sing list item in a (drop-down) content control.
SwContentControlListItemDlg(weld::Widget *pParent, SwContentControlListItem &rItem)
std::unique_ptr< weld::Entry > m_xValueED
std::unique_ptr< weld::Button > m_xOk
std::unique_ptr< weld::Entry > m_xDisplayNameED
Represents one list item in a content control dropdown list.
OUString m_aValue
This must not be empty.
OUString m_aDisplayText
This may be empty, ToString() falls back to m_aValue.
IMPL_LINK_NOARG(SwContentControlListItemDlg, OkHdl, weld::Button &, void)
RET_OK