Simplify a bit
[LibreOffice.git] / svx / source / form / fmtextcontroldialogs.cxx
blob70e044db2d70fbf61b6fff966c8c18015033513b
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 <fmtextcontroldialogs.hxx>
21 #include <svx/dialogs.hrc>
22 #include <svx/svxids.hrc>
24 #include <svx/flagsdef.hxx>
25 #include <svl/intitem.hxx>
27 #include <svl/cjkoptions.hxx>
28 #include <utility>
31 namespace svx
34 TextControlCharAttribDialog::TextControlCharAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet, SvxFontListItem aFontList)
35 : SfxTabDialogController(pParent, u"svx/ui/textcontrolchardialog.ui"_ustr, u"TextControlCharacterPropertiesDialog"_ustr, &rCoreSet)
36 , m_aFontList(std::move(aFontList))
38 AddTabPage(u"font"_ustr, RID_SVXPAGE_CHAR_NAME);
39 AddTabPage(u"fonteffects"_ustr, RID_SVXPAGE_CHAR_EFFECTS);
40 AddTabPage(u"position"_ustr, RID_SVXPAGE_CHAR_POSITION);
43 void TextControlCharAttribDialog::PageCreated(const OUString& rId, SfxTabPage& rPage)
45 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
47 if (rId == "font")
49 aSet.Put (m_aFontList);
50 rPage.PageCreated(aSet);
52 else if (rId == "fonteffects")
54 aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
55 rPage.PageCreated(aSet);
57 else if (rId == "position")
59 aSet.Put( SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER) );
60 rPage.PageCreated(aSet);
64 TextControlParaAttribDialog::TextControlParaAttribDialog(weld::Window* pParent, const SfxItemSet& rCoreSet)
65 : SfxTabDialogController(pParent, u"svx/ui/textcontrolparadialog.ui"_ustr, u"TextControlParagraphPropertiesDialog"_ustr, &rCoreSet)
67 AddTabPage(u"labelTP_PARA_STD"_ustr, RID_SVXPAGE_STD_PARAGRAPH);
68 AddTabPage(u"labelTP_PARA_ALIGN"_ustr, RID_SVXPAGE_ALIGN_PARAGRAPH);
70 if( SvtCJKOptions::IsAsianTypographyEnabled() )
71 AddTabPage(u"labelTP_PARA_ASIAN"_ustr, RID_SVXPAGE_PARA_ASIAN);
72 else
73 RemoveTabPage(u"labelTP_PARA_ASIAN"_ustr);
75 AddTabPage(u"labelTP_TABULATOR"_ustr, RID_SVXPAGE_TABULATOR);
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */