Stop leaking all ScPostIt instances.
[LibreOffice.git] / sc / source / ui / miscdlgs / textdlgs.cxx
blobe906949718c56df4e4da08c15193ad0fc6018fe4
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>
33 // -----------------------------------------------------------------------
35 ScCharDlg::ScCharDlg( Window* pParent, const SfxItemSet* pAttr,
36 const SfxObjectShell* pDocShell ) :
37 SfxTabDialog ( pParent, ScResId( RID_SCDLG_CHAR ), pAttr ),
38 rDocShell ( *pDocShell )
40 FreeResource();
42 AddTabPage( RID_SVXPAGE_CHAR_NAME );
43 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
44 AddTabPage( RID_SVXPAGE_CHAR_POSITION );
47 // -----------------------------------------------------------------------
49 void ScCharDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
51 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
52 switch( nId )
54 case RID_SVXPAGE_CHAR_NAME:
56 SvxFontListItem aItem(*( (const SvxFontListItem*)
57 ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
59 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
60 rPage.PageCreated(aSet);
62 break;
64 case RID_SVXPAGE_CHAR_EFFECTS:
65 aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
66 rPage.PageCreated(aSet);
67 break;
69 default:
70 break;
74 // -----------------------------------------------------------------------
76 ScParagraphDlg::ScParagraphDlg( Window* pParent, const SfxItemSet* pAttr ) :
77 SfxTabDialog ( pParent, ScResId( RID_SCDLG_PARAGRAPH ), pAttr )
79 FreeResource();
81 SvtCJKOptions aCJKOptions;
83 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
84 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
85 if ( aCJKOptions.IsAsianTypographyEnabled() )
86 AddTabPage( RID_SVXPAGE_PARA_ASIAN);
87 else
88 RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
89 AddTabPage( RID_SVXPAGE_TABULATOR );
92 // -----------------------------------------------------------------------
94 void ScParagraphDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
96 switch( nId )
98 case RID_SVXPAGE_TABULATOR:
100 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
101 aSet.Put(SfxUInt16Item(SID_SVXTABULATORTABPAGE_CONTROLFLAGS,(TABTYPE_ALL &~TABTYPE_LEFT) |
102 (TABFILL_ALL &~TABFILL_NONE) ));
103 rPage.PageCreated(aSet);
105 break;
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */