officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu | 29 ++++++ sw/inc/cmdid.h | 4 sw/sdi/_viewsh.sdi | 19 +++ sw/sdi/swriter.sdi | 48 ++++++++++ sw/sdi/viewsh.sdi | 15 +++ sw/sdi/wviewsh.sdi | 12 ++ sw/source/uibase/uiview/pview.cxx | 3 sw/source/uibase/uiview/srcview.cxx | 3 sw/source/uibase/uiview/view0.cxx | 27 +++++ sw/uiconfig/swriter/menubar/menubar.xml | 7 + 10 files changed, 167 insertions(+)
New commits: commit f993df9a13abeb869bcbb6c7be6d7ad7f8ceb612 Author: Adesola Samuel <adesolasamuel2...@outlook.com> AuthorDate: Mon Nov 11 01:27:35 2024 +0100 Commit: Heiko Tietze <heiko.tie...@documentfoundation.org> CommitDate: Tue Dec 10 17:49:07 2024 +0100 tdf#150839 a11y added page layout view under View Option An option "Layout of pages" is added to the view option which allows user to select any of the three page layout: 1) Single Page per Row 2) Multiple Pages per Row 3) Book View view for ease of accessibility. Change-Id: I8dcab9b78deee15fb68cf313dab6eff40025f5a2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176367 Tested-by: Jenkins Reviewed-by: Hossein <hoss...@libreoffice.org> Reviewed-by: Heiko Tietze <heiko.tie...@documentfoundation.org> (cherry picked from commit 62fbc583a7a04c69631d84177f26f51a5aad16d9) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/178242 diff --git a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu index b92f978d5c09..f8dd394dfa5c 100644 --- a/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu +++ b/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu @@ -4324,6 +4324,35 @@ <value>1</value> </prop> </node> + <node oor:name=".uno:PagesLayout" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Page Layout</value> + </prop> + </node> + <node oor:name=".uno:SinglePagePerRow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Single Page per Row</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>8</value> + </prop> + </node> + <node oor:name=".uno:MultiplePagesPerRow" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Multiple Pages per Row</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>8</value> + </prop> + </node> + <node oor:name=".uno:BookView" oor:op="replace"> + <prop oor:name="Label" oor:type="xs:string"> + <value xml:lang="en-US">Book View</value> + </prop> + <prop oor:name="Properties" oor:type="xs:int"> + <value>8</value> + </prop> + </node> </node> </node> </oor:component-data> diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h index e6bef505a03c..f50754b6e274 100644 --- a/sw/inc/cmdid.h +++ b/sw/inc/cmdid.h @@ -777,6 +777,10 @@ class SwUINumRuleItem; #define FN_TO_PREV_PAGE (FN_SELECTION + 96) #define FN_SELECTION_CYCLE (FN_SELECTION + 97) +#define FN_SINGLE_PAGE_PER_ROW (FN_SELECTION + 98) /*Show Single Page per row*/ +#define FN_MULTIPLE_PAGES_PER_ROW (FN_SELECTION + 99) /*Show Multiple Page per row*/ +#define FN_BOOKVIEW (FN_SELECTION + 100) /*Show in Bookview*/ + // QUERY-Block #define FN_TXTATR_INET (FN_QUERY +29) /* INet-Attribute */ diff --git a/sw/sdi/_viewsh.sdi b/sw/sdi/_viewsh.sdi index ba6ae5f6775d..71b2c08e0396 100644 --- a/sw/sdi/_viewsh.sdi +++ b/sw/sdi/_viewsh.sdi @@ -137,6 +137,25 @@ interface BaseTextEditView ExecMethod = ExecViewOptions ; StateMethod = StateViewOptions ; ] + + FN_SINGLE_PAGE_PER_ROW + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + + FN_MULTIPLE_PAGES_PER_ROW + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + + FN_BOOKVIEW + [ + ExecMethod = ExecViewOptions ; + StateMethod = StateViewOptions ; + ] + FN_REDLINE_PROTECT [ ExecMethod = Execute; diff --git a/sw/sdi/swriter.sdi b/sw/sdi/swriter.sdi index caa91ab74f94..77403112479e 100644 --- a/sw/sdi/swriter.sdi +++ b/sw/sdi/swriter.sdi @@ -8789,6 +8789,54 @@ SfxInt32Item TableRightSpace SID_ATTR_TABLE_RIGHT_SPACE GroupId = SfxGroupId::Table; ] +SfxBoolItem SinglePagePerRow FN_SINGLE_PAGE_PER_ROW +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + +SfxBoolItem MultiplePagesPerRow FN_MULTIPLE_PAGES_PER_ROW +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + +SfxBoolItem BookView FN_BOOKVIEW +[ + AutoUpdate = TRUE, + FastCall = FALSE, + ReadOnlyDoc = TRUE, + Toggle = FALSE, + Container = FALSE, + RecordAbsolute = FALSE, + RecordPerSet; + + AccelConfig = TRUE, + MenuConfig = TRUE, + ToolBoxConfig = TRUE, + GroupId = SfxGroupId::View; +] + SfxVoidItem OutlineLevelsShown FN_OUTLINE_LEVELS_SHOWN () [ diff --git a/sw/sdi/viewsh.sdi b/sw/sdi/viewsh.sdi index e18efeaebe86..f289cde9fb3d 100644 --- a/sw/sdi/viewsh.sdi +++ b/sw/sdi/viewsh.sdi @@ -299,6 +299,21 @@ interface TextPrintPreview ExecMethod = Execute; StateMethod = GetState; ] + FN_SINGLE_PAGE_PER_ROW + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + FN_MULTIPLE_PAGES_PER_ROW + [ + ExecMethod = Execute; + StateMethod = GetState; + ] + FN_BOOKVIEW + [ + ExecMethod = Execute; + StateMethod = GetState; + ] SID_REFRESH_VIEW // status(final|play) [ StateMethod = GetState ; diff --git a/sw/sdi/wviewsh.sdi b/sw/sdi/wviewsh.sdi index 7606a4baf268..05011b26d0c2 100644 --- a/sw/sdi/wviewsh.sdi +++ b/sw/sdi/wviewsh.sdi @@ -153,6 +153,18 @@ interface WebSourceView [ StateMethod = GetState; ] + FN_SINGLE_PAGE_PER_ROW + [ + StateMethod = GetState; + ] + FN_MULTIPLE_PAGES_PER_ROW + [ + StateMethod = GetState; + ] + FN_BOOKVIEW + [ + StateMethod = GetState; + ] } shell SwSrcView diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index aca313a9bc1b..9811b027f586 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -942,6 +942,9 @@ void SwPagePreview::GetState( SfxItemSet& rSet ) { case SID_BROWSER_MODE: case FN_PRINT_LAYOUT: + case FN_SINGLE_PAGE_PER_ROW: + case FN_MULTIPLE_PAGES_PER_ROW: + case FN_BOOKVIEW: rSet.DisableItem(nWhich); break; case FN_START_OF_DOCUMENT: diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index a2c3fe851486..f6988e1c63ba 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -504,6 +504,9 @@ void SwSrcView::GetState(SfxItemSet& rSet) case SID_REPEAT: case SID_BROWSER_MODE: case FN_PRINT_LAYOUT: + case FN_SINGLE_PAGE_PER_ROW: + case FN_MULTIPLE_PAGES_PER_ROW: + case FN_BOOKVIEW: rSet.DisableItem(nWhich); break; case SID_CUT: diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index fdf8d1f1ea18..e4e89e76c1eb 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -185,6 +185,9 @@ void SwView::RecheckBrowseMode() FN_PRINT_LAYOUT, /*20237*/ FN_QRY_MERGE, /*20364*/ FN_SHADOWCURSOR, /**/ + FN_SINGLE_PAGE_PER_ROW, /**/ + FN_MULTIPLE_PAGES_PER_ROW, /**/ + FN_BOOKVIEW, /**/ 0 }; // the view must not exist! @@ -356,6 +359,15 @@ void SwView::StateViewOptions(SfxItemSet &rSet) case SID_SPOTLIGHT_CHARSTYLES: aBool.SetValue(m_bIsSpotlightCharStyles); break; + case FN_SINGLE_PAGE_PER_ROW: + aBool.SetValue( !pOpt->IsMultipageView()); + break; + case FN_MULTIPLE_PAGES_PER_ROW: + aBool.SetValue( pOpt->GetViewLayoutColumns() == 0); + break; + case FN_BOOKVIEW: + aBool.SetValue( pOpt->IsViewLayoutBookMode()); + break; } if( nWhich ) @@ -699,6 +711,21 @@ void SwView::ExecViewOptions(SfxRequest &rReq) pOpt->SetShowChangesInMargin( bFlag ); break; + case FN_SINGLE_PAGE_PER_ROW: + pOpt->SetViewLayoutBookMode( false ); + pOpt->SetViewLayoutColumns( 1 ); + break; + + case FN_MULTIPLE_PAGES_PER_ROW: + pOpt->SetViewLayoutBookMode( false ); + pOpt->SetViewLayoutColumns( 0 ); + break; + + case FN_BOOKVIEW: + pOpt->SetViewLayoutColumns( 2 ); + pOpt->SetViewLayoutBookMode( true ); + break; + default: OSL_FAIL("wrong request method"); return; diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml index a277c2c061b2..7bd02bc1bc5f 100644 --- a/sw/uiconfig/swriter/menubar/menubar.xml +++ b/sw/uiconfig/swriter/menubar/menubar.xml @@ -180,6 +180,13 @@ <menu:menupopup> <menu:menuitem menu:id=".uno:PrintLayout" menu:style="radio"/> <menu:menuitem menu:id=".uno:BrowseView" menu:style="radio"/> + <menu:menu menu:id=".uno:PagesLayout"> + <menu:menupopup> + <menu:menuitem menu:id=".uno:SinglePagePerRow" menu:style="radio"/> + <menu:menuitem menu:id=".uno:MultiplePagesPerRow" menu:style="radio"/> + <menu:menuitem menu:id=".uno:BookView" menu:style="radio"/> + </menu:menupopup> + </menu:menu> <menu:menuseparator/> <menu:menuitem menu:id=".uno:ToolbarModeUI"/> <menu:menuitem menu:id=".uno:AvailableToolbars" menu:style="text"/>