summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGulsah Kose <gulsah.1004@gmail.com>2018-01-08 15:37:08 +0300
committerGülşah Köse <gulsah.1004@gmail.com>2018-01-25 09:36:46 +0100
commit463ca11b764dfdf48d0422b0a392a462bf6681a3 (patch)
tree7fce30cc063bd5a53ddff09658d794a3997b8ac6
parent027abe22f11a8c7dac38697f02d03156bb91a8a1 (diff)
[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@gmail.com> Reviewed-on: https://gerrit.libreoffice.org/47597 Tested-by: Jenkins <ci@libreoffice.org>
-rw-r--r--sw/source/uibase/docvw/HeaderFooterWin.cxx6
-rw-r--r--sw/uiconfig/swriter/ui/headerfootermenu.ui8
2 files changed, 14 insertions, 0 deletions
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>