LibreOffice Module sc (master) 1
textdlgs.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#undef SC_DLLIMPLEMENTATION
21
22#include <svx/svxids.hrc>
23#include <svx/dialogs.hrc>
24
25#include <editeng/flstitem.hxx>
26#include <sfx2/objsh.hxx>
27#include <svl/cjkoptions.hxx>
28
29#include <textdlgs.hxx>
30#include <svl/intitem.hxx>
31#include <svx/flagsdef.hxx>
32
33ScCharDlg::ScCharDlg(weld::Window* pParent, const SfxItemSet* pAttr, const SfxObjectShell* pDocShell, bool bDrawText)
34 : SfxTabDialogController(pParent, "modules/scalc/ui/chardialog.ui", "CharDialog", pAttr)
35 , rDocShell(*pDocShell)
36{
37 AddTabPage("font", RID_SVXPAGE_CHAR_NAME);
38 AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS);
39 AddTabPage("position", RID_SVXPAGE_CHAR_POSITION);
40
41 if (bDrawText)
42 AddTabPage("background", RID_SVXPAGE_BKG);
43 else
44 RemoveTabPage("background");
45}
46
47void ScCharDlg::PageCreated(const OUString& rId, SfxTabPage &rPage)
48{
49 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
50 if (rId == "font")
51 {
52 SvxFontListItem aItem(*static_cast<const SvxFontListItem*>(
53 ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
54
55 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
56 rPage.PageCreated(aSet);
57 }
58 else if (rId == "fonteffects")
59 {
60 aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
61 rPage.PageCreated(aSet);
62 }
63 else if (rId == "background")
64 {
65 aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
66 rPage.PageCreated(aSet);
67 }
68}
69
71 : SfxTabDialogController(pParent, "modules/scalc/ui/paradialog.ui", "ParagraphDialog", pAttr)
72{
73 AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH);
74 AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH);
76 AddTabPage("labelTP_PARA_ASIAN", RID_SVXPAGE_PARA_ASIAN);
77 else
78 RemoveTabPage("labelTP_PARA_ASIAN");
79 AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
80}
81
82void ScParagraphDlg::PageCreated(const OUString& rId, SfxTabPage &rPage)
83{
84 if (rId == "labelTP_TABULATOR")
85 {
86 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
87 TabulatorDisableFlags const nFlags((TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft) |
88 (TabulatorDisableFlags::FillMask &~TabulatorDisableFlags::FillNone));
89 aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_DISABLEFLAGS, static_cast<sal_uInt16>(nFlags)));
90 rPage.PageCreated(aSet);
91 }
92}
93
94/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScCharDlg(weld::Window *pParent, const SfxItemSet *pAttr, const SfxObjectShell *pDocShell, bool bDrawText)
Definition: textdlgs.cxx:33
const SfxObjectShell & rDocShell
Definition: textdlgs.hxx:29
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: textdlgs.cxx:47
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
Definition: textdlgs.cxx:82
ScParagraphDlg(weld::Window *pParent, const SfxItemSet *pAttr)
Definition: textdlgs.cxx:70
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
void RemoveTabPage(const OUString &rName)
SfxItemSet * GetInputSetImpl()
virtual void PageCreated(const SfxAllItemSet &aSet)
const FontList * GetFontList() const
#define DISABLE_CASEMAP
TabulatorDisableFlags
bool IsAsianTypographyEnabled()