Line data Source code
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 : #include <svx/dialogs.hrc>
21 : #include <editeng/flstitem.hxx>
22 : #include <svx/flagsdef.hxx>
23 : #include <sfx2/objsh.hxx>
24 : #include <svx/svxdlg.hxx>
25 :
26 : #include "sdresid.hxx"
27 : #include "dlg_char.hxx"
28 : #include <svx/svxids.hrc>
29 : #include <svl/intitem.hxx>
30 :
31 : /**
32 : * Constructor of tab dialog: append pages to dialog
33 : */
34 0 : SdCharDlg::SdCharDlg( vcl::Window* pParent, const SfxItemSet* pAttr,
35 : const SfxObjectShell* pDocShell ) :
36 : SfxTabDialog ( pParent
37 : ,"DrawCharDialog"
38 : ,"modules/sdraw/ui/drawchardialog.ui"
39 : , pAttr ),
40 0 : rDocShell ( *pDocShell )
41 : {
42 :
43 0 : SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
44 : OSL_ENSURE(pFact, "Dialog creation failed!");
45 :
46 0 : mnCharName = AddTabPage( "RID_SVXPAGE_CHAR_NAME", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME ), 0 );
47 0 : mnCharEffects = AddTabPage( "RID_SVXPAGE_CHAR_EFFECTS", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), 0 );
48 0 : mnCharPosition = AddTabPage( "RID_SVXPAGE_CHAR_POSITION", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), 0 );
49 0 : }
50 :
51 0 : void SdCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
52 : {
53 0 : SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
54 0 : if (nId == mnCharName)
55 : {
56 0 : SvxFontListItem aItem(*( (const SvxFontListItem*) ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
57 :
58 0 : aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
59 0 : rPage.PageCreated(aSet);
60 : }
61 0 : else if (nId == mnCharEffects)
62 : {
63 0 : aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
64 0 : rPage.PageCreated(aSet);
65 0 : }
66 0 : }
67 :
68 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|