[Libreoffice-commits] core.git: editeng/source include/svx offapi/com offapi/UnoApi_offapi.mk svx/Library_svx.mk svx/sdi svx/source svx/uiconfig svx/UIConfig_svx.mk sw/source sw/uiconfig

Szymon Kłos eszkadev at gmail.com
Mon Jun 27 12:47:23 UTC 2016


 editeng/source/items/frmitems.cxx                         |   33 +
 include/svx/ParaSpacingControl.hxx                        |   84 +++
 offapi/UnoApi_offapi.mk                                   |    1 
 offapi/com/sun/star/frame/status/LeftRightMarginScale.idl |   78 +++
 svx/Library_svx.mk                                        |    2 
 svx/UIConfig_svx.mk                                       |    2 
 svx/sdi/svx.sdi                                           |    2 
 svx/source/sidebar/paragraph/ParaSpacingControl.cxx       |  181 +++++++
 svx/source/sidebar/paragraph/ParaSpacingWindow.cxx        |  265 ++++++++++
 svx/source/sidebar/paragraph/ParaSpacingWindow.hxx        |   85 +++
 svx/uiconfig/ui/paralrspacing.ui                          |  185 +++++++
 svx/uiconfig/ui/paraulspacing.ui                          |  137 +++++
 sw/source/uibase/app/swmodule.cxx                         |    3 
 sw/uiconfig/swriter/ui/notebookbar.ui                     |  355 +-------------
 14 files changed, 1093 insertions(+), 320 deletions(-)

New commits:
commit 723467bd88a50323ccd2e4046d0a36332c664a66
Author: Szymon Kłos <eszkadev at gmail.com>
Date:   Tue May 31 16:57:13 2016 +0200

    [API CHANGE] notebookbar: paragraph spacing controls
    
    Change-Id: I9d2672cd156f2dcc2ee4c544902e9d42632cab70
    Reviewed-on: https://gerrit.libreoffice.org/26039
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/editeng/source/items/frmitems.cxx b/editeng/source/items/frmitems.cxx
index 58a118c..1012926 100644
--- a/editeng/source/items/frmitems.cxx
+++ b/editeng/source/items/frmitems.cxx
@@ -41,6 +41,7 @@
 #include <com/sun/star/awt/Size.hpp>
 #include <com/sun/star/text/WritingMode2.hpp>
 #include <com/sun/star/frame/status/UpperLowerMarginScale.hpp>
+#include <com/sun/star/frame/status/LeftRightMarginScale.hpp>
 #include <com/sun/star/drawing/ShadingPattern.hpp>
 
 #include <i18nutil/unicode.hxx>
@@ -430,6 +431,20 @@ bool SvxLRSpaceItem::QueryValue( uno::Any& rVal, sal_uInt8 nMemberId ) const
     switch( nMemberId )
     {
         // now all signed
+        case 0:
+        {
+            css::frame::status::LeftRightMarginScale aLRSpace;
+            aLRSpace.Left = (sal_Int32)(bConvert ? convertTwipToMm100(nLeftMargin) : nLeftMargin);
+            aLRSpace.TextLeft = (sal_Int32)(bConvert ? convertTwipToMm100(nTxtLeft) : nTxtLeft);
+            aLRSpace.Right = (sal_Int32)(bConvert ? convertTwipToMm100(nRightMargin) : nRightMargin);
+            aLRSpace.ScaleLeft = (sal_Int16)nPropLeftMargin;
+            aLRSpace.ScaleRight = (sal_Int16)nPropRightMargin;
+            aLRSpace.FirstLine = (sal_Int32)(bConvert ? convertTwipToMm100(nFirstLineOfst) : nFirstLineOfst);
+            aLRSpace.ScaleFirstLine = (sal_Int16)(nPropFirstLineOfst);
+            aLRSpace.AutoFirstLine = IsAutoFirst();
+            rVal <<= aLRSpace;
+            break;
+        }
         case MID_L_MARGIN:
             rVal <<= (sal_Int32)(bConvert ? convertTwipToMm100(nLeftMargin) : nLeftMargin);
             break;
@@ -473,13 +488,29 @@ bool SvxLRSpaceItem::PutValue( const uno::Any& rVal, sal_uInt8 nMemberId )
     bool bConvert = 0 != (nMemberId&CONVERT_TWIPS);
     nMemberId &= ~CONVERT_TWIPS;
     sal_Int32 nVal = 0;
-    if( nMemberId != MID_FIRST_AUTO &&
+    if( nMemberId != 0 && nMemberId != MID_FIRST_AUTO &&
             nMemberId != MID_L_REL_MARGIN && nMemberId != MID_R_REL_MARGIN)
         if(!(rVal >>= nVal))
             return false;
 
     switch( nMemberId )
     {
+        case 0:
+        {
+            css::frame::status::LeftRightMarginScale aLRSpace;
+            if(!(rVal >>= aLRSpace))
+                return false;
+
+            SetLeft( bConvert ? convertMm100ToTwip(aLRSpace.Left) : aLRSpace.Left );
+            SetTextLeft( bConvert ? convertMm100ToTwip(aLRSpace.TextLeft) : aLRSpace.TextLeft );
+            SetRight(bConvert ? convertMm100ToTwip(aLRSpace.Right) : aLRSpace.Right);
+            nPropLeftMargin = aLRSpace.ScaleLeft;
+            nPropRightMargin = aLRSpace.ScaleRight;
+            SetTextFirstLineOfst((short)(bConvert ?  convertMm100ToTwip(aLRSpace.FirstLine) : aLRSpace.FirstLine));
+            SetPropTextFirstLineOfst ( (sal_uInt16)aLRSpace.ScaleFirstLine );
+            SetAutoFirst( aLRSpace.AutoFirstLine );
+            break;
+        }
         case MID_L_MARGIN:
             SetLeft( bConvert ? convertMm100ToTwip(nVal) : nVal );
             break;
diff --git a/include/svx/ParaSpacingControl.hxx b/include/svx/ParaSpacingControl.hxx
new file mode 100644
index 0000000..03e7cf9
--- /dev/null
+++ b/include/svx/ParaSpacingControl.hxx
@@ -0,0 +1,84 @@
+/* -*- 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 .
+ */
+#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGCONTROL_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGCONTROL_HXX
+
+#include <sfx2/tbxctrl.hxx>
+#include <svx/svxdllapi.h>
+#include <vcl/window.hxx>
+#include <com/sun/star/ui/XContextChangeEventListener.hpp>
+#include <com/sun/star/ui/ContextChangeEventMultiplexer.hpp>
+#include <com/sun/star/ui/XContextChangeEventMultiplexer.hpp>
+#include <sfx2/sidebar/EnumContext.hxx>
+
+namespace svx {
+
+class SVX_DLLPUBLIC ParaULSpacingControl : public SfxToolBoxControl
+{
+public:
+    SFX_DECL_TOOLBOX_CONTROL();
+
+    ParaULSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+    virtual ~ParaULSpacingControl();
+
+    virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
+                              const SfxPoolItem* pState) override;
+    virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) override;
+};
+
+class SVX_DLLPUBLIC ParaLRSpacingControl : public SfxToolBoxControl,
+                                    public css::ui::XContextChangeEventListener
+{
+public:
+    SFX_DECL_TOOLBOX_CONTROL();
+
+    ParaLRSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx);
+    virtual ~ParaLRSpacingControl();
+
+    virtual void SAL_CALL dispose()
+        throw (css::uno::RuntimeException, std::exception) override;
+
+    virtual void StateChanged(sal_uInt16 nSID, SfxItemState eState,
+                              const SfxPoolItem* pState) override;
+    virtual VclPtr<vcl::Window> CreateItemWindow(vcl::Window* pParent) override;
+
+    // XContextChangeEventListener
+    virtual void SAL_CALL notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent)
+        throw (css::uno::RuntimeException, std::exception) override;
+
+    virtual ::css::uno::Any SAL_CALL queryInterface(const ::css::uno::Type& aType)
+        throw (::css::uno::RuntimeException, ::std::exception) override;
+
+    virtual void SAL_CALL acquire() throw () override;
+
+    virtual void SAL_CALL disposing(const ::css::lang::EventObject&)
+        throw (::css::uno::RuntimeException, ::std::exception) override;
+
+    virtual void SAL_CALL release() throw () override;
+
+private:
+    css::uno::Reference<css::ui::XContextChangeEventMultiplexer> m_xMultiplexer;
+};
+
+}
+
+#endif
+
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 543ae6e..29bf3c3 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -2667,6 +2667,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/frame/status,\
 	ItemState \
 	ItemStatus \
 	LeftRightMargin \
+	LeftRightMarginScale \
 	Template \
 	UpperLowerMargin \
 	UpperLowerMarginScale \
diff --git a/offapi/com/sun/star/frame/status/LeftRightMarginScale.idl b/offapi/com/sun/star/frame/status/LeftRightMarginScale.idl
new file mode 100644
index 0000000..b5f66e2
--- /dev/null
+++ b/offapi/com/sun/star/frame/status/LeftRightMarginScale.idl
@@ -0,0 +1,78 @@
+/* -*- 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 .
+ */
+#ifndef __com_sun_star_frame_status_LeftRightMarginScale_idl__
+#define __com_sun_star_frame_status_LeftRightMarginScale_idl__
+
+
+
+module com {  module sun {  module star {  module frame {  module status {
+
+
+/** specifies a left and right margin.
+
+    @since LibreOffice 5.3
+ */
+struct LeftRightMarginScale
+{
+    /** specifies a left text margin in 1/100th mm.
+     */
+    long TextLeft;
+
+
+    /** specifies a left margin in 1/100th mm.
+     */
+    long Left;
+
+
+    /** specifies a right margin in 1/100th mm.
+     */
+    long Right;
+
+
+     /** specifies a first line indent relative to TextLeft.
+     */
+    long FirstLine;
+
+
+    /** specifies a scale value for the left margin.
+     */
+    short ScaleLeft;
+
+
+    /** specifies a scale value for the right margin.
+     */
+    short ScaleRight;
+
+
+    /** specifies a scale value for the first line margin.
+     */
+    short ScaleFirstLine;
+
+
+    /** specifies if the automatic calculation of the first line indent occurs.
+    */
+    boolean AutoFirstLine;
+};
+
+
+}; }; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 047eb9d..2233de4 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -196,6 +196,8 @@ $(eval $(call gb_Library_add_exception_objects,svx,\
     svx/source/sidebar/paragraph/ParaLineSpacingControl \
     svx/source/sidebar/paragraph/ParaLineSpacingPopup \
     svx/source/sidebar/paragraph/ParaPropertyPanel \
+    svx/source/sidebar/paragraph/ParaSpacingWindow \
+    svx/source/sidebar/paragraph/ParaSpacingControl \
     svx/source/sidebar/area/AreaPropertyPanel \
     svx/source/sidebar/area/AreaPropertyPanelBase \
     svx/source/sidebar/area/AreaTransparencyGradientControl \
diff --git a/svx/UIConfig_svx.mk b/svx/UIConfig_svx.mk
index 56ca90d..9202248 100644
--- a/svx/UIConfig_svx.mk
+++ b/svx/UIConfig_svx.mk
@@ -47,6 +47,8 @@ $(eval $(call gb_UIConfig_add_uifiles,svx,\
 	svx/uiconfig/ui/namespacedialog \
 	svx/uiconfig/ui/optgridpage \
 	svx/uiconfig/ui/paralinespacingcontrol \
+	svx/uiconfig/ui/paralrspacing \
+	svx/uiconfig/ui/paraulspacing \
 	svx/uiconfig/ui/passwd \
 	svx/uiconfig/ui/querydeletecontourdialog \
 	svx/uiconfig/ui/querydeleteobjectdialog \
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index f9667eb..ddab822 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -5303,6 +5303,8 @@ SfxVoidItem LeftRightParaMargin SID_ATTR_PARA_LRSPACE
     RecordAbsolute = FALSE,
     RecordPerSet;
 
+    SlotType = SvxLRSpaceItem
+
     AccelConfig = FALSE,
     MenuConfig = FALSE,
     ToolBoxConfig = FALSE,
diff --git a/svx/source/sidebar/paragraph/ParaSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx
new file mode 100644
index 0000000..7822db1
--- /dev/null
+++ b/svx/source/sidebar/paragraph/ParaSpacingControl.cxx
@@ -0,0 +1,181 @@
+/* -*- 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 "ParaSpacingWindow.hxx"
+
+#include <editeng/ulspitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <editeng/editids.hrc>
+#include <svx/ParaSpacingControl.hxx>
+#include <vcl/toolbox.hxx>
+#include <svl/itempool.hxx>
+#include <sfx2/sfxsids.hrc>
+#include <svl/intitem.hxx>
+
+using namespace svx;
+
+SFX_IMPL_TOOLBOX_CONTROL(ParaULSpacingControl, SvxULSpaceItem);
+SFX_IMPL_TOOLBOX_CONTROL(ParaLRSpacingControl, SvxLRSpaceItem);
+
+ParaULSpacingControl::ParaULSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
+    : SfxToolBoxControl(nSlotId, nId, rTbx)
+{
+    addStatusListener(".uno:MetricUnit");
+}
+
+ParaULSpacingControl::~ParaULSpacingControl()
+{
+}
+
+void ParaULSpacingControl::StateChanged(sal_uInt16 nSID, SfxItemState eState,
+                              const SfxPoolItem* pState)
+{
+    sal_uInt16 nId = GetId();
+    ToolBox& rTbx = GetToolBox();
+    ParaULSpacingWindow* pWindow = static_cast<ParaULSpacingWindow*>(rTbx.GetItemWindow(nId));
+
+    DBG_ASSERT( pWindow, "Control not found!" );
+
+    if(SfxItemState::DISABLED == eState)
+        pWindow->Disable();
+    else
+        pWindow->Enable();
+
+    rTbx.EnableItem(nId, SfxItemState::DISABLED != eState);
+
+    if(nSID == SID_ATTR_METRIC && pState && eState >= SfxItemState::DEFAULT)
+    {
+        const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pState);
+        pWindow->SetUnit((FieldUnit)pMetricItem->GetValue());
+    }
+    else if(nSID == SID_ATTR_PARA_ULSPACE && pState && eState >= SfxItemState::DEFAULT)
+        pWindow->SetValue(static_cast<const SvxULSpaceItem*>(pState));
+}
+
+VclPtr<vcl::Window> ParaULSpacingControl::CreateItemWindow(vcl::Window* pParent)
+{
+    VclPtr<ParaULSpacingWindow> pWindow = VclPtr<ParaULSpacingWindow>::Create(pParent, m_xFrame);
+    pWindow->Show();
+
+    return pWindow;
+}
+
+// ParaLRSpacingControl
+
+ParaLRSpacingControl::ParaLRSpacingControl(sal_uInt16 nSlotId, sal_uInt16 nId, ToolBox& rTbx)
+    : SfxToolBoxControl(nSlotId, nId, rTbx)
+{
+    addStatusListener(".uno:MetricUnit");
+}
+
+ParaLRSpacingControl::~ParaLRSpacingControl()
+{
+}
+
+void SAL_CALL ParaLRSpacingControl::dispose() throw (css::uno::RuntimeException, std::exception)
+{
+    if(m_xMultiplexer.is())
+    {
+        m_xMultiplexer->removeAllContextChangeEventListeners(this);
+        m_xMultiplexer.clear();
+    }
+
+    SfxToolBoxControl::dispose();
+}
+
+void ParaLRSpacingControl::StateChanged(sal_uInt16 nSID, SfxItemState eState,
+                              const SfxPoolItem* pState)
+{
+    sal_uInt16 nId = GetId();
+    ToolBox& rTbx = GetToolBox();
+    ParaLRSpacingWindow* pWindow = static_cast<ParaLRSpacingWindow*>(rTbx.GetItemWindow(nId));
+
+    DBG_ASSERT( pWindow, "Control not found!" );
+
+    if(!m_xMultiplexer.is())
+    {
+        m_xMultiplexer = css::ui::ContextChangeEventMultiplexer::get(
+                                    ::comphelper::getProcessComponentContext());
+
+        if(m_xFrame.is() && m_xMultiplexer.is())
+            m_xMultiplexer->addContextChangeEventListener(this, m_xFrame->getController());
+    }
+
+    if(nSID == SID_ATTR_METRIC && pState && eState >= SfxItemState::DEFAULT)
+    {
+        const SfxUInt16Item* pMetricItem = static_cast<const SfxUInt16Item*>(pState);
+        pWindow->SetUnit((FieldUnit)pMetricItem->GetValue());
+    }
+    else if(nSID == SID_ATTR_PARA_LRSPACE)
+    {
+        pWindow->SetValue(eState, pState);
+    }
+}
+
+void SAL_CALL ParaLRSpacingControl::notifyContextChangeEvent(const css::ui::ContextChangeEventObject& rEvent)
+        throw (css::uno::RuntimeException, std::exception)
+{
+    sal_uInt16 nId = GetId();
+    ToolBox& rTbx = GetToolBox();
+    ParaLRSpacingWindow* pWindow = static_cast<ParaLRSpacingWindow*>(rTbx.GetItemWindow(nId));
+
+    if(pWindow)
+    {
+        ::sfx2::sidebar::EnumContext eContext = ::sfx2::sidebar::EnumContext(
+                ::sfx2::sidebar::EnumContext::GetApplicationEnum(rEvent.ApplicationName),
+                ::sfx2::sidebar::EnumContext::GetContextEnum(rEvent.ContextName));
+        pWindow->SetContext(eContext);
+    }
+}
+
+::css::uno::Any SAL_CALL ParaLRSpacingControl::queryInterface(const ::css::uno::Type& aType)
+        throw (::css::uno::RuntimeException, ::std::exception)
+{
+    ::css::uno::Any a(SfxToolBoxControl::queryInterface(aType));
+    if (a.hasValue())
+        return a;
+
+    return ::cppu::queryInterface(aType, static_cast<css::ui::XContextChangeEventListener*>(this));
+}
+
+void SAL_CALL ParaLRSpacingControl::acquire() throw ()
+{
+    SfxToolBoxControl::acquire();
+}
+
+void SAL_CALL ParaLRSpacingControl::disposing(const ::css::lang::EventObject&)
+    throw (::css::uno::RuntimeException, ::std::exception)
+{
+    SfxToolBoxControl::disposing();
+}
+
+void SAL_CALL ParaLRSpacingControl::release() throw ()
+{
+    SfxToolBoxControl::release();
+}
+
+VclPtr<vcl::Window> ParaLRSpacingControl::CreateItemWindow(vcl::Window* pParent)
+{
+    VclPtr<ParaLRSpacingWindow> pWindow = VclPtr<ParaLRSpacingWindow>::Create(pParent, m_xFrame);
+    pWindow->Show();
+
+    return pWindow;
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
new file mode 100644
index 0000000..93a2099
--- /dev/null
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.cxx
@@ -0,0 +1,265 @@
+/* -*- 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 "ParaSpacingWindow.hxx"
+#include <editeng/editids.hrc>
+#include <sfx2/dispatch.hxx>
+#include <svl/itempool.hxx>
+#include <svl/intitem.hxx>
+#include <vcl/builderfactory.hxx>
+
+using namespace svx;
+
+#define DEFAULT_VALUE          0
+#define MAX_DURCH             5670
+#define MAX_SW                  1709400
+#define MAX_SC_SD               116220200
+#define NEGA_MAXVALUE          -10000000
+
+// ParaULSpacingWindow
+
+ParaULSpacingWindow::ParaULSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame)
+    : VclVBox(pParent)
+{
+    m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
+                                  "svx/ui/paraulspacing.ui",
+                                  "ParaULSpacingWindow",
+                                  xFrame);
+
+    get(m_pAboveSpacing, "aboveparaspacing");
+    get(m_pBelowSpacing, "belowparaspacing");
+
+    Link<Edit&,void> aLink = LINK(this, ParaULSpacingWindow, ModifySpacingHdl);
+    m_pAboveSpacing->SetModifyHdl(aLink);
+    m_pBelowSpacing->SetModifyHdl(aLink);
+}
+
+ParaULSpacingWindow::~ParaULSpacingWindow()
+{
+    disposeOnce();
+}
+
+void ParaULSpacingWindow::dispose()
+{
+    m_pAboveSpacing.clear();
+    m_pBelowSpacing.clear();
+
+    disposeBuilder();
+    VclVBox::dispose();
+}
+
+void ParaULSpacingWindow::SetUnit(FieldUnit eUnit)
+{
+    SetFieldUnit(*m_pAboveSpacing, eUnit);
+    SetFieldUnit(*m_pBelowSpacing, eUnit);
+
+    SfxItemPool &rPool = SfxGetpApp()->GetPool();
+    sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_PARA_ULSPACE);
+    m_eUnit = rPool.GetMetric(nWhich);
+
+    m_pAboveSpacing->SetMax(m_pAboveSpacing->Normalize(MAX_DURCH), MapToFieldUnit(m_eUnit));
+    m_pBelowSpacing->SetMax(m_pBelowSpacing->Normalize(MAX_DURCH), MapToFieldUnit(m_eUnit));
+}
+
+void ParaULSpacingWindow::SetValue(const SvxULSpaceItem* pItem)
+{
+    sal_Int64 nVal = pItem->GetUpper();
+    nVal = m_pAboveSpacing->Normalize(nVal);
+    m_pAboveSpacing->SetValue(nVal, FUNIT_100TH_MM);
+
+    nVal = pItem->GetLower();
+    nVal = m_pBelowSpacing->Normalize(nVal);
+    m_pBelowSpacing->SetValue(nVal, FUNIT_100TH_MM);
+}
+
+IMPL_LINK_NOARG_TYPED(ParaULSpacingWindow, ModifySpacingHdl, Edit&, void)
+{
+    SfxDispatcher* pDisp = SfxViewFrame::Current()->GetBindings().GetDispatcher();
+    if(pDisp)
+    {
+        SvxULSpaceItem aMargin(SID_ATTR_PARA_ULSPACE);
+        aMargin.SetUpper((sal_uInt16)GetCoreValue(*m_pAboveSpacing, m_eUnit));
+        aMargin.SetLower((sal_uInt16)GetCoreValue(*m_pBelowSpacing, m_eUnit));
+        pDisp->ExecuteList(SID_ATTR_PARA_ULSPACE, SfxCallMode::RECORD, {&aMargin});
+    }
+}
+
+// ParaLRSpacingWindow
+
+ParaLRSpacingWindow::ParaLRSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame)
+    : VclVBox(pParent)
+{
+    m_pUIBuilder = new VclBuilder(this, getUIRootDir(),
+                                  "svx/ui/paralrspacing.ui",
+                                  "ParaLRSpacingWindow",
+                                  xFrame);
+
+    get(m_pBeforeSpacing, "beforetextindent");
+    get(m_pAfterSpacing, "aftertextindent");
+    get(m_pFLSpacing, "firstlineindent");
+
+    Link<Edit&,void> aLink = LINK(this, ParaLRSpacingWindow, ModifySpacingHdl);
+    m_pBeforeSpacing->SetModifyHdl(aLink);
+    m_pAfterSpacing->SetModifyHdl(aLink);
+    m_pFLSpacing->SetModifyHdl(aLink);
+}
+
+ParaLRSpacingWindow::~ParaLRSpacingWindow()
+{
+    disposeOnce();
+}
+
+void ParaLRSpacingWindow::dispose()
+{
+    m_pBeforeSpacing.clear();
+    m_pAfterSpacing.clear();
+    m_pFLSpacing.clear();
+
+    disposeBuilder();
+    VclVBox::dispose();
+}
+
+void ParaLRSpacingWindow::SetContext(const ::sfx2::sidebar::EnumContext& eContext)
+{
+    m_aContext = eContext;
+}
+
+void ParaLRSpacingWindow::SetValue(SfxItemState eState, const SfxPoolItem* pState)
+{
+    switch(m_aContext.GetCombinedContext_DI())
+    {
+
+    case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
+    case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
+    case CombinedEnumContext(Application_Calc, Context_DrawText):
+    case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+    case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+    case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+    case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+    case CombinedEnumContext(Application_DrawImpress, Context_Table):
+        {
+            m_pBeforeSpacing->SetMin(DEFAULT_VALUE);
+            m_pAfterSpacing->SetMin(DEFAULT_VALUE);
+            m_pFLSpacing->SetMin(DEFAULT_VALUE);
+        }
+        break;
+    case CombinedEnumContext(Application_WriterVariants, Context_Default):
+    case CombinedEnumContext(Application_WriterVariants, Context_Text):
+    case CombinedEnumContext(Application_WriterVariants, Context_Table):
+        {
+            m_pBeforeSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM);
+            m_pAfterSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM);
+            m_pFLSpacing->SetMin(NEGA_MAXVALUE, FUNIT_100TH_MM);
+        }
+        break;
+    }
+
+    if(pState && eState >= SfxItemState::DEFAULT)
+    {
+        m_pBeforeSpacing-> Enable();
+        m_pAfterSpacing->Enable();
+        m_pFLSpacing->Enable();
+
+        const SvxLRSpaceItem* pSpace = static_cast<const SvxLRSpaceItem*>(pState);
+        long aTxtLeft = pSpace->GetTextLeft();
+        long aTxtRight = pSpace->GetRight();
+        long aTxtFirstLineOfst = pSpace->GetTextFirstLineOfst();
+
+        aTxtLeft = (long)m_pBeforeSpacing->Normalize(aTxtLeft);
+
+        if(m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text)
+             && m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default)
+             && m_aContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Table))
+        {
+            m_pFLSpacing->SetMin(aTxtLeft*(-1), FUNIT_100TH_MM);
+        }
+
+        aTxtRight = (long)m_pAfterSpacing->Normalize(aTxtRight);
+
+        switch(m_aContext.GetCombinedContext_DI())
+        {
+        case CombinedEnumContext(Application_WriterVariants, Context_DrawText):
+        case CombinedEnumContext(Application_WriterVariants, Context_Text):
+        case CombinedEnumContext(Application_WriterVariants, Context_Default):
+        case CombinedEnumContext(Application_WriterVariants, Context_Table):
+        case CombinedEnumContext(Application_WriterVariants, Context_Annotation):
+            {
+                m_pBeforeSpacing->SetMax(MAX_SW - aTxtRight, FUNIT_100TH_MM);
+                m_pAfterSpacing->SetMax(MAX_SW - aTxtLeft, FUNIT_100TH_MM);
+                m_pFLSpacing->SetMax(MAX_SW - aTxtLeft - aTxtRight, FUNIT_100TH_MM);
+            }
+            break;
+        case CombinedEnumContext(Application_DrawImpress, Context_DrawText):
+        case CombinedEnumContext(Application_DrawImpress, Context_Draw):
+        case CombinedEnumContext(Application_DrawImpress, Context_Table):
+        case CombinedEnumContext(Application_DrawImpress, Context_TextObject):
+        case CombinedEnumContext(Application_DrawImpress, Context_Graphic):
+            {
+                m_pBeforeSpacing->SetMax(MAX_SC_SD - aTxtRight, FUNIT_100TH_MM);
+                m_pAfterSpacing->SetMax(MAX_SC_SD - aTxtLeft, FUNIT_100TH_MM);
+                m_pFLSpacing->SetMax(MAX_SC_SD - aTxtLeft - aTxtRight, FUNIT_100TH_MM);
+            }
+        }
+
+        m_pBeforeSpacing->SetValue(aTxtLeft, FUNIT_100TH_MM);
+        m_pAfterSpacing->SetValue(aTxtRight, FUNIT_100TH_MM);
+
+        aTxtFirstLineOfst = (long)m_pFLSpacing->Normalize(aTxtFirstLineOfst);
+        m_pFLSpacing->SetValue(aTxtFirstLineOfst, FUNIT_100TH_MM);
+    }
+    else if(eState == SfxItemState::DISABLED)
+    {
+        m_pBeforeSpacing-> Disable();
+        m_pAfterSpacing->Disable();
+        m_pFLSpacing->Disable();
+    }
+    else
+    {
+        m_pBeforeSpacing->SetEmptyFieldValue();
+        m_pAfterSpacing->SetEmptyFieldValue();
+        m_pFLSpacing->SetEmptyFieldValue();
+    }
+}
+
+void ParaLRSpacingWindow::SetUnit(FieldUnit eUnit)
+{
+    SetFieldUnit(*m_pBeforeSpacing, eUnit);
+    SetFieldUnit(*m_pAfterSpacing, eUnit);
+    SetFieldUnit(*m_pFLSpacing, eUnit);
+
+    SfxItemPool &rPool = SfxGetpApp()->GetPool();
+    sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_PARA_LRSPACE);
+    m_eUnit = rPool.GetMetric(nWhich);
+}
+
+IMPL_LINK_NOARG_TYPED(ParaLRSpacingWindow, ModifySpacingHdl, Edit&, void)
+{
+    SfxDispatcher* pDisp = SfxViewFrame::Current()->GetBindings().GetDispatcher();
+    if(pDisp)
+    {
+        SvxLRSpaceItem aMargin(SID_ATTR_PARA_LRSPACE);
+        aMargin.SetTextLeft((const long)GetCoreValue(*m_pBeforeSpacing, m_eUnit));
+        aMargin.SetRight((const long)GetCoreValue(*m_pAfterSpacing, m_eUnit));
+        aMargin.SetTextFirstLineOfst((const short)GetCoreValue(*m_pFLSpacing, m_eUnit));
+
+        pDisp->ExecuteList(SID_ATTR_PARA_LRSPACE, SfxCallMode::RECORD, {&aMargin});
+    }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx
new file mode 100644
index 0000000..4a01ae8
--- /dev/null
+++ b/svx/source/sidebar/paragraph/ParaSpacingWindow.hxx
@@ -0,0 +1,85 @@
+/* -*- 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 .
+ */
+#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGWINDOW_HXX
+#define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARASPACINGWINDOW_HXX
+
+#include <cppuhelper/queryinterface.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <vcl/builder.hxx>
+#include <vcl/layout.hxx>
+#include <svx/relfld.hxx>
+#include <svtools/unitconv.hxx>
+#include <sfx2/sidebar/ControllerItem.hxx>
+#include <sfx2/sidebar/EnumContext.hxx>
+
+using namespace com::sun::star;
+
+namespace svx {
+
+class ParaULSpacingWindow : public VclVBox,
+                            public VclBuilderContainer
+
+{
+public:
+    explicit ParaULSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame);
+    virtual ~ParaULSpacingWindow();
+    virtual void dispose() override;
+
+    void SetValue(const SvxULSpaceItem* pItem);
+    void SetUnit(FieldUnit eUnit);
+
+private:
+    VclPtr<SvxRelativeField> m_pAboveSpacing;
+    VclPtr<SvxRelativeField> m_pBelowSpacing;
+
+    SfxMapUnit m_eUnit;
+
+    DECL_LINK_TYPED(ModifySpacingHdl, Edit&, void);
+};
+
+class ParaLRSpacingWindow : public VclVBox,
+                            public VclBuilderContainer
+{
+public:
+    explicit ParaLRSpacingWindow(vcl::Window* pParent, css::uno::Reference<css::frame::XFrame>& xFrame);
+    virtual ~ParaLRSpacingWindow();
+    virtual void dispose() override;
+
+    void SetValue(SfxItemState eState, const SfxPoolItem* pState);
+    void SetUnit(FieldUnit eUnit);
+    void SetContext(const ::sfx2::sidebar::EnumContext& eContext);
+
+private:
+    VclPtr<SvxRelativeField> m_pBeforeSpacing;
+    VclPtr<SvxRelativeField> m_pAfterSpacing;
+    VclPtr<SvxRelativeField> m_pFLSpacing;
+
+    SfxMapUnit m_eUnit;
+
+    ::sfx2::sidebar::EnumContext m_aContext;
+
+    DECL_LINK_TYPED(ModifySpacingHdl, Edit&, void);
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/uiconfig/ui/paralrspacing.ui b/svx/uiconfig/ui/paralrspacing.ui
new file mode 100644
index 0000000..9795b4e
--- /dev/null
+++ b/svx/uiconfig/ui/paralrspacing.ui
@@ -0,0 +1,185 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+  <requires lib="gtk+" version="3.10"/>
+  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkBox" id="ParaLRSpacingWindow">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="spacing">6</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="row_spacing">6</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkBox" id="box67">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkImage" id="image5">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="pixbuf">svx/res/symphony/Indent4.png</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label11">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Before</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="svxlo-SvxRelativeField" id="beforetextindent">
+            <property name="width_request">150</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="tooltip_text" translatable="yes">Before Text Indent</property>
+            <property name="hexpand">True</property>
+            <property name="invisible_char">•</property>
+            <property name="text">0</property>
+            <property name="progress_fraction">0.10000000000000001</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box66">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <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="pixbuf">svx/res/symphony/Indent3.png</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label12">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">After</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="svxlo-SvxRelativeField" id="aftertextindent">
+            <property name="width_request">150</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="tooltip_text" translatable="yes">After Text Indent</property>
+            <property name="hexpand">True</property>
+            <property name="invisible_char">•</property>
+            <property name="text">0</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box30">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <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="pixbuf">svx/res/symphony/Indent2.png</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label13">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">First line</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="svxlo-SvxRelativeField" id="firstlineindent">
+                <property name="width_request">150</property>
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="tooltip_text" translatable="yes">First Line Indent</property>
+                <property name="hexpand">True</property>
+                <property name="invisible_char">•</property>
+                <property name="text">0</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+        <child>
+          <placeholder/>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/svx/uiconfig/ui/paraulspacing.ui b/svx/uiconfig/ui/paraulspacing.ui
new file mode 100644
index 0000000..4d864e5
--- /dev/null
+++ b/svx/uiconfig/ui/paraulspacing.ui
@@ -0,0 +1,137 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.18.3 -->
+<interface>
+  <requires lib="gtk+" version="3.10"/>
+  <requires lib="LibreOffice" version="1.0"/>
+  <object class="GtkAdjustment" id="adjustment1">
+    <property name="upper">100</property>
+    <property name="step_increment">1</property>
+    <property name="page_increment">10</property>
+  </object>
+  <object class="GtkBox" id="ParaULSpacingWindow">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="spacing">6</property>
+    <child>
+      <object class="GtkGrid" id="grid1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="row_spacing">6</property>
+        <property name="column_spacing">6</property>
+        <child>
+          <object class="GtkBox" id="box27">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkImage" id="image6">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="pixbuf">svx/res/symphony/spacing1.png</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label2">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Above</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkBox" id="box28">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+            <property name="spacing">6</property>
+            <child>
+              <object class="GtkImage" id="image7">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="halign">center</property>
+                <property name="valign">center</property>
+                <property name="pixbuf">svx/res/symphony/spacing2.png</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">0</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="label10">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="label" translatable="yes">Below</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">1</property>
+              </packing>
+            </child>
+          </object>
+          <packing>
+            <property name="left_attach">0</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="svxlo-SvxRelativeField" id="aboveparaspacing">
+            <property name="width_request">150</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip_text" translatable="yes">Above Paragraph Spacing</property>
+            <property name="hexpand">True</property>
+            <property name="invisible_char">•</property>
+            <property name="text">0</property>
+            <property name="adjustment">adjustment1</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">0</property>
+          </packing>
+        </child>
+        <child>
+          <object class="svxlo-SvxRelativeField" id="belowparaspacing">
+            <property name="width_request">150</property>
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="has_tooltip">True</property>
+            <property name="tooltip_text" translatable="yes">Below Paragraph Spacing</property>
+            <property name="hexpand">True</property>
+            <property name="invisible_char">•</property>
+            <property name="text">0</property>
+            <property name="adjustment">adjustment1</property>
+          </object>
+          <packing>
+            <property name="left_attach">1</property>
+            <property name="top_attach">1</property>
+          </packing>
+        </child>
+      </object>
+      <packing>
+        <property name="expand">False</property>
+        <property name="fill">True</property>
+        <property name="position">1</property>
+      </packing>
+    </child>
+  </object>
+</interface>
diff --git a/sw/source/uibase/app/swmodule.cxx b/sw/source/uibase/app/swmodule.cxx
index 3ab2832..c4bfa35 100644
--- a/sw/source/uibase/app/swmodule.cxx
+++ b/sw/source/uibase/app/swmodule.cxx
@@ -27,6 +27,7 @@
 #include <svx/ParaLineSpacingPopup.hxx>
 #include <svx/TextCharacterSpacingPopup.hxx>
 #include <svx/TextUnderlinePopup.hxx>
+#include <svx/ParaSpacingControl.hxx>
 #include <svx/svdobj.hxx>
 #include <svx/pszctrl.hxx>
 #include <svx/insctrl.hxx>
@@ -288,6 +289,8 @@ void SwDLL::RegisterControls()
     svx::ParaLineSpacingPopup::RegisterControl(SID_ATTR_PARA_LINESPACE, pMod);
     svx::TextCharacterSpacingPopup::RegisterControl(SID_ATTR_CHAR_KERNING, pMod);
     svx::TextUnderlinePopup::RegisterControl(SID_ATTR_CHAR_UNDERLINE, pMod);
+    svx::ParaULSpacingControl::RegisterControl(SID_ATTR_PARA_ULSPACE, pMod);
+    svx::ParaLRSpacingControl::RegisterControl(SID_ATTR_PARA_LRSPACE, pMod);
 
     SvxColorToolBoxControl::RegisterControl( SID_EXTRUSION_3D_COLOR, pMod );
 
diff --git a/sw/uiconfig/swriter/ui/notebookbar.ui b/sw/uiconfig/swriter/ui/notebookbar.ui
index cd60ae1..0c22525 100644
--- a/sw/uiconfig/swriter/ui/notebookbar.ui
+++ b/sw/uiconfig/swriter/ui/notebookbar.ui
@@ -1888,341 +1888,58 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkBox" id="box18">
+                  <object class="sfxlo-SidebarToolBox" id="ulspacing">
+                    <property name="width_request">200</property>
+                    <property name="height_request">75</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
-                    <property name="spacing">6</property>
+                    <property name="has_tooltip">True</property>
+                    <property name="tooltip_text" translatable="yes">Indent</property>
                     <child>
-                      <object class="GtkGrid" id="grid1">
+                      <object class="GtkToolButton" id="ULSpacing">
+                        <property name="use_action_appearance">False</property>
+                        <property name="width_request">200</property>
+                        <property name="height_request">75</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="row_spacing">6</property>
-                        <property name="column_spacing">6</property>
-                        <child>
-                          <object class="GtkBox" id="box27">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkImage" id="image6">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="halign">center</property>
-                                <property name="valign">center</property>
-                                <property name="pixbuf">svx/res/symphony/spacing1.png</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label2">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Above</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box28">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkImage" id="image7">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="halign">center</property>
-                                <property name="valign">center</property>
-                                <property name="pixbuf">svx/res/symphony/spacing2.png</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label10">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Below</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="svxlo-SvxRelativeField" id="aboveparaspacing">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="has_tooltip">True</property>
-                            <property name="tooltip_text" translatable="yes">Above Paragraph Spacing</property>
-                            <property name="hexpand">True</property>
-                            <property name="invisible_char">•</property>
-                            <property name="text">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="svxlo-SvxRelativeField" id="belowparaspacing">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="has_tooltip">True</property>
-                            <property name="tooltip_text" translatable="yes">Below Paragraph Spacing</property>
-                            <property name="hexpand">True</property>
-                            <property name="invisible_char">•</property>
-                            <property name="text">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
+                        <property name="is_important">True</property>
+                        <property name="action_name">.uno:ULSpacing</property>
+                        <property name="use_underline">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">1</property>
+                        <property name="homogeneous">True</property>
                       </packing>
                     </child>
+                  </object>
+                  <packing>
+                    <property name="expand">False</property>
+                    <property name="fill">True</property>
+                    <property name="position">2</property>
+                  </packing>
+                </child>
+                <child>
+                  <object class="sfxlo-SidebarToolBox" id="lrspacing">
+                    <property name="width_request">450</property>
+                    <property name="height_request">75</property>
+                    <property name="visible">True</property>
+                    <property name="can_focus">False</property>
+                    <property name="has_tooltip">True</property>
+                    <property name="tooltip_text" translatable="yes">Indent</property>
                     <child>
-                      <object class="GtkGrid" id="grid2">
+                      <object class="GtkToolButton" id="LeftRightParaMargin">
+                        <property name="use_action_appearance">False</property>
+                        <property name="width_request">450</property>
+                        <property name="height_request">75</property>
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
-                        <property name="row_spacing">6</property>
-                        <property name="column_spacing">6</property>
-                        <child>
-                          <object class="GtkBox" id="box67">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <child>
-                              <object class="GtkImage" id="image5">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="halign">center</property>
-                                <property name="valign">center</property>
-                                <property name="pixbuf">svx/res/symphony/Indent4.png</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label11">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Before</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box66">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <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="pixbuf">svx/res/symphony/Indent3.png</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label12">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">After</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">0</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="svxlo-SvxRelativeField" id="beforetextindent1">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="tooltip_text" translatable="yes">Before Text Indent</property>
-                            <property name="hexpand">True</property>
-                            <property name="invisible_char">•</property>
-                            <property name="text">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="svxlo-SvxRelativeField" id="aftertextindent1">
-                            <property name="visible">True</property>
-                            <property name="can_focus">True</property>
-                            <property name="tooltip_text" translatable="yes">After Text Indent</property>
-                            <property name="hexpand">True</property>
-                            <property name="invisible_char">•</property>
-                            <property name="text">0</property>
-                          </object>
-                          <packing>
-                            <property name="left_attach">1</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box30">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <property name="spacing">6</property>
-                            <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="pixbuf">svx/res/symphony/Indent2.png</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label13">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">First line</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="svxlo-SvxRelativeField" id="firstlineindent1">
-                                <property name="visible">True</property>
-                                <property name="can_focus">True</property>
-                                <property name="tooltip_text" translatable="yes">First Line Indent</property>
-                                <property name="hexpand">True</property>
-                                <property name="invisible_char">•</property>
-                                <property name="text">0</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">2</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">2</property>
-                            <property name="top_attach">0</property>
-                          </packing>
-                        </child>
-                        <child>
-                          <object class="GtkBox" id="box31">
-                            <property name="visible">True</property>
-                            <property name="can_focus">False</property>
-                            <child>
-                              <object class="sfxlo-SidebarToolBox" id="linespacing1">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="has_tooltip">True</property>
-                                <child>
-                                  <object class="GtkMenuToolButton" id="setlinespacing1">
-                                    <property name="visible">True</property>
-                                    <property name="can_focus">False</property>
-                                    <property name="has_tooltip">True</property>
-                                    <property name="tooltip_text" translatable="yes">Line Spacing</property>
-                                    <property name="action_name">.uno:LineSpacing</property>
-                                    <property name="use_underline">True</property>
-                                  </object>
-                                  <packing>
-                                    <property name="expand">False</property>
-                                    <property name="homogeneous">True</property>
-                                  </packing>
-                                </child>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">0</property>
-                              </packing>
-                            </child>
-                            <child>
-                              <object class="GtkLabel" id="label14">
-                                <property name="visible">True</property>
-                                <property name="can_focus">False</property>
-                                <property name="label" translatable="yes">Line spacing</property>
-                                <property name="xalign">0</property>
-                              </object>
-                              <packing>
-                                <property name="expand">False</property>
-                                <property name="fill">True</property>
-                                <property name="position">1</property>
-                              </packing>
-                            </child>
-                          </object>
-                          <packing>
-                            <property name="left_attach">2</property>
-                            <property name="top_attach">1</property>
-                          </packing>
-                        </child>
+                        <property name="is_important">True</property>
+                        <property name="action_name">.uno:LeftRightParaMargin</property>
+                        <property name="use_underline">True</property>
                       </object>
                       <packing>
                         <property name="expand">False</property>
-                        <property name="fill">True</property>
-                        <property name="position">3</property>
+                        <property name="homogeneous">True</property>
                       </packing>
                     </child>
                   </object>


More information about the Libreoffice-commits mailing list