[Libreoffice-commits] core.git: sc/source
Henry Castro
hcastro at collabora.com
Tue Jan 12 13:30:26 PST 2016
sc/source/ui/inc/tabcont.hxx | 2 +-
sc/source/ui/inc/tabview.hxx | 1 +
sc/source/ui/unoobj/docuno.cxx | 20 ++++----------------
sc/source/ui/view/tabview3.cxx | 5 +++++
4 files changed, 11 insertions(+), 17 deletions(-)
New commits:
commit ab95fb7a19d7847dd1cbfad0059cc175a809a50f
Author: Henry Castro <hcastro at collabora.com>
Date: Tue Jan 12 15:37:25 2016 -0400
sc lokit: refactor setPart
Change-Id: I01786551aef0274ae11fe673cc5b0c250e8817cc
Reviewed-on: https://gerrit.libreoffice.org/21403
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Henry Castro <hcastro at collabora.com>
diff --git a/sc/source/ui/inc/tabcont.hxx b/sc/source/ui/inc/tabcont.hxx
index 246a794..31503b4 100644
--- a/sc/source/ui/inc/tabcont.hxx
+++ b/sc/source/ui/inc/tabcont.hxx
@@ -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
diff --git a/sc/source/ui/inc/tabview.hxx b/sc/source/ui/inc/tabview.hxx
index 3b0c909..23b97ed 100644
--- a/sc/source/ui/inc/tabview.hxx
+++ b/sc/source/ui/inc/tabview.hxx
@@ -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 );
diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 18fe18d..ebcb87b 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -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()
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 7bdeeae..10de038 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -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 )
More information about the Libreoffice-commits
mailing list