summaryrefslogtreecommitdiff
path: root/cui/source/dialogs
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2022-10-04 16:05:06 +0300
committerMaxim Monastirsky <momonasmon@gmail.com>2022-11-19 18:13:54 +0100
commit553cfbfc9e74a03fe02a58e9aa6076fc1dddeb7b (patch)
treea33fe5384144e737ff9f2527e9f4bd4a078f9fb9 /cui/source/dialogs
parentbac26f91ae930902c336b1e5ceb08e1ae5de8d8a (diff)
Prepare the dialog for cell style editing
Change-Id: I54ec1486f49f240e1ab88662b9d1b0b741cf8878 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142905 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'cui/source/dialogs')
-rw-r--r--cui/source/dialogs/sdrcelldlg.cxx43
1 files changed, 40 insertions, 3 deletions
diff --git a/cui/source/dialogs/sdrcelldlg.cxx b/cui/source/dialogs/sdrcelldlg.cxx
index fda8b4ce1385..3afbc0f694d3 100644
--- a/cui/source/dialogs/sdrcelldlg.cxx
+++ b/cui/source/dialogs/sdrcelldlg.cxx
@@ -21,10 +21,15 @@
#include <cuitabarea.hxx>
#include <svx/svdmodel.hxx>
#include <border.hxx>
+#include <paragrph.hxx>
+#include <svl/intitem.hxx>
+#include <svl/cjkoptions.hxx>
+#include <svx/flagsdef.hxx>
+#include <svx/svxids.hrc>
#include <svx/dialogs.hrc>
-SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel)
- : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr)
+SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemSet* pAttr, const SdrModel& rModel, bool bStyle)
+ : SfxTabDialogController(pParent, "cui/ui/formatcellsdialog.ui", "FormatCellsDialog", pAttr, bStyle)
, mrOutAttrs(*pAttr)
, mpColorTab(rModel.GetColorList())
, mnColorTabState ( ChangeType::NONE )
@@ -37,7 +42,29 @@ SvxFormatCellsDialog::SvxFormatCellsDialog(weld::Window* pParent, const SfxItemS
AddTabPage("effects", RID_SVXPAGE_CHAR_EFFECTS);
AddTabPage("border", RID_SVXPAGE_BORDER );
AddTabPage("area", RID_SVXPAGE_AREA);
- AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
+
+ if (bStyle)
+ {
+ AddTabPage("position", RID_SVXPAGE_CHAR_POSITION);
+ AddTabPage("highlight", RID_SVXPAGE_BKG);
+ AddTabPage("indentspacing", RID_SVXPAGE_STD_PARAGRAPH);
+ AddTabPage("alignment", SvxParaAlignTabPage::Create, SvxParaAlignTabPage::GetSdrRanges);
+ RemoveTabPage("shadow");
+ }
+ else
+ {
+ RemoveTabPage("position");
+ RemoveTabPage("highlight");
+ RemoveTabPage("indentspacing");
+ RemoveTabPage("alignment");
+ AddTabPage("shadow", SvxShadowTabPage::Create, nullptr);
+ RemoveStandardButton();
+ }
+
+ if (bStyle && SvtCJKOptions::IsAsianTypographyEnabled())
+ AddTabPage("asian", RID_SVXPAGE_PARA_ASIAN);
+ else
+ RemoveTabPage("asian");
}
void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
@@ -62,6 +89,16 @@ void SvxFormatCellsDialog::PageCreated(const OString& rId, SfxTabPage &rPage)
static_cast<SvxShadowTabPage&>(rPage).SetColorList( mpColorTab );
static_cast<SvxShadowTabPage&>(rPage).SetColorChgd( &mnColorTabState );
}
+ else if (rId == "alignment")
+ {
+ static_cast<SvxParaAlignTabPage&>(rPage).EnableSdrVertAlign();
+ }
+ else if (rId == "highlight")
+ {
+ SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
+ aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast<sal_uInt32>(SvxBackgroundTabFlags::SHOW_CHAR_BKGCOLOR)));
+ rPage.PageCreated(aSet);
+ }
else
SfxTabDialogController::PageCreated(rId, rPage);
}