Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / sc / source / ui / miscdlgs / textdlgs.cxx
blob2f27de79ca8fc6840a1ed900583ccc9c6cea5d99
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 #undef SC_DLLIMPLEMENTATION
22 #include <svx/svxids.hrc>
24 #include <editeng/flstitem.hxx>
25 #include <sfx2/objsh.hxx>
26 #include <svl/cjkoptions.hxx>
28 #include "textdlgs.hxx"
29 #include "scresid.hxx"
30 #include "sc.hrc"
31 #include <svl/intitem.hxx>
32 #include <svx/flagsdef.hxx>
34 ScCharDlg::ScCharDlg( vcl::Window* pParent, const SfxItemSet* pAttr,
35 const SfxObjectShell* pDocShell )
36 : SfxTabDialog(pParent, "CharDialog",
37 "modules/scalc/ui/chardialog.ui", pAttr)
38 , rDocShell(*pDocShell)
39 , m_nNamePageId(0)
40 , m_nEffectsPageId(0)
42 m_nNamePageId = AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
43 m_nEffectsPageId = AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS);
44 AddTabPage("position", RID_SVXPAGE_CHAR_POSITION);
47 void ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
49 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
50 if (nId == m_nNamePageId)
52 SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(
53 ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
55 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
56 rPage.PageCreated(aSet);
58 else if (nId == m_nEffectsPageId)
60 aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
61 rPage.PageCreated(aSet);
65 ScParagraphDlg::ScParagraphDlg(vcl::Window* pParent, const SfxItemSet* pAttr)
66 : SfxTabDialog(pParent, "ParagraphDialog",
67 "modules/scalc/ui/paradialog.ui", pAttr)
68 , m_nTabPageId(0)
70 AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
71 AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH);
72 SvtCJKOptions aCJKOptions;
73 if (aCJKOptions.IsAsianTypographyEnabled() )
74 AddTabPage("labelTP_PARA_ASIAN", RID_SVXPAGE_PARA_ASIAN);
75 else
76 RemoveTabPage("labelTP_PARA_ASIAN");
77 m_nTabPageId = AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
80 void ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
82 if (nId == m_nTabPageId)
84 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
85 TabulatorDisableFlags nFlags((TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft) |
86 (TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone));
87 aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_DISABLEFLAGS, (sal_uInt16)nFlags));
88 rPage.PageCreated(aSet);
92 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */