summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSzymon Kłos <eszkadev@gmail.com>2016-05-31 16:57:13 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-06-27 12:46:56 +0000
commit723467bd88a50323ccd2e4046d0a36332c664a66 (patch)
tree475685253a63b6ac919ba6de3ebc95df0226efc2 /svx
parentbf9728a85413df8324a428bb2c19c9c8a02ba022 (diff)
[API CHANGE] notebookbar: paragraph spacing controls
Change-Id: I9d2672cd156f2dcc2ee4c544902e9d42632cab70 Reviewed-on: https://gerrit.libreoffice.org/26039 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/Library_svx.mk2
-rw-r--r--svx/UIConfig_svx.mk2
-rw-r--r--svx/sdi/svx.sdi2
-rw-r--r--svx/source/sidebar/paragraph/ParaSpacingControl.cxx181
-rw-r--r--svx/source/sidebar/paragraph/ParaSpacingWindow.cxx265
-rw-r--r--svx/source/sidebar/paragraph/ParaSpacingWindow.hxx85
-rw-r--r--svx/uiconfig/ui/paralrspacing.ui185
-rw-r--r--svx/uiconfig/ui/paraulspacing.ui137
8 files changed, 859 insertions, 0 deletions
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index 047eb9d7c40c..2233de44eb35 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 56ca90da4038..9202248d2e18 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 f9667ebcff0c..ddab822c42cf 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 000000000000..7822db158fa7
--- /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 000000000000..93a2099c92c2
--- /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 000000000000..4a01ae8ed372
--- /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 000000000000..9795b4e6879b
--- /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 000000000000..4d864e56aca1
--- /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>