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 <swtypes.hxx>
21 #include <multmrk.hxx>
22 #include <toxmgr.hxx>
23 #include <wrtsh.hxx>
24 
26  : GenericDialogController(pParent, "modules/swriter/ui/selectindexdialog.ui", "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);
42  m_xTextFT->set_label(m_rMgr.GetTOXMark(0)->GetTOXType()->GetTypeName());
43 }
44 
45 IMPL_LINK( SwMultiTOXMarkDlg, SelectHdl, weld::TreeView&, rBox, void )
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 {
58 }
59 
61 {
62 }
63 
64 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SwWrtShell * GetShell()
Definition: toxmgr.hxx:259
SwTOXMgr & m_rMgr
Definition: multmrk.hxx:31
IMPL_LINK(SwMultiTOXMarkDlg, SelectHdl, weld::TreeView &, rBox, void)
Definition: multmrk.cxx:45
const SwTOXType * GetTOXType() const
Definition: tox.hxx:542
SwTOXMark * GetTOXMark(sal_uInt16 nId)
Definition: toxmgr.cxx:38
int i
std::unique_ptr< weld::TreeView > m_xTOXLB
Definition: multmrk.hxx:35
OUString GetText(SwRootFrame const *pLayout) const
Definition: tox.cxx:168
sal_uInt16 GetTOXMarkCount() const
Definition: toxmgr.hxx:263
const OUString & GetTypeName() const
Definition: tox.hxx:660
void SetCurTOXMark(sal_uInt16 nId)
Definition: toxmgr.cxx:263
std::unique_ptr< weld::Label > m_xTextFT
Definition: multmrk.hxx:34
SwMultiTOXMarkDlg(weld::Window *pParent, SwTOXMgr &rTOXMgr)
Definition: multmrk.cxx:25
sal_uInt16 m_nPos
Definition: multmrk.hxx:32
SwRootFrame * GetLayout() const
Definition: viewsh.cxx:2075
virtual ~SwMultiTOXMarkDlg() override
Definition: multmrk.cxx:60