tdf#83830: Removal of Page Margin Panel

Change-Id: I05c0b2ba42cf395a2b30ce658e1f1d034e95f21f
Reviewed-on: https://gerrit.libreoffice.org/26217
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de>
This commit is contained in:
Susobhan Ghosh
2016-06-13 16:53:48 +05:30
committed by Katarina Behrens
parent e8dfe9bca7
commit 3e19a763b9
7 changed files with 0 additions and 478 deletions

View File

@@ -407,34 +407,6 @@
</prop>
</node>
<node oor:name="PageMarginPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Margin</value>
</prop>
<prop oor:name="Id" oor:type="xs:string">
<value>PageMarginPanel</value>
</prop>
<prop oor:name="DeckId" oor:type="xs:string">
<value>WriterPageDeck</value>
</prop>
<prop oor:name="DefaultMenuCommand">
<value>.uno:PageDialog</value>
</prop>
<prop oor:name="ContextList">
<value oor:separator=";">
Writer, Table, visible ;
Writer, Text, visible ;
Writer, default, visible ;
</value>
</prop>
<prop oor:name="ImplementationURL" oor:type="xs:string">
<value>private:resource/toolpanel/SwPanelFactory/PageMarginPanel</value>
</prop>
<prop oor:name="OrderIndex" oor:type="xs:int">
<value>300</value>
</prop>
</node>
<node oor:name="PageFormatPanel" oor:op="replace">
<prop oor:name="Title" oor:type="xs:string">
<value xml:lang="en-US">Format</value>

View File

@@ -681,7 +681,6 @@ $(eval $(call gb_Library_add_exception_objects,sw,\
sw/source/uibase/sidebar/PageSizeControl \
sw/source/uibase/sidebar/PageColumnControl \
sw/source/uibase/sidebar/PagePropertyPanel \
sw/source/uibase/sidebar/PageMarginPanel \
sw/source/uibase/sidebar/PageFormatPanel \
sw/source/uibase/sidebar/PageHeaderPanel \
sw/source/uibase/sidebar/PageFooterPanel \

View File

@@ -225,7 +225,6 @@ $(eval $(call gb_UIConfig_add_uifiles,modules/swriter,\
sw/uiconfig/swriter/ui/selectindexdialog \
sw/uiconfig/swriter/ui/selecttabledialog \
sw/uiconfig/swriter/ui/sidebarpage \
sw/uiconfig/swriter/ui/pagemarginpanel \
sw/uiconfig/swriter/ui/pageformatpanel \
sw/uiconfig/swriter/ui/pagestylespanel \
sw/uiconfig/swriter/ui/pageheaderpanel \

View File

@@ -1,211 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <swtypes.hxx>
#include <svl/intitem.hxx>
#include <editeng/sizeitem.hxx>
#include <editeng/paperinf.hxx>
#include <svx/svxids.hrc>
#include <svx/dlgutil.hxx>
#include <svx/rulritem.hxx>
#include "PageMarginPanel.hxx"
#include <sfx2/sidebar/ControlFactory.hxx>
#include <sfx2/dispatch.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/viewsh.hxx>
#include <sfx2/objsh.hxx>
#include "cmdid.h"
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
namespace sw { namespace sidebar{
VclPtr<vcl::Window> PageMarginPanel::Create(
vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings)
{
if( !pParent )
throw ::com::sun::star::lang::IllegalArgumentException("no parent window given to PageMarginPanel::Create", nullptr, 0);
if( !rxFrame.is() )
throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to PageMarginPanel::Create", nullptr, 0);
if( !pBindings )
throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PageMarginPanel::Create", nullptr, 0);
return VclPtr<PageMarginPanel>::Create(pParent, rxFrame, pBindings);
}
PageMarginPanel::PageMarginPanel(
vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings
) :
PanelLayout(pParent, "PageMarginPanel" , "modules/swriter/ui/pagemarginpanel.ui", rxFrame),
mpBindings(pBindings),
meFUnit(),
meUnit(),
mnPageLeftMargin(0),
mnPageRightMargin(0),
mnPageTopMargin(0),
mnPageBottomMargin(0),
mpPageLRMarginItem( new SvxLongLRSpaceItem( 0, 0, SID_ATTR_PAGE_LRSPACE ) ),
mpPageULMarginItem( new SvxLongULSpaceItem( 0, 0, SID_ATTR_PAGE_ULSPACE ) ),
maSwPageLRControl(SID_ATTR_PAGE_LRSPACE, *pBindings, *this),
maSwPageULControl(SID_ATTR_PAGE_ULSPACE, *pBindings, *this),
maSwPageSizeControl(SID_ATTR_PAGE_SIZE, *pBindings, *this),
maSwPageMetricControl(SID_ATTR_METRIC, *pBindings, *this)
{
get(mpLeftMarginEdit, "leftmargin");
get(mpRightMarginEdit, "rightmargin");
get(mpTopMarginEdit, "topmargin");
get(mpBottomMarginEdit, "bottommargin");
Initialize();
}
PageMarginPanel::~PageMarginPanel()
{
disposeOnce();
}
void PageMarginPanel::dispose()
{
mpLeftMarginEdit.disposeAndClear();
mpRightMarginEdit.disposeAndClear();
mpTopMarginEdit.disposeAndClear();
mpBottomMarginEdit.disposeAndClear();
mpPageLRMarginItem.reset();
mpPageULMarginItem.reset();
maSwPageULControl.dispose();
maSwPageLRControl.dispose();
maSwPageSizeControl.dispose();
maSwPageMetricControl.dispose();
PanelLayout::dispose();
}
void PageMarginPanel::Initialize()
{
meUnit = maSwPageSizeControl.GetCoreMetric();
mpLeftMarginEdit->SetModifyHdl( LINK(this, PageMarginPanel, ModifyLRMarginHdl) );
mpRightMarginEdit->SetModifyHdl( LINK(this, PageMarginPanel, ModifyLRMarginHdl) );
mpTopMarginEdit->SetModifyHdl( LINK(this, PageMarginPanel, ModifyULMarginHdl) );
mpBottomMarginEdit->SetModifyHdl( LINK(this, PageMarginPanel, ModifyULMarginHdl) );
}
void PageMarginPanel::MetricState( SfxItemState eState, const SfxPoolItem* pState )
{
meFUnit = FUNIT_NONE;
if ( pState && eState >= SfxItemState::DEFAULT )
{
meFUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pState )->GetValue();
}
else
{
SfxViewFrame* pFrame = SfxViewFrame::Current();
SfxObjectShell* pSh = nullptr;
if ( pFrame )
pSh = pFrame->GetObjectShell();
if ( pSh )
{
SfxModule* pModule = pSh->GetModule();
if ( pModule )
{
const SfxPoolItem* pItem = pModule->GetItem( SID_ATTR_METRIC );
if ( pItem )
meFUnit = (FieldUnit)static_cast<const SfxUInt16Item*>(pItem )->GetValue();
}
else
{
SAL_WARN("sw.ui", "<PageMarginPanel::MetricState(..)>: no module found");
}
}
}
/*
SetFieldUnit( *mpLeftMarginEdit.get(), meFUnit );
SetFieldUnit( *mpRightMarginEdit.get(), meFUnit );
SetFieldUnit( *mpTopMarginEdit.get(), meFUnit );
SetFieldUnit( *mpBottomMarginEdit.get(), meFUnit );
*/
}
void PageMarginPanel::ExecuteMarginLRChange(
const long nPageLeftMargin,
const long nPageRightMargin )
{
mpPageLRMarginItem->SetLeft( nPageLeftMargin );
mpPageLRMarginItem->SetRight( nPageRightMargin );
GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_LRSPACE, SfxCallMode::RECORD, { mpPageLRMarginItem.get() });
}
void PageMarginPanel::ExecuteMarginULChange(
const long nPageTopMargin,
const long nPageBottomMargin )
{
mpPageULMarginItem->SetUpper( nPageTopMargin );
mpPageULMarginItem->SetLower( nPageBottomMargin );
GetBindings()->GetDispatcher()->ExecuteList( SID_ATTR_PAGE_ULSPACE, SfxCallMode::RECORD, { mpPageULMarginItem.get() });
}
void PageMarginPanel::NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled)
{
(void)bIsEnabled;
switch( nSId )
{
case SID_ATTR_PAGE_LRSPACE:
{
}
break;
case SID_ATTR_PAGE_ULSPACE:
{
}
break;
case SID_ATTR_METRIC:
MetricState(eState, pState);
break;
}
}
IMPL_LINK_NOARG_TYPED( PageMarginPanel, ModifyLRMarginHdl, Edit&, void )
{
mnPageLeftMargin = GetCoreValue( *mpLeftMarginEdit.get(), meUnit );
mnPageRightMargin = GetCoreValue( *mpRightMarginEdit.get(), meUnit );
ExecuteMarginLRChange( mnPageLeftMargin, mnPageRightMargin );
}
IMPL_LINK_NOARG_TYPED( PageMarginPanel, ModifyULMarginHdl, Edit&, void )
{
mnPageTopMargin = GetCoreValue( *mpTopMarginEdit.get(), meUnit );
mnPageBottomMargin = GetCoreValue( *mpBottomMarginEdit.get(), meUnit );
ExecuteMarginULChange( mnPageTopMargin, mnPageBottomMargin );
}
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -1,113 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEMARGINPANEL_HXX
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEMARGINPANEL_HXX
#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
#include <svx/sidebar/Popup.hxx>
#include <svx/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <i18nutil/paper.hxx>
#include <svx/pageitem.hxx>
#include <svx/rulritem.hxx>
#include <editeng/sizeitem.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/fixed.hxx>
#include <vcl/button.hxx>
#include <vcl/toolbox.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/field.hxx>
#include <svl/intitem.hxx>
#include <tools/fldunit.hxx>
#include <svl/poolitem.hxx>
#include <svx/rulritem.hxx>
namespace sw { namespace sidebar {
class PageMarginPanel:
public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
static VclPtr<vcl::Window> Create(
vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(
const sal_uInt16 nSID,
const SfxItemState eState,
const SfxPoolItem* pState,
const bool bIsEnabled) override;
SfxBindings* GetBindings() const { return mpBindings; }
PageMarginPanel(
vcl::Window* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings);
virtual ~PageMarginPanel();
virtual void dispose() override;
private:
SfxBindings* mpBindings;
VclPtr<MetricField> mpLeftMarginEdit;
VclPtr<MetricField> mpRightMarginEdit;
VclPtr<MetricField> mpTopMarginEdit;
VclPtr<MetricField> mpBottomMarginEdit;
FieldUnit meFUnit;
SfxMapUnit meUnit;
long mnPageLeftMargin;
long mnPageRightMargin;
long mnPageTopMargin;
long mnPageBottomMargin;
void Initialize();
void ExecuteMarginLRChange( const long nPageLeftMargin, const long nPageRightMargin );
void ExecuteMarginULChange( const long nPageTopMargin, const long nPageBottomMargin);
void MetricState( SfxItemState eState, const SfxPoolItem* pState );
std::unique_ptr<SvxLongLRSpaceItem> mpPageLRMarginItem;
std::unique_ptr<SvxLongULSpaceItem> mpPageULMarginItem;
::sfx2::sidebar::ControllerItem maSwPageLRControl;
::sfx2::sidebar::ControllerItem maSwPageULControl;
::sfx2::sidebar::ControllerItem maSwPageSizeControl;
::sfx2::sidebar::ControllerItem maSwPageMetricControl;
DECL_LINK_TYPED( ModifyLRMarginHdl, Edit&, void );
DECL_LINK_TYPED( ModifyULMarginHdl, Edit&, void );
};
} } // end of namespace sw::sidebar
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@@ -22,7 +22,6 @@
#include <ThemePanel.hxx>
#include <StylePresetsPanel.hxx>
#include <PagePropertyPanel.hxx>
#include <PageMarginPanel.hxx>
#include <PageStylesPanel.hxx>
#include <PageFormatPanel.hxx>
#include <PageHeaderPanel.hxx>
@@ -134,15 +133,6 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
pPanel,
ui::LayoutSize(-1,-1,-1));
}
else if(rsResourceURL.endsWith("/PageMarginPanel"))
{
VclPtr<vcl::Window> pPanel = sw::sidebar::PageMarginPanel::Create( pParentWindow, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
pPanel,
ui::LayoutSize(-1,-1,-1));
}
else if(rsResourceURL.endsWith("/PageStylesPanel"))
{
VclPtr<vcl::Window> pPanel = sw::sidebar::PageStylesPanel::Create( pParentWindow, xFrame );

View File

@@ -1,114 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 -->
<interface>
<requires lib="gtk+" version="3.12"/>
<object class="GtkGrid" id="PageMarginPanel">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<child>
<object class="GtkComboBoxText" id="marginLB">
<property name="visible">True</property>
<property name="can_focus">False</property>
<items>
<item translatable="yes">Narrow</item>
<item translatable="yes">Normal</item>
<item translatable="yes">Wide</item>
<item translatable="yes">Mirrored</item>
</items>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkGrid" id="grid2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<child>
<object class="GtkSpinButton" id="topmargin:0cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="climb_rate">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">0</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="leftmargin:0cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="climb_rate">1</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="bottommargin:0cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="climb_rate">1</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="top_attach">2</property>
</packing>
</child>
<child>
<object class="GtkSpinButton" id="rightmargin:0cm">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="climb_rate">1</property>
</object>
<packing>
<property name="left_attach">2</property>
<property name="top_attach">1</property>
</packing>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="expand">True</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>
</object>
</interface>