1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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>
23 #include <svx/dialogs.hrc>
25 #include <editeng/flstitem.hxx>
26 #include <sfx2/objsh.hxx>
27 #include <svl/cjkoptions.hxx>
29 #include <textdlgs.hxx>
30 #include <svl/intitem.hxx>
31 #include <svx/flagsdef.hxx>
33 ScCharDlg::ScCharDlg(weld::Window
* pParent
, const SfxItemSet
* pAttr
, const SfxObjectShell
* pDocShell
, bool bDrawText
)
34 : SfxTabDialogController(pParent
, u
"modules/scalc/ui/chardialog.ui"_ustr
, u
"CharDialog"_ustr
, pAttr
)
35 , m_rDocShell(*pDocShell
)
36 , m_bDrawText(bDrawText
)
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 AddTabPage(u
"background"_ustr
, RID_SVXPAGE_BKG
);
45 RemoveTabPage(u
"background"_ustr
);
48 void ScCharDlg::PageCreated(const OUString
& rId
, SfxTabPage
&rPage
)
50 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
53 SvxFontListItem
aItem(*static_cast<const SvxFontListItem
*>(
54 ( m_rDocShell
.GetItem( SID_ATTR_CHAR_FONTLIST
) ) ) );
56 aSet
.Put (SvxFontListItem( aItem
.GetFontList(), SID_ATTR_CHAR_FONTLIST
));
57 rPage
.PageCreated(aSet
);
59 else if (rId
== "fonteffects")
61 // Allow CaseMap in drawings, but not in normal text
63 aSet
.Put (SfxUInt16Item(SID_DISABLE_CTL
,DISABLE_CASEMAP
));
64 rPage
.PageCreated(aSet
);
66 else if (rId
== "background")
68 aSet
.Put (SfxUInt32Item(SID_FLAG_TYPE
, static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR
)));
69 rPage
.PageCreated(aSet
);
73 ScParagraphDlg::ScParagraphDlg(weld::Window
* pParent
, const SfxItemSet
* pAttr
)
74 : SfxTabDialogController(pParent
, u
"modules/scalc/ui/paradialog.ui"_ustr
, u
"ParagraphDialog"_ustr
, pAttr
)
76 AddTabPage(u
"labelTP_PARA_STD"_ustr
, RID_SVXPAGE_STD_PARAGRAPH
);
77 AddTabPage(u
"labelTP_PARA_ALIGN"_ustr
, RID_SVXPAGE_ALIGN_PARAGRAPH
);
78 if (SvtCJKOptions::IsAsianTypographyEnabled() )
79 AddTabPage(u
"labelTP_PARA_ASIAN"_ustr
, RID_SVXPAGE_PARA_ASIAN
);
81 RemoveTabPage(u
"labelTP_PARA_ASIAN"_ustr
);
82 AddTabPage(u
"labelTP_TABULATOR"_ustr
, RID_SVXPAGE_TABULATOR
);
85 void ScParagraphDlg::PageCreated(const OUString
& rId
, SfxTabPage
&rPage
)
87 if (rId
== "labelTP_TABULATOR")
89 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
90 TabulatorDisableFlags
const nFlags((TabulatorDisableFlags::TypeMask
&~TabulatorDisableFlags::TypeLeft
) |
91 (TabulatorDisableFlags::FillMask
&~TabulatorDisableFlags::FillNone
));
92 aSet
.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_DISABLEFLAGS
, static_cast<sal_uInt16
>(nFlags
)));
93 rPage
.PageCreated(aSet
);
97 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */