[Libreoffice-commits] core.git: officecfg/registry sw/inc sw/sdi sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 3 02:50:51 UTC 2020
officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 22 ++++++
sw/inc/cmdid.h | 3
sw/sdi/_viewsh.sdi | 8 ++
sw/sdi/swriter.sdi | 34 +++++++++
sw/source/uibase/uiview/view2.cxx | 36 ++++++++++
5 files changed, 103 insertions(+)
New commits:
commit 021f0b4a8c556561f5b0a5fe2ecc20209d548193
Author: Jim Raykowski <raykowj at gmail..com>
AuthorDate: Wed Apr 1 22:20:00 2020 -0800
Commit: Jim Raykowski <raykowj at gmail.com>
CommitDate: Wed Jun 3 04:50:16 2020 +0200
tdf#101211 Add goto prev and next page uno commands
Change-Id: I7e195727066e47f93665fdebf1042282ecbb42b4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91605
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj at gmail.com>
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
index 9ca5e132d534..a15e89e8c705 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu
@@ -2084,6 +2084,28 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:GoToPrevPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">To Previous Page</value>
+ </prop>
+ <prop oor:name="TooltipLabel" oor:type="xs:string">
+ <value xml:lang="en-US">To Previous Page</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
+ <node oor:name=".uno:GoToNextPage" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">To Next Page</value>
+ </prop>
+ <prop oor:name="TooltipLabel" oor:type="xs:string">
+ <value xml:lang="en-US">To Next Page</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:SetMultiSelection" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">MultiSelection On</value>
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 6513bf5032a8..5dacd22c53c7 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -721,6 +721,9 @@
#define FN_SELECT_SENTENCE (FN_SELECTION + 94) /* select paragraph*/
+#define FN_TO_NEXT_PAGE (FN_SELECTION + 95)
+#define FN_TO_PREV_PAGE (FN_SELECTION + 96)
+
// QUERY-Block
#define FN_TXTATR_INET (FN_QUERY +29) /* INet-Attribute */
diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi
index 55072f98ec2a..4dbc2aecffcf 100644
--- a/sw/sdi/_viewsh.sdi
+++ b/sw/sdi/_viewsh.sdi
@@ -22,6 +22,14 @@ interface BaseTextEditView
[
ExecMethod = Execute ;
]
+ FN_TO_PREV_PAGE
+ [
+ ExecMethod = Execute ;
+ ]
+ FN_TO_NEXT_PAGE
+ [
+ ExecMethod = Execute ;
+ ]
FN_PAGEUP // status(final|play)
[
ExecMethod = Execute ;
diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi
index 851a086492d4..69dbc63205c0 100644
--- a/sw/sdi/swriter.sdi
+++ b/sw/sdi/swriter.sdi
@@ -4643,6 +4643,40 @@ SfxVoidItem PageDownSel FN_PAGEDOWN_SEL
GroupId = SfxGroupId::Navigator;
]
+SfxVoidItem GoToPrevPage FN_TO_PREV_PAGE
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Navigator;
+]
+
+SfxVoidItem GoToNextPage FN_TO_NEXT_PAGE
+()
+[
+ AutoUpdate = FALSE,
+ FastCall = FALSE,
+ ReadOnlyDoc = TRUE,
+ Toggle = FALSE,
+ Container = FALSE,
+ RecordAbsolute = FALSE,
+ RecordPerSet;
+
+ AccelConfig = TRUE,
+ MenuConfig = TRUE,
+ ToolBoxConfig = TRUE,
+ GroupId = SfxGroupId::Navigator;
+]
+
SfxUInt16Item PageOffsetDialog FN_CHANGE_PAGENUM
(SfxUInt16Item nOffset FN_CHANGE_PAGENUM)
[
diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx
index 066b6d855c54..fca753fe6a20 100644
--- a/sw/source/uibase/uiview/view2.cxx
+++ b/sw/source/uibase/uiview/view2.cxx
@@ -134,6 +134,9 @@
#include <rootfrm.hxx>
#include <frameformats.hxx>
+#include <viewimp.hxx>
+#include <pagefrm.hxx>
+
#include <memory>
const char sStatusDelim[] = " : ";
@@ -566,6 +569,39 @@ void SwView::Execute(SfxRequest &rReq)
rTmpWin.SetUseInputLanguage( false );
}
break;
+ case FN_TO_PREV_PAGE:
+ case FN_TO_NEXT_PAGE:
+ {
+ SwFrame* pPageFrame = m_pWrtShell->Imp()->GetFirstVisPage(m_pWrtShell->GetOut());
+ if (pPageFrame)
+ {
+ sal_uInt16 nPage(pPageFrame->GetPhyPageNum());
+ if (nPage != 0)
+ {
+ sal_uInt16 nOldPage(nPage);
+ if (FN_TO_PREV_PAGE == nSlot && nPage > 1)
+ nPage--;
+ else if (FN_TO_NEXT_PAGE == nSlot && nPage < m_pWrtShell->GetPageCount())
+ nPage++;
+ if (nPage != nOldPage)
+ {
+ m_pWrtShell->LockPaint();
+ if (IsDrawMode())
+ LeaveDrawCreate();
+ m_pWrtShell->EnterStdMode();
+ m_pWrtShell->GotoPage(nPage, true);
+ // set visible area (borrowed from SwView::PhyPageUp/Down)
+ const Point aPt(m_aVisArea.Left(), m_pWrtShell->GetPagePos(nPage).Y());
+ Point aAlPt(AlignToPixel(aPt));
+ if(aPt.Y() != aAlPt.Y())
+ aAlPt.AdjustY(3 * GetEditWin().PixelToLogic(Size(0, 1)).Height());
+ SetVisArea(aAlPt);
+ m_pWrtShell->UnlockPaint();
+ }
+ }
+ }
+ }
+ break;
case FN_REDLINE_ON:
{
if( pArgs &&
More information about the Libreoffice-commits
mailing list