[Libreoffice-commits] core.git: officecfg/registry sw/Library_sw.mk sw/source sw/uiconfig sw/UIConfig_swriter.mk

Susobhan Ghosh susobhang70 at gmail.com
Mon Jun 13 15:43:26 UTC 2016


 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu |   28 -
 sw/Library_sw.mk                                             |    1 
 sw/UIConfig_swriter.mk                                       |    1 
 sw/source/uibase/sidebar/PageMarginPanel.cxx                 |  211 -----------
 sw/source/uibase/sidebar/PageMarginPanel.hxx                 |  113 -----
 sw/source/uibase/sidebar/SwPanelFactory.cxx                  |   10 
 sw/uiconfig/swriter/ui/pagemarginpanel.ui                    |  114 -----
 7 files changed, 478 deletions(-)

New commits:
commit 3e19a763b95c45c275d15356ff5531e855cfcb03
Author: Susobhan Ghosh <susobhang70 at gmail.com>
Date:   Mon Jun 13 16:53:48 2016 +0530

    tdf#83830: Removal of Page Margin Panel
    
    Change-Id: I05c0b2ba42cf395a2b30ce658e1f1d034e95f21f
    Reviewed-on: https://gerrit.libreoffice.org/26217
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Katarina Behrens <Katarina.Behrens at cib.de>

diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 4be7a46..6b2f53a 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -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>
diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk
index bb2d680..0555d16 100644
--- a/sw/Library_sw.mk
+++ b/sw/Library_sw.mk
@@ -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 \
diff --git a/sw/UIConfig_swriter.mk b/sw/UIConfig_swriter.mk
index 43e66ae..da0fc29 100644
--- a/sw/UIConfig_swriter.mk
+++ b/sw/UIConfig_swriter.mk
@@ -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 \
diff --git a/sw/source/uibase/sidebar/PageMarginPanel.cxx b/sw/source/uibase/sidebar/PageMarginPanel.cxx
deleted file mode 100644
index 0575408..0000000
--- a/sw/source/uibase/sidebar/PageMarginPanel.cxx
+++ /dev/null
@@ -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: */
diff --git a/sw/source/uibase/sidebar/PageMarginPanel.hxx b/sw/source/uibase/sidebar/PageMarginPanel.hxx
deleted file mode 100644
index 39c7751..0000000
--- a/sw/source/uibase/sidebar/PageMarginPanel.hxx
+++ /dev/null
@@ -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: */
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index c89ec5d..7f28f93 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -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 );
diff --git a/sw/uiconfig/swriter/ui/pagemarginpanel.ui b/sw/uiconfig/swriter/ui/pagemarginpanel.ui
deleted file mode 100644
index 7127800..0000000
--- a/sw/uiconfig/swriter/ui/pagemarginpanel.ui
+++ /dev/null
@@ -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>


More information about the Libreoffice-commits mailing list