[Libreoffice-commits] .: 2 commits - vcl/aqua vcl/inc vcl/ios vcl/source

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Sun May 27 02:33:29 PDT 2012


 vcl/aqua/source/app/salinst.cxx |    1 -
 vcl/inc/svdata.hxx              |    1 -
 vcl/inc/vcl/tabctrl.hxx         |    1 -
 vcl/ios/source/app/salinst.cxx  |    1 -
 vcl/source/control/tabctrl.cxx  |   33 ++-------------------------------
 5 files changed, 2 insertions(+), 35 deletions(-)

New commits:
commit 510bfdc31d3e5834a7a461395ad2a6c3129cb572
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun May 27 04:32:48 2012 -0500

    WaE unused argument
    
    Change-Id: I04c06fd83142c7ced83a27370f50aee88a6a2101

diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index 0bf541d..dc48425 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -749,7 +749,7 @@ void TabControl::ImplShowFocus()
 
 // -----------------------------------------------------------------------
 
-void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout, bool bFirstInGroup, bool bLastInGroup, bool bIsCurrentItem )
+void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bool bLayout, bool bFirstInGroup, bool bLastInGroup, bool /* bIsCurrentItem */ )
 {
     if ( pItem->maRect.IsEmpty() )
         return;
commit 072e4f9869f88019145cd75af7612b2e00a7046f
Author: Stefan Knorr (astron) <heinzlesspam at gmail.com>
Date:   Wed May 2 16:33:59 2012 +0200

    Use normal font in tab headers

diff --git a/vcl/aqua/source/app/salinst.cxx b/vcl/aqua/source/app/salinst.cxx
index 794dd84..f8a8835 100644
--- a/vcl/aqua/source/app/salinst.cxx
+++ b/vcl/aqua/source/app/salinst.cxx
@@ -448,7 +448,6 @@ SalInstance* CreateSalInstance()
     SalData::ensureThreadAutoreleasePool();
     // no focus rects on NWF aqua
     ImplGetSVData()->maNWFData.mbNoFocusRects = true;
-    ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true;
     ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true;
     ImplGetSVData()->maNWFData.mbCenteredTabs = true;
     ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx
index 08c165d..a0f610d 100644
--- a/vcl/inc/svdata.hxx
+++ b/vcl/inc/svdata.hxx
@@ -314,7 +314,6 @@ struct ImplSVNWFData
     bool                    mbTransparentMenubar:1;         //< keep the background of the menubar transparent; needed for the Aero theme
     bool                    mbOpenMenuOnF10:1;              // on gnome the first menu opens on F10
     bool                    mbNoFocusRects:1;               // on Aqua focus rects are not used
-    bool                    mbNoBoldTabFocus:1;             // on Aqua and Gnome the focused tab has not bold text
     bool                    mbCenteredTabs:1;               // on Aqua, tabs are centered
     bool                    mbNoActiveTabTextRaise:1;       // on Aqua the text for the selected tab
                                                             // should not "jump up" a pixel
diff --git a/vcl/inc/vcl/tabctrl.hxx b/vcl/inc/vcl/tabctrl.hxx
index fd064db..c9d8583 100644
--- a/vcl/inc/vcl/tabctrl.hxx
+++ b/vcl/inc/vcl/tabctrl.hxx
@@ -68,7 +68,6 @@ private:
     sal_Bool                mbRestoreHelpId;
     sal_Bool                mbRestoreUnqId;
     sal_Bool                mbSmallInvalidate;
-    sal_Bool                mbExtraSpace;
     Link                maActivateHdl;
     Link                maDeactivateHdl;
 
diff --git a/vcl/ios/source/app/salinst.cxx b/vcl/ios/source/app/salinst.cxx
index e3747c2..5536538 100644
--- a/vcl/ios/source/app/salinst.cxx
+++ b/vcl/ios/source/app/salinst.cxx
@@ -314,7 +314,6 @@ SalInstance* CreateSalInstance()
     SalData::ensureThreadAutoreleasePool();
     // no focus rects on NWF ios
     ImplGetSVData()->maNWFData.mbNoFocusRects = true;
-    ImplGetSVData()->maNWFData.mbNoBoldTabFocus = true;
     ImplGetSVData()->maNWFData.mbNoActiveTabTextRaise = true;
     ImplGetSVData()->maNWFData.mbCenteredTabs = true;
     ImplGetSVData()->maNWFData.mbProgressNeedsErase = true;
diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx
index fb73946..0bf541d 100644
--- a/vcl/source/control/tabctrl.cxx
+++ b/vcl/source/control/tabctrl.cxx
@@ -121,7 +121,6 @@ void TabControl::ImplInit( Window* pParent, WinBits nStyle )
     mbRestoreHelpId             = sal_False;
     mbRestoreUnqId              = sal_False;
     mbSmallInvalidate           = sal_False;
-    mbExtraSpace                = sal_False;
     mpTabCtrlData               = new ImplTabCtrlData;
     mpTabCtrlData->mpListBox    = NULL;
 
@@ -326,12 +325,9 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth )
         return aContentRgn.GetSize();
     }
 
