summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpv2k <vidhey96@gmail.com>2017-05-11 23:49:54 +0530
committerKatarina Behrens <Katarina.Behrens@cib.de>2017-07-09 23:19:14 +0200
commitfba28df77d7e98663d1cf77ac206f8799fce4108 (patch)
tree7ff28253e31d314b4947aed8858bcd5a09a1c14d
parent4eae2eeb4c3942648aa5d32678ddb5bbbae9d221 (diff)
Added margin feature to the Draw's SideBar
Change-Id: I53b5430d1563fcceae29418fd5907ac42ea856e7 Reviewed-on: https://gerrit.libreoffice.org/37626 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
-rw-r--r--include/svx/svxids.hrc16
-rw-r--r--sd/sdi/_drvwsh.sdi10
-rw-r--r--sd/source/ui/inc/DrawViewShell.hxx1
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx153
-rw-r--r--sd/source/ui/sidebar/SlideBackground.hxx23
-rw-r--r--sd/source/ui/view/drviews7.cxx96
-rw-r--r--sd/uiconfig/simpress/ui/sidebarslidebackground.ui165
-rw-r--r--svx/sdi/svx.sdi38
-rw-r--r--sw/inc/cmdid.h2
-rw-r--r--sw/sdi/swriter.sdi36
10 files changed, 494 insertions, 46 deletions
diff --git a/include/svx/svxids.hrc b/include/svx/svxids.hrc
index 91ad64d3ff93..a698c4d91af5 100644
--- a/include/svx/svxids.hrc
+++ b/include/svx/svxids.hrc
@@ -236,13 +236,15 @@
#define SID_ATTR_PAGE_MAXSIZE ( SID_SVX_START + 52 )
#define SID_ATTR_PAGE_ORIENTATION ( SID_SVX_START + 53 )
#define SID_ATTR_PAGE_PAPERBIN ( SID_SVX_START + 54 )
-#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 56 )
-#define SID_ATTR_PAGE_EXT2 ( SID_SVX_START + 57 )
-#define SID_ATTR_PAGE_HEADERSET ( SID_SVX_START + 58 )
-#define SID_ATTR_PAGE_FOOTERSET ( SID_SVX_START + 59 )
-#define SID_ATTR_PAGE_ON ( SID_SVX_START + 60 )
-#define SID_ATTR_PAGE_DYNAMIC ( SID_SVX_START + 61 )
-#define SID_ATTR_PAGE_SHARED ( SID_SVX_START + 62 )
+#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 55 )
+#define SID_ATTR_PAGE_EXT2 ( SID_SVX_START + 56 )
+#define SID_ATTR_PAGE_HEADERSET ( SID_SVX_START + 57 )
+#define SID_ATTR_PAGE_FOOTERSET ( SID_SVX_START + 58 )
+#define SID_ATTR_PAGE_ON ( SID_SVX_START + 59 )
+#define SID_ATTR_PAGE_DYNAMIC ( SID_SVX_START + 60 )
+#define SID_ATTR_PAGE_SHARED ( SID_SVX_START + 61 )
+#define SID_ATTR_PAGE_LRSPACE ( SID_SVX_START + 62 )
+#define SID_ATTR_PAGE_ULSPACE ( SID_SVX_START + 63 )
// CAUTION! Range <64 .. 67> used by EditEngine (!)
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 0e9d8eee12e5..833c578eb8f5 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -2603,6 +2603,16 @@ interface DrawView
ExecMethod = FuTemporary ;
StateMethod = GetPageProperties ;
]
+ SID_ATTR_PAGE_LRSPACE
+ [
+ ExecMethod = SetPageProperties ;
+ StateMethod = GetMarginProperties ;
+ ]
+ SID_ATTR_PAGE_ULSPACE
+ [
+ ExecMethod = SetPageProperties ;
+ StateMethod = GetMarginProperties ;
+ ]
SID_ATTR_PAGE_COLOR
[
ExecMethod = SetPageProperties ;
diff --git a/sd/source/ui/inc/DrawViewShell.hxx b/sd/source/ui/inc/DrawViewShell.hxx
index 56083d5a2f4d..7a4836f308de 100644
--- a/sd/source/ui/inc/DrawViewShell.hxx
+++ b/sd/source/ui/inc/DrawViewShell.hxx
@@ -159,6 +159,7 @@ public:
void SetPageProperties (SfxRequest& rReq);
void GetPageProperties(SfxItemSet& rSet);
+ void GetMarginProperties(SfxItemSet& rSet);
void GetState (SfxItemSet& rSet);
void Execute (SfxRequest& rReq);
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index 3d40c8123648..2c881f2a4acb 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -45,7 +45,7 @@
#include <sfx2/sidebar/Theme.hxx>
#include "app.hrc"
#include <editeng/paperinf.hxx>
-#include <editeng/sizeitem.hxx>
+#include <svx/rulritem.hxx>
#include <svx/svxids.hrc>
#include <svx/xflclit.hxx>
#include <svx/xgrad.hxx>
@@ -59,16 +59,41 @@
#include <sfx2/dispatch.hxx>
#include <sfx2/objface.hxx>
#include <svx/dlgutil.hxx>
+#include <sfx2/tabdlg.hxx>
#include <algorithm>
#include "EventMultiplexer.hxx"
#include "glob.hrc"
#include <vcl/salbtype.hxx>
#include <vcl/EnumContext.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/lrspitem.hxx>
+#include <svl/itemset.hxx>
+
using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference;
+namespace
+{
+ FieldUnit lcl_GetFieldUnit()
+ {
+ FieldUnit eUnit = FUNIT_CM;
+ const SfxPoolItem* pItem = nullptr;
+ SfxItemState eState = SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_METRIC, pItem );
+ if ( pItem && eState >= SfxItemState::DEFAULT )
+ {
+ eUnit = (FieldUnit)static_cast<const SfxUInt16Item*>( pItem )->GetValue();
+ }
+ else
+ {
+ return SfxModule::GetCurrentFieldUnit();
+ }
+
+ return eUnit;
+ }
+}
+
namespace sd { namespace sidebar {
enum eFillStyle
@@ -91,6 +116,8 @@ SlideBackground::SlideBackground(
mrBase( rBase ),
maPaperSizeController(SID_ATTR_PAGE_SIZE, *pBindings, *this),
maPaperOrientationController(SID_ATTR_PAGE, *pBindings, *this),
+ maPaperMarginLRController(SID_ATTR_PAGE_LRSPACE, *pBindings, *this),
+ maPaperMarginULController(SID_ATTR_PAGE_ULSPACE, *pBindings, *this),
maBckColorController(SID_ATTR_PAGE_COLOR, *pBindings, *this),
maBckGradientController(SID_ATTR_PAGE_GRADIENT, *pBindings, *this),
maBckHatchController(SID_ATTR_PAGE_HATCH, *pBindings, *this),
@@ -114,6 +141,11 @@ SlideBackground::SlideBackground(
maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage),
maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage),
mbTitle(false),
+ meFieldUnit(lcl_GetFieldUnit()),
+ m_nPageLeftMargin(0),
+ m_nPageRightMargin(0),
+ m_nPageTopMargin(0),
+ m_nPageBottomMargin(0),
mpBindings(pBindings)
{
get(mpPaperSizeBox,"paperformat");
@@ -131,6 +163,23 @@ SlideBackground::SlideBackground(
get(mpCloseMaster, "closemasterslide");
get(mpEditMaster, "masterslidebutton");
get(mpMasterLabel, "masterlabel");
+ get(m_pLeftMarginEdit, "left");
+ get(m_pRightMarginEdit, "right");
+ get(m_pTopMarginEdit, "top");
+ get(m_pBottomMarginEdit, "bottom");
+
+ const SfxPoolItem* pItem;
+ const SvxSizeItem* pSize = nullptr;
+ if ( SfxViewFrame::Current() )
+ {
+ SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState( SID_ATTR_PAGE_SIZE, pItem );
+ pSize = static_cast<const SvxSizeItem*>( pItem );
+ m_aPageSize = pSize->GetSize();
+ }
+ SetFieldUnit( *m_pTopMarginEdit, meFieldUnit );
+ SetFieldUnit( *m_pBottomMarginEdit, meFieldUnit );
+ SetFieldUnit( *m_pLeftMarginEdit, meFieldUnit );
+ SetFieldUnit( *m_pRightMarginEdit, meFieldUnit );
addListener();
Initialize();
}
@@ -182,6 +231,12 @@ void SlideBackground::Initialize()
mpDspMasterBackground->SetClickHdl(LINK(this, SlideBackground, DspBackground));
mpDspMasterObjects->SetClickHdl(LINK(this,SlideBackground, DspObjects));
+ //margins
+ m_pLeftMarginEdit->SetModifyHdl(LINK(this, SlideBackground, ModifyLRMarginHdl));
+ m_pRightMarginEdit->SetModifyHdl(LINK(this, SlideBackground, ModifyLRMarginHdl));
+ m_pTopMarginEdit->SetModifyHdl(LINK(this, SlideBackground, ModifyULMarginHdl));
+ m_pBottomMarginEdit->SetModifyHdl(LINK(this, SlideBackground, ModifyULMarginHdl));
+
Update();
}
@@ -472,9 +527,16 @@ void SlideBackground::dispose()
mpMasterLabel.clear();
mpEditMaster.clear();
mpCloseMaster.clear();
+ m_pLeftMarginEdit.clear();
+ m_pRightMarginEdit.clear();
+ m_pTopMarginEdit.clear();
+ m_pBottomMarginEdit.clear();
+ m_pContainer.clear();
maPaperSizeController.dispose();
maPaperOrientationController.dispose();
+ maPaperMarginLRController.dispose();
+ maPaperMarginULController.dispose();
maBckColorController.dispose();
maBckGradientController.dispose();
maBckHatchController.dispose();
@@ -694,6 +756,38 @@ void SlideBackground::NotifyItemUpdate(
}
break;
+ case SID_ATTR_PAGE_LRSPACE:
+ {
+ const SvxLongLRSpaceItem* pLRItem = nullptr;
+ if (eState >= SfxItemState::DEFAULT)
+ {
+ pLRItem = dynamic_cast<const SvxLongLRSpaceItem*>(pState);
+ m_nPageLeftMargin = pLRItem->GetLeft();
+ m_nPageRightMargin = pLRItem->GetRight();
+ SetFieldUnit(*m_pLeftMarginEdit, meFieldUnit, true);
+ SetMetricValue(*m_pLeftMarginEdit.get(), m_nPageLeftMargin, meUnit);
+ SetFieldUnit(*m_pRightMarginEdit, meFieldUnit, true);
+ SetMetricValue(*m_pRightMarginEdit.get(), m_nPageRightMargin, meUnit);
+ }
+ }
+ break;
+
+ case SID_ATTR_PAGE_ULSPACE:
+ {
+ const SvxLongULSpaceItem* pULItem = nullptr;
+ if (eState >= SfxItemState::DEFAULT)
+ {
+ pULItem = dynamic_cast<const SvxLongULSpaceItem*>(pState);
+ m_nPageTopMargin = pULItem->GetUpper();
+ m_nPageBottomMargin = pULItem->GetLower();
+ SetFieldUnit(*m_pTopMarginEdit, meFieldUnit, true);
+ SetMetricValue(*m_pTopMarginEdit.get(), m_nPageTopMargin, meUnit);
+ SetFieldUnit(*m_pBottomMarginEdit, meFieldUnit, true);
+ SetMetricValue(*m_pBottomMarginEdit.get(), m_nPageBottomMargin, meUnit);
+ }
+ }
+ break;
+
case SID_DISPLAY_MASTER_BACKGROUND:
{
const SfxBoolItem* pBoolItem = nullptr;
@@ -726,6 +820,33 @@ void SlideBackground::NotifyItemUpdate(
}
}
+void SlideBackground::SetMetricFieldMaxValues( const Size& rPageSize )
+{
+ const long nML = m_pLeftMarginEdit->Denormalize( m_pLeftMarginEdit->GetValue( FUNIT_TWIP ) );
+ const long nMR = m_pRightMarginEdit->Denormalize( m_pRightMarginEdit->GetValue( FUNIT_TWIP ) );
+ const long nMT = m_pTopMarginEdit->Denormalize( m_pTopMarginEdit->GetValue( FUNIT_TWIP ) );
+ const long nMB = m_pBottomMarginEdit->Denormalize( m_pBottomMarginEdit->GetValue( FUNIT_TWIP ) );
+
+ const long nPH = LogicToLogic( rPageSize.Height(), meUnit, MapUnit::MapTwip );
+ const long nPW = LogicToLogic( rPageSize.Width(), meUnit, MapUnit::MapTwip );
+
+ // Left
+ long nMax = nPW - nMR - MINBODY;
+ m_pLeftMarginEdit->SetMax( m_pLeftMarginEdit->Normalize( nMax ), FUNIT_TWIP );
+
+ // Right
+ nMax = nPW - nML - MINBODY;
+ m_pRightMarginEdit->SetMax( m_pRightMarginEdit->Normalize( nMax ), FUNIT_TWIP );
+
+ //Top
+ nMax = nPH - nMB - MINBODY;
+ m_pTopMarginEdit->SetMax( m_pTopMarginEdit->Normalize( nMax ), FUNIT_TWIP );
+
+ //Bottom
+ nMax = nPH - nMT - MINBODY;
+ m_pBottomMarginEdit->SetMax( m_pTopMarginEdit->Normalize( nMax ), FUNIT_TWIP );
+}
+
IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void)
{
const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectEntryPos();
@@ -906,6 +1027,36 @@ IMPL_LINK_NOARG(SlideBackground, DspObjects, Button*, void)
GetBindings()->GetDispatcher()->ExecuteList(SID_DISPLAY_MASTER_OBJECTS, SfxCallMode::RECORD, { &aBoolItem, &aBoolItem });
}
+IMPL_LINK_NOARG( SlideBackground, ModifyLRMarginHdl, Edit&, void )
+{
+ m_nPageLeftMargin = GetCoreValue( *m_pLeftMarginEdit.get(), meUnit );
+ m_nPageRightMargin = GetCoreValue( *m_pRightMarginEdit.get(), meUnit );
+ if ( SfxViewFrame::Current() )
+ {
+ std::unique_ptr<SvxLongLRSpaceItem> pPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) );
+ pPageLRMarginItem->SetLeft( m_nPageLeftMargin );
+ pPageLRMarginItem->SetRight( m_nPageRightMargin );
+ GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE, SfxCallMode::RECORD, { pPageLRMarginItem.get() } );
+ pPageLRMarginItem.reset();
+ }
+ SetMetricFieldMaxValues( m_aPageSize );
+}
+
+IMPL_LINK_NOARG( SlideBackground, ModifyULMarginHdl, Edit&, void )
+{
+ m_nPageTopMargin = GetCoreValue( *m_pTopMarginEdit.get(), meUnit );
+ m_nPageBottomMargin = GetCoreValue( *m_pBottomMarginEdit.get(), meUnit );
+ if ( SfxViewFrame::Current() )
+ {
+ std::unique_ptr<SvxLongULSpaceItem> pPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) );
+ pPageULMarginItem->SetUpper( m_nPageTopMargin );
+ pPageULMarginItem->SetLower( m_nPageBottomMargin );
+ GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_ULSPACE, SfxCallMode::RECORD, { pPageULMarginItem.get() } );
+ pPageULMarginItem.reset();
+ }
+ SetMetricFieldMaxValues( m_aPageSize );
+}
+
}}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index 4294027a0b53..20b6a289b691 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -34,7 +34,9 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <com/sun/star/drawing/XDrawView.hpp>
#include "fupage.hxx"
+#include <editeng/sizeitem.hxx>
#include <svx/papersizelistbox.hxx>
+#include <svx/rulritem.hxx>
#include <svx/xflclit.hxx>
#include <svx/xgrad.hxx>
#include <svx/xflgrit.hxx>
@@ -47,6 +49,8 @@
class SvxColorListBox;
+static const long MINBODY = 284;
+
namespace sd { namespace sidebar {
class SlideBackground :
@@ -89,9 +93,16 @@ private:
VclPtr<Button> mpCloseMaster;
VclPtr<Button> mpEditMaster;
VclPtr<FixedText> mpMasterLabel;
+ VclPtr<MetricField> m_pLeftMarginEdit;
+ VclPtr<MetricField> m_pRightMarginEdit;
+ VclPtr<MetricField> m_pTopMarginEdit;
+ VclPtr<MetricField> m_pBottomMarginEdit;
+ VclPtr<VclVBox> m_pContainer;
::sfx2::sidebar::ControllerItem maPaperSizeController;
::sfx2::sidebar::ControllerItem maPaperOrientationController;
+ ::sfx2::sidebar::ControllerItem maPaperMarginLRController;
+ ::sfx2::sidebar::ControllerItem maPaperMarginULController;
::sfx2::sidebar::ControllerItem maBckColorController;
::sfx2::sidebar::ControllerItem maBckGradientController;
::sfx2::sidebar::ControllerItem maBckHatchController;
@@ -104,6 +115,8 @@ private:
::sfx2::sidebar::ControllerItem maCloseMasterController;
std::unique_ptr< SvxPageItem > mpPageItem;
+ std::unique_ptr< SvxLongLRSpaceItem > mpLRItem;
+ std::unique_ptr< SvxLongULSpaceItem > mpULItem;
std::unique_ptr< XFillColorItem > mpColorItem;
std::unique_ptr< XFillGradientItem > mpGradientItem;
std::unique_ptr< XFillHatchItem > mpHatchItem;
@@ -118,9 +131,16 @@ private:
vcl::EnumContext maImpressOtherContext;
vcl::EnumContext maImpressMasterContext;
bool mbTitle;
+ FieldUnit meFieldUnit;
+ long m_nPageLeftMargin;
+ long m_nPageRightMargin;
+ long m_nPageTopMargin;
+ long m_nPageBottomMargin;
+
SfxBindings* mpBindings;
MapUnit meUnit;
+ Size m_aPageSize;
DECL_LINK(FillBackgroundHdl, ListBox&, void);
DECL_LINK(FillStyleModifyHdl, ListBox&, void);
@@ -131,6 +151,8 @@ private:
DECL_LINK(DspObjects, Button*, void);
DECL_LINK(CloseMasterHdl, Button*, void);
DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
+ DECL_LINK( ModifyLRMarginHdl, Edit&, void );
+ DECL_LINK( ModifyULMarginHdl, Edit&, void );
void Initialize();
void Update();
@@ -146,6 +168,7 @@ private:
void removeListener();
void populateMasterSlideDropdown();
void updateMasterSlideSelection();
+ void SetMetricFieldMaxValues(const Size& rPageSize);
};
}}
diff --git a/sd/source/ui/view/drviews7.cxx b/sd/source/ui/view/drviews7.cxx
index 6e9d40f365e7..d829639e0bae 100644
--- a/sd/source/ui/view/drviews7.cxx
+++ b/sd/source/ui/view/drviews7.cxx
@@ -18,6 +18,7 @@
*/
#include <memory>
+
#include <sal/config.h>
#include <utility>
@@ -27,11 +28,14 @@
#include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <svx/fmglob.hxx>
#include <svx/globl3d.hxx>
+#include <svx/rulritem.hxx>
#include <svx/svdouno.hxx>
#include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx>
#include <editeng/outlobj.hxx>
#include <editeng/sizeitem.hxx>
+#include <editeng/ulspitem.hxx>
+#include <editeng/lrspitem.hxx>
#include <officecfg/Office/Common.hxx>
#include <officecfg/Office/Impress.hxx>
#include <svx/svxids.hrc>
@@ -40,6 +44,7 @@
#include <svx/fmshell.hxx>
#include <svl/eitem.hxx>
#include <svl/aeitem.hxx>
+#include <svl/itemset.hxx>
#include <svl/stritem.hxx>
#include <svl/visitem.hxx>
#include <svl/whiter.hxx>
@@ -73,6 +78,7 @@
#include "Outliner.hxx"
#include "drawdoc.hxx"
+#include "DrawViewShell.hxx"
#include "sdresid.hxx"
#include "sdpage.hxx"
#include "Client.hxx"
@@ -80,6 +86,7 @@
#include "zoomlist.hxx"
#include "slideshow.hxx"
#include "drawview.hxx"
+#include "View.hxx"
#include "ViewShellBase.hxx"
#include "ViewShellManager.hxx"
#include "LayerTabBar.hxx"
@@ -149,6 +156,7 @@ using namespace ::com::sun::star::linguistic2;
break;
}
+
case SotClipboardFormatId::LINK_SOURCE:
case SotClipboardFormatId::DRAWING:
case SotClipboardFormatId::SVXB:
@@ -249,6 +257,44 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet)
return pOL;
}
+void DrawViewShell::GetMarginProperties( SfxItemSet &rSet )
+{
+ SdPage *pPage = getCurrentPage();
+ SfxWhichIter aIter( rSet );
+ sal_uInt16 nWhich = aIter.FirstWhich();
+ while ( nWhich )
+ {
+ switch ( nWhich )
+ {
+ case SID_ATTR_PAGE_LRSPACE:
+ {
+ // const SvxLRSpaceItem aTmpPageLRSpace ( rDesc.GetMaster().GetLRSpace() );
+ const SvxLongLRSpaceItem aLongLR(
+ (long)pPage->GetLftBorder(),
+ (long)pPage->GetRgtBorder(),
+ SID_ATTR_PAGE_LRSPACE );
+ rSet.Put( aLongLR );
+ }
+ break;
+
+ case SID_ATTR_PAGE_ULSPACE:
+ {
+ // const SvxULSpaceItem aUL( rDesc.GetMaster().GetULSpace() );
+ SvxLongULSpaceItem aLongUL(
+ (long)pPage->GetUppBorder(),
+ (long)pPage->GetLwrBorder(),
+ SID_ATTR_PAGE_ULSPACE );
+ rSet.Put( aLongUL );
+ }
+ break;
+
+ default:
+ break;
+ }
+ nWhich = aIter.NextWhich();
+ }
+}
+
void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{
if (mpDrawView == nullptr)
@@ -1712,6 +1758,18 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
SdPage *pPage = getCurrentPage();
sal_uInt16 nSlotId = rReq.GetSlot();
const SfxItemSet *pArgs = rReq.GetArgs();
+ // const size_t nDescId = rSh->GetCurPageDesc();
+ // const SdPage& rDesc = rSh->GetPageDesc( nDescId );
+ Size maSize = pPage->GetSize();
+ PageKind ePageKind = GetPageKind();
+ const SfxPoolItem* pPoolItem = nullptr;
+ Size aNewSize(maSize);
+ sal_Int32 nLeft = -1, nRight = -1, nUpper = -1, nLower = -1;
+ bool bScaleAll = true;
+ Orientation eOrientation = pPage->GetOrientation();
+ SdPage* pMasterPage = pPage->IsMasterPage() ? pPage : &static_cast<SdPage&>(pPage->TRG_GetMasterPage());
+ bool bFullSize = pMasterPage->IsBackgroundFullSize();
+ sal_uInt16 nPaperBin = pPage->GetPaperBin();
if ( pPage && pArgs )
{
@@ -1784,6 +1842,44 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
rReq.Done();
}
+ else
+ {
+ switch (nSlotId)
+ {
+ case SID_ATTR_PAGE_LRSPACE:
+ if( pArgs->GetItemState(GetPool().GetWhich(SID_ATTR_PAGE_LRSPACE),
+ true,&pPoolItem) == SfxItemState::SET )
+ {
+ nLeft = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetLeft();
+ nRight = static_cast<const SvxLongLRSpaceItem*>(pPoolItem)->GetRight();
+ if (nLeft != -1 && nUpper == -1)
+ {
+ nUpper = pPage->GetUppBorder();
+ nLower = pPage->GetLwrBorder();
+ }
+ SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
+ }
+ break;
+
+ case SID_ATTR_PAGE_ULSPACE:
+ if( pArgs->GetItemState(SID_ATTR_PAGE_ULSPACE,
+ true,&pPoolItem) == SfxItemState::SET )
+ {
+ nUpper = static_cast<const SvxLongULSpaceItem*>(pPoolItem)->GetUpper();
+ nLower = static_cast<const SvxLongULSpaceItem*>(pPoolItem)->GetLower();
+ if (nLeft == -1 && nUpper != -1)
+ {
+ nLeft = pPage->GetLftBorder();
+ nRight = pPage->GetRgtBorder();
+ }
+ SetPageSizeAndBorder(ePageKind, aNewSize, nLeft, nRight, nUpper, nLower, bScaleAll, eOrientation, nPaperBin, bFullSize );
+ }
+ break;
+
+ default:
+ break;
+ }
+ }
}
}
diff --git a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
index 823d2c03f052..b9d07ab29ce9 100644
--- a/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
+++ b/sd/uiconfig/simpress/ui/sidebarslidebackground.ui
@@ -3,6 +3,11 @@
<interface>
<requires lib="gtk+" version="3.0"/>
<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="GtkGrid" id="SlideBackgroundPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -236,6 +241,166 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="labeltop">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Top: </property>
+ <property name="mnemonic_widget">top:0.00cm</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">13</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="top:0.00cm">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="digits">2</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">13</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelbottom">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Bottom: </property>
+ <property name="mnemonic_widget">bottom:0.00cm</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">14</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="bottom:0.00cm">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="digits">2</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">14</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelleft">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Left: </property>
+ <property name="mnemonic_widget">left:0.00cm</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="left:0.00cm">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="digits">2</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">11</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="labelright">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="halign">end</property>
+ <property name="label" translatable="yes">Right: </property>
+ <property name="mnemonic_widget">right:0.00cm</property>
+ </object>
+ <packing>
+ <property name="left_attach">0</property>
+ <property name="top_attach">12</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkSpinButton" id="right:0.00cm">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">•</property>
+ <property name="digits">2</property>
+ <property name="adjustment">adjustment1</property>
+ </object>
+ <packing>
+ <property name="left_attach">1</property>
+ <property name="top_attach">12</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="container">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="left_attach">2</property>
+ <property name="top_attach">0</property>
+ </packing>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
+ <placeholder/>
+ </child>
+ <child>
<placeholder/>
</child>
<child>
diff --git a/svx/sdi/svx.sdi b/svx/sdi/svx.sdi
index a8c2a3431aa1..d8fa3f060409 100644
--- a/svx/sdi/svx.sdi
+++ b/svx/sdi/svx.sdi
@@ -6176,6 +6176,44 @@ SvxPageItem Orientation SID_ATTR_PAGE_ORIENTATION
]
+SvxLongULSpaceItem PageULMargin SID_ATTR_PAGE_ULSPACE
+
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_FORMAT;
+]
+
+
+SvxLongLRSpaceItem PageLRMargin SID_ATTR_PAGE_LRSPACE
+
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = FALSE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+
+ AccelConfig = FALSE,
+ MenuConfig = FALSE,
+ ToolBoxConfig = FALSE,
+ GroupId = GID_FORMAT;
+]
+
+
SvxAutoKernItem PairKerning SID_ATTR_CHAR_AUTOKERN
[
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 91078196f67b..e7dd58be6c9c 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -810,8 +810,6 @@
#define FN_UNO_DESCRIPTION (FN_FRAME + 20)
#define SID_ATTR_PAGE_COLUMN (FN_SIDEBAR + 0)
-#define SID_ATTR_PAGE_ULSPACE (FN_SIDEBAR + 1)
-#define SID_ATTR_PAGE_LRSPACE (FN_SIDEBAR + 2)
#define SID_ATTR_PAGE_HEADER (FN_SIDEBAR + 3)
#define SID_ATTR_PAGE_HEADER_LRMARGIN (FN_SIDEBAR + 4)
#define SID_ATTR_PAGE_HEADER_SPACING (FN_SIDEBAR + 5)
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 0146294d4ed6..efcf9a9ffe43 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -7384,42 +7384,6 @@ SfxInt16Item PageColumnType SID_ATTR_PAGE_COLUMN
GroupId = GID_FORMAT;
]
-SvxLongULSpaceItem SwPageULMargin SID_ATTR_PAGE_ULSPACE
-
-[
- AutoUpdate = FALSE,
- FastCall = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
-
-
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_FORMAT;
-]
-
-SvxLongLRSpaceItem SwPageLRMargin SID_ATTR_PAGE_LRSPACE
-
-[
- AutoUpdate = FALSE,
- FastCall = FALSE,
- ReadOnlyDoc = FALSE,
- Toggle = FALSE,
- Container = FALSE,
- RecordAbsolute = FALSE,
- RecordPerSet;
-
-
- AccelConfig = FALSE,
- MenuConfig = FALSE,
- ToolBoxConfig = FALSE,
- GroupId = GID_FORMAT;
-]
-
SfxVoidItem PageMargin SID_ATTR_PAGE_MARGIN
[