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 "fmtextcontroldialogs.hxx"
21 #include <svx/dialmgr.hxx>
22 #include <svx/dialogs.hrc>
24 #include <editeng/eeitem.hxx>
26 #include "svx/flagsdef.hxx"
27 #include <svl/intitem.hxx>
29 #include <com/sun/star/uno/Sequence.hxx>
30 #include <svl/cjkoptions.hxx>
38 //= TextControlCharAttribDialog
41 TextControlCharAttribDialog::TextControlCharAttribDialog( Window
* pParent
, const SfxItemSet
& _rCoreSet
, const SvxFontListItem
& _rFontList
)
42 : SfxTabDialog( pParent
, "TextControlCharacterPropertiesDialog",
43 "svx/ui/textcontrolchardialog.ui", &_rCoreSet
)
44 , m_aFontList(_rFontList
)
45 , m_nCharNamePageId(0)
46 , m_nCharEffectsPageId(0)
47 , m_nCharPositionPageId(0)
49 m_nCharNamePageId
= AddTabPage("font", RID_SVXPAGE_CHAR_NAME
);
50 m_nCharEffectsPageId
= AddTabPage("fonteffects", RID_SVXPAGE_CHAR_EFFECTS
);
51 m_nCharPositionPageId
= AddTabPage("position", RID_SVXPAGE_CHAR_POSITION
);
54 void TextControlCharAttribDialog::PageCreated( sal_uInt16 _nId
, SfxTabPage
& _rPage
)
56 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
58 if (_nId
== m_nCharNamePageId
)
60 aSet
.Put (m_aFontList
);
61 _rPage
.PageCreated(aSet
);
63 else if (_nId
== m_nCharEffectsPageId
)
65 aSet
.Put (SfxUInt16Item(SID_DISABLE_CTL
,DISABLE_CASEMAP
));
66 _rPage
.PageCreated(aSet
);
68 else if (_nId
== m_nCharPositionPageId
)
70 aSet
.Put( SfxUInt32Item(SID_FLAG_TYPE
, SVX_PREVIEW_CHARACTER
) );
71 _rPage
.PageCreated(aSet
);
75 TextControlParaAttribDialog::TextControlParaAttribDialog(Window
* _pParent
,
76 const SfxItemSet
& _rCoreSet
)
77 : SfxTabDialog( _pParent
, "TextControlParagraphPropertiesDialog",
78 "svx/ui/textcontrolparadialog.ui", &_rCoreSet
)
80 AddTabPage("labelTP_PARA_STD", RID_SVXPAGE_STD_PARAGRAPH
);
81 AddTabPage("labelTP_PARA_ALIGN", RID_SVXPAGE_ALIGN_PARAGRAPH
);
83 SvtCJKOptions aCJKOptions
;
84 if( aCJKOptions
.IsAsianTypographyEnabled() )
85 AddTabPage("labelTP_PARA_ASIAN", RID_SVXPAGE_PARA_ASIAN
);
87 RemoveTabPage("labelTP_PARA_ASIAN");
89 AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR
);
95 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */