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 <momonasmon@gmail.com>
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 583cc5c..ec2d222 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 62291ef..a6dcd3b 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 f85ce1d..ee0413e 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 01925f1..731303d 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -30,7 +30,6 @@
#include <svx/svxids.hrc>
#include <numfmt.hxx>
#include <splitcelldlg.hxx>
#include <dstribut.hxx>
#include <cuiimapwnd.hxx>
#include <cui/cuicharmap.hxx>
#include <srchxtra.hxx>
@@ -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<AbstractSvxCaptionDialog> AbstractDialogFactory_Impl::CreateCaptionDialog
    return VclPtr<AbstractSvxCaptionDialog_Impl>::Create(std::make_shared<SvxCaptionTabDialog>(pParent, pView, nAnchorTypes));
}

VclPtr<AbstractSvxDistributeDialog> AbstractDialogFactory_Impl::CreateSvxDistributeDialog(weld::Window* pParent,
                                                                                          const SfxItemSet& rAttr)
{
    return VclPtr<AbstractSvxDistributeDialog_Impl>::Create(std::make_unique<SvxDistributeDialog>(pParent, rAttr, SvxDistributeHorizontal::NONE, SvxDistributeVertical::NONE));
}

VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(weld::Window* pParent)
{
    return VclPtr<AbstractHangulHanjaConversionDialog_Impl>::Create(std::make_unique<HangulHanjaConversionDialog>(pParent));
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index d0072f6..fd11ee4 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -38,7 +38,6 @@
#include <cuitbxform.hxx>
#include <dlgname.hxx>
#include <DiagramDialog.hxx>
#include <dstribut.hxx>
#include <hangulhanjadlg.hxx>
#include <hyphen.hxx>
#include <insdlg.hxx>
@@ -162,21 +161,6 @@ public:
    virtual OString GetScreenshotId() const override;
};

