diff options
author | Gulsah Kose <gulsah.1004@gmail.com> | 2015-10-13 00:53:25 +0300 |
---|---|---|
committer | Oliver Specht <oliver.specht@cib.de> | 2015-11-01 17:41:55 +0000 |
commit | c2a76550a287adf8bdbe93c02395fb80cb11c950 (patch) | |
tree | 49f82b1d8b8e622966cf71f2436f72ecce42eff9 /sw/source/uibase/uiview | |
parent | 707f416192d5a0ca5fa96f7e141c988060b0f292 (diff) |
tdf#80657 Adding new field to jump to specific page.
This patch is not completed. It adds a dropdown field to toolbar.
When you click it, the page preview focuses third page (hard coded).
This patch's purpose is getting information from developers how to
add numbers to dropdown field.
--
v2: Removed unnecessary MV_SPECIFIC_PAGE case.
v3: Added dropdown field and defined new controller for new field.
v4: Implemented page focus who user want.
v5: Used NumericField instead of Combobox and added page count control
v6: Used nSlotId instead of SID_JUMP_TO_SPECIFIC_PAGE in order to fix macOs build error.
Change-Id: I722fbffcc72a1bcee70065e2e9369b73ab27f100
Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com>
Reviewed-on: https://gerrit.libreoffice.org/19335
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Oliver Specht <oliver.specht@cib.de>
Diffstat (limited to 'sw/source/uibase/uiview')
-rw-r--r-- | sw/source/uibase/uiview/pview.cxx | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index ee4f6a767188..2a9018834aeb 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -334,6 +334,7 @@ bool SwPagePreviewWin::MovePage( int eMoveMode ) nNewSttPage = nPageCount; SetSelectedPage( nPageCount ); break; + case MV_SELPAGE: // <nNewSttPage> and <SelectedPage()> are already set. // not start at first column, only if the @@ -880,6 +881,24 @@ void SwPagePreview::Execute( SfxRequest &rReq ) _ExecPgUpAndPgDown( rReq.GetSlot() == FN_PAGEUP, &rReq ); break; } + case SID_JUMP_TO_SPECIFIC_PAGE: + { + sal_uInt16 nPageNum = 1; + const SfxItemSet *pArgs = rReq.GetArgs(); + if( pArgs && pArgs->Count()) + { + nPageNum = static_cast<const SfxUInt16Item &>(pArgs->Get(SID_JUMP_TO_SPECIFIC_PAGE)).GetValue(); + + if( nPageNum > 0 && nPageNum <= mnPageCount ) + { + pViewWin->SetSttPage( nPageNum); + pViewWin->SetSelectedPage( nPageNum ); + ChgPage( SwPagePreviewWin::MV_SPECIFIC_PAGE, false ); + ScrollViewSzChg(); + } + } + } + break; case FN_START_OF_LINE: case FN_START_OF_DOCUMENT: pViewWin->SetSelectedPage( 1 ); |