Kaydet (Commit) fba28df7 authored tarafından pv2k's avatar pv2k Kaydeden (comit) Katarina Behrens

Added margin feature to the Draw's SideBar

Change-Id: I53b5430d1563fcceae29418fd5907ac42ea856e7
Reviewed-on: https://gerrit.libreoffice.org/37626Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
Tested-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
üst 4eae2eeb
...@@ -236,13 +236,15 @@ ...@@ -236,13 +236,15 @@
#define SID_ATTR_PAGE_MAXSIZE ( SID_SVX_START + 52 ) #define SID_ATTR_PAGE_MAXSIZE ( SID_SVX_START + 52 )
#define SID_ATTR_PAGE_ORIENTATION ( SID_SVX_START + 53 ) #define SID_ATTR_PAGE_ORIENTATION ( SID_SVX_START + 53 )
#define SID_ATTR_PAGE_PAPERBIN ( SID_SVX_START + 54 ) #define SID_ATTR_PAGE_PAPERBIN ( SID_SVX_START + 54 )
#define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 56 ) #define SID_ATTR_PAGE_EXT1 ( SID_SVX_START + 55 )
#define SID_ATTR_PAGE_EXT2 ( SID_SVX_START + 57 ) #define SID_ATTR_PAGE_EXT2 ( SID_SVX_START + 56 )
#define SID_ATTR_PAGE_HEADERSET ( SID_SVX_START + 58 ) #define SID_ATTR_PAGE_HEADERSET ( SID_SVX_START + 57 )
#define SID_ATTR_PAGE_FOOTERSET ( SID_SVX_START + 59 ) #define SID_ATTR_PAGE_FOOTERSET ( SID_SVX_START + 58 )
#define SID_ATTR_PAGE_ON ( SID_SVX_START + 60 ) #define SID_ATTR_PAGE_ON ( SID_SVX_START + 59 )
#define SID_ATTR_PAGE_DYNAMIC ( SID_SVX_START + 61 ) #define SID_ATTR_PAGE_DYNAMIC ( SID_SVX_START + 60 )
#define SID_ATTR_PAGE_SHARED ( SID_SVX_START + 62 ) #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 (!) // CAUTION! Range <64 .. 67> used by EditEngine (!)
......
...@@ -2603,6 +2603,16 @@ interface DrawView ...@@ -2603,6 +2603,16 @@ interface DrawView
ExecMethod = FuTemporary ; ExecMethod = FuTemporary ;
StateMethod = GetPageProperties ; StateMethod = GetPageProperties ;
] ]
SID_ATTR_PAGE_LRSPACE
[
ExecMethod = SetPageProperties ;
StateMethod = GetMarginProperties ;
]
SID_ATTR_PAGE_ULSPACE
[
ExecMethod = SetPageProperties ;
StateMethod = GetMarginProperties ;
]
SID_ATTR_PAGE_COLOR SID_ATTR_PAGE_COLOR
[ [
ExecMethod = SetPageProperties ; ExecMethod = SetPageProperties ;
......
...@@ -159,6 +159,7 @@ public: ...@@ -159,6 +159,7 @@ public:
void SetPageProperties (SfxRequest& rReq); void SetPageProperties (SfxRequest& rReq);
void GetPageProperties(SfxItemSet& rSet); void GetPageProperties(SfxItemSet& rSet);
void GetMarginProperties(SfxItemSet& rSet);
void GetState (SfxItemSet& rSet); void GetState (SfxItemSet& rSet);
void Execute (SfxRequest& rReq); void Execute (SfxRequest& rReq);
......
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
#include <sfx2/sidebar/Theme.hxx> #include <sfx2/sidebar/Theme.hxx>
#include "app.hrc" #include "app.hrc"
#include <editeng/paperinf.hxx> #include <editeng/paperinf.hxx>
#include <editeng/sizeitem.hxx> #include <svx/rulritem.hxx>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <svx/xflclit.hxx> #include <svx/xflclit.hxx>
#include <svx/xgrad.hxx> #include <svx/xgrad.hxx>
...@@ -59,16 +59,41 @@ ...@@ -59,16 +59,41 @@
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <sfx2/objface.hxx> #include <sfx2/objface.hxx>
#include <svx/dlgutil.hxx> #include <svx/dlgutil.hxx>
#include <sfx2/tabdlg.hxx>
#include <algorithm> #include <algorithm>
#include "EventMultiplexer.hxx" #include "EventMultiplexer.hxx"
#include "glob.hrc" #include "glob.hrc"
#include <vcl/salbtype.hxx> #include <vcl/salbtype.hxx>
#include <vcl/EnumContext.hxx> #include <vcl/EnumContext.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <svl/itemset.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
using ::com::sun::star::uno::Reference; 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 { namespace sd { namespace sidebar {
enum eFillStyle enum eFillStyle
...@@ -91,6 +116,8 @@ SlideBackground::SlideBackground( ...@@ -91,6 +116,8 @@ SlideBackground::SlideBackground(
mrBase( rBase ), mrBase( rBase ),
maPaperSizeController(SID_ATTR_PAGE_SIZE, *pBindings, *this), maPaperSizeController(SID_ATTR_PAGE_SIZE, *pBindings, *this),
maPaperOrientationController(SID_ATTR_PAGE, *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), maBckColorController(SID_ATTR_PAGE_COLOR, *pBindings, *this),
maBckGradientController(SID_ATTR_PAGE_GRADIENT, *pBindings, *this), maBckGradientController(SID_ATTR_PAGE_GRADIENT, *pBindings, *this),
maBckHatchController(SID_ATTR_PAGE_HATCH, *pBindings, *this), maBckHatchController(SID_ATTR_PAGE_HATCH, *pBindings, *this),
...@@ -114,6 +141,11 @@ SlideBackground::SlideBackground( ...@@ -114,6 +141,11 @@ SlideBackground::SlideBackground(
maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage), maImpressOtherContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::DrawPage),
maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage), maImpressMasterContext(vcl::EnumContext::Application::Impress, vcl::EnumContext::Context::MasterPage),
mbTitle(false), mbTitle(false),
meFieldUnit(lcl_GetFieldUnit()),
m_nPageLeftMargin(0),
m_nPageRightMargin(0),
m_nPageTopMargin(0),
m_nPageBottomMargin(0),
mpBindings(pBindings) mpBindings(pBindings)
{ {
get(mpPaperSizeBox,"paperformat"); get(mpPaperSizeBox,"paperformat");
...@@ -131,6 +163,23 @@ SlideBackground::SlideBackground( ...@@ -131,6 +163,23 @@ SlideBackground::SlideBackground(
get(mpCloseMaster, "closemasterslide"); get(mpCloseMaster, "closemasterslide");
get(mpEditMaster, "masterslidebutton"); get(mpEditMaster, "masterslidebutton");
get(mpMasterLabel, "masterlabel"); 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(); addListener();
Initialize(); Initialize();
} }
...@@ -182,6 +231,12 @@ void SlideBackground::Initialize() ...@@ -182,6 +231,12 @@ void SlideBackground::Initialize()
mpDspMasterBackground->SetClickHdl(LINK(this, SlideBackground, DspBackground)); mpDspMasterBackground->SetClickHdl(LINK(this, SlideBackground, DspBackground));
mpDspMasterObjects->SetClickHdl(LINK(this,SlideBackground, DspObjects)); 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(); Update();
} }
...@@ -472,9 +527,16 @@ void SlideBackground::dispose() ...@@ -472,9 +527,16 @@ void SlideBackground::dispose()
mpMasterLabel.clear(); mpMasterLabel.clear();
mpEditMaster.clear(); mpEditMaster.clear();
mpCloseMaster.clear(); mpCloseMaster.clear();
m_pLeftMarginEdit.clear();
m_pRightMarginEdit.clear();
m_pTopMarginEdit.clear();
m_pBottomMarginEdit.clear();
m_pContainer.clear();
maPaperSizeController.dispose(); maPaperSizeController.dispose();
maPaperOrientationController.dispose(); maPaperOrientationController.dispose();
maPaperMarginLRController.dispose();
maPaperMarginULController.dispose();
maBckColorController.dispose(); maBckColorController.dispose();
maBckGradientController.dispose(); maBckGradientController.dispose();
maBckHatchController.dispose(); maBckHatchController.dispose();
...@@ -694,6 +756,38 @@ void SlideBackground::NotifyItemUpdate( ...@@ -694,6 +756,38 @@ void SlideBackground::NotifyItemUpdate(
} }
break; 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: case SID_DISPLAY_MASTER_BACKGROUND:
{ {
const SfxBoolItem* pBoolItem = nullptr; const SfxBoolItem* pBoolItem = nullptr;
...@@ -726,6 +820,33 @@ void SlideBackground::NotifyItemUpdate( ...@@ -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) IMPL_LINK_NOARG(SlideBackground, FillStyleModifyHdl, ListBox&, void)
{ {
const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectEntryPos(); const eFillStyle nPos = (eFillStyle)mpFillStyle->GetSelectEntryPos();
...@@ -906,6 +1027,36 @@ IMPL_LINK_NOARG(SlideBackground, DspObjects, Button*, void) ...@@ -906,6 +1027,36 @@ IMPL_LINK_NOARG(SlideBackground, DspObjects, Button*, void)
GetBindings()->GetDispatcher()->ExecuteList(SID_DISPLAY_MASTER_OBJECTS, SfxCallMode::RECORD, { &aBoolItem, &aBoolItem }); 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: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -34,7 +34,9 @@ ...@@ -34,7 +34,9 @@
#include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/ControllerItem.hxx>
#include <com/sun/star/drawing/XDrawView.hpp> #include <com/sun/star/drawing/XDrawView.hpp>
#include "fupage.hxx" #include "fupage.hxx"
#include <editeng/sizeitem.hxx>
#include <svx/papersizelistbox.hxx> #include <svx/papersizelistbox.hxx>
#include <svx/rulritem.hxx>
#include <svx/xflclit.hxx> #include <svx/xflclit.hxx>
#include <svx/xgrad.hxx> #include <svx/xgrad.hxx>
#include <svx/xflgrit.hxx> #include <svx/xflgrit.hxx>
...@@ -47,6 +49,8 @@ ...@@ -47,6 +49,8 @@
class SvxColorListBox; class SvxColorListBox;
static const long MINBODY = 284;
namespace sd { namespace sidebar { namespace sd { namespace sidebar {
class SlideBackground : class SlideBackground :
...@@ -89,9 +93,16 @@ private: ...@@ -89,9 +93,16 @@ private:
VclPtr<Button> mpCloseMaster; VclPtr<Button> mpCloseMaster;
VclPtr<Button> mpEditMaster; VclPtr<Button> mpEditMaster;
VclPtr<FixedText> mpMasterLabel; 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 maPaperSizeController;
::sfx2::sidebar::ControllerItem maPaperOrientationController; ::sfx2::sidebar::ControllerItem maPaperOrientationController;
::sfx2::sidebar::ControllerItem maPaperMarginLRController;
::sfx2::sidebar::ControllerItem maPaperMarginULController;
::sfx2::sidebar::ControllerItem maBckColorController; ::sfx2::sidebar::ControllerItem maBckColorController;
::sfx2::sidebar::ControllerItem maBckGradientController; ::sfx2::sidebar::ControllerItem maBckGradientController;
::sfx2::sidebar::ControllerItem maBckHatchController; ::sfx2::sidebar::ControllerItem maBckHatchController;
...@@ -104,6 +115,8 @@ private: ...@@ -104,6 +115,8 @@ private:
::sfx2::sidebar::ControllerItem maCloseMasterController; ::sfx2::sidebar::ControllerItem maCloseMasterController;
std::unique_ptr< SvxPageItem > mpPageItem; std::unique_ptr< SvxPageItem > mpPageItem;
std::unique_ptr< SvxLongLRSpaceItem > mpLRItem;
std::unique_ptr< SvxLongULSpaceItem > mpULItem;
std::unique_ptr< XFillColorItem > mpColorItem; std::unique_ptr< XFillColorItem > mpColorItem;
std::unique_ptr< XFillGradientItem > mpGradientItem; std::unique_ptr< XFillGradientItem > mpGradientItem;
std::unique_ptr< XFillHatchItem > mpHatchItem; std::unique_ptr< XFillHatchItem > mpHatchItem;
...@@ -118,9 +131,16 @@ private: ...@@ -118,9 +131,16 @@ private:
vcl::EnumContext maImpressOtherContext; vcl::EnumContext maImpressOtherContext;
vcl::EnumContext maImpressMasterContext; vcl::EnumContext maImpressMasterContext;
bool mbTitle; bool mbTitle;
FieldUnit meFieldUnit;
long m_nPageLeftMargin;
long m_nPageRightMargin;
long m_nPageTopMargin;
long m_nPageBottomMargin;
SfxBindings* mpBindings; SfxBindings* mpBindings;
MapUnit meUnit; MapUnit meUnit;
Size m_aPageSize;
DECL_LINK(FillBackgroundHdl, ListBox&, void); DECL_LINK(FillBackgroundHdl, ListBox&, void);
DECL_LINK(FillStyleModifyHdl, ListBox&, void); DECL_LINK(FillStyleModifyHdl, ListBox&, void);
...@@ -131,6 +151,8 @@ private: ...@@ -131,6 +151,8 @@ private:
DECL_LINK(DspObjects, Button*, void); DECL_LINK(DspObjects, Button*, void);
DECL_LINK(CloseMasterHdl, Button*, void); DECL_LINK(CloseMasterHdl, Button*, void);
DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void ); DECL_LINK(EventMultiplexerListener, tools::EventMultiplexerEvent&, void );
DECL_LINK( ModifyLRMarginHdl, Edit&, void );
DECL_LINK( ModifyULMarginHdl, Edit&, void );
void Initialize(); void Initialize();
void Update(); void Update();
...@@ -146,6 +168,7 @@ private: ...@@ -146,6 +168,7 @@ private:
void removeListener(); void removeListener();
void populateMasterSlideDropdown(); void populateMasterSlideDropdown();
void updateMasterSlideSelection(); void updateMasterSlideSelection();
void SetMetricFieldMaxValues(const Size& rPageSize);
}; };
}} }}
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <memory> #include <memory>
#include <sal/config.h> #include <sal/config.h>
#include <utility> #include <utility>
...@@ -27,11 +28,14 @@ ...@@ -27,11 +28,14 @@
#include <com/sun/star/linguistic2/XThesaurus.hpp> #include <com/sun/star/linguistic2/XThesaurus.hpp>
#include <svx/fmglob.hxx> #include <svx/fmglob.hxx>
#include <svx/globl3d.hxx> #include <svx/globl3d.hxx>
#include <svx/rulritem.hxx>
#include <svx/svdouno.hxx> #include <svx/svdouno.hxx>
#include <editeng/eeitem.hxx> #include <editeng/eeitem.hxx>
#include <editeng/flditem.hxx> #include <editeng/flditem.hxx>
#include <editeng/outlobj.hxx> #include <editeng/outlobj.hxx>
#include <editeng/sizeitem.hxx> #include <editeng/sizeitem.hxx>
#include <editeng/ulspitem.hxx>
#include <editeng/lrspitem.hxx>
#include <officecfg/Office/Common.hxx> #include <officecfg/Office/Common.hxx>
#include <officecfg/Office/Impress.hxx> #include <officecfg/Office/Impress.hxx>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
...@@ -40,6 +44,7 @@ ...@@ -40,6 +44,7 @@
#include <svx/fmshell.hxx> #include <svx/fmshell.hxx>
#include <svl/eitem.hxx> #include <svl/eitem.hxx>
#include <svl/aeitem.hxx> #include <svl/aeitem.hxx>
#include <svl/itemset.hxx>
#include <svl/stritem.hxx> #include <svl/stritem.hxx>
#include <svl/visitem.hxx> #include <svl/visitem.hxx>
#include <svl/whiter.hxx> #include <svl/whiter.hxx>
...@@ -73,6 +78,7 @@ ...@@ -73,6 +78,7 @@
#include "Outliner.hxx" #include "Outliner.hxx"
#include "drawdoc.hxx" #include "drawdoc.hxx"
#include "DrawViewShell.hxx"
#include "sdresid.hxx" #include "sdresid.hxx"
#include "sdpage.hxx" #include "sdpage.hxx"
#include "Client.hxx" #include "Client.hxx"
...@@ -80,6 +86,7 @@ ...@@ -80,6 +86,7 @@
#include "zoomlist.hxx" #include "zoomlist.hxx"
#include "slideshow.hxx" #include "slideshow.hxx"
#include "drawview.hxx" #include "drawview.hxx"
#include "View.hxx"
#include "ViewShellBase.hxx" #include "ViewShellBase.hxx"
#include "ViewShellManager.hxx" #include "ViewShellManager.hxx"
#include "LayerTabBar.hxx" #include "LayerTabBar.hxx"
...@@ -149,6 +156,7 @@ using namespace ::com::sun::star::linguistic2; ...@@ -149,6 +156,7 @@ using namespace ::com::sun::star::linguistic2;
break; break;
} }
case SotClipboardFormatId::LINK_SOURCE: case SotClipboardFormatId::LINK_SOURCE:
case SotClipboardFormatId::DRAWING: case SotClipboardFormatId::DRAWING:
case SotClipboardFormatId::SVXB: case SotClipboardFormatId::SVXB:
...@@ -249,6 +257,44 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet) ...@@ -249,6 +257,44 @@ void DrawViewShell::GetDrawAttrState(SfxItemSet& rSet)
return pOL; 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 ) void DrawViewShell::GetMenuState( SfxItemSet &rSet )
{ {
if (mpDrawView == nullptr) if (mpDrawView == nullptr)
...@@ -1712,6 +1758,18 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) ...@@ -1712,6 +1758,18 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
SdPage *pPage = getCurrentPage(); SdPage *pPage = getCurrentPage();
sal_uInt16 nSlotId = rReq.GetSlot(); sal_uInt16 nSlotId = rReq.GetSlot();
const SfxItemSet *pArgs = rReq.GetArgs(); 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 ) if ( pPage && pArgs )
{ {
...@@ -1784,6 +1842,44 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq) ...@@ -1784,6 +1842,44 @@ void DrawViewShell::SetPageProperties (SfxRequest& rReq)
rReq.Done(); 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;
}
}
} }
} }
......
...@@ -3,6 +3,11 @@ ...@@ -3,6 +3,11 @@
<interface> <interface>
<requires lib="gtk+" version="3.0"/> <requires lib="gtk+" version="3.0"/>
<requires lib="LibreOffice" version="1.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"> <object class="GtkGrid" id="SlideBackgroundPanel">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -235,6 +240,166 @@ ...@@ -235,6 +240,166 @@
<property name="top_attach">10</property> <property name="top_attach">10</property>
</packing> </packing>
</child> </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> <child>
<placeholder/> <placeholder/>
</child> </child>
......
...@@ -6176,6 +6176,44 @@ SvxPageItem Orientation SID_ATTR_PAGE_ORIENTATION ...@@ -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 SvxAutoKernItem PairKerning SID_ATTR_CHAR_AUTOKERN
[ [
......
...@@ -810,8 +810,6 @@ ...@@ -810,8 +810,6 @@
#define FN_UNO_DESCRIPTION (FN_FRAME + 20) #define FN_UNO_DESCRIPTION (FN_FRAME + 20)
#define SID_ATTR_PAGE_COLUMN (FN_SIDEBAR + 0) #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 (FN_SIDEBAR + 3)
#define SID_ATTR_PAGE_HEADER_LRMARGIN (FN_SIDEBAR + 4) #define SID_ATTR_PAGE_HEADER_LRMARGIN (FN_SIDEBAR + 4)
#define SID_ATTR_PAGE_HEADER_SPACING (FN_SIDEBAR + 5) #define SID_ATTR_PAGE_HEADER_SPACING (FN_SIDEBAR + 5)
......
...@@ -7384,42 +7384,6 @@ SfxInt16Item PageColumnType SID_ATTR_PAGE_COLUMN ...@@ -7384,42 +7384,6 @@ SfxInt16Item PageColumnType SID_ATTR_PAGE_COLUMN
GroupId = GID_FORMAT; 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 SfxVoidItem PageMargin SID_ATTR_PAGE_MARGIN
[ [
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment