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 .
21 #include <svx/dialogs.hrc>
22 #include <svx/svxids.hrc>
23 #include <svx/flagsdef.hxx>
24 #include <svx/svxdlg.hxx>
25 #include <editeng/svxenum.hxx>
26 #include <dlgpage.hxx>
27 #include <strings.hrc>
28 #include <svl/intitem.hxx>
29 #include <svl/cjkoptions.hxx>
30 #include <svl/aeitem.hxx>
31 #include <osl/diagnose.h>
35 /*************************************************************************
37 |* constructor of the tab dialogs: Add the page to the dialog
39 \************************************************************************/
41 ORptPageDialog::ORptPageDialog(weld::Window
* pParent
, const SfxItemSet
* pAttr
, const OUString
&rDialog
)
42 : SfxTabDialogController(pParent
, "modules/dbreport/ui/" +
43 rDialog
.toAsciiLowerCase() + ".ui", rDialog
.toUtf8(), pAttr
)
45 SfxAbstractDialogFactory
* pFact
= SfxAbstractDialogFactory::Create();
47 if (rDialog
== "BackgroundDialog")
49 AddTabPage("background", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND
), nullptr );
51 else if (rDialog
== "PageDialog")
53 AddTabPage("page", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_PAGE
), nullptr );
54 AddTabPage("background", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND
), nullptr );
56 else if (rDialog
== "CharDialog")
58 AddTabPage("font", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_NAME
), nullptr );
59 AddTabPage("fonteffects", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS
), nullptr );
60 AddTabPage("position", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION
), nullptr );
61 AddTabPage("asianlayout", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES
), nullptr );
62 AddTabPage("background", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND
), nullptr );
63 AddTabPage("alignment", pFact
->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT
), nullptr );
66 OSL_FAIL("Unknown page id");
68 SvtCJKOptions aCJKOptions
;
69 if ( !aCJKOptions
.IsDoubleLinesEnabled() )
70 RemoveTabPage("asianlayout");
73 void ORptPageDialog::PageCreated(const OString
& rId
, SfxTabPage
&rPage
)
75 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
76 if (rId
== "background")
78 aSet
.Put(SfxUInt32Item(SID_FLAG_TYPE
,static_cast<sal_uInt32
>(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING
)));
79 rPage
.PageCreated(aSet
);
86 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */