From 705226338beeabd214f260c00f1a6db2cfb52475 Mon Sep 17 00:00:00 2001 From: Heiko Tietze Date: Tue, 1 Sep 2020 10:45:05 +0200 Subject: [PATCH] Resolves tdf#97918 - Individual UNO commands for distribution options New UNO commands added, SID_DISTRIBUTE_DLG bend to dropdown, ui removed Menus and toolbars adjusted Change-Id: Ic0a3cc299f745a1a0cd18edead1f410ff57a1f1f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102272 Tested-by: Jenkins Reviewed-by: Maxim Monastirsky --- cui/Library_cui.mk | 1 - cui/UIConfig_cui.mk | 2 - cui/qa/unit/data/cui-dialogs-test.txt | 2 - cui/source/factory/dlgfact.cxx | 21 - cui/source/factory/dlgfact.hxx | 18 - cui/source/inc/dstribut.hxx | 69 --- cui/source/tabpages/dstribut.cxx | 152 ------ cui/uiconfig/ui/distributiondialog.ui | 90 ---- cui/uiconfig/ui/distributionpage.ui | 439 ------------------ include/svx/svdedtv.hxx | 2 +- include/svx/svxdlg.hxx | 12 - include/svx/svxids.hrc | 10 +- .../org/openoffice/Office/UI/Controller.xcu | 28 ++ .../openoffice/Office/UI/DrawWindowState.xcu | 11 + .../openoffice/Office/UI/GenericCommands.xcu | 110 ++++- .../Office/UI/ImpressWindowState.xcu | 11 + .../openoffice/Office/UI/ReportCommands.xcu | 5 - reportdesign/UIConfig_dbreport.mk | 1 + reportdesign/inc/rptui_slotid.hrc | 2 +- .../source/ui/report/ReportController.cxx | 31 +- .../uiconfig/dbreport/menubar/menubar.xml | 2 +- .../uiconfig/dbreport/popupmenu/report.xml | 2 +- .../dbreport/toolbar/distributebar.xml | 21 + sd/UIConfig_sdraw.mk | 1 + sd/UIConfig_simpress.mk | 1 + sd/sdi/_drvwsh.sdi | 40 ++ sd/source/ui/view/drviews2.cxx | 12 +- sd/source/ui/view/drviewsj.cxx | 28 +- sd/uiconfig/sdraw/toolbar/distributebar.xml | 21 + .../sdraw/toolbar/drawingobjectbar.xml | 2 - .../simpress/toolbar/distributebar.xml | 21 + .../simpress/toolbar/drawingobjectbar.xml | 2 - solenv/clang-format/excludelist | 2 - svx/sdi/svx.sdi | 137 +++++- svx/source/svdraw/svdedtv2.cxx | 26 +- 35 files changed, 484 insertions(+), 851 deletions(-) delete mode 100644 cui/source/inc/dstribut.hxx delete mode 100644 cui/source/tabpages/dstribut.cxx delete mode 100644 cui/uiconfig/ui/distributiondialog.ui delete mode 100644 cui/uiconfig/ui/distributionpage.ui create mode 100644 reportdesign/uiconfig/dbreport/toolbar/distributebar.xml create mode 100644 sd/uiconfig/sdraw/toolbar/distributebar.xml create mode 100644 sd/uiconfig/simpress/toolbar/distributebar.xml diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk index 583cc5c74346..ec2d222a34d9 100644 --- a/cui/Library_cui.mk +++ b/cui/Library_cui.mk @@ -199,7 +199,6 @@ $(eval $(call gb_Library_add_exception_objects,cui,\ cui/source/tabpages/border \ cui/source/tabpages/chardlg \ cui/source/tabpages/connect \ - cui/source/tabpages/dstribut \ cui/source/tabpages/grfpage \ cui/source/tabpages/labdlg \ cui/source/tabpages/macroass \ diff --git a/cui/UIConfig_cui.mk b/cui/UIConfig_cui.mk index 62291eff5acf..a6dcd3bfb88f 100644 --- a/cui/UIConfig_cui.mk +++ b/cui/UIConfig_cui.mk @@ -64,8 +64,6 @@ $(eval $(call gb_UIConfig_add_uifiles,cui,\ cui/uiconfig/ui/gradientpage \ cui/uiconfig/ui/customizedialog \ cui/uiconfig/ui/dbregisterpage \ - cui/uiconfig/ui/distributiondialog \ - cui/uiconfig/ui/distributionpage \ cui/uiconfig/ui/effectspage \ cui/uiconfig/ui/eventsconfigpage \ cui/uiconfig/ui/formatcellsdialog \ diff --git a/cui/qa/unit/data/cui-dialogs-test.txt b/cui/qa/unit/data/cui-dialogs-test.txt index f85ce1d12514..ee0413efcc37 100644 --- a/cui/qa/unit/data/cui-dialogs-test.txt +++ b/cui/qa/unit/data/cui-dialogs-test.txt @@ -88,8 +88,6 @@ cui/ui/customizedialog.ui cui/ui/databaselinkdialog.ui cui/ui/dbregisterpage.ui cui/ui/dimensionlinestabpage.ui -cui/ui/distributiondialog.ui -cui/ui/distributionpage.ui cui/ui/editdictionarydialog.ui cui/ui/editmodulesdialog.ui cui/ui/effectspage.ui diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 01925f1fdb0a..731303dc50a3 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -110,11 +109,6 @@ short CuiAbstractSingleTabController_Impl::Execute() return m_xDlg->run(); } -short AbstractSvxDistributeDialog_Impl::Execute() -{ - return m_xDlg->run(); -} - short AbstractHangulHanjaConversionDialog_Impl::Execute() { return m_xDlg->run(); @@ -397,15 +391,6 @@ void CuiAbstractSingleTabController_Impl::SetText(const OUString& rStr) m_xDlg->set_title(rStr); } -SvxDistributeHorizontal AbstractSvxDistributeDialog_Impl::GetDistributeHor()const -{ - return m_xDlg->GetDistributeHor(); -} -SvxDistributeVertical AbstractSvxDistributeDialog_Impl::GetDistributeVer()const -{ - return m_xDlg->GetDistributeVer(); -} - void AbstractHangulHanjaConversionDialog_Impl::EndDialog(sal_Int32 nResult) { m_xDlg->response(nResult); @@ -1075,12 +1060,6 @@ VclPtr AbstractDialogFactory_Impl::CreateCaptionDialog return VclPtr::Create(std::make_shared(pParent, pView, nAnchorTypes)); } -VclPtr AbstractDialogFactory_Impl::CreateSvxDistributeDialog(weld::Window* pParent, - const SfxItemSet& rAttr) -{ - return VclPtr::Create(std::make_unique(pParent, rAttr, SvxDistributeHorizontal::NONE, SvxDistributeVertical::NONE)); -} - VclPtr AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(weld::Window* pParent) { return VclPtr::Create(std::make_unique(pParent)); diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index d0072f6349c9..fd11ee459d73 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -38,7 +38,6 @@ #include #include #include -#include #include #include #include @@ -162,21 +161,6 @@ public: virtual OString GetScreenshotId() const override; }; -class SvxDistributeDialog; -class AbstractSvxDistributeDialog_Impl: public AbstractSvxDistributeDialog -{ - std::unique_ptr m_xDlg; -public: - explicit AbstractSvxDistributeDialog_Impl(std::unique_ptr p) - : m_xDlg(std::move(p)) - { - } - virtual short Execute() override; -public: - virtual SvxDistributeHorizontal GetDistributeHor() const override; - virtual SvxDistributeVertical GetDistributeVer() const override; -}; - class AbstractHangulHanjaConversionDialog_Impl: public AbstractHangulHanjaConversionDialog { private: @@ -799,8 +783,6 @@ public: CreateCaptionDialog(weld::Window* pParent, const SdrView* pView, SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override; - virtual VclPtr - CreateSvxDistributeDialog(weld::Window* pParent, const SfxItemSet& rAttr) override; virtual VclPtr CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommand, const css::uno::Reference < css::embed::XStorage >& xStor, diff --git a/cui/source/inc/dstribut.hxx b/cui/source/inc/dstribut.hxx deleted file mode 100644 index 847f36ba74a2..000000000000 --- a/cui/source/inc/dstribut.hxx +++ /dev/null @@ -1,69 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ -#pragma once - -#include -#include -#include - -class SvxDistributePage : public SfxTabPage -{ - SvxDistributeHorizontal m_eDistributeHor; - SvxDistributeVertical m_eDistributeVer; - - std::unique_ptr m_xBtnHorNone; - std::unique_ptr m_xBtnHorLeft; - std::unique_ptr m_xBtnHorCenter; - std::unique_ptr m_xBtnHorDistance; - std::unique_ptr m_xBtnHorRight; - std::unique_ptr m_xBtnVerNone; - std::unique_ptr m_xBtnVerTop; - std::unique_ptr m_xBtnVerCenter; - std::unique_ptr m_xBtnVerDistance; - std::unique_ptr m_xBtnVerBottom; - -public: - SvxDistributePage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rInAttrs, - SvxDistributeHorizontal eHor, - SvxDistributeVertical eVer); - virtual ~SvxDistributePage() override; - - virtual bool FillItemSet(SfxItemSet*) override; - virtual void Reset(const SfxItemSet*) override; - - SvxDistributeHorizontal GetDistributeHor() const { return m_eDistributeHor; } - SvxDistributeVertical GetDistributeVer() const { return m_eDistributeVer; } -}; - -class SvxDistributeDialog : public SfxSingleTabDialogController -{ - SvxDistributePage* mpPage; - -public: - SvxDistributeDialog(weld::Window* pParent, const SfxItemSet& rAttr, - SvxDistributeHorizontal eHor, - SvxDistributeVertical eVer); - virtual ~SvxDistributeDialog() override; - - SvxDistributeHorizontal GetDistributeHor() const { return mpPage->GetDistributeHor(); } - SvxDistributeVertical GetDistributeVer() const { return mpPage->GetDistributeVer(); } -}; - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/tabpages/dstribut.cxx b/cui/source/tabpages/dstribut.cxx deleted file mode 100644 index e1653ca4d65e..000000000000 --- a/cui/source/tabpages/dstribut.cxx +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (the "License"); you may not use this file - * except in compliance with the License. You may obtain a copy of - * the License at http://www.apache.org/licenses/LICENSE-2.0 . - */ - -#include -#include - -/************************************************************************* -|* -|* Dialog -|* -\************************************************************************/ - -SvxDistributeDialog::SvxDistributeDialog(weld::Window* pParent, - const SfxItemSet& rInAttrs, SvxDistributeHorizontal eHor, - SvxDistributeVertical eVer) - : SfxSingleTabDialogController(pParent, &rInAttrs, "cui/ui/distributiondialog.ui", - "DistributionDialog") -{ - SetTabPage(std::make_unique(get_content_area(), this, rInAttrs, eHor, eVer)); - mpPage = static_cast(GetTabPage()); -} - -SvxDistributeDialog::~SvxDistributeDialog() -{ -} - -/************************************************************************* -|* -|* Tabpage -|* -\************************************************************************/ - -SvxDistributePage::SvxDistributePage(weld::Container* pPage, weld::DialogController* pController, - const SfxItemSet& rInAttrs, SvxDistributeHorizontal eHor, - SvxDistributeVertical eVer) - : SfxTabPage(pPage, pController, "cui/ui/distributionpage.ui", "DistributionPage", - &rInAttrs) - , m_eDistributeHor(eHor) - , m_eDistributeVer(eVer) - , m_xBtnHorNone(m_xBuilder->weld_radio_button("hornone")) - , m_xBtnHorLeft(m_xBuilder->weld_radio_button("horleft")) - , m_xBtnHorCenter(m_xBuilder->weld_radio_button("horcenter")) - , m_xBtnHorDistance(m_xBuilder->weld_radio_button("hordistance")) - , m_xBtnHorRight(m_xBuilder->weld_radio_button("horright")) - , m_xBtnVerNone(m_xBuilder->weld_radio_button("vernone")) - , m_xBtnVerTop(m_xBuilder->weld_radio_button("vertop")) - , m_xBtnVerCenter(m_xBuilder->weld_radio_button("vercenter")) - , m_xBtnVerDistance(m_xBuilder->weld_radio_button("verdistance")) - , m_xBtnVerBottom(m_xBuilder->weld_radio_button("verbottom")) -{ -} - -SvxDistributePage::~SvxDistributePage() -{ -} - -/************************************************************************* -|* -|* read the delivered Item-Set -|* -\************************************************************************/ - -void SvxDistributePage::Reset(const SfxItemSet* ) -{ - m_xBtnHorNone->set_active(false); - m_xBtnHorLeft->set_active(false); - m_xBtnHorCenter->set_active(false); - m_xBtnHorDistance->set_active(false); - m_xBtnHorRight->set_active(false); - - switch(m_eDistributeHor) - { - case SvxDistributeHorizontal::NONE : m_xBtnHorNone->set_active(true); break; - case SvxDistributeHorizontal::Left : m_xBtnHorLeft->set_active(true); break; - case SvxDistributeHorizontal::Center : m_xBtnHorCenter->set_active(true); break; - case SvxDistributeHorizontal::Distance : m_xBtnHorDistance->set_active(true); break; - case SvxDistributeHorizontal::Right : m_xBtnHorRight->set_active(true); break; - } - - m_xBtnVerNone->set_active(false); - m_xBtnVerTop->set_active(false); - m_xBtnVerCenter->set_active(false); - m_xBtnVerDistance->set_active(false); - m_xBtnVerBottom->set_active(false); - - switch(m_eDistributeVer) - { - case SvxDistributeVertical::NONE : m_xBtnVerNone->set_active(true); break; - case SvxDistributeVertical::Top : m_xBtnVerTop->set_active(true); break; - case SvxDistributeVertical::Center : m_xBtnVerCenter->set_active(true); break; - case SvxDistributeVertical::Distance : m_xBtnVerDistance->set_active(true); break; - case SvxDistributeVertical::Bottom : m_xBtnVerBottom->set_active(true); break; - } -} - -/************************************************************************* -|* -|* Fill the delivered Item-Set with dialogbox-attributes -|* -\************************************************************************/ - -bool SvxDistributePage::FillItemSet( SfxItemSet* ) -{ - SvxDistributeHorizontal eDistributeHor(SvxDistributeHorizontal::NONE); - SvxDistributeVertical eDistributeVer(SvxDistributeVertical::NONE); - - if(m_xBtnHorLeft->get_active()) - eDistributeHor = SvxDistributeHorizontal::Left; - else if(m_xBtnHorCenter->get_active()) - eDistributeHor = SvxDistributeHorizontal::Center; - else if(m_xBtnHorDistance->get_active()) - eDistributeHor = SvxDistributeHorizontal::Distance; - else if(m_xBtnHorRight->get_active()) - eDistributeHor = SvxDistributeHorizontal::Right; - - if(m_xBtnVerTop->get_active()) - eDistributeVer = SvxDistributeVertical::Top; - else if(m_xBtnVerCenter->get_active()) - eDistributeVer = SvxDistributeVertical::Center; - else if(m_xBtnVerDistance->get_active()) - eDistributeVer = SvxDistributeVertical::Distance; - else if(m_xBtnVerBottom->get_active()) - eDistributeVer = SvxDistributeVertical::Bottom; - - if(eDistributeHor != m_eDistributeHor || eDistributeVer != m_eDistributeVer) - { - m_eDistributeHor = eDistributeHor; - m_eDistributeVer = eDistributeVer; - return true; - } - - return false; -} - - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/uiconfig/ui/distributiondialog.ui b/cui/uiconfig/ui/distributiondialog.ui deleted file mode 100644 index 03f848b981ed..000000000000 --- a/cui/uiconfig/ui/distributiondialog.ui +++ /dev/null @@ -1,90 +0,0 @@ - - - - - - False - 6 - Distribution - False - True - 0 - 0 - dialog - - - - - - False - vertical - 12 - - - False - end - - - gtk-ok - True - True - True - True - True - True - - - False - True - 0 - - - - - gtk-cancel - True - True - True - True - - - False - True - 1 - - - - - gtk-help - True - True - True - True - - - False - True - 2 - True - - - - - False - True - end - 0 - - - - - - - - - ok - cancel - help - - - diff --git a/cui/uiconfig/ui/distributionpage.ui b/cui/uiconfig/ui/distributionpage.ui deleted file mode 100644 index 1798e901e1cf..000000000000 --- a/cui/uiconfig/ui/distributionpage.ui +++ /dev/null @@ -1,439 +0,0 @@ - - - - - - True - False - 6 - 12 - - - True - False - 12 - - - True - False - 0 - none - - - True - False - 6 - 12 - - - True - False - 6 - 12 - True - - - _None - True - True - False - True - 0 - True - True - - - Does not distribute the objects horizontally. - - - - - 0 - 1 - - - - - _Left - True - True - False - True - 0 - True - hornone - - - Distributes the selected objects, so that the left edges of the objects are evenly spaced from one another. - - - - - 1 - 1 - - - - - _Center - True - True - False - True - 0 - True - hornone - - - Distributes the selected objects, so that the horizontal centers of the objects are evenly spaced from one another. - - - - - 2 - 1 - - - - - _Right - True - True - False - True - 0 - True - hornone - - - Distributes the selected objects, so that the right edges of the objects are evenly spaced from one another. - - - - - 4 - 1 - - - - - True - False - center - center - svx/res/dsth_low.png - - - 1 - 0 - - - - - True - False - center - center - svx/res/dsth_cen.png - - - 2 - 0 - - - - - _Spacing - True - True - False - True - 0 - True - hornone - - - Distributes the selected objects horizontally, so that the objects are evenly spaced from one another. - - - - - 3 - 1 - - - - - True - False - center - center - svx/res/dsth_dst.png - - - 3 - 0 - - - - - True - False - center - center - svx/res/dsth_hig.png - - - 4 - 0 - - - - - - - - - - - - True - False - Horizontal - - - - - - - - 0 - 0 - - - - - True - False - 0 - none - - - True - False - 6 - 12 - - - True - False - 6 - 12 - True - - - N_one - True - True - False - True - 0 - True - - - Does not distribute the objects vertically. - - - - - 0 - 1 - - - - - _Top - True - True - False - True - 0 - True - vernone - - - Distributes the selected objects, so that the top edges of the objects are evenly spaced from one another. - - - - - 1 - 1 - - - - - C_enter - True - True - False - True - 0 - 0.5600000023841858 - True - vernone - - - Distributes the selected objects, so that the vertical centers of the objects are evenly spaced from one another. - - - - - 2 - 1 - - - - - S_pacing - True - True - False - True - 0 - True - vernone - - - Distributes the selected objects vertically, so that the objects are evenly spaced from one another. - - - - - 3 - 1 - - - - - _Bottom - True - True - False - True - 0 - True - vernone - - - Distributes the selected objects, so that the bottom edges of the objects are evenly spaced from one another. - - - - - 4 - 1 - - - - - True - False - center - center - svx/res/dstv_hig.png - - - 1 - 0 - - - - - True - False - center - center - svx/res/dstv_cen.png - - - 2 - 0 - - - - - True - False - center - center - svx/res/dstv_dst.png - - - 3 - 0 - - - - - True - False - center - center - svx/res/dstv_low.png - - - 4 - 0 - - - - - - - - - - - - True - False - Vertical - - - - - - - - 0 - 1 - - - - - 0 - 0 - - - - - Distributes three or more selected objects evenly along the horizontal axis or the vertical axis. You can also evenly distribute the spacing between objects. - - - - - - - - - - - - - - - - - - diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx index 35236d6e2570..5ddf6856bb7f 100644 --- a/include/svx/svdedtv.hxx +++ b/include/svx/svdedtv.hxx @@ -264,7 +264,7 @@ public: void MergeMarkedObjects(SdrMergeMode eMode); // for distribution dialog function - void DistributeMarkedObjects(weld::Window* pParent); + void DistributeMarkedObjects(sal_uInt16 SlotID); // for setting either the width or height of all selected // objects to the width/height of the last selected object diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx index c07db29b516f..df6f6f106c47 100644 --- a/include/svx/svxdlg.hxx +++ b/include/svx/svxdlg.hxx @@ -66,15 +66,6 @@ namespace weld{ class Window; } -class AbstractSvxDistributeDialog :public VclAbstractDialog -{ -protected: - virtual ~AbstractSvxDistributeDialog() override = default; -public: - virtual SvxDistributeHorizontal GetDistributeHor() const = 0; - virtual SvxDistributeVertical GetDistributeVer() const = 0; -}; - class AbstractFmShowColsDialog : public VclAbstractDialog { protected: @@ -334,9 +325,6 @@ public: const SdrView* pView, SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) = 0; - virtual VclPtr CreateSvxDistributeDialog(weld::Window* pParent, - const SfxItemSet& rAttr)= 0; - virtual VclPtr CreateFmShowColsDialog(weld::Window* pParent) = 0; virtual VclPtr CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) = 0; diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc index ead0bd87d48c..c057e16d81d7 100644 --- a/include/svx/svxids.hrc +++ b/include/svx/svxids.hrc @@ -92,9 +92,17 @@ class SvxSetItem; #define SID_POLY_MERGE (SID_SFX_START + 679) #define SID_POLY_SUBSTRACT (SID_SFX_START + 680) #define SID_POLY_INTERSECT (SID_SFX_START + 681) -#define SID_DISTRIBUTE_DLG (SID_SFX_START + 683) +#define SID_DISTRIBUTE_DLG (SID_SFX_START + 683) // dialog replaced by dropdown #define SID_EQUALIZEWIDTH (SID_SFX_START + 684) #define SID_EQUALIZEHEIGHT (SID_SFX_START + 685) +#define SID_DISTRIBUTE_HLEFT (SID_SFX_START + 686) +#define SID_DISTRIBUTE_HCENTER (SID_SFX_START + 687) +#define SID_DISTRIBUTE_HDISTANCE (SID_SFX_START + 688) +#define SID_DISTRIBUTE_HRIGHT (SID_SFX_START + 689) +#define SID_DISTRIBUTE_VTOP (SID_SFX_START + 690) +#define SID_DISTRIBUTE_VCENTER (SID_SFX_START + 691) +#define SID_DISTRIBUTE_VDISTANCE (SID_SFX_START + 692) +#define SID_DISTRIBUTE_VBOTTOM (SID_SFX_START + 693) // StarBase IDs diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu index 01e6172a80c6..10a67fab1140 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/Controller.xcu @@ -520,6 +520,20 @@ com.sun.star.comp.framework.WindowListMenuController + + + .uno:DistributeSelection + + + + + + com.sun.star.comp.framework.ToolbarAsMenuController + + + distributebar + + @@ -1900,6 +1914,20 @@ com.sun.star.comp.framework.GenericPopupToolbarController + + + .uno:DistributeSelection + + + + + + com.sun.star.comp.framework.SubToolBarController + + + distributebar + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu index b1f0b0f292e1..33eb4cb2e8bd 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu @@ -909,6 +909,17 @@ Redaction + + + false + + + false + + + Distribute Selection + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu index 3212c283a6b3..97b8e210924c 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu @@ -4062,14 +4062,6 @@ 9 - - - ~Distribution... - - - 1 - - P~aragraph... @@ -7180,6 +7172,108 @@ 1 + + + ~Distribution + + + Select at least three objects to distribute + + + Distribute Selection + + + 1 + + + + + Distribute Horizontally Left + + + Horizontally ~Left + + + 1 + + + + + Distribute Horizontally Center + + + Horizontally ~Center + + + 1 + + + + + Distribute Horizontally Spacing + + + Horizontally ~Spacing + + + 1 + + + + + Distribute Horizontally Right + + + Horizontally ~Right + + + 1 + + + + + Distribute Vertically Top + + + Vertically ~Top + + + 1 + + + + + Distribute Vertically Center + + + Vertically C~enter + + + 1 + + + + + Distribute Vertically Spacing + + + Vertically S~pacing + + + 1 + + + + + Distribute Vertically Bottom + + + Vertically ~Bottom + + + 1 + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu index b9d1d1545298..bd50af5c8671 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu @@ -1020,6 +1020,17 @@ true + + + false + + + false + + + Distribute Selection + + diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ReportCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ReportCommands.xcu index dc8d802ccd8b..94a0182b3da0 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/ReportCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/ReportCommands.xcu @@ -182,11 +182,6 @@ 1 - - - Distribution... - - ~Select Objects in Section diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk index d04dce4bbd64..89c60a3dab4f 100644 --- a/reportdesign/UIConfig_dbreport.mk +++ b/reportdesign/UIConfig_dbreport.mk @@ -26,6 +26,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/dbreport,\ reportdesign/uiconfig/dbreport/toolbar/arrowshapes \ reportdesign/uiconfig/dbreport/toolbar/basicshapes \ reportdesign/uiconfig/dbreport/toolbar/calloutshapes \ + reportdesign/uiconfig/dbreport/toolbar/distributebar \ reportdesign/uiconfig/dbreport/toolbar/drawbar \ reportdesign/uiconfig/dbreport/toolbar/flowchartshapes \ reportdesign/uiconfig/dbreport/toolbar/Formatting \ diff --git a/reportdesign/inc/rptui_slotid.hrc b/reportdesign/inc/rptui_slotid.hrc index 95dc0019af70..c66fb556efaf 100644 --- a/reportdesign/inc/rptui_slotid.hrc +++ b/reportdesign/inc/rptui_slotid.hrc @@ -29,7 +29,7 @@ #define SID_CONDITIONALFORMATTING ( SID_RPTUI_START + 4 ) #define SID_PAGEDIALOG ( SID_RPTUI_START + 5 ) #define SID_SETCONTROLDEFAULTS ( SID_RPTUI_START + 6 ) -#define SID_DISTRIBUTION ( SID_RPTUI_START + 7 ) + #define SID_PAGEHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 8 ) #define SID_PAGEFOOTER_WITHOUT_UNDO ( SID_RPTUI_START + 9 ) #define SID_REPORTHEADER_WITHOUT_UNDO ( SID_RPTUI_START + 10 ) diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 9a73953542c8..f6509cd3beaf 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -451,7 +451,14 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const aReturn.bEnabled = m_nSelectionCount > 1; break; - case SID_DISTRIBUTION: + case SID_DISTRIBUTE_HLEFT: + case SID_DISTRIBUTE_HCENTER: + case SID_DISTRIBUTE_HDISTANCE: + case SID_DISTRIBUTE_HRIGHT: + case SID_DISTRIBUTE_VTOP: + case SID_DISTRIBUTE_VCENTER: + case SID_DISTRIBUTE_VDISTANCE: + case SID_DISTRIBUTE_VBOTTOM: aReturn.bEnabled = isEditable() && getDesignView()->HasSelection(); if ( aReturn.bEnabled ) { @@ -1034,11 +1041,18 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue > case SID_OBJECT_HELL: changeZOrder(_nId); break; - case SID_DISTRIBUTION: + case SID_DISTRIBUTE_HLEFT: + case SID_DISTRIBUTE_HCENTER: + case SID_DISTRIBUTE_HDISTANCE: + case SID_DISTRIBUTE_HRIGHT: + case SID_DISTRIBUTE_VTOP: + case SID_DISTRIBUTE_VCENTER: + case SID_DISTRIBUTE_VDISTANCE: + case SID_DISTRIBUTE_VBOTTOM: { OSectionView* pSectionView = getCurrentSectionView(); if ( pSectionView ) - pSectionView->DistributeMarkedObjects(getFrameWeld()); + pSectionView->DistributeMarkedObjects(_nId); } break; case SID_OBJECT_SMALLESTWIDTH: @@ -1838,7 +1852,16 @@ void OReportController::describeSupportedFeatures() implDescribeSupportedFeature( ".uno:SmallestHeight", SID_OBJECT_SMALLESTHEIGHT, CommandGroup::FORMAT ); implDescribeSupportedFeature( ".uno:GreatestWidth", SID_OBJECT_GREATESTWIDTH, CommandGroup::FORMAT ); implDescribeSupportedFeature( ".uno:GreatestHeight", SID_OBJECT_GREATESTHEIGHT, CommandGroup::FORMAT ); - implDescribeSupportedFeature( ".uno:Distribution", SID_DISTRIBUTION, CommandGroup::FORMAT ); + + implDescribeSupportedFeature( ".uno:DistributeSelection", SID_DISTRIBUTE_DLG, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeHorzLeft", SID_DISTRIBUTE_HLEFT, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeHorzCenter", SID_DISTRIBUTE_HCENTER, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeHorzDistance", SID_DISTRIBUTE_HDISTANCE, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeHorzRight", SID_DISTRIBUTE_HRIGHT, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeVertTop", SID_DISTRIBUTE_VTOP, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeVertCenter", SID_DISTRIBUTE_VCENTER, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeVertDistance", SID_DISTRIBUTE_VDISTANCE, CommandGroup::FORMAT ); + implDescribeSupportedFeature( ".uno:DistributeVertBottom", SID_DISTRIBUTE_VBOTTOM, CommandGroup::FORMAT ); implDescribeSupportedFeature( ".uno:ExportTo", SID_EXPORTDOC, CommandGroup::APPLICATION ); implDescribeSupportedFeature( ".uno:ExportToPDF", SID_EXPORTDOCASPDF, CommandGroup::APPLICATION ); diff --git a/reportdesign/uiconfig/dbreport/menubar/menubar.xml b/reportdesign/uiconfig/dbreport/menubar/menubar.xml index cf9bb4543450..2ca14f363a5d 100644 --- a/reportdesign/uiconfig/dbreport/menubar/menubar.xml +++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml @@ -240,7 +240,7 @@ - + diff --git a/reportdesign/uiconfig/dbreport/popupmenu/report.xml b/reportdesign/uiconfig/dbreport/popupmenu/report.xml index 5605aa9c77b7..8791fe4701f2 100644 --- a/reportdesign/uiconfig/dbreport/popupmenu/report.xml +++ b/reportdesign/uiconfig/dbreport/popupmenu/report.xml @@ -62,7 +62,7 @@ - + diff --git a/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml b/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml new file mode 100644 index 000000000000..308104262c47 --- /dev/null +++ b/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk index 643b4fb54072..d757577a97cc 100644 --- a/sd/UIConfig_sdraw.mk +++ b/sd/UIConfig_sdraw.mk @@ -61,6 +61,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/sdraw,\ sd/uiconfig/sdraw/toolbar/commentsbar \ sd/uiconfig/sdraw/toolbar/connectorsbar \ sd/uiconfig/sdraw/toolbar/drawingobjectbar \ + sd/uiconfig/sdraw/toolbar/distributebar \ sd/uiconfig/sdraw/toolbar/ellipsesbar \ sd/uiconfig/sdraw/toolbar/extrusionobjectbar \ sd/uiconfig/sdraw/toolbar/findbar \ diff --git a/sd/UIConfig_simpress.mk b/sd/UIConfig_simpress.mk index ea014ef301b6..f8e10c675609 100644 --- a/sd/UIConfig_simpress.mk +++ b/sd/UIConfig_simpress.mk @@ -63,6 +63,7 @@ $(eval $(call gb_UIConfig_add_toolbarfiles,modules/simpress,\ sd/uiconfig/simpress/toolbar/commontaskbar \ sd/uiconfig/simpress/toolbar/connectorsbar \ sd/uiconfig/simpress/toolbar/drawingobjectbar \ + sd/uiconfig/simpress/toolbar/distributebar \ sd/uiconfig/simpress/toolbar/ellipsesbar \ sd/uiconfig/simpress/toolbar/extrusionobjectbar \ sd/uiconfig/simpress/toolbar/findbar \ diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi index c3dd109a0956..683e52888635 100644 --- a/sd/sdi/_drvwsh.sdi +++ b/sd/sdi/_drvwsh.sdi @@ -479,6 +479,46 @@ interface DrawView StateMethod = GetMenuState ; ] SID_DISTRIBUTE_DLG // ole : no, status : ? + [ + StateMethod = GetMenuState ; + GroupId = SfxGroupId::Document ; + ] + SID_DISTRIBUTE_HLEFT // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_HCENTER // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_HDISTANCE // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_HRIGHT // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_VTOP // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_VCENTER // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_VDISTANCE // ole : no, status : ? + [ + ExecMethod = FuTemporary ; + StateMethod = GetMenuState ; + ] + SID_DISTRIBUTE_VBOTTOM // ole : no, status : ? [ ExecMethod = FuTemporary ; StateMethod = GetMenuState ; diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx index b89c429452ee..9c35ca4077f7 100644 --- a/sd/source/ui/view/drviews2.cxx +++ b/sd/source/ui/view/drviews2.cxx @@ -2755,7 +2755,14 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } break; - case SID_DISTRIBUTE_DLG: + case SID_DISTRIBUTE_HLEFT: + case SID_DISTRIBUTE_HCENTER: + case SID_DISTRIBUTE_HDISTANCE: + case SID_DISTRIBUTE_HRIGHT: + case SID_DISTRIBUTE_VTOP: + case SID_DISTRIBUTE_VCENTER: + case SID_DISTRIBUTE_VDISTANCE: + case SID_DISTRIBUTE_VBOTTOM: { if ( mpDrawView->IsPresObjSelected() ) { @@ -2766,13 +2773,12 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq) } else { - mpDrawView->DistributeMarkedObjects(GetFrameWeld()); + mpDrawView->DistributeMarkedObjects(nSId); } Cancel(); rReq.Done (); } break; - case SID_POLY_MERGE: { // End text edit to avoid conflicts diff --git a/sd/source/ui/view/drviewsj.cxx b/sd/source/ui/view/drviewsj.cxx index 372cb555ebdf..829338a67de1 100644 --- a/sd/source/ui/view/drviewsj.cxx +++ b/sd/source/ui/view/drviewsj.cxx @@ -278,7 +278,14 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem(SID_GROUP); rSet.DisableItem(SID_TEXT_COMBINE); rSet.DisableItem(SID_COMBINE); - rSet.DisableItem(SID_DISTRIBUTE_DLG); + rSet.DisableItem(SID_DISTRIBUTE_HLEFT); + rSet.DisableItem(SID_DISTRIBUTE_HCENTER); + rSet.DisableItem(SID_DISTRIBUTE_HDISTANCE); + rSet.DisableItem(SID_DISTRIBUTE_HRIGHT); + rSet.DisableItem(SID_DISTRIBUTE_VTOP); + rSet.DisableItem(SID_DISTRIBUTE_VCENTER); + rSet.DisableItem(SID_DISTRIBUTE_VDISTANCE); + rSet.DisableItem(SID_DISTRIBUTE_VBOTTOM); rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); @@ -291,7 +298,16 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) { // distribute dialog for 3+n objects if(nMarkCount <= 2) - rSet.DisableItem(SID_DISTRIBUTE_DLG); + { + rSet.DisableItem(SID_DISTRIBUTE_HLEFT); + rSet.DisableItem(SID_DISTRIBUTE_HCENTER); + rSet.DisableItem(SID_DISTRIBUTE_HDISTANCE); + rSet.DisableItem(SID_DISTRIBUTE_HRIGHT); + rSet.DisableItem(SID_DISTRIBUTE_VTOP); + rSet.DisableItem(SID_DISTRIBUTE_VCENTER); + rSet.DisableItem(SID_DISTRIBUTE_VDISTANCE); + rSet.DisableItem(SID_DISTRIBUTE_VBOTTOM); + } rSet.DisableItem( SID_LINEEND_POLYGON ); rSet.DisableItem( SID_ENTER_GROUP ); @@ -492,6 +508,14 @@ void DrawViewShell::GetMenuStateSel( SfxItemSet &rSet ) rSet.DisableItem( SID_TEXT_COMBINE ); rSet.DisableItem( SID_COMBINE ); rSet.DisableItem(SID_DISTRIBUTE_DLG); + rSet.DisableItem(SID_DISTRIBUTE_HLEFT); + rSet.DisableItem(SID_DISTRIBUTE_HCENTER); + rSet.DisableItem(SID_DISTRIBUTE_HDISTANCE); + rSet.DisableItem(SID_DISTRIBUTE_HRIGHT); + rSet.DisableItem(SID_DISTRIBUTE_VTOP); + rSet.DisableItem(SID_DISTRIBUTE_VCENTER); + rSet.DisableItem(SID_DISTRIBUTE_VDISTANCE); + rSet.DisableItem(SID_DISTRIBUTE_VBOTTOM); rSet.DisableItem(SID_POLY_MERGE); rSet.DisableItem(SID_POLY_SUBSTRACT); rSet.DisableItem(SID_POLY_INTERSECT); diff --git a/sd/uiconfig/sdraw/toolbar/distributebar.xml b/sd/uiconfig/sdraw/toolbar/distributebar.xml new file mode 100644 index 000000000000..308104262c47 --- /dev/null +++ b/sd/uiconfig/sdraw/toolbar/distributebar.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml b/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml index 4ec8c431197f..04d010eee3dd 100644 --- a/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml +++ b/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml @@ -56,8 +56,6 @@ - - diff --git a/sd/uiconfig/simpress/toolbar/distributebar.xml b/sd/uiconfig/simpress/toolbar/distributebar.xml new file mode 100644 index 000000000000..308104262c47 --- /dev/null +++ b/sd/uiconfig/simpress/toolbar/distributebar.xml @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml b/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml index 91b087528ae7..f5646c28d7e3 100644 --- a/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml +++ b/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml @@ -56,8 +56,6 @@ - - diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist index a47fe865da53..50ebe0f410d1 100644 --- a/solenv/clang-format/excludelist +++ b/solenv/clang-format/excludelist @@ -2714,7 +2714,6 @@ cui/source/inc/cuitabline.hxx cui/source/inc/dbregister.hxx cui/source/inc/defdlgname.hxx cui/source/inc/dlgname.hxx -cui/source/inc/dstribut.hxx cui/source/inc/grfpage.hxx cui/source/inc/hangulhanjadlg.hxx cui/source/inc/headertablistbox.hxx @@ -2828,7 +2827,6 @@ cui/source/tabpages/border.cxx cui/source/tabpages/chardlg.cxx cui/source/tabpages/chardlg.h cui/source/tabpages/connect.cxx -cui/source/tabpages/dstribut.cxx cui/source/tabpages/grfpage.cxx cui/source/tabpages/labdlg.cxx cui/source/tabpages/macroass.cxx diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi index d382a1814121..42158cac9d81 100644 --- a/svx/sdi/svx.sdi +++ b/svx/sdi/svx.sdi @@ -2258,9 +2258,26 @@ SfxBoolItem SwitchControlDesignMode SID_FM_DESIGN_MODE GroupId = SfxGroupId::Controls; ] - SfxVoidItem DistributeSelection SID_DISTRIBUTE_DLG () +[ + AutoUpdate = FALSE, + FastCall = TRUE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Format; +] + +SfxVoidItem DistributeHorzLeft SID_DISTRIBUTE_HLEFT +() [ AutoUpdate = FALSE, FastCall = FALSE, @@ -2276,7 +2293,125 @@ SfxVoidItem DistributeSelection SID_DISTRIBUTE_DLG ToolBoxConfig = TRUE, GroupId = SfxGroupId::Modify; ] +SfxVoidItem DistributeHorzCenter SID_DISTRIBUTE_HCENTER +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] +SfxVoidItem DistributeHorzDistance SID_DISTRIBUTE_HDISTANCE +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] +SfxVoidItem DistributeHorzRight SID_DISTRIBUTE_HRIGHT +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] +SfxVoidItem DistributeVertTop SID_DISTRIBUTE_VTOP +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] +SfxVoidItem DistributeVertCenter SID_DISTRIBUTE_VCENTER +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] +SfxVoidItem DistributeVertDistance SID_DISTRIBUTE_VDISTANCE +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] +SfxVoidItem DistributeVertBottom SID_DISTRIBUTE_VBOTTOM +() +[ + AutoUpdate = FALSE, + FastCall = FALSE, + ReadOnlyDoc = FALSE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + Asynchron; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::Modify; +] SfxBoolItem DrawSelect SID_DRAW_SELECT diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx index 92bfe93fed56..a9af1d278458 100644 --- a/svx/source/svdraw/svdedtv2.cxx +++ b/svx/source/svdraw/svdedtv2.cxx @@ -50,6 +50,7 @@ #include #include #include +#include using namespace com::sun::star; @@ -768,25 +769,28 @@ struct ImpDistributeEntry typedef std::vector ImpDistributeEntryList; -void SdrEditView::DistributeMarkedObjects(weld::Window* pParent) +void SdrEditView::DistributeMarkedObjects(sal_uInt16 SlotID) { const size_t nMark(GetMarkedObjectCount()); if(nMark <= 2) return; - SfxItemSet aNewAttr(mpModel->GetItemPool()); + SvxDistributeHorizontal eHor = SvxDistributeHorizontal::NONE; + SvxDistributeVertical eVer = SvxDistributeVertical::NONE; - SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - ScopedVclPtr pDlg(pFact->CreateSvxDistributeDialog(pParent, aNewAttr)); + switch (SlotID) + { + case SID_DISTRIBUTE_HLEFT: eHor = SvxDistributeHorizontal::Left; break; + case SID_DISTRIBUTE_HCENTER: eHor = SvxDistributeHorizontal::Center; break; + case SID_DISTRIBUTE_HDISTANCE: eHor = SvxDistributeHorizontal::Distance; break; + case SID_DISTRIBUTE_HRIGHT: eHor = SvxDistributeHorizontal::Right; break; + case SID_DISTRIBUTE_VTOP: eVer = SvxDistributeVertical::Top; break; + case SID_DISTRIBUTE_VCENTER: eVer = SvxDistributeVertical::Center; break; + case SID_DISTRIBUTE_VDISTANCE: eVer = SvxDistributeVertical::Distance; break; + case SID_DISTRIBUTE_VBOTTOM: eVer = SvxDistributeVertical::Bottom; break; + } - sal_uInt16 nResult = pDlg->Execute(); - - if(nResult != RET_OK) - return; - - SvxDistributeHorizontal eHor = pDlg->GetDistributeHor(); - SvxDistributeVertical eVer = pDlg->GetDistributeVer(); ImpDistributeEntryList aEntryList; ImpDistributeEntryList::iterator itEntryList; sal_uInt32 nFullLength;