android: Update app-specific/MIME type icons
[LibreOffice.git] / cui / source / dialogs / sdrcelldlg.cxx
blobc5c4d22e162c8bf765142f4a4bbef394165ac26e
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 #include <sdrcelldlg.hxx>
21 #include <cuitabarea.hxx>
22 #include <svx/svdmodel.hxx>
23 #include <border.hxx>
24 #include <paragrph.hxx>
25 #include <svl/intitem.hxx>
26 #include <svl/cjkoptions.hxx>
27 #include <svx/flagsdef.hxx>
28 #include <svx/svxids.hrc>
29 #include <svx/dialogs.hrc>
31 SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle)
32 : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr, bStyle)
33 , mrOutAttrs(*pAttr)
34 , mpColorTab(rModel.GetColorList())
35 , mnColorTabState ( ChangeType::NONE )
36 , mpGradientList(rModel.GetGradientList())
37 , mpHatchingList(rModel.GetHatchList())
38 , mpBitmapList(rModel.GetBitmapList())
39 , mpPatternList(rModel.GetPatternList())
41 AddTabPage("name", RID_SVXPAGE_CHAR_NAME);
42 AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
43 AddTabPage("border", RID_SVXPAGE_BORDER );
44 AddTabPage("area", RID_SVXPAGE_AREA);
46 if (bStyle)
48 AddTabPage("position", RID_SVXPAGE_CHAR_POSITION);
49 AddTabPage("highlight", RID_SVXPAGE_BKG);
50 AddTabPage("indentspacing", RID_SVXPAGE_STD_PARAGRAPH);
51 AddTabPage("alignment", SvxParaAlignTabPage::Create, SvxParaAlignTabPage::GetSdrRanges);
52 RemoveTabPage("shadow");
54 else
56 RemoveTabPage("position");
57 RemoveTabPage("highlight");
58 RemoveTabPage("indentspacing");
59 RemoveTabPage("alignment");
60 AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
61 RemoveStandardButton();
64 if (bStyle && SvtCJKOptions::IsAsianTypographyEnabled())
65 AddTabPage("asian", RID_SVXPAGE_PARA_ASIAN);
66 else
67 RemoveTabPage("asian");
70 void SvxFormatCellsDialog::PageCreated(const OUString& rId, SfxTabPage &rPage)
72 if (rId == "area")
74 SvxAreaTabPage& rAreaPage = static_cast<SvxAreaTabPage&>(rPage);
75 rAreaPage.SetColorList( mpColorTab );
76 rAreaPage.SetGradientList( mpGradientList );
77 rAreaPage.SetHatchingList( mpHatchingList );
78 rAreaPage.SetBitmapList( mpBitmapList );
79 rAreaPage.SetPatternList( mpPatternList );
80 rAreaPage.ActivatePage( mrOutAttrs );
82 else if (rId == "border")
84 SvxBorderTabPage& rBorderPage = static_cast<SvxBorderTabPage&>(rPage);
85 rBorderPage.SetTableMode();
87 else if (rId == "shadow")
89 static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorTab );
90 static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorTabState );
92 else if (rId == "alignment")
94 static_cast<SvxParaAlignTabPage&>(rPage).EnableSdrVertAlign();
96 else if (rId == "highlight")
98 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
99 aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
100 rPage.PageCreated(aSet);
102 else
103 SfxTabDialogController::PageCreated(rId, rPage);
106 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */