[Libreoffice-commits] core.git: 2 commits - filter/source svx/source

Caolán McNamara caolanm at redhat.com
Tue Jan 28 08:55:37 PST 2014


 filter/source/graphicfilter/ipsd/ipsd.cxx |    1 +
 svx/source/tbxctrls/tbunocontroller.cxx   |   22 +++++++++++++++++-----
 2 files changed, 18 insertions(+), 5 deletions(-)

New commits:
commit 780eb9f704e7a61f43624a2c03b4f6a15647a1a1
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 28 16:53:55 2014 +0000

    Related: fdo#73051 make font size drop down of optimal width
    
    presumably keithcu felt the font size was too wide, so lets
    try and implement the desired effect of an optimal width.
    
    Change-Id: Idc1741de04b3559fa415ebcf2289f96ba240ca8f

diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx
index a536a14..7e4a40f2 100644
--- a/svx/source/tbxctrls/tbunocontroller.cxx
+++ b/svx/source/tbxctrls/tbunocontroller.cxx
@@ -92,6 +92,7 @@ public:
 
     void                statusChanged_Impl( long nHeight, bool bErase = false );
     void                UpdateFont( const ::com::sun::star::awt::FontDescriptor& rCurrentFont );
+    void                SetOptimalSize();
 
     virtual bool        Notify( NotifyEvent& rNEvt );
 
@@ -124,12 +125,11 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
     FontSizeBox( _pParent, WinBits( WB_DROPDOWN ) ),
 
     m_pCtrl             ( &_rCtrl ),
-    m_aLogicalSize      ( 30,100 ),
+    m_aLogicalSize      ( 0,100 ),
     m_bRelease          ( true ),
     m_xDispatchProvider ( _rDispatchProvider ),
     m_xFrame            ( _xFrame )
 {
-    SetSizePixel( LogicToPixel( m_aLogicalSize, MAP_APPFONT ));
     SetValue( 0 );
     SetText( "" );
 }
@@ -260,6 +260,16 @@ bool SvxFontSizeBox_Impl::Notify( NotifyEvent& rNEvt )
     return nHandled || FontSizeBox::Notify( rNEvt );
 }
 
+void SvxFontSizeBox_Impl::SetOptimalSize()
+{
+    Size aPrefSize(LogicToPixel(m_aLogicalSize, MAP_APPFONT));
+    aPrefSize.Width() = get_preferred_size().Width();
+    SetSizePixel(aPrefSize);
+    Size aDropSize(LogicToPixel(Size(0, LOGICAL_EDIT_HEIGHT), MAP_APPFONT));
+    aDropSize.Width() = aPrefSize.Width();
+    SetDropDownSizePixel(aDropSize);
+}
+
 // ---------------------------------------------------------------------------
 
 void SvxFontSizeBox_Impl::DataChanged( const DataChangedEvent& rDCEvt )
@@ -267,9 +277,7 @@ void SvxFontSizeBox_Impl::DataChanged( const DataChangedEvent& rDCEvt )
     if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) &&
          (rDCEvt.GetFlags() & SETTINGS_STYLE) )
     {
-        SetSizePixel( LogicToPixel( m_aLogicalSize, MAP_APPFONT ));
-        Size aDropSize( m_aLogicalSize.Width(), LOGICAL_EDIT_HEIGHT );
-        SetDropDownSizePixel( LogicToPixel( aDropSize, MAP_APPFONT ));
+        SetOptimalSize();
     }
 
     FontSizeBox::DataChanged( rDCEvt );
@@ -413,6 +421,10 @@ uno::Reference< awt::XWindow > SAL_CALL FontHeightToolBoxControl::createItemWind
                         uno::Reference< frame::XDispatchProvider >( m_xFrame, uno::UNO_QUERY ),
                         m_xFrame,
                         *this );
+        //Get the box to fill itself with all its sizes
+        m_pBox->UpdateFont(m_aCurrentFont);
+        //Make it size itself to its optimal size re above sizes
+        m_pBox->SetOptimalSize();
         xItemWindow = VCLUnoHelper::GetInterface( m_pBox );
     }
 
commit 677a42301e21f06b789f650d79fb5d60cb656aab
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jan 28 16:40:41 2014 +0000

    coverity#705167 Missing break in switch
    
    Change-Id: Ia87d4dce6780ce1f69b031599c1a211436f4f819

diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx
index 4eccc13..86bb59c 100644
--- a/filter/source/graphicfilter/ipsd/ipsd.cxx
+++ b/filter/source/graphicfilter/ipsd/ipsd.cxx
@@ -249,6 +249,7 @@ sal_Bool PSDReader::ImplReadHeader()
         case PSD_DUOTONE :                  // we'll handle the duotone color like a normal grayscale picture
             m_rPSD.SeekRel( nColorLength );
             nColorLength = 0;
+            /* Fall through */
         case PSD_GRAYSCALE :
         {
             if ( nColorLength )


More information about the Libreoffice-commits mailing list