-    // For systems without synthetic bold support
-    if ( mbExtraSpace )
-        aSize.Width() += TAB_EXTRASPACE_X;
     // For languages with short names (e.g. Chinese), because the space is
     // normally only one pixel per char
-    else if ( pItem->maFormatText.Len() < TAB_EXTRASPACE_X )
+    if ( pItem->maFormatText.Len() < TAB_EXTRASPACE_X )
         aSize.Width() += TAB_EXTRASPACE_X-pItem->maFormatText.Len();
 
     // Evt. den Text kuerzen
@@ -407,22 +403,8 @@ Rectangle TabControl::ImplGetTabRect( sal_uInt16 nItemPos, long nWidth, long nHe
     if ( mbFormat || (mnLastWidth != nWidth) || (mnLastHeight != nHeight) )
     {
         Font aFont( GetFont() );
-        Font aLightFont = aFont;
         aFont.SetTransparent( sal_True );
-        aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
-        aLightFont.SetTransparent( sal_True );
-        aLightFont.SetWeight( WEIGHT_LIGHT );
-
-        // If Bold and none Bold strings have the same width, we
-        // add in the calcultion extra space, so that the tabs
-        // looks better. The could be the case on systems without
-        // an bold UI font and without synthetic bold support
-        XubString aTestStr( RTL_CONSTASCII_USTRINGPARAM( "Abc." ) );
-        SetFont( aLightFont );
-        long nTextWidth1 = GetTextWidth( aTestStr );
         SetFont( aFont );
-        long nTextWidth2 = GetTextWidth( aTestStr );
-        mbExtraSpace = (nTextWidth1 == nTextWidth2);
 
         Size            aSize;
         const long      nOffsetX = 2 + GetItemsOffset().X();
@@ -720,14 +702,6 @@ void TabControl::ImplShowFocus()
     if ( !GetPageCount() || mpTabCtrlData->mpListBox )
         return;
 
-    // make sure the focussed item rect is computed using a bold font
-    // the font may have changed meanwhile due to mouse over
-
-    Font aOldFont( GetFont() );
-    Font aFont( aOldFont );
-    aFont.SetWeight( (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus) ? WEIGHT_BOLD : WEIGHT_LIGHT );
-    SetFont( aFont );
-
     sal_uInt16                   nCurPos     = GetPagePos( mnCurPageId );
     Rectangle                aRect       = ImplGetTabRect( nCurPos );
     const ImplTabItem&       rItem       = mpTabCtrlData->maItemList[ nCurPos ];
@@ -771,8 +745,6 @@ void TabControl::ImplShowFocus()
         aRect.Bottom() = aRect.Top() + aImageSize.Height() + 4;
     }
     ShowFocus( aRect );
-
-    SetFont( aOldFont );
 }
 
 // -----------------------------------------------------------------------
@@ -939,7 +911,6 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo
     // we set the font attributes always before drawing to be re-entrant (DrawNativeControl may trigger additional paints)
     Font aFont( GetFont() );
     aFont.SetTransparent( sal_True );
-    aFont.SetWeight( ((bIsCurrentItem) && (!ImplGetSVData()->maNWFData.mbNoBoldTabFocus)) ? WEIGHT_BOLD : WEIGHT_LIGHT );
     SetFont( aFont );
 
     Size aTabSize = aRect.GetSize();


More information about the Libreoffice-commits mailing list