LibreOffice Module sw (master) 1
multmrk.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
20#include <multmrk.hxx>
21#include <toxmgr.hxx>
22#include <wrtsh.hxx>
23
25 : GenericDialogController(pParent, "modules/swriter/ui/selectindexdialog.ui",
26 "SelectIndexDialog")
27 , m_rMgr(rTOXMgr)
28 , m_nPos(0)
29 , m_xTextFT(m_xBuilder->weld_label("type"))
30 , m_xTOXLB(m_xBuilder->weld_tree_view("treeview"))
31{
32 m_xTOXLB->set_size_request(m_xTOXLB->get_approximate_digit_width() * 32,
33 m_xTOXLB->get_height_rows(8));
34
35 m_xTOXLB->connect_changed(LINK(this, SwMultiTOXMarkDlg, SelectHdl));
36
37 sal_uInt16 nSize = m_rMgr.GetTOXMarkCount();
38 for (sal_uInt16 i = 0; i < nSize; ++i)
40
41 m_xTOXLB->select(0);
43}
44
46{
47 if (rBox.get_selected_index() != -1)
48 {
49 SwTOXMark* pMark = m_rMgr.GetTOXMark(rBox.get_selected_index());
50 m_xTextFT->set_label(pMark->GetTOXType()->GetTypeName());
51 m_nPos = rBox.get_selected_index();
52 }
53}
54
56{
57 short nRet = GenericDialogController::run();
58 if (nRet == RET_OK)
60 return nRet;
61}
62
64
65/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwTOXMgr & m_rMgr
Definition: multmrk.hxx:31
std::unique_ptr< weld::TreeView > m_xTOXLB
Definition: multmrk.hxx:35
virtual short run() override
Definition: multmrk.cxx:55
std::unique_ptr< weld::Label > m_xTextFT
Definition: multmrk.hxx:34
sal_uInt16 m_nPos
Definition: multmrk.hxx:32
SwMultiTOXMarkDlg(weld::Window *pParent, SwTOXMgr &rTOXMgr)
Definition: multmrk.cxx:24
virtual ~SwMultiTOXMarkDlg() override
Definition: multmrk.cxx:63
const SwTOXType * GetTOXType() const
Definition: tox.hxx:576
OUString GetText(SwRootFrame const *pLayout) const
Definition: tox.cxx:201
Built on top of SwWrtShell, provides functionality to insert, update or perform other actions on vari...
Definition: toxmgr.hxx:231
void SetCurTOXMark(sal_uInt16 nId)
Definition: toxmgr.cxx:262
SwTOXMark * GetTOXMark(sal_uInt16 nId)
Definition: toxmgr.cxx:37
SwWrtShell * GetShell()
Definition: toxmgr.hxx:263
sal_uInt16 GetTOXMarkCount() const
Definition: toxmgr.hxx:267
const OUString & GetTypeName() const
Definition: tox.hxx:690
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2163
size_t m_nPos
IMPL_LINK(SwMultiTOXMarkDlg, SelectHdl, weld::TreeView &, rBox, void)
Definition: multmrk.cxx:45
int i
RET_OK