Mark some visible strings in ui files as translatable
[LibreOffice.git] / sw / source / ui / table / splittbl.cxx
blob5e879ecb7e69b5c9cb066b3c36034fa75c7507b7
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 <wrtsh.hxx>
21 #include <splittbl.hxx>
22 #include <tblenum.hxx>
24 SplitTable_HeadlineOption SwSplitTableDlg::m_eRememberedSplitOption
25 = SplitTable_HeadlineOption::ContentCopy;
27 SwSplitTableDlg::SwSplitTableDlg(weld::Window* pParent, SwWrtShell& rSh)
28 : GenericDialogController(pParent, u"modules/swriter/ui/splittable.ui"_ustr,
29 u"SplitTableDialog"_ustr)
30 , m_xBoxAttrCopyWithParaRB(m_xBuilder->weld_radio_button(u"customheadingapplystyle"_ustr))
31 , m_xBoxAttrCopyNoParaRB(m_xBuilder->weld_radio_button(u"customheading"_ustr))
32 , m_xBorderCopyRB(m_xBuilder->weld_radio_button(u"noheading"_ustr))
33 , m_rShell(rSh)
34 , m_nSplit(SplitTable_HeadlineOption::ContentCopy)
36 // tdf#131759 - remember last used option in split table dialog
37 m_nSplit = m_eRememberedSplitOption;
38 switch (m_nSplit)
40 case SplitTable_HeadlineOption::BoxAttrAllCopy:
41 m_xBoxAttrCopyWithParaRB->set_active(true);
42 break;
43 case SplitTable_HeadlineOption::BoxAttrCopy:
44 m_xBoxAttrCopyNoParaRB->set_active(true);
45 break;
46 case SplitTable_HeadlineOption::BorderCopy:
47 m_xBorderCopyRB->set_active(true);
48 break;
49 case SplitTable_HeadlineOption::NONE:
50 case SplitTable_HeadlineOption::ContentCopy:
51 default:
52 // Use the default value in case of an invalid option
53 m_nSplit = SplitTable_HeadlineOption::ContentCopy;
57 void SwSplitTableDlg::Apply()
59 m_nSplit = SplitTable_HeadlineOption::ContentCopy;
60 if (m_xBoxAttrCopyWithParaRB->get_active())
61 m_nSplit = SplitTable_HeadlineOption::BoxAttrAllCopy;
62 else if (m_xBoxAttrCopyNoParaRB->get_active())
63 m_nSplit = SplitTable_HeadlineOption::BoxAttrCopy;
64 else if (m_xBorderCopyRB->get_active())
65 m_nSplit = SplitTable_HeadlineOption::BorderCopy;
67 // tdf#131759 - remember last used option in split table dialog
68 m_eRememberedSplitOption = m_nSplit;
70 m_rShell.SplitTable(m_nSplit);
73 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */