include/vcl/toolbox.hxx                |    3 +++
 svx/source/tbxctrls/tbxcolorupdate.cxx |    4 ++--
 vcl/source/font/PhysicalFontFamily.cxx |   13 -------------
 vcl/source/window/toolbox2.cxx         |   12 ++++++++++++
 4 files changed, 17 insertions(+), 15 deletions(-)

New commits:
commit 27d94c482e82ea5d4f202109614c6fb3578fb0a4
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed May 6 10:25:34 2015 +0100

    color bar doesn't fill tool item
    
    since
    
    commit b8f21298288890d52c06fef6c84441634c56c986
    Author: Tomaž Vajngerl <tomaz.vajng...@collabora.co.uk>
    Date:   Mon Mar 2 20:57:32 2015 +0900
    
    the color bar is always drawn under the icon and doesn't
    get drawn to the right and fill all the empty space of
    the tool item, e.g. in impress see the new toolbar color
    selector
    
    Change-Id: Ib70fec9c933b9d743e67475899938a5d9f405496

diff --git a/include/vcl/toolbox.hxx b/include/vcl/toolbox.hxx
index f6a4f14..9c94f80 100644
--- a/include/vcl/toolbox.hxx
+++ b/include/vcl/toolbox.hxx
@@ -379,6 +379,9 @@ public:
     Rectangle           GetItemRect( sal_uInt16 nItemId ) const;
     Rectangle           GetItemPosRect( sal_uInt16 nPos ) const;
 
+    /// Returns size of the bitmap / text that is inside this toolbox item.
+    Size                GetItemContentSize( sal_uInt16 nItemId ) const;
+
     /// Retrieves the optimal position to place a popup window for this item 
(subtoolbar or dropdown)
     Point               GetItemPopupPosition( sal_uInt16 nItemId, const Size& 
rSize ) const;
 
diff --git a/svx/source/tbxctrls/tbxcolorupdate.cxx 
b/svx/source/tbxctrls/tbxcolorupdate.cxx
index ff4dc5e..5f1a186 100644
--- a/svx/source/tbxctrls/tbxcolorupdate.cxx
+++ b/svx/source/tbxctrls/tbxcolorupdate.cxx
@@ -79,8 +79,7 @@ namespace svx
     void ToolboxButtonColorUpdater::Update(const Color& rColor)
     {
         Image aImage(mpTbx->GetItemImageOriginal(mnBtnId));
-        BitmapEx aSource(aImage.GetBitmapEx());
-        Size aItemSize = aSource.GetSizePixel();
+        Size aItemSize(mpTbx->GetItemContentSize(mnBtnId));
 
         const bool bSizeChanged = (maBmpSize != aItemSize);
         const bool bDisplayModeChanged = (mbWasHiContrastMode != 
mpTbx->GetSettings().GetStyleSettings().GetHighContrastMode());
@@ -101,6 +100,7 @@ namespace svx
             sal_uInt8 nAlpha = 255;
             BitmapEx aBmpEx(Bitmap(aItemSize, 24), AlphaMask(aItemSize, 
&nAlpha));
 
+            BitmapEx aSource(aImage.GetBitmapEx());
             long nWidth = std::min(aItemSize.Width(), 
aSource.GetSizePixel().Width());
             long nHeight = std::min(aItemSize.Height(), 
aSource.GetSizePixel().Height());
 
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index e209fd2..13e77ef 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -935,6 +935,18 @@ sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const
     return 0;
 }
 
+Size ToolBox::GetItemContentSize( sal_uInt16 nItemId ) const
+{
+    if ( mbCalc || mbFormat )
+        ((ToolBox*)this)->ImplFormat();
+
+    sal_uInt16 nPos = GetItemPos( nItemId );
+    if ( nPos < mpData->m_aItems.size() )
+        return mpData->m_aItems[nPos].maContentSize;
+    else
+        return Size();
+}
+
 sal_uInt16 ToolBox::GetItemId(const OUString &rCommand) const
 {
     if (!mpData)
commit ea593a29006e71e25071aaf01c838e5da632adf0
Author: Caolán McNamara <caol...@redhat.com>
Date:   Wed May 6 09:26:22 2015 +0100

    this is a no-op, remove if
    
    Change-Id: I01a7d41084185c8c9d4a103fb124a0416a3bc890

diff --git a/vcl/source/font/PhysicalFontFamily.cxx 
b/vcl/source/font/PhysicalFontFamily.cxx
index 552c2da..b3c650c 100644
--- a/vcl/source/font/PhysicalFontFamily.cxx
+++ b/vcl/source/font/PhysicalFontFamily.cxx
@@ -159,19 +159,6 @@ bool PhysicalFontFamily::AddFontFace( PhysicalFontFace* 
pNewData )
          ||  (pNewData->GetSlant() == ITALIC_OBLIQUE) )
         mnTypeFaces |= FONT_FAMILY_ITALIC;
 
-    if( (meMatchWeight == WEIGHT_DONTKNOW)
-    ||  (meMatchWidth  == WIDTH_DONTKNOW)
-    ||  (mnMatchType   == ImplFontAttrs::None) )
-    {
-        // TODO: is it cheaper to calc matching attributes now or on demand?
-        // calc matching attributes if other entries are already initialized
-
-        // Do lazy, quite expensive, not needed in start-up!
-        // const FontSubstConfiguration& rFontSubst = 
*FontSubstConfiguration::get();
-        // InitMatchData( rFontSubst, maSearchName );
-        // mbMatchData=true; // Somewhere else???
-    }
-
     // reassign name (sharing saves memory)
     if( pNewData->GetFamilyName() == GetFamilyName() )
         pNewData->SetFamilyName( GetFamilyName() );
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to