[Libreoffice-commits] core.git: svtools/source
Michael Meeks
michael.meeks at collabora.com
Mon Feb 3 13:16:51 PST 2014
svtools/source/control/tabbar.cxx | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
New commits:
commit 6f50837b5ee950776ddca9ceb78caed3015e8ccd
Author: Michael Meeks <michael.meeks at collabora.com>
Date: Mon Feb 3 22:15:04 2014 +0100
ensure selected calc sheet tab is always visible, and we use space sensibly.
Change-Id: I0f935f324ba31784185959a4a4d2c306d4b592d8
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index f410a7d..62ca370 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();
}
More information about the Libreoffice-commits
mailing list