Kaydet (Commit) cd962f12 authored tarafından Caolán McNamara's avatar Caolán McNamara

manually setting drop down size is unnecessary

and can end up with a font size entry in the toolbar
of a different height to the other elements, because
the other ones only call it on DataChange, while
font size calls it all the time.

Change-Id: I495e28dd0d33a093869fd731538e43513a7b8b85
üst 653a4a65
......@@ -114,8 +114,6 @@ public:
virtual void setPosSizePixel( long nX, long nY, long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) SAL_OVERRIDE
{ Edit::SetPosSizePixel( rNewPos, rNewSize ); }
void SetDropDownSizePixel( const Size& rNewSize )
{ if( IsDropDownBox() ) setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(), WINDOW_POSSIZE_SIZE | WINDOW_POSSIZE_DROPDOWN ); }
Rectangle GetDropDownPosSizePixel() const;
......
......@@ -103,8 +103,6 @@ public:
long nWidth, long nHeight, sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ) SAL_OVERRIDE;
void SetPosSizePixel( const Point& rNewPos, const Size& rNewSize ) SAL_OVERRIDE
{ Control::SetPosSizePixel( rNewPos, rNewSize ); }
void SetDropDownSizePixel( const Size& rNewSize )
{ if( IsDropDownBox() ) setPosSizePixel( 0, 0, rNewSize.Width(), rNewSize.Height(), WINDOW_POSSIZE_SIZE | WINDOW_POSSIZE_DROPDOWN ); }
Rectangle GetDropDownPosSizePixel() const;
......
......@@ -51,8 +51,6 @@ using namespace ::com::sun::star::util;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::beans;
#define LOGICAL_EDIT_HEIGHT 12
SvxLineBox::SvxLineBox( vcl::Window* pParent, const Reference< XFrame >& rFrame, WinBits nBits ) :
LineLB( pParent, nBits ),
nCurPos ( 0 ),
......@@ -235,8 +233,6 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{
SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
Size aDropSize( aLogicalSize.Width(), LOGICAL_EDIT_HEIGHT);
SetDropDownSizePixel(LogicToPixel(aDropSize, MAP_APPFONT));
}
LineLB::DataChanged( rDCEvt );
......
......@@ -93,7 +93,6 @@
#include <svx/xflclit.hxx>
#define MAX_MRU_FONTNAME_ENTRIES 5
#define LOGICAL_EDIT_HEIGHT 12
// don't make more than 15 entries visible at once
#define MAX_STYLES_ENTRIES static_cast< sal_uInt16 >( 15 )
......@@ -529,8 +528,6 @@ void SvxStyleBox_Impl::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{
SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
Size aDropSize( aLogicalSize.Width(), LOGICAL_EDIT_HEIGHT);
SetDropDownSizePixel(LogicToPixel(aDropSize, MAP_APPFONT));
}
ComboBox::DataChanged( rDCEvt );
......@@ -1040,8 +1037,6 @@ void SvxFontNameBox_Impl::DataChanged( const DataChangedEvent& rDCEvt )
(rDCEvt.GetFlags() & AllSettingsFlags::STYLE) )
{
SetSizePixel(LogicToPixel(aLogicalSize, MAP_APPFONT));
Size aDropSize( aLogicalSize.Width(), LOGICAL_EDIT_HEIGHT);
SetDropDownSizePixel(LogicToPixel(aDropSize, MAP_APPFONT));
}
else if ( ( rDCEvt.GetType() == DataChangedEventType::FONTS ) ||
( rDCEvt.GetType() == DataChangedEventType::DISPLAY ) )
......
......@@ -38,8 +38,6 @@
#include <boost/scoped_ptr.hpp>
#define LOGICAL_EDIT_HEIGHT 12
using namespace ::com::sun::star;
namespace {
......@@ -132,8 +130,6 @@ SvxFontSizeBox_Impl::SvxFontSizeBox_Impl(
SetText( "" );
}
void SvxFontSizeBox_Impl::ReleaseFocus_Impl()
{
if ( !m_bRelease )
......@@ -263,13 +259,8 @@ 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 )
{
if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment