[Libreoffice-commits] core.git: sw/source sw/uiconfig

Gulsah Kose gulsah.1004 at gmail.com
Thu Jan 25 08:37:08 UTC 2018


 sw/source/uibase/docvw/HeaderFooterWin.cxx |    6 ++++++
 sw/uiconfig/swriter/ui/headerfootermenu.ui |    8 ++++++++
 2 files changed, 14 insertions(+)

New commits:
commit 463ca11b764dfdf48d0422b0a392a462bf6681a3
Author: Gulsah Kose <gulsah.1004 at gmail.com>
Date:   Mon Jan 8 15:37:08 2018 +0300

    [Pardus] tdf#92685 Add insert page number option to header menu.
    
    This patch is sponsored by ULAKBIM/Pardus project.
    
    Change-Id: I9f1f5bd0f05b7f92204615b48a1e7be06272a8a3
    Signed-off-by: Gulsah Kose <gulsah.1004 at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/47597
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/sw/source/uibase/docvw/HeaderFooterWin.cxx b/sw/source/uibase/docvw/HeaderFooterWin.cxx
index 23a85053f358..007184220816 100644
--- a/sw/source/uibase/docvw/HeaderFooterWin.cxx
+++ b/sw/source/uibase/docvw/HeaderFooterWin.cxx
@@ -41,6 +41,7 @@
 #include <editeng/boxitem.hxx>
 #include <svtools/svtresid.hxx>
 #include <svx/hdft.hxx>
+#include <sfx2/dispatch.hxx>
 #include <drawinglayer/processor2d/processorfromoutputdevice.hxx>
 #include <vcl/decoview.hxx>
 #include <vcl/gradient.hxx>
@@ -462,6 +463,11 @@ void SwHeaderFooterWin::ExecuteCommand(const OString& rIdent)
     {
         rSh.ChangeHeaderOrFooter( rStyleName, m_bIsHeader, false, true );
     }
+    else if (rIdent == "insert_pagenumber")
+    {
+        SfxViewFrame* pVFrame = rSh.GetView().GetViewFrame();
+        pVFrame->GetBindings().Execute(FN_INSERT_FLD_PGNUMBER);
+    }
 }
 
 void SwHeaderFooterWin::SetReadonly( bool bReadonly )
diff --git a/sw/uiconfig/swriter/ui/headerfootermenu.ui b/sw/uiconfig/swriter/ui/headerfootermenu.ui
index be7661876209..037931137938 100644
--- a/sw/uiconfig/swriter/ui/headerfootermenu.ui
+++ b/sw/uiconfig/swriter/ui/headerfootermenu.ui
@@ -27,5 +27,13 @@
         <property name="use_underline">True</property>
       </object>
     </child>
+    <child>
+      <object class="GtkMenuItem" id="insert_pagenumber">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes" context="headerfootermenu|insert_pagenumber">Insert Page Number</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
   </object>
 </interface>


More information about the Libreoffice-commits mailing list