class SvxDistributeDialog;
class AbstractSvxDistributeDialog_Impl: public AbstractSvxDistributeDialog
{
    std::unique_ptr<SvxDistributeDialog> m_xDlg;
public:
    explicit AbstractSvxDistributeDialog_Impl(std::unique_ptr<SvxDistributeDialog> 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<AbstractSvxDistributeDialog>
                                          CreateSvxDistributeDialog(weld::Window* pParent, const SfxItemSet& rAttr) override;
    virtual VclPtr<SfxAbstractInsertObjectDialog>
                                           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 847f36b..0000000
--- 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 <sfx2/tabdlg.hxx>
#include <svx/dstribut_enum.hxx>
#include <vcl/weld.hxx>

class SvxDistributePage : public SfxTabPage
{
    SvxDistributeHorizontal     m_eDistributeHor;
    SvxDistributeVertical       m_eDistributeVer;

    std::unique_ptr<weld::RadioButton> m_xBtnHorNone;
    std::unique_ptr<weld::RadioButton> m_xBtnHorLeft;
    std::unique_ptr<weld::RadioButton> m_xBtnHorCenter;
    std::unique_ptr<weld::RadioButton> m_xBtnHorDistance;
    std::unique_ptr<weld::RadioButton> m_xBtnHorRight;
    std::unique_ptr<weld::RadioButton> m_xBtnVerNone;
    std::unique_ptr<weld::RadioButton> m_xBtnVerTop;
    std::unique_ptr<weld::RadioButton> m_xBtnVerCenter;
    std::unique_ptr<weld::RadioButton> m_xBtnVerDistance;
    std::unique_ptr<weld::RadioButton> 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 e1653ca..0000000
--- 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 <sfx2/basedlgs.hxx>
#include <dstribut.hxx>

/*************************************************************************
|*
|* 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<SvxDistributePage>(get_content_area(), this, rInAttrs, eHor, eVer));
    mpPage = static_cast<SvxDistributePage*>(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 03f848b..0000000
--- a/cui/uiconfig/ui/distributiondialog.ui
+++ /dev/null
@@ -1,90 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
  <requires lib="gtk+" version="3.18"/>
  <object class="GtkDialog" id="DistributionDialog">
    <property name="can_focus">False</property>
    <property name="border_width">6</property>
    <property name="title" translatable="yes" context="distributiondialog|DistributionDialog">Distribution</property>
    <property name="resizable">False</property>
    <property name="modal">True</property>
    <property name="default_width">0</property>
    <property name="default_height">0</property>
    <property name="type_hint">dialog</property>
    <child>
      <placeholder/>
    </child>
    <child internal-child="vbox">
      <object class="GtkBox" id="dialog-vbox1">
        <property name="can_focus">False</property>
        <property name="orientation">vertical</property>
        <property name="spacing">12</property>
        <child internal-child="action_area">
          <object class="GtkButtonBox" id="dialog-action_area1">
            <property name="can_focus">False</property>
            <property name="layout_style">end</property>
            <child>
              <object class="GtkButton" id="ok">
                <property name="label">gtk-ok</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="can_default">True</property>
                <property name="has_default">True</property>
                <property name="receives_default">True</property>
                <property name="use_stock">True</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">0</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="cancel">
                <property name="label">gtk-cancel</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="use_stock">True</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">1</property>
              </packing>
            </child>
            <child>
              <object class="GtkButton" id="help">
                <property name="label">gtk-help</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="use_stock">True</property>
              </object>
              <packing>
                <property name="expand">False</property>
                <property name="fill">True</property>
                <property name="position">2</property>
                <property name="secondary">True</property>
              </packing>
            </child>
          </object>
          <packing>
            <property name="expand">False</property>
            <property name="fill">True</property>
            <property name="pack_type">end</property>
            <property name="position">0</property>
          </packing>
        </child>
        <child>
          <placeholder/>
        </child>
      </object>
    </child>
    <action-widgets>
      <action-widget response="-5">ok</action-widget>
      <action-widget response="-6">cancel</action-widget>
      <action-widget response="-11">help</action-widget>
    </action-widgets>
  </object>
</interface>
diff --git a/cui/uiconfig/ui/distributionpage.ui b/cui/uiconfig/ui/distributionpage.ui
deleted file mode 100644
index 1798e90..0000000
--- a/cui/uiconfig/ui/distributionpage.ui
+++ /dev/null
@@ -1,439 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.36.0 -->
<interface domain="cui">
  <requires lib="gtk+" version="3.18"/>
  <object class="GtkGrid" id="DistributionPage">
    <property name="visible">True</property>
    <property name="can_focus">False</property>
    <property name="border_width">6</property>
    <property name="row_spacing">12</property>
    <child>
      <object class="GtkGrid" id="grid1">
        <property name="visible">True</property>
        <property name="can_focus">False</property>
        <property name="row_spacing">12</property>
        <child>
          <object class="GtkFrame" id="frame1">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="label_xalign">0</property>
            <property name="shadow_type">none</property>
            <child>
              <object class="GtkAlignment" id="alignment1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="top_padding">6</property>
                <property name="left_padding">12</property>
                <child>
                  <object class="GtkGrid" id="grid2">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="row_spacing">6</property>
                    <property name="column_spacing">12</property>
                    <property name="row_homogeneous">True</property>
                    <child>
                      <object class="GtkRadioButton" id="hornone">
                        <property name="label" translatable="yes" context="distributionpage|hornone">_None</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="active">True</property>
                        <property name="draw_indicator">True</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="hornone-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|hornone">Does not distribute the objects horizontally.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="horleft">
                        <property name="label" translatable="yes" context="distributionpage|horleft">_Left</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">hornone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="horleft-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|horleft">Distributes the selected objects, so that the left edges of the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="horcenter">
                        <property name="label" translatable="yes" context="distributionpage|horcenter">_Center</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">hornone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="horcenter-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|horcenter">Distributes the selected objects, so that the horizontal centers of the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">2</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="horright">
                        <property name="label" translatable="yes" context="distributionpage|horright">_Right</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">hornone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="horright-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|horright">Distributes the selected objects, so that the right edges of the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">4</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image1">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dsth_low.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image3">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dsth_cen.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">2</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="hordistance">
                        <property name="label" translatable="yes" context="distributionpage|hordistance">_Spacing</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">hornone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="hordistance-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|hordistance">Distributes the selected objects horizontally, so that the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">3</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image2">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dsth_dst.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">3</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image4">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dsth_hig.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">4</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <placeholder/>
                    </child>
                  </object>
                </child>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel" id="label">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="label" translatable="yes" context="distributionpage|label">Horizontal</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="left_attach">0</property>
            <property name="top_attach">0</property>
          </packing>
        </child>
        <child>
          <object class="GtkFrame" id="frame2">
            <property name="visible">True</property>
            <property name="can_focus">False</property>
            <property name="label_xalign">0</property>
            <property name="shadow_type">none</property>
            <child>
              <object class="GtkAlignment" id="alignment2">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="top_padding">6</property>
                <property name="left_padding">12</property>
                <child>
                  <object class="GtkGrid" id="grid3">
                    <property name="visible">True</property>
                    <property name="can_focus">False</property>
                    <property name="row_spacing">6</property>
                    <property name="column_spacing">12</property>
                    <property name="row_homogeneous">True</property>
                    <child>
                      <object class="GtkRadioButton" id="vernone">
                        <property name="label" translatable="yes" context="distributionpage|vernone">N_one</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="vernone-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|vernone">Does not distribute the objects vertically.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">0</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="vertop">
                        <property name="label" translatable="yes" context="distributionpage|vertop">_Top</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">vernone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="vertop-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|vertop">Distributes the selected objects, so that the top edges of the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="vercenter">
                        <property name="label" translatable="yes" context="distributionpage|vercenter">C_enter</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="yalign">0.5600000023841858</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">vernone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="vercenter-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|vercenter">Distributes the selected objects, so that the vertical centers of the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">2</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="verdistance">
                        <property name="label" translatable="yes" context="distributionpage|verdistance">S_pacing</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">vernone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="verdistance-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|verdistance">Distributes the selected objects vertically, so that the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">3</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkRadioButton" id="verbottom">
                        <property name="label" translatable="yes" context="distributionpage|verbottom">_Bottom</property>
                        <property name="visible">True</property>
                        <property name="can_focus">True</property>
                        <property name="receives_default">False</property>
                        <property name="use_underline">True</property>
                        <property name="xalign">0</property>
                        <property name="draw_indicator">True</property>
                        <property name="group">vernone</property>
                        <child internal-child="accessible">
                          <object class="AtkObject" id="verbottom-atkobject">
                            <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|verbottom">Distributes the selected objects, so that the bottom edges of the objects are evenly spaced from one another.</property>
                          </object>
                        </child>
                      </object>
                      <packing>
                        <property name="left_attach">4</property>
                        <property name="top_attach">1</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image9">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dstv_hig.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">1</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image10">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dstv_cen.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">2</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image11">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dstv_dst.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">3</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <object class="GtkImage" id="image12">
                        <property name="visible">True</property>
                        <property name="can_focus">False</property>
                        <property name="halign">center</property>
                        <property name="valign">center</property>
                        <property name="icon_name">svx/res/dstv_low.png</property>
                      </object>
                      <packing>
                        <property name="left_attach">4</property>
                        <property name="top_attach">0</property>
                      </packing>
                    </child>
                    <child>
                      <placeholder/>
                    </child>
                  </object>
                </child>
              </object>
            </child>
            <child type="label">
              <object class="GtkLabel" id="label1">
                <property name="visible">True</property>
                <property name="can_focus">False</property>
                <property name="label" translatable="yes" context="distributionpage|label1">Vertical</property>
                <attributes>
                  <attribute name="weight" value="bold"/>
                </attributes>
              </object>
            </child>
          </object>
          <packing>
            <property name="left_attach">0</property>
            <property name="top_attach">1</property>
          </packing>
        </child>
      </object>
      <packing>
        <property name="left_attach">0</property>
        <property name="top_attach">0</property>
      </packing>
    </child>
    <child internal-child="accessible">
      <object class="AtkObject" id="DistributionPage-atkobject">
        <property name="AtkObject::accessible-description" translatable="yes" context="distributionpage|extended_tip|DistributionPage">Distributes three or more selected objects evenly along the horizontal axis or the vertical axis. You can also evenly distribute the spacing between objects.</property>
      </object>
    </child>
  </object>
  <object class="GtkSizeGroup" id="sizegroup1">
    <widgets>
      <widget name="hornone"/>
      <widget name="horleft"/>
      <widget name="horcenter"/>
      <widget name="horright"/>
      <widget name="hordistance"/>
      <widget name="vernone"/>
      <widget name="vertop"/>
      <widget name="vercenter"/>
      <widget name="verdistance"/>
      <widget name="verbottom"/>
    </widgets>
  </object>
</interface>
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 35236d6..5ddf685 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 c07db29..df6f6f1 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<AbstractSvxDistributeDialog>    CreateSvxDistributeDialog(weld::Window* pParent,
                                            const SfxItemSet& rAttr)= 0;

    virtual VclPtr<AbstractFmShowColsDialog> CreateFmShowColsDialog(weld::Window* pParent) = 0;

    virtual VclPtr<AbstractSvxZoomDialog> CreateSvxZoomDialog(weld::Window* pParent, const SfxItemSet& rCoreSet) = 0;
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index ead0bd8..c057e16 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 01e6172..10a67fa 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 @@
          <value>com.sun.star.comp.framework.WindowListMenuController</value>
        </prop>
      </node>
      <node oor:name="DistributeControl" oor:op="replace">
        <prop oor:name="Command">
          <value>.uno:DistributeSelection</value>
        </prop>
        <prop oor:name="Module">
          <value/>
        </prop>
        <prop oor:name="Controller">
          <value>com.sun.star.comp.framework.ToolbarAsMenuController</value>
        </prop>
        <prop oor:name="Value">
          <value>distributebar</value>
        </prop>
      </node>
    </node>
    <node oor:name="ToolBar">
      <node oor:name="lo.writer.ScrollToPrevious" oor:op="replace">
@@ -1900,6 +1914,20 @@
          <value>com.sun.star.comp.framework.GenericPopupToolbarController</value>
        </prop>
      </node>
      <node oor:name="DistributeControl" oor:op="replace">
        <prop oor:name="Command">
          <value>.uno:DistributeSelection</value>
        </prop>
        <prop oor:name="Module">
          <value/>
        </prop>
        <prop oor:name="Controller">
          <value>com.sun.star.comp.framework.SubToolBarController</value>
        </prop>
        <prop oor:name="Value">
          <value>distributebar</value>
        </prop>
      </node>
    </node>
    <node oor:name="StatusBar">
      <node oor:name="c5" oor:op="replace">
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/DrawWindowState.xcu
index b1f0b0f..33eb4cb2 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 @@
          <value xml:lang="en-US">Redaction</value>
        </prop>
      </node>
      <node oor:name="private:resource/toolbar/distributebar" oor:op="replace">
        <prop oor:name="Docked" oor:type="xs:boolean">
          <value>false</value>
        </prop>
        <prop oor:name="Visible" oor:type="xs:boolean">
          <value>false</value>
        </prop>
        <prop oor:name="UIName" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Selection</value>
        </prop>
      </node>
    </node>
  </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index 3212c28..97b8e21 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 @@
          <value>9</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeSelection" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">~Distribution...</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:ParagraphDialog" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">P~aragraph...</value>
@@ -7180,6 +7172,108 @@
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeSelection" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">~Distribution</value>
        </prop>
        <prop oor:name="TooltipLabel" oor:type="xs:string">
          <value xml:lang="en-US">Select at least three objects to distribute</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Selection</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeHorzLeft" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Horizontally Left</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Horizontally ~Left</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeHorzCenter" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Horizontally Center</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Horizontally ~Center</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeHorzDistance" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Horizontally Spacing</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Horizontally ~Spacing</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeHorzRight" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Horizontally Right</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Horizontally ~Right</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeVertTop" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Vertically Top</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Vertically ~Top</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeVertCenter" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Vertically Center</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Vertically C~enter</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeVertDistance" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Vertically Spacing</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Vertically S~pacing</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:DistributeVertBottom" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Vertically Bottom</value>
        </prop>
        <prop oor:name="ContextLabel" oor:type="xs:string">
          <value xml:lang="en-US">Vertically ~Bottom</value>
        </prop>
        <prop oor:name="Properties" oor:type="xs:int">
          <value>1</value>
        </prop>
      </node>
    </node>
  </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ImpressWindowState.xcu
index b9d1d15..bd50af5 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 @@
          <value>true</value>
        </prop>
      </node>
      <node oor:name="private:resource/toolbar/distributebar" oor:op="replace">
        <prop oor:name="Docked" oor:type="xs:boolean">
          <value>false</value>
        </prop>
        <prop oor:name="Visible" oor:type="xs:boolean">
          <value>false</value>
        </prop>
        <prop oor:name="UIName" oor:type="xs:string">
          <value xml:lang="en-US">Distribute Selection</value>
        </prop>
      </node>
    </node>
  </node>
</oor:component-data>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/ReportCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/ReportCommands.xcu
index dc8d802c..94a0182b 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 @@
          <value>1</value>
        </prop>
      </node>
      <node oor:name=".uno:Distribution" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">Distribution...</value>
        </prop>
      </node>
      <node oor:name=".uno:SelectAllInSection" oor:op="replace">
        <prop oor:name="Label" oor:type="xs:string">
          <value xml:lang="en-US">~Select Objects in Section</value>
diff --git a/reportdesign/UIConfig_dbreport.mk b/reportdesign/UIConfig_dbreport.mk
index d04dce4..89c60a3 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 95dc001..c66fb55 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 9a73953..f6509cd 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 cf9bb45..2ca14f3 100644
--- a/reportdesign/uiconfig/dbreport/menubar/menubar.xml
+++ b/reportdesign/uiconfig/dbreport/menubar/menubar.xml
@@ -240,7 +240,7 @@
                </menu:menupopup>
            </menu:menu>
            <menu:menuseparator/>
            <menu:menuitem menu:id=".uno:Distribution"/>
            <menu:menuitem menu:id=".uno:DistributeSelection"/>
        </menu:menupopup>
    </menu:menu>
    <menu:menu menu:id=".uno:ToolsMenu" >
diff --git a/reportdesign/uiconfig/dbreport/popupmenu/report.xml b/reportdesign/uiconfig/dbreport/popupmenu/report.xml
index 5605aa9..8791fe4 100644
--- a/reportdesign/uiconfig/dbreport/popupmenu/report.xml
+++ b/reportdesign/uiconfig/dbreport/popupmenu/report.xml
@@ -62,7 +62,7 @@
    </menu:menupopup>
  </menu:menu>
  <menu:menuseparator/>
  <menu:menuitem menu:id=".uno:Distribution"/>
  <menu:menuitem menu:id=".uno:DistributeSelection"/>
  <menu:menuseparator/>
  <menu:menuitem menu:id=".uno:ControlProperties"/>
</menu:menupopup>
diff --git a/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml b/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml
new file mode 100644
index 0000000..3081042
--- /dev/null
+++ b/reportdesign/uiconfig/dbreport/toolbar/distributebar.xml
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<!--
 * 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/.
 *
-->
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzLeft"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzCenter"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzDistance"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzRight"/>
 <toolbar:toolbarbreak/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertTop"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertCenter"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertDistance"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertBottom"/>
</toolbar:toolbar>
\ No newline at end of file
diff --git a/sd/UIConfig_sdraw.mk b/sd/UIConfig_sdraw.mk
index 643b4fb5..d757577 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 ea014ef..f8e10c6 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 c3dd109a..683e528 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -480,6 +480,46 @@ interface DrawView
    ]
    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 b89c429..9c35ca4 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 372cb55..829338a6 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 0000000..3081042
--- /dev/null
+++ b/sd/uiconfig/sdraw/toolbar/distributebar.xml
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<!--
 * 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/.
 *
-->
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzLeft"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzCenter"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzDistance"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzRight"/>
 <toolbar:toolbarbreak/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertTop"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertCenter"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertDistance"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertBottom"/>
</toolbar:toolbar>
\ No newline at end of file
diff --git a/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml b/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml
index 4ec8c43..04d010e 100644
--- a/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/drawingobjectbar.xml
@@ -56,8 +56,6 @@
 <toolbar:toolbaritem xlink:href=".uno:MirrorHorz"/>
 <toolbar:toolbaritem xlink:href=".uno:AdvancedMode"/>
 <toolbar:toolbarseparator/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeSelection"/>
 <toolbar:toolbarseparator/>
 <toolbar:toolbaritem xlink:href=".uno:FormatLine" toolbar:visible="false"/>
 <toolbar:toolbaritem xlink:href=".uno:FormatArea" toolbar:visible="false"/>
 <toolbar:toolbaritem xlink:href=".uno:Window3D" toolbar:visible="false"/>
diff --git a/sd/uiconfig/simpress/toolbar/distributebar.xml b/sd/uiconfig/simpress/toolbar/distributebar.xml
new file mode 100644
index 0000000..3081042
--- /dev/null
+++ b/sd/uiconfig/simpress/toolbar/distributebar.xml
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE toolbar:toolbar PUBLIC "-//OpenOffice.org//DTD OfficeDocument 1.0//EN" "toolbar.dtd">
<!--
 * 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/.
 *
-->
<toolbar:toolbar xmlns:toolbar="http://openoffice.org/2001/toolbar" xmlns:xlink="http://www.w3.org/1999/xlink">
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzLeft"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzCenter"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzDistance"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeHorzRight"/>
 <toolbar:toolbarbreak/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertTop"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertCenter"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertDistance"/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeVertBottom"/>
</toolbar:toolbar>
\ No newline at end of file
diff --git a/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml b/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml
index 91b0875..f5646c2 100644
--- a/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml
+++ b/sd/uiconfig/simpress/toolbar/drawingobjectbar.xml
@@ -56,8 +56,6 @@
 <toolbar:toolbaritem xlink:href=".uno:MirrorHorz"/>
 <toolbar:toolbaritem xlink:href=".uno:AdvancedMode"/>
 <toolbar:toolbarseparator/>
 <toolbar:toolbaritem xlink:href=".uno:DistributeSelection"/>
 <toolbar:toolbarseparator/>
 <toolbar:toolbaritem xlink:href=".uno:FormatLine" toolbar:visible="false"/>
 <toolbar:toolbaritem xlink:href=".uno:FormatArea" toolbar:visible="false"/>
 <toolbar:toolbaritem xlink:href=".uno:Window3D" toolbar:visible="false"/>
diff --git a/solenv/clang-format/excludelist b/solenv/clang-format/excludelist
index a47fe86..50ebe0f 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 d382a18..42158ca 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -2258,11 +2258,28 @@ 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,
    ReadOnlyDoc = FALSE,
    Toggle = 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 92bfe93..a9af1d2 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -50,6 +50,7 @@
#include <memory>
#include <vector>
#include <vcl/graph.hxx>
#include <svx/svxids.hrc>

using namespace com::sun::star;

@@ -768,25 +769,28 @@ struct ImpDistributeEntry

typedef std::vector<ImpDistributeEntry> 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<AbstractSvxDistributeDialog> 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;