diff options
author | Michael Meeks <michael.meeks@collabora.com> | 2014-02-03 22:15:04 +0100 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2014-02-03 22:16:26 +0100 |
commit | 6f50837b5ee950776ddca9ceb78caed3015e8ccd (patch) | |
tree | c8a6020bd269db5bd3925bee87b77932011685ba /svtools | |
parent | 79d2132d29dd56bcd549c9911d37f3b49bcfee7b (diff) |
ensure selected calc sheet tab is always visible, and we use space sensibly.
Change-Id: I0f935f324ba31784185959a4a4d2c306d4b592d8
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/control/tabbar.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx index f410a7d7c795..62ca3708999c 100644 --- a/svtools/source/control/tabbar.cxx +++ b/svtools/source/control/tabbar.cxx @@ -645,7 +645,7 @@ void TabBar::ImplFormat() pItem->maRect.SetEmpty(); else { - // Slightly befor the tab before the first visible page + // Slightly before the tab before the first visible page // should also be visible if ( n+1 == mnFirstPos ) pItem->maRect.Left() = x-pItem->mnWidth; @@ -1535,6 +1535,20 @@ void TabBar::Resize() { if ( ImplCalcWidth() ) Invalidate(); + + ImplFormat(); + + // Ensure as many tabs as possible are visible: + sal_uInt16 nLastFirstPos = ImplGetLastFirstPos(); + if ( mnFirstPos > nLastFirstPos ) + { + mnFirstPos = nLastFirstPos; + mbFormat = sal_True; + Invalidate(); + } + // Ensure the currently selected page is visible + ImplShowPage( GetPagePos( mnCurPageId ) ); + ImplFormat(); } |