Kaydet (Commit) ab95fb7a authored tarafından Henry Castro's avatar Henry Castro

sc lokit: refactor setPart

Change-Id: I01786551aef0274ae11fe673cc5b0c250e8817cc
Reviewed-on: https://gerrit.libreoffice.org/21403Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarHenry Castro <hcastro@collabora.com>
üst 16c7f891
......@@ -44,7 +44,6 @@ private:
DECL_LINK_TYPED(ShowPageList, const CommandEvent&, void);
void SwitchToPageId(sal_uInt16 nId);
protected:
virtual void Select() override;
virtual void Command( const CommandEvent& rCEvt ) override;
......@@ -73,6 +72,7 @@ public:
void UpdateStatus();
void SetSheetLayoutRTL( bool bSheetRTL );
void SwitchToPageId( sal_uInt16 nId );
};
#endif
......
......@@ -386,6 +386,7 @@ public:
SC_DLLPUBLIC void SetTabNo( SCTAB nTab, bool bNew = false, bool bExtendSelection = false, bool bSameTabButMoved = false );
void SelectNextTab( short nDir, bool bExtendSelection = false );
void SelectTabPage( const sal_uInt16 nTab );
void ActivateView( bool bActivate, bool bFirst );
void ActivatePart( ScSplitPos eWhich );
......
......@@ -495,22 +495,10 @@ void ScModelObj::paintTile( VirtualDevice& rDevice,
void ScModelObj::setPart( int nPart )
{
ScViewData* pViewData = ScDocShell::GetViewData();
SfxUInt16Item aItem( SID_CURRENTTAB, nPart + 1 );
SfxDispatcher& rDisp = pViewData->GetDispatcher();
rDisp.Execute( SID_CURRENTTAB, SfxCallMode::SLOT | SfxCallMode::RECORD, &aItem, nullptr );
SfxBindings& rBind = pViewData->GetBindings();
rBind.Invalidate( FID_FILL_TAB );
rBind.Invalidate( FID_TAB_DESELECTALL );
rBind.Invalidate( FID_INS_TABLE );
rBind.Invalidate( FID_TAB_APPEND );
rBind.Invalidate( FID_TAB_MOVE );
rBind.Invalidate( FID_TAB_RENAME );
rBind.Invalidate( FID_DELETE_TABLE );
rBind.Invalidate( FID_TABLE_SHOW );
rBind.Invalidate( FID_TABLE_HIDE );
rBind.Invalidate( FID_TAB_SET_TAB_BG_COLOR );
ScTabView* pTabView = dynamic_cast< ScTabView* >( pViewData->GetView() );
if (pTabView)
pTabView->SelectTabPage(nPart + 1);
}
int ScModelObj::getParts()
......
......@@ -1514,6 +1514,11 @@ void ScTabView::SelectNextTab( short nDir, bool bExtendSelection )
PaintExtras();
}
void ScTabView::SelectTabPage( const sal_uInt16 nTab )
{
pTabControl->SwitchToPageId( nTab );
}
// SetTabNo - set the displayed sheet
void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSameTabButMoved )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment