tdf#130857 qt weld: Implement QtInstanceWidget::get_text_height
[LibreOffice.git] / cui / source / dialogs / sdrcelldlg.cxx
blobdce598ec961da5a60d36e5b2c6b4f17b7acdf03c
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& rAttr, const SdrModel& rModel, bool bStyle)
32 : SfxTabDialogController(pParent, u"cui/ui/formatcellsdialog.ui"_ustr, u"FormatCellsDialog"_ustr, &rAttr, bStyle)
33 , mrOutAttrs(rAttr)
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(u"name"_ustr, RID_SVXPAGE_CHAR_NAME);
42 AddTabPage(u"effects"_ustr, RID_SVXPAGE_CHAR_EFFECTS);
43 AddTabPage(u"border"_ustr, RID_SVXPAGE_BORDER );
44 AddTabPage(u"area"_ustr, RID_SVXPAGE_AREA);
46 if (bStyle)
48 AddTabPage(u"position"_ustr, RID_SVXPAGE_CHAR_POSITION);
49 AddTabPage(u"highlight"_ustr, RID_SVXPAGE_BKG);
50 AddTabPage(u"indentspacing"_ustr, RID_SVXPAGE_STD_PARAGRAPH);
51 AddTabPage(u"alignment"_ustr, SvxParaAlignTabPage::Create, SvxParaAlignTabPage::GetSdrRanges);
52 RemoveTabPage(u"shadow"_ustr);
54 else
56 RemoveTabPage(u"position"_ustr);
57 RemoveTabPage(u"highlight"_ustr);
58 RemoveTabPage(u"indentspacing"_ustr);
59 RemoveTabPage(u"alignment"_ustr);
60 AddTabPage(u"shadow"_ustr, SvxShadowTabPage::Create, nullptr);
61 RemoveStandardButton();
64 if (bStyle && SvtCJKOptions::IsAsianTypographyEnabled())
65 AddTabPage(u"asian"_ustr, RID_SVXPAGE_PARA_ASIAN);
66 else
67 RemoveTabPage(u"asian"_ustr);
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: */