Add Go to Sheet to tabs context menu
Follow up of tdf#171207 to ease access when the number of sheets is high Command is disable if there is only one visible sheet. Same in menu Sheet > Navigate Change-Id: I248ce773548747a615ad443d39352d040ba31813 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211223 Reviewed-by: Laurent Balland <laurent.balland@mailo.fr> Tested-by: Jenkins
This commit is contained in:
@@ -199,6 +199,8 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
|
|||||||
bool bOle = GetViewFrame().GetFrame().IsInPlace();
|
bool bOle = GetViewFrame().GetFrame().IsInPlace();
|
||||||
|
|
||||||
SCTAB nTabSelCount = rMark.GetSelectCount();
|
SCTAB nTabSelCount = rMark.GetSelectCount();
|
||||||
|
SCTAB nCountVisible = 0;
|
||||||
|
const SCTAB nTabCount = rDoc.GetTableCount();
|
||||||
|
|
||||||
SfxWhichIter aIter(rSet);
|
SfxWhichIter aIter(rSet);
|
||||||
sal_uInt16 nWhich = aIter.FirstWhich();
|
sal_uInt16 nWhich = aIter.FirstWhich();
|
||||||
@@ -275,6 +277,13 @@ void ScTabViewShell::GetState( SfxItemSet& rSet )
|
|||||||
case SID_CURRENTTAB:
|
case SID_CURRENTTAB:
|
||||||
// Table for Basic is 1-based
|
// Table for Basic is 1-based
|
||||||
rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(GetViewData().GetTabNumber()) + 1 ) );
|
rSet.Put( SfxUInt16Item( nWhich, static_cast<sal_uInt16>(GetViewData().GetTabNumber()) + 1 ) );
|
||||||
|
|
||||||
|
// enabled only if several sheets are visible
|
||||||
|
for ( SCTAB i = 0; nCountVisible < 2 && i < nTabCount ; i++ )
|
||||||
|
if ( rDoc.IsVisible( i ) )
|
||||||
|
++nCountVisible;
|
||||||
|
if ( nCountVisible < 2 )
|
||||||
|
rSet.DisableItem( nWhich );
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SID_CURRENTDOC:
|
case SID_CURRENTDOC:
|
||||||
|
|||||||
@@ -13,6 +13,8 @@
|
|||||||
<menu:menuitem menu:id=".uno:RenameTable"/>
|
<menu:menuitem menu:id=".uno:RenameTable"/>
|
||||||
<menu:menuitem menu:id=".uno:DuplicateSheet"/>
|
<menu:menuitem menu:id=".uno:DuplicateSheet"/>
|
||||||
<menu:menuitem menu:id=".uno:Move"/>
|
<menu:menuitem menu:id=".uno:Move"/>
|
||||||
|
<menu:menuseparator/>
|
||||||
|
<menu:menuitem menu:id=".uno:JumpToTable"/>
|
||||||
<menu:menuitem menu:id=".uno:TableSelectAll"/>
|
<menu:menuitem menu:id=".uno:TableSelectAll"/>
|
||||||
<menu:menuitem menu:id=".uno:TableDeselectAll"/>
|
<menu:menuitem menu:id=".uno:TableDeselectAll"/>
|
||||||
<menu:menuseparator/>
|
<menu:menuseparator/>
|
||||||
|
|||||||
Reference in New Issue
Block a user