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 #include <svx/dialogs.hrc>
21 #include <editeng/flstitem.hxx>
22 #include <svx/flagsdef.hxx>
23 #include <sfx2/objsh.hxx>
24 #include <svx/svxdlg.hxx>
26 #include <dlg_char.hxx>
27 #include <svx/svxids.hrc>
28 #include <svl/intitem.hxx>
31 * Constructor of tab dialog: append pages to dialog
33 SdCharDlg::SdCharDlg( vcl::Window
* pParent
, const SfxItemSet
* pAttr
,
34 const SfxObjectShell
* pDocShell
) :
35 SfxTabDialog ( pParent
37 ,"modules/sdraw/ui/drawchardialog.ui"
39 rDocShell ( *pDocShell
)
42 SfxAbstractDialogFactory
* pFact
= SfxAbstractDialogFactory::Create();
43 OSL_ENSURE(pFact
, "Dialog creation failed!");
45 mnCharName
= AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME
), nullptr );
46 mnCharEffects
= AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS
), nullptr );
47 AddTabPage( "RID_SVXPAGE_CHAR_POSITION", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION
), nullptr );
48 mnCharBackground
= AddTabPage( "RID_SVXPAGE_BACKGROUND", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND
), nullptr );
51 void SdCharDlg::PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
)
53 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
54 if (nId
== mnCharName
)
56 SvxFontListItem
aItem(* static_cast<const SvxFontListItem
*>( rDocShell
.GetItem( SID_ATTR_CHAR_FONTLIST
) ) );
58 aSet
.Put (SvxFontListItem( aItem
.GetFontList(), SID_ATTR_CHAR_FONTLIST
));
59 rPage
.PageCreated(aSet
);
61 else if (nId
== mnCharEffects
)
63 rPage
.PageCreated(aSet
);
65 else if (nId
== mnCharBackground
)
67 aSet
.Put(SfxUInt32Item(SID_FLAG_TYPE
,static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR
)));
68 rPage
.PageCreated(aSet
);
72 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */